From 43241098a4a1b6c6514e4b080c1faa4b40fbad54 Mon Sep 17 00:00:00 2001 From: Wey-Han Liaw Date: Tue, 7 Sep 2021 00:58:24 -0700 Subject: [PATCH] Revert "sync with cpython 9ad2184d (#104)" This reverts commit d54eaf6bf4e2e4f139eeb809b3ef6dcba359c305. --- bugs.po | 6 +- c-api/arg.po | 44 +- c-api/bool.po | 16 +- c-api/buffer.po | 26 +- c-api/bytearray.po | 6 +- c-api/bytes.po | 6 +- c-api/call.po | 13 +- c-api/capsule.po | 56 +- c-api/cell.po | 16 +- c-api/code.po | 6 +- c-api/complex.po | 8 +- c-api/contextvars.po | 14 +- c-api/conversion.po | 14 +- c-api/coro.po | 6 +- c-api/datetime.po | 97 +- c-api/dict.po | 55 +- c-api/exceptions.po | 382 +++--- c-api/file.po | 14 +- c-api/float.po | 6 +- c-api/function.po | 5 +- c-api/gcsupport.po | 68 +- c-api/gen.po | 14 +- c-api/import.po | 11 +- c-api/init.po | 20 +- c-api/init_config.po | 165 ++- c-api/intro.po | 14 +- c-api/iter.po | 10 +- c-api/iterator.po | 18 +- c-api/list.po | 6 +- c-api/long.po | 92 +- c-api/marshal.po | 16 +- c-api/memory.po | 14 +- c-api/memoryview.po | 9 +- c-api/method.po | 31 +- c-api/module.po | 197 ++- c-api/object.po | 9 +- c-api/set.po | 43 +- c-api/slice.po | 40 +- c-api/structures.po | 98 +- c-api/sys.po | 4 +- c-api/tuple.po | 12 +- c-api/type.po | 171 +-- c-api/typehints.po | 56 - c-api/typeobj.po | 470 ++++--- c-api/unicode.po | 756 ++++++----- c-api/veryhigh.po | 80 +- c-api/weakref.po | 25 +- copyright.po | 5 +- distributing/index.po | 28 +- distutils/_setuptools_disclaimer.po | 3 +- extending/newtypes_tutorial.po | 6 +- faq/design.po | 95 +- faq/general.po | 19 +- faq/gui.po | 173 ++- faq/programming.po | 932 ++++++-------- faq/windows.po | 61 +- glossary.po | 596 ++++----- howto/descriptor.po | 943 +++----------- howto/instrumentation.po | 50 +- howto/logging-cookbook.po | 125 +- howto/pyporting.po | 8 +- howto/urllib2.po | 4 +- install/index.po | 8 +- library/__future__.po | 4 +- library/aifc.po | 12 +- library/argparse.po | 420 +++---- library/array.po | 44 +- library/ast.po | 421 +++---- library/asyncio-dev.po | 47 +- library/asyncio-eventloop.po | 678 +++++----- library/asyncio-policy.po | 6 +- library/asyncio-protocol.po | 6 +- library/asyncio-subprocess.po | 127 +- library/asyncio-sync.po | 14 +- library/asyncio-task.po | 329 ++--- library/atexit.po | 28 +- library/audit_events.po | 81 +- library/bz2.po | 8 +- library/calendar.po | 4 +- library/cgi.po | 112 +- library/codecs.po | 1019 ++++++++------- library/collections.abc.po | 81 +- library/collections.po | 142 +-- library/compileall.po | 75 +- library/concurrency.po | 4 +- library/concurrent.futures.po | 140 ++- library/configparser.po | 337 +++-- library/contextlib.po | 191 ++- library/csv.po | 151 ++- library/ctypes.po | 460 ++++--- library/curses.po | 1247 ++++++++++--------- library/dataclasses.po | 89 +- library/decimal.po | 244 ++-- library/devmode.po | 3 +- library/dialog.po | 3 +- library/difflib.po | 266 ++-- library/dis.po | 10 +- library/email.compat32-message.po | 4 +- library/email.po | 4 +- library/email.utils.po | 3 +- library/ensurepip.po | 4 +- library/enum.po | 377 +++--- library/exceptions.po | 203 ++- library/filecmp.po | 77 +- library/fnmatch.po | 8 +- library/ftplib.po | 124 +- library/functions.po | 671 +++++----- library/functools.po | 186 ++- library/gc.po | 104 +- library/glob.po | 26 +- library/graphlib.po | 26 +- library/hashlib.po | 260 ++-- library/http.server.po | 167 ++- library/idle.po | 350 +++--- library/imaplib.po | 14 +- library/importlib.metadata.po | 91 +- library/importlib.po | 515 ++++---- library/io.po | 420 ++++--- library/ipaddress.po | 303 ++--- library/itertools.po | 4 +- library/json.po | 146 +-- library/keyword.po | 14 +- library/logging.config.po | 174 +-- library/logging.po | 258 ++-- library/mailbox.po | 607 ++++----- library/marshal.po | 48 +- library/math.po | 4 +- library/mmap.po | 4 +- library/multiprocessing.po | 1115 ++++++++--------- library/multiprocessing.shared_memory.po | 3 +- library/nntplib.po | 6 +- library/numbers.po | 42 +- library/operator.po | 262 ++-- library/optparse.po | 4 +- library/os.path.po | 108 +- library/os.po | 1145 +++++++++-------- library/pathlib.po | 227 ++-- library/pdb.po | 12 +- library/pkgutil.po | 5 +- library/platform.po | 27 +- library/poplib.po | 6 +- library/pty.po | 4 +- library/py_compile.po | 12 +- library/pyexpat.po | 6 +- library/random.po | 176 +-- library/re.po | 268 ++-- library/resource.po | 145 ++- library/secrets.po | 25 +- library/security_warnings.po | 96 -- library/shelve.po | 57 +- library/shutil.po | 172 ++- library/signal.po | 18 +- library/site.po | 21 +- library/smtplib.po | 4 +- library/socket.po | 434 +++---- library/sqlite3.po | 481 +++---- library/ssl.po | 741 ++++++----- library/stdtypes.po | 1386 ++++++++------------- library/string.po | 226 ++-- library/struct.po | 6 +- library/subprocess.po | 327 +++-- library/symtable.po | 20 +- library/sys.po | 835 ++++++------- library/sysconfig.po | 8 +- library/syslog.po | 4 +- library/tarfile.po | 327 +++-- library/telnetlib.po | 4 +- library/tempfile.po | 62 +- library/test.po | 12 +- library/textwrap.po | 90 +- library/threading.po | 425 ++++--- library/time.po | 10 +- library/timeit.po | 4 +- library/tk.po | 12 +- library/tkinter.colorchooser.po | 3 +- library/tkinter.dnd.po | 3 +- library/tkinter.font.po | 11 +- library/tkinter.messagebox.po | 3 +- library/tkinter.po | 709 ++++++----- library/token.po | 12 +- library/turtle.po | 555 +++++---- library/types.po | 183 +-- library/typing.po | 1444 ++++++++-------------- library/unittest.mock.po | 598 +++++---- library/unittest.po | 930 +++++++------- library/urllib.parse.po | 306 ++--- library/urllib.request.po | 4 +- library/venv.po | 15 +- library/webbrowser.po | 6 +- library/winreg.po | 18 +- library/wsgiref.po | 6 +- library/xml.dom.minidom.po | 4 +- library/xml.etree.elementtree.po | 414 +++---- library/xml.po | 72 +- library/zipfile.po | 330 +++-- library/zoneinfo.po | 3 +- license.po | 160 +-- reference/compound_stmts.po | 259 ++-- reference/datamodel.po | 987 +++++++-------- reference/expressions.po | 794 ++++++------ reference/grammar.po | 18 +- reference/import.po | 112 +- reference/lexical_analysis.po | 114 +- reference/simple_stmts.po | 155 ++- sphinx.po | 56 +- tutorial/classes.po | 18 +- tutorial/controlflow.po | 231 ++-- tutorial/errors.po | 44 +- tutorial/inputoutput.po | 46 +- tutorial/introduction.po | 20 +- tutorial/modules.po | 78 +- tutorial/venv.po | 22 +- using/cmdline.po | 8 +- using/editors.po | 3 +- using/windows.po | 403 +++--- whatsnew/3.2.po | 14 +- whatsnew/3.3.po | 6 +- whatsnew/3.5.po | 10 +- whatsnew/3.6.po | 20 +- whatsnew/3.7.po | 22 +- whatsnew/3.8.po | 689 +++++------ whatsnew/3.9.po | 1281 +++++-------------- 222 files changed, 17525 insertions(+), 21354 deletions(-) delete mode 100644 c-api/typehints.po delete mode 100644 library/security_warnings.po diff --git a/bugs.po b/bugs.po index ce0d0ca727..a21c41d32d 100644 --- a/bugs.po +++ b/bugs.po @@ -12,7 +12,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.7\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2021-09-07 06:52+0000\n" +"POT-Creation-Date: 2020-06-20 18:08+0800\n" "PO-Revision-Date: 2018-10-13 16:29+0800\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -173,8 +173,8 @@ msgstr "" #: ../../bugs.rst:84 msgid "" -"`Bug Writing Guidelines `_" +"`Bug Report Writing Guidelines `_" msgstr "" #: ../../bugs.rst:84 diff --git a/c-api/arg.po b/c-api/arg.po index 8dbfbfbe0c..c5a658cd1f 100644 --- a/c-api/arg.po +++ b/c-api/arg.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.7\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2021-09-07 06:52+0000\n" +"POT-Creation-Date: 2020-06-20 18:08+0800\n" "PO-Revision-Date: 2018-05-23 14:29+0000\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -240,7 +240,7 @@ msgstr "" msgid "" "Requires that the Python object is a :class:`bytes` object, without " "attempting any conversion. Raises :exc:`TypeError` if the object is not a " -"bytes object. The C variable may also be declared as :c:type:`PyObject*`." +"bytes object. The C variable may also be declared as :c:type:`PyObject\\*`." msgstr "" #: ../../c-api/arg.rst:139 @@ -252,7 +252,7 @@ msgid "" "Requires that the Python object is a :class:`bytearray` object, without " "attempting any conversion. Raises :exc:`TypeError` if the object is not a :" "class:`bytearray` object. The C variable may also be declared as :c:type:" -"`PyObject*`." +"`PyObject\\*`." msgstr "" #: ../../c-api/arg.rst:156 @@ -319,7 +319,7 @@ msgstr "" msgid "" "Requires that the Python object is a Unicode object, without attempting any " "conversion. Raises :exc:`TypeError` if the object is not a Unicode object. " -"The C variable may also be declared as :c:type:`PyObject*`." +"The C variable may also be declared as :c:type:`PyObject\\*`." msgstr "" #: ../../c-api/arg.rst:192 @@ -347,12 +347,13 @@ msgstr "" #: ../../c-api/arg.rst:198 msgid "" "This format requires two arguments. The first is only used as input, and " -"must be a :c:type:`const char*` which points to the name of an encoding as a " -"NUL-terminated string, or ``NULL``, in which case ``'utf-8'`` encoding is " +"must be a :c:type:`const char\\*` which points to the name of an encoding as " +"a NUL-terminated string, or ``NULL``, in which case ``'utf-8'`` encoding is " "used. An exception is raised if the named encoding is not known to Python. " -"The second argument must be a :c:type:`char**`; the value of the pointer it " -"references will be set to a buffer with the contents of the argument text. " -"The text will be encoded in the encoding specified by the first argument." +"The second argument must be a :c:type:`char\\*\\*`; the value of the pointer " +"it references will be set to a buffer with the contents of the argument " +"text. The text will be encoded in the encoding specified by the first " +"argument." msgstr "" #: ../../c-api/arg.rst:206 @@ -392,10 +393,10 @@ msgstr "" #: ../../c-api/arg.rst:221 msgid "" "It requires three arguments. The first is only used as input, and must be " -"a :c:type:`const char*` which points to the name of an encoding as a NUL-" +"a :c:type:`const char\\*` which points to the name of an encoding as a NUL-" "terminated string, or ``NULL``, in which case ``'utf-8'`` encoding is used. " "An exception is raised if the named encoding is not known to Python. The " -"second argument must be a :c:type:`char**`; the value of the pointer it " +"second argument must be a :c:type:`char\\*\\*`; the value of the pointer it " "references will be set to a buffer with the contents of the argument text. " "The text will be encoded in the encoding specified by the first argument. " "The third argument must be a pointer to an integer; the referenced integer " @@ -618,7 +619,7 @@ msgstr "" msgid "" "Store a Python object in a C object pointer. This is similar to ``O``, but " "takes two C arguments: the first is the address of a Python type object, the " -"second is the address of the C variable (of type :c:type:`PyObject*`) into " +"second is the address of the C variable (of type :c:type:`PyObject\\*`) into " "which the object pointer is stored. If the Python object does not have the " "required type, :exc:`TypeError` is raised." msgstr "" @@ -631,14 +632,14 @@ msgstr "" msgid "" "Convert a Python object to a C variable through a *converter* function. " "This takes two arguments: the first is a function, the second is the address " -"of a C variable (of arbitrary type), converted to :c:type:`void *`. The " +"of a C variable (of arbitrary type), converted to :c:type:`void \\*`. The " "*converter* function in turn is called as follows::" msgstr "" #: ../../c-api/arg.rst:339 msgid "" "where *object* is the Python object to be converted and *address* is the :c:" -"type:`void*` argument that was passed to the :c:func:`PyArg_Parse\\*` " +"type:`void\\*` argument that was passed to the :c:func:`PyArg_Parse\\*` " "function. The returned *status* should be ``1`` for a successful conversion " "and ``0`` if the conversion has failed. When the conversion fails, the " "*converter* function should raise an exception and leave the content of " @@ -836,12 +837,13 @@ msgid "" "should be passed as *args*; it must actually be a tuple. The length of the " "tuple must be at least *min* and no more than *max*; *min* and *max* may be " "equal. Additional arguments must be passed to the function, each of which " -"should be a pointer to a :c:type:`PyObject*` variable; these will be filled " -"in with the values from *args*; they will contain borrowed references. The " -"variables which correspond to optional parameters not given by *args* will " -"not be filled in; these should be initialized by the caller. This function " -"returns true on success and false if *args* is not a tuple or contains the " -"wrong number of elements; an exception will be set if there was a failure." +"should be a pointer to a :c:type:`PyObject\\*` variable; these will be " +"filled in with the values from *args*; they will contain borrowed " +"references. The variables which correspond to optional parameters not given " +"by *args* will not be filled in; these should be initialized by the caller. " +"This function returns true on success and false if *args* is not a tuple or " +"contains the wrong number of elements; an exception will be set if there was " +"a failure." msgstr "" #: ../../c-api/arg.rst:493 @@ -1105,7 +1107,7 @@ msgstr "" msgid "" "Convert *anything* to a Python object through a *converter* function. The " "function is called with *anything* (which should be compatible with :c:type:" -"`void*`) as its argument and should return a \"new\" Python object, or " +"`void \\*`) as its argument and should return a \"new\" Python object, or " "``NULL`` if an error occurred." msgstr "" diff --git a/c-api/bool.po b/c-api/bool.po index 8e5d7f9947..da730384c0 100644 --- a/c-api/bool.po +++ b/c-api/bool.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.7\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2021-09-07 06:52+0000\n" +"POT-Creation-Date: 2018-06-26 18:54+0800\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-" @@ -32,36 +32,34 @@ msgid "" msgstr "" #: ../../c-api/bool.rst:16 -msgid "" -"Return true if *o* is of type :c:data:`PyBool_Type`. This function always " -"succeeds." +msgid "Return true if *o* is of type :c:data:`PyBool_Type`." msgstr "" -#: ../../c-api/bool.rst:22 +#: ../../c-api/bool.rst:21 msgid "" "The Python ``False`` object. This object has no methods. It needs to be " "treated just like any other object with respect to reference counts." msgstr "" -#: ../../c-api/bool.rst:28 +#: ../../c-api/bool.rst:27 msgid "" "The Python ``True`` object. This object has no methods. It needs to be " "treated just like any other object with respect to reference counts." msgstr "" -#: ../../c-api/bool.rst:34 +#: ../../c-api/bool.rst:33 msgid "" "Return :const:`Py_False` from a function, properly incrementing its " "reference count." msgstr "" -#: ../../c-api/bool.rst:40 +#: ../../c-api/bool.rst:39 msgid "" "Return :const:`Py_True` from a function, properly incrementing its reference " "count." msgstr "" -#: ../../c-api/bool.rst:46 +#: ../../c-api/bool.rst:45 msgid "" "Return a new reference to :const:`Py_True` or :const:`Py_False` depending on " "the truth value of *v*." diff --git a/c-api/buffer.po b/c-api/buffer.po index 57a1d18d8b..eb0fd1949b 100644 --- a/c-api/buffer.po +++ b/c-api/buffer.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.7\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2021-09-07 06:52+0000\n" +"POT-Creation-Date: 2020-06-20 18:08+0800\n" "PO-Revision-Date: 2018-05-23 14:30+0000\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -453,10 +453,6 @@ msgstr "" msgid "C or F" msgstr "" -#: ../../c-api/buffer.rst:304 -msgid ":c:macro:`PyBUF_ND`" -msgstr "" - #: ../../c-api/buffer.rst:309 msgid "compound requests" msgstr "" @@ -572,15 +568,17 @@ msgstr "" msgid "" "Send a request to *exporter* to fill in *view* as specified by *flags*. If " "the exporter cannot provide a buffer of the exact type, it MUST raise :c:" -"data:`PyExc_BufferError`, set ``view->obj`` to ``NULL`` and return ``-1``." +"data:`PyExc_BufferError`, set :c:member:`view->obj` to ``NULL`` and return " +"``-1``." msgstr "" #: ../../c-api/buffer.rst:444 msgid "" -"On success, fill in *view*, set ``view->obj`` to a new reference to " +"On success, fill in *view*, set :c:member:`view->obj` to a new reference to " "*exporter* and return 0. In the case of chained buffer providers that " -"redirect requests to a single object, ``view->obj`` MAY refer to this object " -"instead of *exporter* (See :ref:`Buffer Object Structures `)." +"redirect requests to a single object, :c:member:`view->obj` MAY refer to " +"this object instead of *exporter* (See :ref:`Buffer Object Structures " +"`)." msgstr "" #: ../../c-api/buffer.rst:449 @@ -593,8 +591,8 @@ msgstr "" #: ../../c-api/buffer.rst:457 msgid "" -"Release the buffer *view* and decrement the reference count for ``view-" -">obj``. This function MUST be called when the buffer is no longer being " +"Release the buffer *view* and decrement the reference count for :c:member:" +"`view->obj`. This function MUST be called when the buffer is no longer being " "used, otherwise reference leaks may occur." msgstr "" @@ -665,9 +663,9 @@ msgstr "" #: ../../c-api/buffer.rst:519 msgid "" -"On success, set ``view->obj`` to a new reference to *exporter* and return 0. " -"Otherwise, raise :c:data:`PyExc_BufferError`, set ``view->obj`` to ``NULL`` " -"and return ``-1``;" +"On success, set :c:member:`view->obj` to a new reference to *exporter* and " +"return 0. Otherwise, raise :c:data:`PyExc_BufferError`, set :c:member:`view-" +">obj` to ``NULL`` and return ``-1``;" msgstr "" #: ../../c-api/buffer.rst:523 diff --git a/c-api/bytearray.po b/c-api/bytearray.po index 26012abe89..c25b2c106f 100644 --- a/c-api/bytearray.po +++ b/c-api/bytearray.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.7\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2021-09-07 06:52+0000\n" +"POT-Creation-Date: 2020-06-20 18:08+0800\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-" @@ -40,13 +40,13 @@ msgstr "" #: ../../c-api/bytearray.rst:27 msgid "" "Return true if the object *o* is a bytearray object or an instance of a " -"subtype of the bytearray type. This function always succeeds." +"subtype of the bytearray type." msgstr "" #: ../../c-api/bytearray.rst:33 msgid "" "Return true if the object *o* is a bytearray object, but not an instance of " -"a subtype of the bytearray type. This function always succeeds." +"a subtype of the bytearray type." msgstr "" #: ../../c-api/bytearray.rst:38 diff --git a/c-api/bytes.po b/c-api/bytes.po index f58642f958..a70ad45b20 100644 --- a/c-api/bytes.po +++ b/c-api/bytes.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.7\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2021-09-07 06:52+0000\n" +"POT-Creation-Date: 2020-06-20 18:08+0800\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-" @@ -41,13 +41,13 @@ msgstr "" #: ../../c-api/bytes.rst:27 msgid "" "Return true if the object *o* is a bytes object or an instance of a subtype " -"of the bytes type. This function always succeeds." +"of the bytes type." msgstr "" #: ../../c-api/bytes.rst:33 msgid "" "Return true if the object *o* is a bytes object, but not an instance of a " -"subtype of the bytes type. This function always succeeds." +"subtype of the bytes type." msgstr "" #: ../../c-api/bytes.rst:39 diff --git a/c-api/call.po b/c-api/call.po index 6a41b88985..0c2823f7fd 100644 --- a/c-api/call.po +++ b/c-api/call.po @@ -8,11 +8,10 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.9\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2021-09-07 06:52+0000\n" +"POT-Creation-Date: 2020-06-20 18:08+0800\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" -"Language: \n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" @@ -443,7 +442,7 @@ msgstr "" #: ../../c-api/call.rst:286 msgid "" -"Note that if you only pass :c:type:`PyObject *` args, :c:func:" +"Note that if you only pass :c:type:`PyObject \\*` args, :c:func:" "`PyObject_CallFunctionObjArgs` is a faster alternative." msgstr "" @@ -470,7 +469,7 @@ msgstr "" #: ../../c-api/call.rst:307 msgid "" -"Note that if you only pass :c:type:`PyObject *` args, :c:func:" +"Note that if you only pass :c:type:`PyObject \\*` args, :c:func:" "`PyObject_CallMethodObjArgs` is a faster alternative." msgstr "" @@ -481,8 +480,8 @@ msgstr "" #: ../../c-api/call.rst:316 msgid "" "Call a callable Python object *callable*, with a variable number of :c:type:" -"`PyObject *` arguments. The arguments are provided as a variable number of " -"parameters followed by *NULL*." +"`PyObject \\*` arguments. The arguments are provided as a variable number " +"of parameters followed by *NULL*." msgstr "" #: ../../c-api/call.rst:323 @@ -495,7 +494,7 @@ msgstr "" msgid "" "Call a method of the Python object *obj*, where the name of the method is " "given as a Python string object in *name*. It is called with a variable " -"number of :c:type:`PyObject *` arguments. The arguments are provided as a " +"number of :c:type:`PyObject \\*` arguments. The arguments are provided as a " "variable number of parameters followed by *NULL*." msgstr "" diff --git a/c-api/capsule.po b/c-api/capsule.po index 1d44886bc9..5e9267e642 100644 --- a/c-api/capsule.po +++ b/c-api/capsule.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.7\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2021-09-07 06:52+0000\n" +"POT-Creation-Date: 2020-06-20 18:08+0800\n" "PO-Revision-Date: 2018-05-23 14:30+0000\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -30,7 +30,7 @@ msgstr "" #: ../../c-api/capsule.rst:17 msgid "" "This subtype of :c:type:`PyObject` represents an opaque value, useful for C " -"extension modules who need to pass an opaque value (as a :c:type:`void*` " +"extension modules who need to pass an opaque value (as a :c:type:`void\\*` " "pointer) through Python code to other C code. It is often used to make a C " "function pointer defined in one module available to other modules, so the " "regular import mechanism can be used to access C APIs defined in dynamically " @@ -48,48 +48,46 @@ msgid "" msgstr "" #: ../../c-api/capsule.rst:37 -msgid "" -"Return true if its argument is a :c:type:`PyCapsule`. This function always " -"succeeds." +msgid "Return true if its argument is a :c:type:`PyCapsule`." msgstr "" -#: ../../c-api/capsule.rst:43 +#: ../../c-api/capsule.rst:42 msgid "" "Create a :c:type:`PyCapsule` encapsulating the *pointer*. The *pointer* " "argument may not be ``NULL``." msgstr "" -#: ../../c-api/capsule.rst:46 +#: ../../c-api/capsule.rst:45 msgid "On failure, set an exception and return ``NULL``." msgstr "" -#: ../../c-api/capsule.rst:48 +#: ../../c-api/capsule.rst:47 msgid "" "The *name* string may either be ``NULL`` or a pointer to a valid C string. " "If non-``NULL``, this string must outlive the capsule. (Though it is " "permitted to free it inside the *destructor*.)" msgstr "" -#: ../../c-api/capsule.rst:52 +#: ../../c-api/capsule.rst:51 msgid "" "If the *destructor* argument is not ``NULL``, it will be called with the " "capsule as its argument when it is destroyed." msgstr "" -#: ../../c-api/capsule.rst:55 +#: ../../c-api/capsule.rst:54 msgid "" "If this capsule will be stored as an attribute of a module, the *name* " "should be specified as ``modulename.attributename``. This will enable other " "modules to import the capsule using :c:func:`PyCapsule_Import`." msgstr "" -#: ../../c-api/capsule.rst:62 +#: ../../c-api/capsule.rst:61 msgid "" "Retrieve the *pointer* stored in the capsule. On failure, set an exception " "and return ``NULL``." msgstr "" -#: ../../c-api/capsule.rst:65 +#: ../../c-api/capsule.rst:64 msgid "" "The *name* parameter must compare exactly to the name stored in the capsule. " "If the name stored in the capsule is ``NULL``, the *name* passed in must " @@ -97,46 +95,46 @@ msgid "" "capsule names." msgstr "" -#: ../../c-api/capsule.rst:73 +#: ../../c-api/capsule.rst:72 msgid "" "Return the current destructor stored in the capsule. On failure, set an " "exception and return ``NULL``." msgstr "" -#: ../../c-api/capsule.rst:76 +#: ../../c-api/capsule.rst:75 msgid "" "It is legal for a capsule to have a ``NULL`` destructor. This makes a " "``NULL`` return code somewhat ambiguous; use :c:func:`PyCapsule_IsValid` or :" "c:func:`PyErr_Occurred` to disambiguate." msgstr "" -#: ../../c-api/capsule.rst:83 +#: ../../c-api/capsule.rst:82 msgid "" "Return the current context stored in the capsule. On failure, set an " "exception and return ``NULL``." msgstr "" -#: ../../c-api/capsule.rst:86 +#: ../../c-api/capsule.rst:85 msgid "" "It is legal for a capsule to have a ``NULL`` context. This makes a ``NULL`` " "return code somewhat ambiguous; use :c:func:`PyCapsule_IsValid` or :c:func:" "`PyErr_Occurred` to disambiguate." msgstr "" -#: ../../c-api/capsule.rst:93 +#: ../../c-api/capsule.rst:92 msgid "" "Return the current name stored in the capsule. On failure, set an exception " "and return ``NULL``." msgstr "" -#: ../../c-api/capsule.rst:96 +#: ../../c-api/capsule.rst:95 msgid "" "It is legal for a capsule to have a ``NULL`` name. This makes a ``NULL`` " "return code somewhat ambiguous; use :c:func:`PyCapsule_IsValid` or :c:func:" "`PyErr_Occurred` to disambiguate." msgstr "" -#: ../../c-api/capsule.rst:103 +#: ../../c-api/capsule.rst:102 msgid "" "Import a pointer to a C object from a capsule attribute in a module. The " "*name* parameter should specify the full name to the attribute, as in " @@ -146,13 +144,13 @@ msgid "" "import the module conventionally (using :c:func:`PyImport_ImportModule`)." msgstr "" -#: ../../c-api/capsule.rst:110 +#: ../../c-api/capsule.rst:109 msgid "" "Return the capsule's internal *pointer* on success. On failure, set an " "exception and return ``NULL``." msgstr "" -#: ../../c-api/capsule.rst:116 +#: ../../c-api/capsule.rst:115 msgid "" "Determines whether or not *capsule* is a valid capsule. A valid capsule is " "non-``NULL``, passes :c:func:`PyCapsule_CheckExact`, has a non-``NULL`` " @@ -161,41 +159,41 @@ msgid "" "compared.)" msgstr "" -#: ../../c-api/capsule.rst:122 +#: ../../c-api/capsule.rst:121 msgid "" "In other words, if :c:func:`PyCapsule_IsValid` returns a true value, calls " "to any of the accessors (any function starting with :c:func:`PyCapsule_Get`) " "are guaranteed to succeed." msgstr "" -#: ../../c-api/capsule.rst:126 +#: ../../c-api/capsule.rst:125 msgid "" "Return a nonzero value if the object is valid and matches the name passed " "in. Return ``0`` otherwise. This function will not fail." msgstr "" -#: ../../c-api/capsule.rst:132 +#: ../../c-api/capsule.rst:131 msgid "Set the context pointer inside *capsule* to *context*." msgstr "" -#: ../../c-api/capsule.rst:134 ../../c-api/capsule.rst:141 -#: ../../c-api/capsule.rst:150 ../../c-api/capsule.rst:158 +#: ../../c-api/capsule.rst:133 ../../c-api/capsule.rst:140 +#: ../../c-api/capsule.rst:149 ../../c-api/capsule.rst:157 msgid "" "Return ``0`` on success. Return nonzero and set an exception on failure." msgstr "" -#: ../../c-api/capsule.rst:139 +#: ../../c-api/capsule.rst:138 msgid "Set the destructor inside *capsule* to *destructor*." msgstr "" -#: ../../c-api/capsule.rst:146 +#: ../../c-api/capsule.rst:145 msgid "" "Set the name inside *capsule* to *name*. If non-``NULL``, the name must " "outlive the capsule. If the previous *name* stored in the capsule was not " "``NULL``, no attempt is made to free it." msgstr "" -#: ../../c-api/capsule.rst:155 +#: ../../c-api/capsule.rst:154 msgid "" "Set the void pointer inside *capsule* to *pointer*. The pointer may not be " "``NULL``." diff --git a/c-api/cell.po b/c-api/cell.po index 6f34ec1c7b..019c612249 100644 --- a/c-api/cell.po +++ b/c-api/cell.po @@ -9,7 +9,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.7\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2021-09-07 06:52+0000\n" +"POT-Creation-Date: 2020-06-20 18:08+0800\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-" @@ -45,28 +45,26 @@ msgid "The type object corresponding to cell objects." msgstr "對應 cell 物件的物件型別。" #: ../../c-api/cell.rst:30 -msgid "" -"Return true if *ob* is a cell object; *ob* must not be ``NULL``. This " -"function always succeeds." +msgid "Return true if *ob* is a cell object; *ob* must not be ``NULL``." msgstr "" -#: ../../c-api/cell.rst:36 +#: ../../c-api/cell.rst:35 msgid "" "Create and return a new cell object containing the value *ob*. The parameter " "may be ``NULL``." msgstr "" -#: ../../c-api/cell.rst:42 +#: ../../c-api/cell.rst:41 msgid "Return the contents of the cell *cell*." msgstr "回傳 cell 內容中的 *cell*\\ 。" -#: ../../c-api/cell.rst:47 +#: ../../c-api/cell.rst:46 msgid "" "Return the contents of the cell *cell*, but without checking that *cell* is " "non-``NULL`` and a cell object." msgstr "" -#: ../../c-api/cell.rst:53 +#: ../../c-api/cell.rst:52 msgid "" "Set the contents of the cell object *cell* to *value*. This releases the " "reference to any current content of the cell. *value* may be ``NULL``. " @@ -74,7 +72,7 @@ msgid "" "returned. On success, ``0`` will be returned." msgstr "" -#: ../../c-api/cell.rst:61 +#: ../../c-api/cell.rst:60 msgid "" "Sets the value of the cell object *cell* to *value*. No reference counts " "are adjusted, and no checks are made for safety; *cell* must be non-``NULL`` " diff --git a/c-api/code.po b/c-api/code.po index 61ecb630fd..e0a8bc5d60 100644 --- a/c-api/code.po +++ b/c-api/code.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.7\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2021-09-07 06:52+0000\n" +"POT-Creation-Date: 2020-06-20 18:08+0800\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-" @@ -42,9 +42,7 @@ msgid "" msgstr "" #: ../../c-api/code.rst:30 -msgid "" -"Return true if *co* is a :class:`code` object. This function always " -"succeeds." +msgid "Return true if *co* is a :class:`code` object." msgstr "" #: ../../c-api/code.rst:34 diff --git a/c-api/complex.po b/c-api/complex.po index df1d2375b1..640c9b68c7 100644 --- a/c-api/complex.po +++ b/c-api/complex.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.7\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2021-09-07 06:52+0000\n" +"POT-Creation-Date: 2020-06-20 18:08+0800\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-" @@ -63,7 +63,7 @@ msgstr "" #: ../../c-api/complex.rst:51 msgid "" -"Return the negation of the complex number *num*, using the C :c:type:" +"Return the negation of the complex number *complex*, using the C :c:type:" "`Py_complex` representation." msgstr "" @@ -115,13 +115,13 @@ msgstr "" #: ../../c-api/complex.rst:96 msgid "" "Return true if its argument is a :c:type:`PyComplexObject` or a subtype of :" -"c:type:`PyComplexObject`. This function always succeeds." +"c:type:`PyComplexObject`." msgstr "" #: ../../c-api/complex.rst:102 msgid "" "Return true if its argument is a :c:type:`PyComplexObject`, but not a " -"subtype of :c:type:`PyComplexObject`. This function always succeeds." +"subtype of :c:type:`PyComplexObject`." msgstr "" #: ../../c-api/complex.rst:108 diff --git a/c-api/contextvars.po b/c-api/contextvars.po index cc9bebae7b..6c9c7ecad9 100644 --- a/c-api/contextvars.po +++ b/c-api/contextvars.po @@ -5,7 +5,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.7\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2021-09-07 06:52+0000\n" +"POT-Creation-Date: 2020-06-20 18:08+0800\n" "PO-Revision-Date: 2018-07-15 18:56+0800\n" "Last-Translator: \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -125,8 +125,8 @@ msgstr "" #: ../../c-api/contextvars.rst:109 msgid "" "Create a new ``ContextVar`` object. The *name* parameter is used for " -"introspection and debug purposes. The *def* parameter specifies a default " -"value for the context variable, or ``NULL`` for no default. If an error has " +"introspection and debug purposes. The *def* parameter may optionally " +"specify the default value for the context variable. If an error has " "occurred, this function returns ``NULL``." msgstr "" @@ -156,16 +156,16 @@ msgid "``NULL``" msgstr "" #: ../../c-api/contextvars.rst:127 -msgid "Except for ``NULL``, the function returns a new reference." +msgid "If the value was found, the function will create a new reference to it." msgstr "" #: ../../c-api/contextvars.rst:131 msgid "" -"Set the value of *var* to *value* in the current context. Returns a new " -"token object for this change, or ``NULL`` if an error has occurred." +"Set the value of *var* to *value* in the current context. Returns a pointer " +"to a :c:type:`PyObject` object, or ``NULL`` if an error has occurred." msgstr "" -#: ../../c-api/contextvars.rst:136 +#: ../../c-api/contextvars.rst:137 msgid "" "Reset the state of the *var* context variable to that it was in before :c:" "func:`PyContextVar_Set` that returned the *token* was called. This function " diff --git a/c-api/conversion.po b/c-api/conversion.po index afd1758430..64b1791b14 100644 --- a/c-api/conversion.po +++ b/c-api/conversion.po @@ -9,7 +9,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.7\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2021-09-07 06:52+0000\n" +"POT-Creation-Date: 2020-06-20 18:08+0800\n" "PO-Revision-Date: 2017-09-22 18:26+0000\n" "Last-Translator: Leon H.\n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -32,14 +32,14 @@ msgstr "數字轉換函數和被格式化的字串輸出。" msgid "" "Output not more than *size* bytes to *str* according to the format string " "*format* and the extra arguments. See the Unix man page :manpage:" -"`snprintf(3)`." +"`snprintf(2)`." msgstr "" #: ../../c-api/conversion.rst:19 msgid "" "Output not more than *size* bytes to *str* according to the format string " "*format* and the variable argument list *va*. Unix man page :manpage:" -"`vsnprintf(3)`." +"`vsnprintf(2)`." msgstr "" #: ../../c-api/conversion.rst:23 @@ -52,7 +52,7 @@ msgstr "" #: ../../c-api/conversion.rst:28 msgid "" -"The wrappers ensure that ``str[size-1]`` is always ``'\\0'`` upon return. " +"The wrappers ensure that *str*[*size*-1] is always ``'\\0'`` upon return. " "They never write more than *size* bytes (including the trailing ``'\\0'``) " "into str. Both functions require that ``str != NULL``, ``size > 0`` and " "``format != NULL``." @@ -74,19 +74,19 @@ msgstr "當回傳值 (*rv*) 給這些函數應該被編譯如下:" msgid "" "When ``0 <= rv < size``, the output conversion was successful and *rv* " "characters were written to *str* (excluding the trailing ``'\\0'`` byte at " -"``str[rv]``)." +"*str*[*rv*])." msgstr "" #: ../../c-api/conversion.rst:43 msgid "" "When ``rv >= size``, the output conversion was truncated and a buffer with " -"``rv + 1`` bytes would have been needed to succeed. ``str[size-1]`` is " +"``rv + 1`` bytes would have been needed to succeed. *str*[*size*-1] is " "``'\\0'`` in this case." msgstr "" #: ../../c-api/conversion.rst:47 msgid "" -"When ``rv < 0``, \"something bad happened.\" ``str[size-1]`` is ``'\\0'`` in " +"When ``rv < 0``, \"something bad happened.\" *str*[*size*-1] is ``'\\0'`` in " "this case too, but the rest of *str* is undefined. The exact cause of the " "error depends on the underlying platform." msgstr "" diff --git a/c-api/coro.po b/c-api/coro.po index fd00ddc0e6..fdcdf24bd1 100644 --- a/c-api/coro.po +++ b/c-api/coro.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.7\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2021-09-07 06:52+0000\n" +"POT-Creation-Date: 2020-06-20 18:08+0800\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-" @@ -39,10 +39,10 @@ msgstr "" #: ../../c-api/coro.rst:26 msgid "" "Return true if *ob*'s type is :c:type:`PyCoro_Type`; *ob* must not be " -"``NULL``. This function always succeeds." +"``NULL``." msgstr "" -#: ../../c-api/coro.rst:32 +#: ../../c-api/coro.rst:31 msgid "" "Create and return a new coroutine object based on the *frame* object, with " "``__name__`` and ``__qualname__`` set to *name* and *qualname*. A reference " diff --git a/c-api/datetime.po b/c-api/datetime.po index ad156f8302..95da8c7c1c 100644 --- a/c-api/datetime.po +++ b/c-api/datetime.po @@ -9,7 +9,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.7\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2021-09-07 06:52+0000\n" +"POT-Creation-Date: 2020-06-20 18:08+0800\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-" @@ -52,108 +52,103 @@ msgstr "" #: ../../c-api/datetime.rst:30 msgid "" "Return true if *ob* is of type :c:data:`PyDateTime_DateType` or a subtype " -"of :c:data:`PyDateTime_DateType`. *ob* must not be ``NULL``. This function " -"always succeeds." +"of :c:data:`PyDateTime_DateType`. *ob* must not be ``NULL``." msgstr "" -#: ../../c-api/datetime.rst:37 +#: ../../c-api/datetime.rst:36 msgid "" "Return true if *ob* is of type :c:data:`PyDateTime_DateType`. *ob* must not " -"be ``NULL``. This function always succeeds." +"be ``NULL``." msgstr "" -#: ../../c-api/datetime.rst:43 +#: ../../c-api/datetime.rst:42 msgid "" "Return true if *ob* is of type :c:data:`PyDateTime_DateTimeType` or a " -"subtype of :c:data:`PyDateTime_DateTimeType`. *ob* must not be ``NULL``. " -"This function always succeeds." +"subtype of :c:data:`PyDateTime_DateTimeType`. *ob* must not be ``NULL``." msgstr "" -#: ../../c-api/datetime.rst:50 +#: ../../c-api/datetime.rst:48 msgid "" "Return true if *ob* is of type :c:data:`PyDateTime_DateTimeType`. *ob* must " -"not be ``NULL``. This function always succeeds." +"not be ``NULL``." msgstr "" -#: ../../c-api/datetime.rst:56 +#: ../../c-api/datetime.rst:54 msgid "" "Return true if *ob* is of type :c:data:`PyDateTime_TimeType` or a subtype " -"of :c:data:`PyDateTime_TimeType`. *ob* must not be ``NULL``. This function " -"always succeeds." +"of :c:data:`PyDateTime_TimeType`. *ob* must not be ``NULL``." msgstr "" -#: ../../c-api/datetime.rst:63 +#: ../../c-api/datetime.rst:60 msgid "" "Return true if *ob* is of type :c:data:`PyDateTime_TimeType`. *ob* must not " -"be ``NULL``. This function always succeeds." +"be ``NULL``." msgstr "" -#: ../../c-api/datetime.rst:69 +#: ../../c-api/datetime.rst:66 msgid "" "Return true if *ob* is of type :c:data:`PyDateTime_DeltaType` or a subtype " -"of :c:data:`PyDateTime_DeltaType`. *ob* must not be ``NULL``. This " -"function always succeeds." +"of :c:data:`PyDateTime_DeltaType`. *ob* must not be ``NULL``." msgstr "" -#: ../../c-api/datetime.rst:76 +#: ../../c-api/datetime.rst:72 msgid "" "Return true if *ob* is of type :c:data:`PyDateTime_DeltaType`. *ob* must not " -"be ``NULL``. This function always succeeds." +"be ``NULL``." msgstr "" -#: ../../c-api/datetime.rst:82 +#: ../../c-api/datetime.rst:78 msgid "" "Return true if *ob* is of type :c:data:`PyDateTime_TZInfoType` or a subtype " -"of :c:data:`PyDateTime_TZInfoType`. *ob* must not be ``NULL``. This " -"function always succeeds." +"of :c:data:`PyDateTime_TZInfoType`. *ob* must not be ``NULL``." msgstr "" -#: ../../c-api/datetime.rst:89 +#: ../../c-api/datetime.rst:84 msgid "" "Return true if *ob* is of type :c:data:`PyDateTime_TZInfoType`. *ob* must " -"not be ``NULL``. This function always succeeds." +"not be ``NULL``." msgstr "" -#: ../../c-api/datetime.rst:93 +#: ../../c-api/datetime.rst:88 msgid "Macros to create objects:" msgstr "" -#: ../../c-api/datetime.rst:97 +#: ../../c-api/datetime.rst:92 #, fuzzy msgid "" "Return a :class:`datetime.date` object with the specified year, month and " "day." msgstr "回傳一個具體的年、月、日物件 ``datetime.date``\\ 。" -#: ../../c-api/datetime.rst:102 +#: ../../c-api/datetime.rst:97 #, fuzzy msgid "" "Return a :class:`datetime.datetime` object with the specified year, month, " "day, hour, minute, second and microsecond." msgstr "回傳一個具體的年、月、日物件 ``datetime.date``\\ 。" -#: ../../c-api/datetime.rst:108 +#: ../../c-api/datetime.rst:103 #, fuzzy msgid "" "Return a :class:`datetime.datetime` object with the specified year, month, " "day, hour, minute, second, microsecond and fold." msgstr "回傳一個具體的年、月、日物件 ``datetime.date``\\ 。" -#: ../../c-api/datetime.rst:116 +#: ../../c-api/datetime.rst:111 #, fuzzy msgid "" "Return a :class:`datetime.time` object with the specified hour, minute, " "second and microsecond." msgstr "回傳一個具體的年、月、日物件 ``datetime.date``\\ 。" -#: ../../c-api/datetime.rst:122 +#: ../../c-api/datetime.rst:117 #, fuzzy msgid "" "Return a :class:`datetime.time` object with the specified hour, minute, " "second, microsecond and fold." msgstr "回傳一個具體的年、月、日物件 ``datetime.date``\\ 。" -#: ../../c-api/datetime.rst:130 +#: ../../c-api/datetime.rst:125 msgid "" "Return a :class:`datetime.timedelta` object representing the given number of " "days, seconds and microseconds. Normalization is performed so that the " @@ -161,19 +156,19 @@ msgid "" "for :class:`datetime.timedelta` objects." msgstr "" -#: ../../c-api/datetime.rst:137 +#: ../../c-api/datetime.rst:132 msgid "" "Return a :class:`datetime.timezone` object with an unnamed fixed offset " "represented by the *offset* argument." msgstr "" -#: ../../c-api/datetime.rst:144 +#: ../../c-api/datetime.rst:139 msgid "" "Return a :class:`datetime.timezone` object with a fixed offset represented " "by the *offset* argument and with tzname *name*." msgstr "" -#: ../../c-api/datetime.rst:150 +#: ../../c-api/datetime.rst:145 msgid "" "Macros to extract fields from date objects. The argument must be an " "instance of :c:data:`PyDateTime_Date`, including subclasses (such as :c:data:" @@ -181,78 +176,78 @@ msgid "" "not checked:" msgstr "" -#: ../../c-api/datetime.rst:157 +#: ../../c-api/datetime.rst:152 msgid "Return the year, as a positive int." msgstr "回傳年份,為正整數。" -#: ../../c-api/datetime.rst:162 +#: ../../c-api/datetime.rst:157 msgid "Return the month, as an int from 1 through 12." msgstr "回傳月份,為正整數,從 1 到 12。" -#: ../../c-api/datetime.rst:167 +#: ../../c-api/datetime.rst:162 msgid "Return the day, as an int from 1 through 31." msgstr "回傳日期,為正整數,從 1 到 31。" -#: ../../c-api/datetime.rst:170 +#: ../../c-api/datetime.rst:165 msgid "" "Macros to extract fields from datetime objects. The argument must be an " "instance of :c:data:`PyDateTime_DateTime`, including subclasses. The " "argument must not be ``NULL``, and the type is not checked:" msgstr "" -#: ../../c-api/datetime.rst:176 ../../c-api/datetime.rst:200 +#: ../../c-api/datetime.rst:171 ../../c-api/datetime.rst:195 msgid "Return the hour, as an int from 0 through 23." msgstr "回傳小時,為正整數,從 0 到 23。" -#: ../../c-api/datetime.rst:181 ../../c-api/datetime.rst:205 +#: ../../c-api/datetime.rst:176 ../../c-api/datetime.rst:200 msgid "Return the minute, as an int from 0 through 59." msgstr "回傳分鐘,為正整數,從 0 到 59。" -#: ../../c-api/datetime.rst:186 ../../c-api/datetime.rst:210 +#: ../../c-api/datetime.rst:181 ../../c-api/datetime.rst:205 msgid "Return the second, as an int from 0 through 59." msgstr "回傳秒,為正整數,從0 到59。" -#: ../../c-api/datetime.rst:191 ../../c-api/datetime.rst:215 +#: ../../c-api/datetime.rst:186 ../../c-api/datetime.rst:210 msgid "Return the microsecond, as an int from 0 through 999999." msgstr "回傳微秒,為正整數,從 0 到 999999。" -#: ../../c-api/datetime.rst:194 +#: ../../c-api/datetime.rst:189 msgid "" "Macros to extract fields from time objects. The argument must be an " "instance of :c:data:`PyDateTime_Time`, including subclasses. The argument " "must not be ``NULL``, and the type is not checked:" msgstr "" -#: ../../c-api/datetime.rst:218 +#: ../../c-api/datetime.rst:213 msgid "" "Macros to extract fields from time delta objects. The argument must be an " "instance of :c:data:`PyDateTime_Delta`, including subclasses. The argument " "must not be ``NULL``, and the type is not checked:" msgstr "" -#: ../../c-api/datetime.rst:224 +#: ../../c-api/datetime.rst:219 msgid "Return the number of days, as an int from -999999999 to 999999999." msgstr "" -#: ../../c-api/datetime.rst:231 +#: ../../c-api/datetime.rst:226 msgid "Return the number of seconds, as an int from 0 through 86399." msgstr "" -#: ../../c-api/datetime.rst:238 +#: ../../c-api/datetime.rst:233 msgid "Return the number of microseconds, as an int from 0 through 999999." msgstr "" -#: ../../c-api/datetime.rst:243 +#: ../../c-api/datetime.rst:238 msgid "Macros for the convenience of modules implementing the DB API:" msgstr "" -#: ../../c-api/datetime.rst:247 +#: ../../c-api/datetime.rst:242 msgid "" "Create and return a new :class:`datetime.datetime` object given an argument " "tuple suitable for passing to :meth:`datetime.datetime.fromtimestamp()`." msgstr "" -#: ../../c-api/datetime.rst:253 +#: ../../c-api/datetime.rst:248 msgid "" "Create and return a new :class:`datetime.date` object given an argument " "tuple suitable for passing to :meth:`datetime.date.fromtimestamp()`." diff --git a/c-api/dict.po b/c-api/dict.po index de1f79611f..38beb714e3 100644 --- a/c-api/dict.po +++ b/c-api/dict.po @@ -9,7 +9,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.7\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2021-09-07 06:52+0000\n" +"POT-Creation-Date: 2020-06-20 18:08+0800\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-" @@ -38,17 +38,15 @@ msgstr "" "class:`dict` 為同一個物件。" #: ../../c-api/dict.rst:24 -#, fuzzy msgid "" "Return true if *p* is a dict object or an instance of a subtype of the dict " -"type. This function always succeeds." +"type." msgstr "若 *p* 是一個字典物件或字典的子型態實例則會回傳 true。" #: ../../c-api/dict.rst:30 -#, fuzzy msgid "" "Return true if *p* is a dict object, but not an instance of a subtype of the " -"dict type. This function always succeeds." +"dict type." msgstr "若 *p* 是一個字典物件但並不是一個字典子型態的實例,則回傳 true。" #: ../../c-api/dict.rst:36 @@ -89,7 +87,7 @@ msgstr "" #: ../../c-api/dict.rst:75 msgid "" "Insert *val* into the dictionary *p* using *key* as a key. *key* should be " -"a :c:type:`const char*`. The key object is created using " +"a :c:type:`const char\\*`. The key object is created using " "``PyUnicode_FromString(key)``. Return ``0`` on success or ``-1`` on " "failure. This function *does not* steal a reference to *val*." msgstr "" @@ -97,51 +95,50 @@ msgstr "" #: ../../c-api/dict.rst:83 msgid "" "Remove the entry in dictionary *p* with key *key*. *key* must be hashable; " -"if it isn't, :exc:`TypeError` is raised. If *key* is not in the dictionary, :" -"exc:`KeyError` is raised. Return ``0`` on success or ``-1`` on failure." +"if it isn't, :exc:`TypeError` is raised. Return ``0`` on success or ``-1`` " +"on failure." msgstr "" -#: ../../c-api/dict.rst:91 +#: ../../c-api/dict.rst:90 msgid "" "Remove the entry in dictionary *p* which has a key specified by the string " -"*key*. If *key* is not in the dictionary, :exc:`KeyError` is raised. Return " -"``0`` on success or ``-1`` on failure." +"*key*. Return ``0`` on success or ``-1`` on failure." msgstr "" -#: ../../c-api/dict.rst:98 +#: ../../c-api/dict.rst:96 msgid "" "Return the object from dictionary *p* which has a key *key*. Return " "``NULL`` if the key *key* is not present, but *without* setting an exception." msgstr "" -#: ../../c-api/dict.rst:101 +#: ../../c-api/dict.rst:99 msgid "" "Note that exceptions which occur while calling :meth:`__hash__` and :meth:" "`__eq__` methods will get suppressed. To get error reporting use :c:func:" "`PyDict_GetItemWithError()` instead." msgstr "" -#: ../../c-api/dict.rst:108 +#: ../../c-api/dict.rst:106 msgid "" "Variant of :c:func:`PyDict_GetItem` that does not suppress exceptions. " "Return ``NULL`` **with** an exception set if an exception occurred. Return " "``NULL`` **without** an exception set if the key wasn't present." msgstr "" -#: ../../c-api/dict.rst:116 +#: ../../c-api/dict.rst:114 msgid "" "This is the same as :c:func:`PyDict_GetItem`, but *key* is specified as a :c:" -"type:`const char*`, rather than a :c:type:`PyObject*`." +"type:`const char\\*`, rather than a :c:type:`PyObject\\*`." msgstr "" -#: ../../c-api/dict.rst:119 +#: ../../c-api/dict.rst:117 msgid "" "Note that exceptions which occur while calling :meth:`__hash__` and :meth:" "`__eq__` methods and creating a temporary string object will get suppressed. " "To get error reporting use :c:func:`PyDict_GetItemWithError()` instead." msgstr "" -#: ../../c-api/dict.rst:127 +#: ../../c-api/dict.rst:125 msgid "" "This is the same as the Python-level :meth:`dict.setdefault`. If present, " "it returns the value corresponding to *key* from the dictionary *p*. If the " @@ -151,54 +148,54 @@ msgid "" "the insertion." msgstr "" -#: ../../c-api/dict.rst:137 +#: ../../c-api/dict.rst:135 msgid "" "Return a :c:type:`PyListObject` containing all the items from the dictionary." msgstr "" -#: ../../c-api/dict.rst:142 +#: ../../c-api/dict.rst:140 msgid "" "Return a :c:type:`PyListObject` containing all the keys from the dictionary." msgstr "" -#: ../../c-api/dict.rst:147 +#: ../../c-api/dict.rst:145 msgid "" "Return a :c:type:`PyListObject` containing all the values from the " "dictionary *p*." msgstr "" -#: ../../c-api/dict.rst:155 +#: ../../c-api/dict.rst:153 msgid "" "Return the number of items in the dictionary. This is equivalent to " "``len(p)`` on a dictionary." msgstr "" -#: ../../c-api/dict.rst:161 +#: ../../c-api/dict.rst:159 msgid "" "Iterate over all key-value pairs in the dictionary *p*. The :c:type:" "`Py_ssize_t` referred to by *ppos* must be initialized to ``0`` prior to the " "first call to this function to start the iteration; the function returns " "true for each pair in the dictionary, and false once all pairs have been " "reported. The parameters *pkey* and *pvalue* should either point to :c:type:" -"`PyObject*` variables that will be filled in with each key and value, " +"`PyObject\\*` variables that will be filled in with each key and value, " "respectively, or may be ``NULL``. Any references returned through them are " "borrowed. *ppos* should not be altered during iteration. Its value " "represents offsets within the internal dictionary structure, and since the " "structure is sparse, the offsets are not consecutive." msgstr "" -#: ../../c-api/dict.rst:172 +#: ../../c-api/dict.rst:170 msgid "For example::" msgstr "" -#: ../../c-api/dict.rst:182 +#: ../../c-api/dict.rst:180 msgid "" "The dictionary *p* should not be mutated during iteration. It is safe to " "modify the values of the keys as you iterate over the dictionary, but only " "so long as the set of keys does not change. For example::" msgstr "" -#: ../../c-api/dict.rst:207 +#: ../../c-api/dict.rst:205 msgid "" "Iterate over mapping object *b* adding key-value pairs to dictionary *a*. " "*b* may be a dictionary, or any object supporting :c:func:`PyMapping_Keys` " @@ -208,7 +205,7 @@ msgid "" "or ``-1`` if an exception was raised." msgstr "" -#: ../../c-api/dict.rst:217 +#: ../../c-api/dict.rst:215 msgid "" "This is the same as ``PyDict_Merge(a, b, 1)`` in C, and is similar to ``a." "update(b)`` in Python except that :c:func:`PyDict_Update` doesn't fall back " @@ -217,7 +214,7 @@ msgid "" "exception was raised." msgstr "" -#: ../../c-api/dict.rst:226 +#: ../../c-api/dict.rst:224 msgid "" "Update or merge into dictionary *a*, from the key-value pairs in *seq2*. " "*seq2* must be an iterable object producing iterable objects of length 2, " diff --git a/c-api/exceptions.po b/c-api/exceptions.po index 3bd90da09e..82b2ce0fdd 100644 --- a/c-api/exceptions.po +++ b/c-api/exceptions.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.7\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2021-09-07 06:52+0000\n" +"POT-Creation-Date: 2020-06-20 18:08+0800\n" "PO-Revision-Date: 2018-05-23 14:05+0000\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -143,7 +143,7 @@ msgid "" "specifies the exception type; it is normally one of the standard exceptions, " "e.g. :c:data:`PyExc_RuntimeError`. You need not increment its reference " "count. The second argument is an error message; it is decoded from " -"``'utf-8'``." +"``'utf-8``'." msgstr "" #: ../../c-api/exceptions.rst:108 @@ -665,77 +665,61 @@ msgid "" "UTF-8 encoded strings." msgstr "" -#: ../../c-api/exceptions.rst:640 ../../c-api/exceptions.rst:650 -msgid "3.11" -msgstr "" - #: ../../c-api/exceptions.rst:642 msgid "" -"``Py_UNICODE`` is deprecated since Python 3.3. Please migrate to " -"``PyObject_CallFunction(PyExc_UnicodeEncodeError, \"sOnns\", ...)``." -msgstr "" - -#: ../../c-api/exceptions.rst:647 -msgid "" "Create a :class:`UnicodeTranslateError` object with the attributes *object*, " "*length*, *start*, *end* and *reason*. *reason* is a UTF-8 encoded string." msgstr "" -#: ../../c-api/exceptions.rst:652 -msgid "" -"``Py_UNICODE`` is deprecated since Python 3.3. Please migrate to " -"``PyObject_CallFunction(PyExc_UnicodeTranslateError, \"Onns\", ...)``." -msgstr "" - -#: ../../c-api/exceptions.rst:658 +#: ../../c-api/exceptions.rst:648 msgid "Return the *encoding* attribute of the given exception object." msgstr "" -#: ../../c-api/exceptions.rst:664 +#: ../../c-api/exceptions.rst:654 msgid "Return the *object* attribute of the given exception object." msgstr "" -#: ../../c-api/exceptions.rst:670 +#: ../../c-api/exceptions.rst:660 msgid "" "Get the *start* attribute of the given exception object and place it into *" "\\*start*. *start* must not be ``NULL``. Return ``0`` on success, ``-1`` " "on failure." msgstr "" -#: ../../c-api/exceptions.rst:678 +#: ../../c-api/exceptions.rst:668 msgid "" "Set the *start* attribute of the given exception object to *start*. Return " "``0`` on success, ``-1`` on failure." msgstr "" -#: ../../c-api/exceptions.rst:685 +#: ../../c-api/exceptions.rst:675 msgid "" "Get the *end* attribute of the given exception object and place it into *" "\\*end*. *end* must not be ``NULL``. Return ``0`` on success, ``-1`` on " "failure." msgstr "" -#: ../../c-api/exceptions.rst:693 +#: ../../c-api/exceptions.rst:683 msgid "" "Set the *end* attribute of the given exception object to *end*. Return " "``0`` on success, ``-1`` on failure." msgstr "" -#: ../../c-api/exceptions.rst:700 +#: ../../c-api/exceptions.rst:690 msgid "Return the *reason* attribute of the given exception object." msgstr "" -#: ../../c-api/exceptions.rst:706 +#: ../../c-api/exceptions.rst:696 msgid "" "Set the *reason* attribute of the given exception object to *reason*. " "Return ``0`` on success, ``-1`` on failure." msgstr "" -#: ../../c-api/exceptions.rst:713 +#: ../../c-api/exceptions.rst:703 msgid "Recursion Control" msgstr "" -#: ../../c-api/exceptions.rst:715 +#: ../../c-api/exceptions.rst:705 msgid "" "These two functions provide a way to perform safe recursive calls at the C " "level, both in the core and in extension modules. They are needed if the " @@ -745,42 +729,42 @@ msgid "" "recursion handling." msgstr "" -#: ../../c-api/exceptions.rst:724 +#: ../../c-api/exceptions.rst:714 msgid "Marks a point where a recursive C-level call is about to be performed." msgstr "" -#: ../../c-api/exceptions.rst:726 +#: ../../c-api/exceptions.rst:716 msgid "" "If :const:`USE_STACKCHECK` is defined, this function checks if the OS stack " "overflowed using :c:func:`PyOS_CheckStack`. In this is the case, it sets a :" "exc:`MemoryError` and returns a nonzero value." msgstr "" -#: ../../c-api/exceptions.rst:730 +#: ../../c-api/exceptions.rst:720 msgid "" "The function then checks if the recursion limit is reached. If this is the " "case, a :exc:`RecursionError` is set and a nonzero value is returned. " "Otherwise, zero is returned." msgstr "" -#: ../../c-api/exceptions.rst:734 +#: ../../c-api/exceptions.rst:724 msgid "" "*where* should be a UTF-8 encoded string such as ``\" in instance check\"`` " "to be concatenated to the :exc:`RecursionError` message caused by the " "recursion depth limit." msgstr "" -#: ../../c-api/exceptions.rst:738 ../../c-api/exceptions.rst:746 +#: ../../c-api/exceptions.rst:728 ../../c-api/exceptions.rst:736 msgid "This function is now also available in the limited API." msgstr "" -#: ../../c-api/exceptions.rst:743 +#: ../../c-api/exceptions.rst:733 msgid "" "Ends a :c:func:`Py_EnterRecursiveCall`. Must be called once for each " "*successful* invocation of :c:func:`Py_EnterRecursiveCall`." msgstr "" -#: ../../c-api/exceptions.rst:749 +#: ../../c-api/exceptions.rst:739 msgid "" "Properly implementing :c:member:`~PyTypeObject.tp_repr` for container types " "requires special recursion handling. In addition to protecting the stack, :" @@ -789,13 +773,13 @@ msgid "" "Effectively, these are the C equivalent to :func:`reprlib.recursive_repr`." msgstr "" -#: ../../c-api/exceptions.rst:757 +#: ../../c-api/exceptions.rst:747 msgid "" "Called at the beginning of the :c:member:`~PyTypeObject.tp_repr` " "implementation to detect cycles." msgstr "" -#: ../../c-api/exceptions.rst:760 +#: ../../c-api/exceptions.rst:750 msgid "" "If the object has already been processed, the function returns a positive " "integer. In that case the :c:member:`~PyTypeObject.tp_repr` implementation " @@ -803,486 +787,486 @@ msgid "" "`dict` objects return ``{...}`` and :class:`list` objects return ``[...]``." msgstr "" -#: ../../c-api/exceptions.rst:766 +#: ../../c-api/exceptions.rst:756 msgid "" "The function will return a negative integer if the recursion limit is " "reached. In that case the :c:member:`~PyTypeObject.tp_repr` implementation " "should typically return ``NULL``." msgstr "" -#: ../../c-api/exceptions.rst:770 +#: ../../c-api/exceptions.rst:760 msgid "" "Otherwise, the function returns zero and the :c:member:`~PyTypeObject." "tp_repr` implementation can continue normally." msgstr "" -#: ../../c-api/exceptions.rst:775 +#: ../../c-api/exceptions.rst:765 msgid "" "Ends a :c:func:`Py_ReprEnter`. Must be called once for each invocation of :" "c:func:`Py_ReprEnter` that returns zero." msgstr "" -#: ../../c-api/exceptions.rst:782 +#: ../../c-api/exceptions.rst:772 msgid "Standard Exceptions" msgstr "" -#: ../../c-api/exceptions.rst:784 +#: ../../c-api/exceptions.rst:774 msgid "" "All standard Python exceptions are available as global variables whose names " "are ``PyExc_`` followed by the Python exception name. These have the type :" -"c:type:`PyObject*`; they are all class objects. For completeness, here are " -"all the variables:" +"c:type:`PyObject\\*`; they are all class objects. For completeness, here " +"are all the variables:" msgstr "" -#: ../../c-api/exceptions.rst:845 ../../c-api/exceptions.rst:978 -#: ../../c-api/exceptions.rst:1023 +#: ../../c-api/exceptions.rst:835 ../../c-api/exceptions.rst:968 +#: ../../c-api/exceptions.rst:1013 msgid "C Name" msgstr "" -#: ../../c-api/exceptions.rst:845 ../../c-api/exceptions.rst:1023 +#: ../../c-api/exceptions.rst:835 ../../c-api/exceptions.rst:1013 msgid "Python Name" msgstr "" -#: ../../c-api/exceptions.rst:845 ../../c-api/exceptions.rst:978 -#: ../../c-api/exceptions.rst:1023 +#: ../../c-api/exceptions.rst:835 ../../c-api/exceptions.rst:968 +#: ../../c-api/exceptions.rst:1013 msgid "Notes" msgstr "註解" -#: ../../c-api/exceptions.rst:847 +#: ../../c-api/exceptions.rst:837 msgid ":c:data:`PyExc_BaseException`" msgstr "" -#: ../../c-api/exceptions.rst:847 +#: ../../c-api/exceptions.rst:837 msgid ":exc:`BaseException`" msgstr "" -#: ../../c-api/exceptions.rst:847 ../../c-api/exceptions.rst:849 -#: ../../c-api/exceptions.rst:851 ../../c-api/exceptions.rst:897 -#: ../../c-api/exceptions.rst:909 ../../c-api/exceptions.rst:1025 +#: ../../c-api/exceptions.rst:837 ../../c-api/exceptions.rst:839 +#: ../../c-api/exceptions.rst:841 ../../c-api/exceptions.rst:887 +#: ../../c-api/exceptions.rst:899 ../../c-api/exceptions.rst:1015 msgid "\\(1)" msgstr "\\(1)" -#: ../../c-api/exceptions.rst:849 +#: ../../c-api/exceptions.rst:839 msgid ":c:data:`PyExc_Exception`" msgstr "" -#: ../../c-api/exceptions.rst:849 +#: ../../c-api/exceptions.rst:839 msgid ":exc:`Exception`" msgstr "" -#: ../../c-api/exceptions.rst:851 +#: ../../c-api/exceptions.rst:841 msgid ":c:data:`PyExc_ArithmeticError`" msgstr "" -#: ../../c-api/exceptions.rst:851 +#: ../../c-api/exceptions.rst:841 msgid ":exc:`ArithmeticError`" msgstr "" -#: ../../c-api/exceptions.rst:853 +#: ../../c-api/exceptions.rst:843 msgid ":c:data:`PyExc_AssertionError`" msgstr "" -#: ../../c-api/exceptions.rst:853 +#: ../../c-api/exceptions.rst:843 msgid ":exc:`AssertionError`" msgstr "" -#: ../../c-api/exceptions.rst:855 +#: ../../c-api/exceptions.rst:845 msgid ":c:data:`PyExc_AttributeError`" msgstr "" -#: ../../c-api/exceptions.rst:855 +#: ../../c-api/exceptions.rst:845 msgid ":exc:`AttributeError`" msgstr "" -#: ../../c-api/exceptions.rst:857 +#: ../../c-api/exceptions.rst:847 msgid ":c:data:`PyExc_BlockingIOError`" msgstr "" -#: ../../c-api/exceptions.rst:857 +#: ../../c-api/exceptions.rst:847 msgid ":exc:`BlockingIOError`" msgstr "" -#: ../../c-api/exceptions.rst:859 +#: ../../c-api/exceptions.rst:849 msgid ":c:data:`PyExc_BrokenPipeError`" msgstr "" -#: ../../c-api/exceptions.rst:859 +#: ../../c-api/exceptions.rst:849 msgid ":exc:`BrokenPipeError`" msgstr "" -#: ../../c-api/exceptions.rst:861 +#: ../../c-api/exceptions.rst:851 msgid ":c:data:`PyExc_BufferError`" msgstr "" -#: ../../c-api/exceptions.rst:861 +#: ../../c-api/exceptions.rst:851 msgid ":exc:`BufferError`" msgstr "" -#: ../../c-api/exceptions.rst:863 +#: ../../c-api/exceptions.rst:853 msgid ":c:data:`PyExc_ChildProcessError`" msgstr "" -#: ../../c-api/exceptions.rst:863 +#: ../../c-api/exceptions.rst:853 msgid ":exc:`ChildProcessError`" msgstr "" -#: ../../c-api/exceptions.rst:865 +#: ../../c-api/exceptions.rst:855 msgid ":c:data:`PyExc_ConnectionAbortedError`" msgstr "" -#: ../../c-api/exceptions.rst:865 +#: ../../c-api/exceptions.rst:855 msgid ":exc:`ConnectionAbortedError`" msgstr "" -#: ../../c-api/exceptions.rst:867 +#: ../../c-api/exceptions.rst:857 msgid ":c:data:`PyExc_ConnectionError`" msgstr "" -#: ../../c-api/exceptions.rst:867 +#: ../../c-api/exceptions.rst:857 msgid ":exc:`ConnectionError`" msgstr "" -#: ../../c-api/exceptions.rst:869 +#: ../../c-api/exceptions.rst:859 msgid ":c:data:`PyExc_ConnectionRefusedError`" msgstr "" -#: ../../c-api/exceptions.rst:869 +#: ../../c-api/exceptions.rst:859 msgid ":exc:`ConnectionRefusedError`" msgstr "" -#: ../../c-api/exceptions.rst:871 +#: ../../c-api/exceptions.rst:861 msgid ":c:data:`PyExc_ConnectionResetError`" msgstr "" -#: ../../c-api/exceptions.rst:871 +#: ../../c-api/exceptions.rst:861 msgid ":exc:`ConnectionResetError`" msgstr "" -#: ../../c-api/exceptions.rst:873 +#: ../../c-api/exceptions.rst:863 msgid ":c:data:`PyExc_EOFError`" msgstr "" -#: ../../c-api/exceptions.rst:873 +#: ../../c-api/exceptions.rst:863 msgid ":exc:`EOFError`" msgstr "" -#: ../../c-api/exceptions.rst:875 +#: ../../c-api/exceptions.rst:865 msgid ":c:data:`PyExc_FileExistsError`" msgstr "" -#: ../../c-api/exceptions.rst:875 +#: ../../c-api/exceptions.rst:865 msgid ":exc:`FileExistsError`" msgstr "" -#: ../../c-api/exceptions.rst:877 +#: ../../c-api/exceptions.rst:867 msgid ":c:data:`PyExc_FileNotFoundError`" msgstr "" -#: ../../c-api/exceptions.rst:877 +#: ../../c-api/exceptions.rst:867 msgid ":exc:`FileNotFoundError`" msgstr "" -#: ../../c-api/exceptions.rst:879 +#: ../../c-api/exceptions.rst:869 msgid ":c:data:`PyExc_FloatingPointError`" msgstr "" -#: ../../c-api/exceptions.rst:879 +#: ../../c-api/exceptions.rst:869 msgid ":exc:`FloatingPointError`" msgstr "" -#: ../../c-api/exceptions.rst:881 +#: ../../c-api/exceptions.rst:871 msgid ":c:data:`PyExc_GeneratorExit`" msgstr "" -#: ../../c-api/exceptions.rst:881 +#: ../../c-api/exceptions.rst:871 msgid ":exc:`GeneratorExit`" msgstr "" -#: ../../c-api/exceptions.rst:883 +#: ../../c-api/exceptions.rst:873 msgid ":c:data:`PyExc_ImportError`" msgstr "" -#: ../../c-api/exceptions.rst:883 +#: ../../c-api/exceptions.rst:873 msgid ":exc:`ImportError`" msgstr "" -#: ../../c-api/exceptions.rst:885 +#: ../../c-api/exceptions.rst:875 msgid ":c:data:`PyExc_IndentationError`" msgstr "" -#: ../../c-api/exceptions.rst:885 +#: ../../c-api/exceptions.rst:875 msgid ":exc:`IndentationError`" msgstr "" -#: ../../c-api/exceptions.rst:887 +#: ../../c-api/exceptions.rst:877 msgid ":c:data:`PyExc_IndexError`" msgstr "" -#: ../../c-api/exceptions.rst:887 +#: ../../c-api/exceptions.rst:877 msgid ":exc:`IndexError`" msgstr "" -#: ../../c-api/exceptions.rst:889 +#: ../../c-api/exceptions.rst:879 msgid ":c:data:`PyExc_InterruptedError`" msgstr "" -#: ../../c-api/exceptions.rst:889 +#: ../../c-api/exceptions.rst:879 msgid ":exc:`InterruptedError`" msgstr "" -#: ../../c-api/exceptions.rst:891 +#: ../../c-api/exceptions.rst:881 msgid ":c:data:`PyExc_IsADirectoryError`" msgstr "" -#: ../../c-api/exceptions.rst:891 +#: ../../c-api/exceptions.rst:881 msgid ":exc:`IsADirectoryError`" msgstr "" -#: ../../c-api/exceptions.rst:893 +#: ../../c-api/exceptions.rst:883 msgid ":c:data:`PyExc_KeyError`" msgstr "" -#: ../../c-api/exceptions.rst:893 +#: ../../c-api/exceptions.rst:883 msgid ":exc:`KeyError`" msgstr "" -#: ../../c-api/exceptions.rst:895 +#: ../../c-api/exceptions.rst:885 msgid ":c:data:`PyExc_KeyboardInterrupt`" msgstr "" -#: ../../c-api/exceptions.rst:895 +#: ../../c-api/exceptions.rst:885 msgid ":exc:`KeyboardInterrupt`" msgstr "" -#: ../../c-api/exceptions.rst:897 +#: ../../c-api/exceptions.rst:887 msgid ":c:data:`PyExc_LookupError`" msgstr "" -#: ../../c-api/exceptions.rst:897 +#: ../../c-api/exceptions.rst:887 msgid ":exc:`LookupError`" msgstr "" -#: ../../c-api/exceptions.rst:899 +#: ../../c-api/exceptions.rst:889 msgid ":c:data:`PyExc_MemoryError`" msgstr "" -#: ../../c-api/exceptions.rst:899 +#: ../../c-api/exceptions.rst:889 msgid ":exc:`MemoryError`" msgstr "" -#: ../../c-api/exceptions.rst:901 +#: ../../c-api/exceptions.rst:891 msgid ":c:data:`PyExc_ModuleNotFoundError`" msgstr "" -#: ../../c-api/exceptions.rst:901 +#: ../../c-api/exceptions.rst:891 msgid ":exc:`ModuleNotFoundError`" msgstr "" -#: ../../c-api/exceptions.rst:903 +#: ../../c-api/exceptions.rst:893 msgid ":c:data:`PyExc_NameError`" msgstr "" -#: ../../c-api/exceptions.rst:903 +#: ../../c-api/exceptions.rst:893 msgid ":exc:`NameError`" msgstr "" -#: ../../c-api/exceptions.rst:905 +#: ../../c-api/exceptions.rst:895 msgid ":c:data:`PyExc_NotADirectoryError`" msgstr "" -#: ../../c-api/exceptions.rst:905 +#: ../../c-api/exceptions.rst:895 msgid ":exc:`NotADirectoryError`" msgstr "" -#: ../../c-api/exceptions.rst:907 +#: ../../c-api/exceptions.rst:897 msgid ":c:data:`PyExc_NotImplementedError`" msgstr "" -#: ../../c-api/exceptions.rst:907 +#: ../../c-api/exceptions.rst:897 msgid ":exc:`NotImplementedError`" msgstr "" -#: ../../c-api/exceptions.rst:909 +#: ../../c-api/exceptions.rst:899 msgid ":c:data:`PyExc_OSError`" msgstr "" -#: ../../c-api/exceptions.rst:909 +#: ../../c-api/exceptions.rst:899 msgid ":exc:`OSError`" msgstr "" -#: ../../c-api/exceptions.rst:911 +#: ../../c-api/exceptions.rst:901 msgid ":c:data:`PyExc_OverflowError`" msgstr "" -#: ../../c-api/exceptions.rst:911 +#: ../../c-api/exceptions.rst:901 msgid ":exc:`OverflowError`" msgstr "" -#: ../../c-api/exceptions.rst:913 +#: ../../c-api/exceptions.rst:903 msgid ":c:data:`PyExc_PermissionError`" msgstr "" -#: ../../c-api/exceptions.rst:913 +#: ../../c-api/exceptions.rst:903 msgid ":exc:`PermissionError`" msgstr "" -#: ../../c-api/exceptions.rst:915 +#: ../../c-api/exceptions.rst:905 msgid ":c:data:`PyExc_ProcessLookupError`" msgstr "" -#: ../../c-api/exceptions.rst:915 +#: ../../c-api/exceptions.rst:905 msgid ":exc:`ProcessLookupError`" msgstr "" -#: ../../c-api/exceptions.rst:917 +#: ../../c-api/exceptions.rst:907 msgid ":c:data:`PyExc_RecursionError`" msgstr "" -#: ../../c-api/exceptions.rst:917 +#: ../../c-api/exceptions.rst:907 msgid ":exc:`RecursionError`" msgstr "" -#: ../../c-api/exceptions.rst:919 +#: ../../c-api/exceptions.rst:909 msgid ":c:data:`PyExc_ReferenceError`" msgstr "" -#: ../../c-api/exceptions.rst:919 +#: ../../c-api/exceptions.rst:909 msgid ":exc:`ReferenceError`" msgstr "" -#: ../../c-api/exceptions.rst:919 +#: ../../c-api/exceptions.rst:909 msgid "\\(2)" msgstr "\\(2)" -#: ../../c-api/exceptions.rst:921 +#: ../../c-api/exceptions.rst:911 msgid ":c:data:`PyExc_RuntimeError`" msgstr "" -#: ../../c-api/exceptions.rst:921 +#: ../../c-api/exceptions.rst:911 msgid ":exc:`RuntimeError`" msgstr "" -#: ../../c-api/exceptions.rst:923 +#: ../../c-api/exceptions.rst:913 msgid ":c:data:`PyExc_StopAsyncIteration`" msgstr "" -#: ../../c-api/exceptions.rst:923 +#: ../../c-api/exceptions.rst:913 msgid ":exc:`StopAsyncIteration`" msgstr "" -#: ../../c-api/exceptions.rst:925 +#: ../../c-api/exceptions.rst:915 msgid ":c:data:`PyExc_StopIteration`" msgstr "" -#: ../../c-api/exceptions.rst:925 +#: ../../c-api/exceptions.rst:915 msgid ":exc:`StopIteration`" msgstr "" -#: ../../c-api/exceptions.rst:927 +#: ../../c-api/exceptions.rst:917 msgid ":c:data:`PyExc_SyntaxError`" msgstr "" -#: ../../c-api/exceptions.rst:927 +#: ../../c-api/exceptions.rst:917 msgid ":exc:`SyntaxError`" msgstr "" -#: ../../c-api/exceptions.rst:929 +#: ../../c-api/exceptions.rst:919 msgid ":c:data:`PyExc_SystemError`" msgstr "" -#: ../../c-api/exceptions.rst:929 +#: ../../c-api/exceptions.rst:919 msgid ":exc:`SystemError`" msgstr "" -#: ../../c-api/exceptions.rst:931 +#: ../../c-api/exceptions.rst:921 msgid ":c:data:`PyExc_SystemExit`" msgstr "" -#: ../../c-api/exceptions.rst:931 +#: ../../c-api/exceptions.rst:921 msgid ":exc:`SystemExit`" msgstr "" -#: ../../c-api/exceptions.rst:933 +#: ../../c-api/exceptions.rst:923 msgid ":c:data:`PyExc_TabError`" msgstr "" -#: ../../c-api/exceptions.rst:933 +#: ../../c-api/exceptions.rst:923 msgid ":exc:`TabError`" msgstr "" -#: ../../c-api/exceptions.rst:935 +#: ../../c-api/exceptions.rst:925 msgid ":c:data:`PyExc_TimeoutError`" msgstr "" -#: ../../c-api/exceptions.rst:935 +#: ../../c-api/exceptions.rst:925 msgid ":exc:`TimeoutError`" msgstr "" -#: ../../c-api/exceptions.rst:937 +#: ../../c-api/exceptions.rst:927 msgid ":c:data:`PyExc_TypeError`" msgstr "" -#: ../../c-api/exceptions.rst:937 +#: ../../c-api/exceptions.rst:927 msgid ":exc:`TypeError`" msgstr "" -#: ../../c-api/exceptions.rst:939 +#: ../../c-api/exceptions.rst:929 msgid ":c:data:`PyExc_UnboundLocalError`" msgstr "" -#: ../../c-api/exceptions.rst:939 +#: ../../c-api/exceptions.rst:929 msgid ":exc:`UnboundLocalError`" msgstr "" -#: ../../c-api/exceptions.rst:941 +#: ../../c-api/exceptions.rst:931 msgid ":c:data:`PyExc_UnicodeDecodeError`" msgstr "" -#: ../../c-api/exceptions.rst:941 +#: ../../c-api/exceptions.rst:931 msgid ":exc:`UnicodeDecodeError`" msgstr "" -#: ../../c-api/exceptions.rst:943 +#: ../../c-api/exceptions.rst:933 msgid ":c:data:`PyExc_UnicodeEncodeError`" msgstr "" -#: ../../c-api/exceptions.rst:943 +#: ../../c-api/exceptions.rst:933 msgid ":exc:`UnicodeEncodeError`" msgstr "" -#: ../../c-api/exceptions.rst:945 +#: ../../c-api/exceptions.rst:935 msgid ":c:data:`PyExc_UnicodeError`" msgstr "" -#: ../../c-api/exceptions.rst:945 +#: ../../c-api/exceptions.rst:935 msgid ":exc:`UnicodeError`" msgstr "" -#: ../../c-api/exceptions.rst:947 +#: ../../c-api/exceptions.rst:937 msgid ":c:data:`PyExc_UnicodeTranslateError`" msgstr "" -#: ../../c-api/exceptions.rst:947 +#: ../../c-api/exceptions.rst:937 msgid ":exc:`UnicodeTranslateError`" msgstr "" -#: ../../c-api/exceptions.rst:949 +#: ../../c-api/exceptions.rst:939 msgid ":c:data:`PyExc_ValueError`" msgstr "" -#: ../../c-api/exceptions.rst:949 +#: ../../c-api/exceptions.rst:939 msgid ":exc:`ValueError`" msgstr "" -#: ../../c-api/exceptions.rst:951 +#: ../../c-api/exceptions.rst:941 msgid ":c:data:`PyExc_ZeroDivisionError`" msgstr "" -#: ../../c-api/exceptions.rst:951 +#: ../../c-api/exceptions.rst:941 msgid ":exc:`ZeroDivisionError`" msgstr "" -#: ../../c-api/exceptions.rst:954 +#: ../../c-api/exceptions.rst:944 msgid "" ":c:data:`PyExc_BlockingIOError`, :c:data:`PyExc_BrokenPipeError`, :c:data:" "`PyExc_ChildProcessError`, :c:data:`PyExc_ConnectionError`, :c:data:" @@ -1294,156 +1278,156 @@ msgid "" "`PyExc_TimeoutError` were introduced following :pep:`3151`." msgstr "" -#: ../../c-api/exceptions.rst:964 +#: ../../c-api/exceptions.rst:954 msgid ":c:data:`PyExc_StopAsyncIteration` and :c:data:`PyExc_RecursionError`." msgstr "" -#: ../../c-api/exceptions.rst:967 +#: ../../c-api/exceptions.rst:957 msgid ":c:data:`PyExc_ModuleNotFoundError`." msgstr "" -#: ../../c-api/exceptions.rst:970 +#: ../../c-api/exceptions.rst:960 msgid "These are compatibility aliases to :c:data:`PyExc_OSError`:" msgstr "" -#: ../../c-api/exceptions.rst:980 +#: ../../c-api/exceptions.rst:970 msgid ":c:data:`PyExc_EnvironmentError`" msgstr "" -#: ../../c-api/exceptions.rst:982 +#: ../../c-api/exceptions.rst:972 msgid ":c:data:`PyExc_IOError`" msgstr "" -#: ../../c-api/exceptions.rst:984 +#: ../../c-api/exceptions.rst:974 msgid ":c:data:`PyExc_WindowsError`" msgstr "" -#: ../../c-api/exceptions.rst:984 +#: ../../c-api/exceptions.rst:974 msgid "\\(3)" msgstr "" -#: ../../c-api/exceptions.rst:987 +#: ../../c-api/exceptions.rst:977 msgid "These aliases used to be separate exception types." msgstr "" -#: ../../c-api/exceptions.rst:990 ../../c-api/exceptions.rst:1051 +#: ../../c-api/exceptions.rst:980 ../../c-api/exceptions.rst:1041 msgid "Notes:" msgstr "註解:" -#: ../../c-api/exceptions.rst:993 +#: ../../c-api/exceptions.rst:983 msgid "This is a base class for other standard exceptions." msgstr "" -#: ../../c-api/exceptions.rst:996 +#: ../../c-api/exceptions.rst:986 msgid "" "Only defined on Windows; protect code that uses this by testing that the " "preprocessor macro ``MS_WINDOWS`` is defined." msgstr "" -#: ../../c-api/exceptions.rst:1002 +#: ../../c-api/exceptions.rst:992 msgid "Standard Warning Categories" msgstr "" -#: ../../c-api/exceptions.rst:1004 +#: ../../c-api/exceptions.rst:994 msgid "" "All standard Python warning categories are available as global variables " "whose names are ``PyExc_`` followed by the Python exception name. These have " -"the type :c:type:`PyObject*`; they are all class objects. For completeness, " -"here are all the variables:" +"the type :c:type:`PyObject\\*`; they are all class objects. For " +"completeness, here are all the variables:" msgstr "" -#: ../../c-api/exceptions.rst:1025 +#: ../../c-api/exceptions.rst:1015 msgid ":c:data:`PyExc_Warning`" msgstr "" -#: ../../c-api/exceptions.rst:1025 +#: ../../c-api/exceptions.rst:1015 msgid ":exc:`Warning`" msgstr "" -#: ../../c-api/exceptions.rst:1027 +#: ../../c-api/exceptions.rst:1017 msgid ":c:data:`PyExc_BytesWarning`" msgstr "" -#: ../../c-api/exceptions.rst:1027 +#: ../../c-api/exceptions.rst:1017 msgid ":exc:`BytesWarning`" msgstr "" -#: ../../c-api/exceptions.rst:1029 +#: ../../c-api/exceptions.rst:1019 msgid ":c:data:`PyExc_DeprecationWarning`" msgstr "" -#: ../../c-api/exceptions.rst:1029 +#: ../../c-api/exceptions.rst:1019 msgid ":exc:`DeprecationWarning`" msgstr "" -#: ../../c-api/exceptions.rst:1031 +#: ../../c-api/exceptions.rst:1021 msgid ":c:data:`PyExc_FutureWarning`" msgstr "" -#: ../../c-api/exceptions.rst:1031 +#: ../../c-api/exceptions.rst:1021 msgid ":exc:`FutureWarning`" msgstr "" -#: ../../c-api/exceptions.rst:1033 +#: ../../c-api/exceptions.rst:1023 msgid ":c:data:`PyExc_ImportWarning`" msgstr "" -#: ../../c-api/exceptions.rst:1033 +#: ../../c-api/exceptions.rst:1023 msgid ":exc:`ImportWarning`" msgstr "" -#: ../../c-api/exceptions.rst:1035 +#: ../../c-api/exceptions.rst:1025 msgid ":c:data:`PyExc_PendingDeprecationWarning`" msgstr "" -#: ../../c-api/exceptions.rst:1035 +#: ../../c-api/exceptions.rst:1025 msgid ":exc:`PendingDeprecationWarning`" msgstr "" -#: ../../c-api/exceptions.rst:1037 +#: ../../c-api/exceptions.rst:1027 msgid ":c:data:`PyExc_ResourceWarning`" msgstr "" -#: ../../c-api/exceptions.rst:1037 +#: ../../c-api/exceptions.rst:1027 msgid ":exc:`ResourceWarning`" msgstr "" -#: ../../c-api/exceptions.rst:1039 +#: ../../c-api/exceptions.rst:1029 msgid ":c:data:`PyExc_RuntimeWarning`" msgstr "" -#: ../../c-api/exceptions.rst:1039 +#: ../../c-api/exceptions.rst:1029 msgid ":exc:`RuntimeWarning`" msgstr "" -#: ../../c-api/exceptions.rst:1041 +#: ../../c-api/exceptions.rst:1031 msgid ":c:data:`PyExc_SyntaxWarning`" msgstr "" -#: ../../c-api/exceptions.rst:1041 +#: ../../c-api/exceptions.rst:1031 msgid ":exc:`SyntaxWarning`" msgstr "" -#: ../../c-api/exceptions.rst:1043 +#: ../../c-api/exceptions.rst:1033 msgid ":c:data:`PyExc_UnicodeWarning`" msgstr "" -#: ../../c-api/exceptions.rst:1043 +#: ../../c-api/exceptions.rst:1033 msgid ":exc:`UnicodeWarning`" msgstr "" -#: ../../c-api/exceptions.rst:1045 +#: ../../c-api/exceptions.rst:1035 msgid ":c:data:`PyExc_UserWarning`" msgstr "" -#: ../../c-api/exceptions.rst:1045 +#: ../../c-api/exceptions.rst:1035 msgid ":exc:`UserWarning`" msgstr "" -#: ../../c-api/exceptions.rst:1048 +#: ../../c-api/exceptions.rst:1038 msgid ":c:data:`PyExc_ResourceWarning`." msgstr "" -#: ../../c-api/exceptions.rst:1054 +#: ../../c-api/exceptions.rst:1044 msgid "This is a base class for other standard warning categories." msgstr "" diff --git a/c-api/file.po b/c-api/file.po index d4795ea3d0..f178fd3d36 100644 --- a/c-api/file.po +++ b/c-api/file.po @@ -9,7 +9,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.7\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2021-09-07 06:52+0000\n" +"POT-Creation-Date: 2020-06-20 18:08+0800\n" "PO-Revision-Date: 2017-09-22 18:26+0000\n" "Last-Translator: Liang-Bo Wang \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -27,7 +27,7 @@ msgstr "檔案(File)物件" #: ../../c-api/file.rst:10 msgid "" "These APIs are a minimal emulation of the Python 2 C API for built-in file " -"objects, which used to rely on the buffered I/O (:c:type:`FILE*`) support " +"objects, which used to rely on the buffered I/O (:c:type:`FILE\\*`) support " "from the C standard library. In Python 3, files and streams use the new :" "mod:`io` module, which defines several layers over the low-level unbuffered " "I/O of the operating system. The functions described below are convenience " @@ -116,13 +116,7 @@ msgstr "" msgid "This function is safe to call before :c:func:`Py_Initialize`." msgstr "" -#: ../../c-api/file.rst:85 -msgid "" -"Raises an :ref:`auditing event ` ``setopencodehook`` with no " -"arguments." -msgstr "" - -#: ../../c-api/file.rst:95 +#: ../../c-api/file.rst:93 msgid "" "Write object *obj* to file object *p*. The only supported flag for *flags* " "is :const:`Py_PRINT_RAW`; if given, the :func:`str` of the object is written " @@ -130,7 +124,7 @@ msgid "" "the appropriate exception will be set." msgstr "" -#: ../../c-api/file.rst:103 +#: ../../c-api/file.rst:101 msgid "" "Write string *s* to file object *p*. Return ``0`` on success or ``-1`` on " "failure; the appropriate exception will be set." diff --git a/c-api/float.po b/c-api/float.po index 91e1d889fa..6752bebc58 100644 --- a/c-api/float.po +++ b/c-api/float.po @@ -9,7 +9,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.7\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2021-09-07 06:52+0000\n" +"POT-Creation-Date: 2020-06-20 18:08+0800\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-" @@ -38,13 +38,13 @@ msgstr "" #: ../../c-api/float.rst:24 msgid "" "Return true if its argument is a :c:type:`PyFloatObject` or a subtype of :c:" -"type:`PyFloatObject`. This function always succeeds." +"type:`PyFloatObject`." msgstr "" #: ../../c-api/float.rst:30 msgid "" "Return true if its argument is a :c:type:`PyFloatObject`, but not a subtype " -"of :c:type:`PyFloatObject`. This function always succeeds." +"of :c:type:`PyFloatObject`." msgstr "" #: ../../c-api/float.rst:36 diff --git a/c-api/function.po b/c-api/function.po index ab910dfad8..a6b7831bdb 100644 --- a/c-api/function.po +++ b/c-api/function.po @@ -9,7 +9,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.7\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2021-09-07 06:52+0000\n" +"POT-Creation-Date: 2020-06-20 18:08+0800\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-" @@ -42,8 +42,7 @@ msgstr "" #: ../../c-api/function.rst:28 msgid "" "Return true if *o* is a function object (has type :c:data:" -"`PyFunction_Type`). The parameter must not be ``NULL``. This function " -"always succeeds." +"`PyFunction_Type`). The parameter must not be ``NULL``." msgstr "" #: ../../c-api/function.rst:34 diff --git a/c-api/gcsupport.po b/c-api/gcsupport.po index 8d79be4c42..6bc913a2e8 100644 --- a/c-api/gcsupport.po +++ b/c-api/gcsupport.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.7\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2021-09-07 06:52+0000\n" +"POT-Creation-Date: 2020-06-20 18:08+0800\n" "PO-Revision-Date: 2018-05-23 14:31+0000\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -64,44 +64,26 @@ msgid "" "initialized, it must call :c:func:`PyObject_GC_Track`." msgstr "" -#: ../../c-api/gcsupport.rst:37 -msgid "" -"If a type adds the Py_TPFLAGS_HAVE_GC, then it *must* implement at least a :" -"c:member:`~PyTypeObject.tp_traverse` handler or explicitly use one from its " -"subclass or subclasses." -msgstr "" - -#: ../../c-api/gcsupport.rst:41 -msgid "" -"When calling :c:func:`PyType_Ready` or some of the APIs that indirectly call " -"it like :c:func:`PyType_FromSpecWithBases` or :c:func:`PyType_FromSpec` the " -"interpreter will automatically populate the :c:member:`~PyTypeObject." -"tp_flags`, :c:member:`~PyTypeObject.tp_traverse` and :c:member:" -"`~PyTypeObject.tp_clear` fields if the type inherits from a class that " -"implements the garbage collector protocol and the child class does *not* " -"include the :const:`Py_TPFLAGS_HAVE_GC` flag." -msgstr "" - -#: ../../c-api/gcsupport.rst:51 +#: ../../c-api/gcsupport.rst:39 msgid "" "Analogous to :c:func:`PyObject_New` but for container objects with the :" "const:`Py_TPFLAGS_HAVE_GC` flag set." msgstr "" -#: ../../c-api/gcsupport.rst:57 +#: ../../c-api/gcsupport.rst:45 msgid "" "Analogous to :c:func:`PyObject_NewVar` but for container objects with the :" "const:`Py_TPFLAGS_HAVE_GC` flag set." msgstr "" -#: ../../c-api/gcsupport.rst:63 +#: ../../c-api/gcsupport.rst:51 msgid "" "Resize an object allocated by :c:func:`PyObject_NewVar`. Returns the " "resized object or ``NULL`` on failure. *op* must not be tracked by the " "collector yet." msgstr "" -#: ../../c-api/gcsupport.rst:69 +#: ../../c-api/gcsupport.rst:57 msgid "" "Adds the object *op* to the set of container objects tracked by the " "collector. The collector can run at unexpected times so objects must be " @@ -110,62 +92,62 @@ msgid "" "usually near the end of the constructor." msgstr "" -#: ../../c-api/gcsupport.rst:78 +#: ../../c-api/gcsupport.rst:66 msgid "" "Returns non-zero if the object implements the garbage collector protocol, " "otherwise returns 0." msgstr "" -#: ../../c-api/gcsupport.rst:81 +#: ../../c-api/gcsupport.rst:69 msgid "" "The object cannot be tracked by the garbage collector if this function " "returns 0." msgstr "" -#: ../../c-api/gcsupport.rst:86 +#: ../../c-api/gcsupport.rst:74 msgid "" "Returns 1 if the object type of *op* implements the GC protocol and *op* is " "being currently tracked by the garbage collector and 0 otherwise." msgstr "" -#: ../../c-api/gcsupport.rst:89 +#: ../../c-api/gcsupport.rst:77 msgid "This is analogous to the Python function :func:`gc.is_tracked`." msgstr "" -#: ../../c-api/gcsupport.rst:96 +#: ../../c-api/gcsupport.rst:84 msgid "" "Returns 1 if the object type of *op* implements the GC protocol and *op* has " "been already finalized by the garbage collector and 0 otherwise." msgstr "" -#: ../../c-api/gcsupport.rst:99 +#: ../../c-api/gcsupport.rst:87 msgid "This is analogous to the Python function :func:`gc.is_finalized`." msgstr "" -#: ../../c-api/gcsupport.rst:103 +#: ../../c-api/gcsupport.rst:91 msgid "" "Similarly, the deallocator for the object must conform to a similar pair of " "rules:" msgstr "" -#: ../../c-api/gcsupport.rst:106 +#: ../../c-api/gcsupport.rst:94 msgid "" "Before fields which refer to other containers are invalidated, :c:func:" "`PyObject_GC_UnTrack` must be called." msgstr "" -#: ../../c-api/gcsupport.rst:109 +#: ../../c-api/gcsupport.rst:97 msgid "" "The object's memory must be deallocated using :c:func:`PyObject_GC_Del`." msgstr "" -#: ../../c-api/gcsupport.rst:114 +#: ../../c-api/gcsupport.rst:102 msgid "" "Releases memory allocated to an object using :c:func:`PyObject_GC_New` or :c:" "func:`PyObject_GC_NewVar`." msgstr "" -#: ../../c-api/gcsupport.rst:120 +#: ../../c-api/gcsupport.rst:108 msgid "" "Remove the object *op* from the set of container objects tracked by the " "collector. Note that :c:func:`PyObject_GC_Track` can be called again on " @@ -175,19 +157,19 @@ msgid "" "handler become invalid." msgstr "" -#: ../../c-api/gcsupport.rst:129 +#: ../../c-api/gcsupport.rst:117 msgid "" "The :c:func:`_PyObject_GC_TRACK` and :c:func:`_PyObject_GC_UNTRACK` macros " "have been removed from the public C API." msgstr "" -#: ../../c-api/gcsupport.rst:132 +#: ../../c-api/gcsupport.rst:120 msgid "" "The :c:member:`~PyTypeObject.tp_traverse` handler accepts a function " "parameter of this type:" msgstr "" -#: ../../c-api/gcsupport.rst:137 +#: ../../c-api/gcsupport.rst:125 msgid "" "Type of the visitor function passed to the :c:member:`~PyTypeObject." "tp_traverse` handler. The function should be called with an object to " @@ -197,13 +179,13 @@ msgid "" "users will need to write their own visitor functions." msgstr "" -#: ../../c-api/gcsupport.rst:144 +#: ../../c-api/gcsupport.rst:132 msgid "" "The :c:member:`~PyTypeObject.tp_traverse` handler must have the following " "type:" msgstr "" -#: ../../c-api/gcsupport.rst:149 +#: ../../c-api/gcsupport.rst:137 msgid "" "Traversal function for a container object. Implementations must call the " "*visit* function for each object directly contained by *self*, with the " @@ -213,7 +195,7 @@ msgid "" "returned immediately." msgstr "" -#: ../../c-api/gcsupport.rst:156 +#: ../../c-api/gcsupport.rst:144 msgid "" "To simplify writing :c:member:`~PyTypeObject.tp_traverse` handlers, a :c:" "func:`Py_VISIT` macro is provided. In order to use this macro, the :c:" @@ -221,20 +203,20 @@ msgid "" "exactly *visit* and *arg*:" msgstr "" -#: ../../c-api/gcsupport.rst:163 +#: ../../c-api/gcsupport.rst:151 msgid "" "If *o* is not ``NULL``, call the *visit* callback, with arguments *o* and " "*arg*. If *visit* returns a non-zero value, then return it. Using this " "macro, :c:member:`~PyTypeObject.tp_traverse` handlers look like::" msgstr "" -#: ../../c-api/gcsupport.rst:176 +#: ../../c-api/gcsupport.rst:164 msgid "" "The :c:member:`~PyTypeObject.tp_clear` handler must be of the :c:type:" "`inquiry` type, or ``NULL`` if the object is immutable." msgstr "" -#: ../../c-api/gcsupport.rst:182 +#: ../../c-api/gcsupport.rst:170 msgid "" "Drop references that may have created reference cycles. Immutable objects " "do not have to define this method since they can never directly create " diff --git a/c-api/gen.po b/c-api/gen.po index a9ee25f83a..46653046a0 100644 --- a/c-api/gen.po +++ b/c-api/gen.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.7\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2021-09-07 06:52+0000\n" +"POT-Creation-Date: 2020-06-20 18:08+0800\n" "PO-Revision-Date: 2017-09-22 18:26+0000\n" "Last-Translator: Leon H.\n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -40,25 +40,23 @@ msgid "The type object corresponding to generator objects." msgstr "" #: ../../c-api/gen.rst:25 -msgid "" -"Return true if *ob* is a generator object; *ob* must not be ``NULL``. This " -"function always succeeds." +msgid "Return true if *ob* is a generator object; *ob* must not be ``NULL``." msgstr "" -#: ../../c-api/gen.rst:31 +#: ../../c-api/gen.rst:30 msgid "" "Return true if *ob*'s type is :c:type:`PyGen_Type`; *ob* must not be " -"``NULL``. This function always succeeds." +"``NULL``." msgstr "" -#: ../../c-api/gen.rst:37 +#: ../../c-api/gen.rst:35 msgid "" "Create and return a new generator object based on the *frame* object. A " "reference to *frame* is stolen by this function. The argument must not be " "``NULL``." msgstr "" -#: ../../c-api/gen.rst:43 +#: ../../c-api/gen.rst:41 msgid "" "Create and return a new generator object based on the *frame* object, with " "``__name__`` and ``__qualname__`` set to *name* and *qualname*. A reference " diff --git a/c-api/import.po b/c-api/import.po index a999763aac..5314b4ff5f 100644 --- a/c-api/import.po +++ b/c-api/import.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.7\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2021-09-07 06:52+0000\n" +"POT-Creation-Date: 2020-06-20 18:08+0800\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-" @@ -311,13 +311,6 @@ msgid "" "`name` field; failure to provide the sentinel value can result in a memory " "fault. Returns ``0`` on success or ``-1`` if insufficient memory could be " "allocated to extend the internal table. In the event of failure, no modules " -"are added to the internal table. This must be called before :c:func:" +"are added to the internal table. This should be called before :c:func:" "`Py_Initialize`." msgstr "" - -#: ../../c-api/import.rst:304 -msgid "" -"If Python is initialized multiple times, :c:func:`PyImport_AppendInittab` " -"or :c:func:`PyImport_ExtendInittab` must be called before each Python " -"initialization." -msgstr "" diff --git a/c-api/init.po b/c-api/init.po index 10d686f64f..e602d57a79 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-07 06:52+0000\n" +"POT-Creation-Date: 2020-06-20 18:08+0800\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-" @@ -463,7 +463,7 @@ msgid "" "than once." msgstr "" -#: ../../c-api/init.rst:304 +#: ../../c-api/init.rst:305 msgid "" "Raises an :ref:`auditing event ` ``cpython." "_PySys_ClearAuditHooks`` with no arguments." @@ -990,7 +990,7 @@ msgstr "" #: ../../c-api/init.rst:832 msgid "" "This data structure represents the state of a single thread. The only " -"public data member is :attr:`interp` (:c:type:`PyInterpreterState *`), which " +"public data member is :c:type:`PyInterpreterState \\*`:attr:`interp`, which " "points to this thread's interpreter state." msgstr "" @@ -1864,7 +1864,7 @@ msgid "" "(TLS) which wraps the underlying native TLS implementation to support the " "Python-level thread local storage API (:class:`threading.local`). The " "CPython C level APIs are similar to those offered by pthreads and Windows: " -"use a thread key and functions to associate a :c:type:`void*` value per " +"use a thread key and functions to associate a :c:type:`void\\*` value per " "thread." msgstr "" @@ -1883,9 +1883,9 @@ msgstr "" #: ../../c-api/init.rst:1632 msgid "" "None of these API functions handle memory management on behalf of the :c:" -"type:`void*` values. You need to allocate and deallocate them yourself. If " -"the :c:type:`void*` values happen to be :c:type:`PyObject*`, these functions " -"don't do refcount operations on them either." +"type:`void\\*` values. You need to allocate and deallocate them yourself. " +"If the :c:type:`void\\*` values happen to be :c:type:`PyObject\\*`, these " +"functions don't do refcount operations on them either." msgstr "" #: ../../c-api/init.rst:1640 @@ -1990,14 +1990,14 @@ msgstr "" #: ../../c-api/init.rst:1730 msgid "" -"Return a zero value to indicate successfully associating a :c:type:`void*` " +"Return a zero value to indicate successfully associating a :c:type:`void\\*` " "value with a TSS key in the current thread. Each thread has a distinct " -"mapping of the key to a :c:type:`void*` value." +"mapping of the key to a :c:type:`void\\*` value." msgstr "" #: ../../c-api/init.rst:1737 msgid "" -"Return the :c:type:`void*` value associated with a TSS key in the current " +"Return the :c:type:`void\\*` value associated with a TSS key in the current " "thread. This returns ``NULL`` if no value is associated with the key in the " "current thread." msgstr "" diff --git a/c-api/init_config.po b/c-api/init_config.po index 6c5bcc2552..b20e8b8f41 100644 --- a/c-api/init_config.po +++ b/c-api/init_config.po @@ -8,11 +8,10 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.9\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2021-09-07 06:52+0000\n" +"POT-Creation-Date: 2020-06-20 18:08+0800\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" -"Language: \n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" @@ -978,35 +977,33 @@ msgstr "" #: ../../c-api/init_config.rst:733 msgid "" -"If :c:func:`PyImport_FrozenModules`, :c:func:`PyImport_AppendInittab` or :c:" -"func:`PyImport_ExtendInittab` are used, they must be set or called after " -"Python preinitialization and before the Python initialization. If Python is " -"initialized multiple times, :c:func:`PyImport_AppendInittab` or :c:func:" -"`PyImport_ExtendInittab` must be called before each Python initialization." +"If ``PyImport_FrozenModules``, ``PyImport_AppendInittab()`` or " +"``PyImport_ExtendInittab()`` are used, they must be set or called after " +"Python preinitialization and before the Python initialization." msgstr "" -#: ../../c-api/init_config.rst:740 +#: ../../c-api/init_config.rst:737 msgid "Example setting the program name::" msgstr "" -#: ../../c-api/init_config.rst:768 +#: ../../c-api/init_config.rst:765 msgid "" "More complete example modifying the default configuration, read the " "configuration, and then override some parameters::" msgstr "" -#: ../../c-api/init_config.rst:819 +#: ../../c-api/init_config.rst:816 msgid "Isolated Configuration" msgstr "" -#: ../../c-api/init_config.rst:821 +#: ../../c-api/init_config.rst:818 msgid "" ":c:func:`PyPreConfig_InitIsolatedConfig` and :c:func:" "`PyConfig_InitIsolatedConfig` functions create a configuration to isolate " "Python from the system. For example, to embed Python into an application." msgstr "" -#: ../../c-api/init_config.rst:826 +#: ../../c-api/init_config.rst:823 msgid "" "This configuration ignores global configuration variables, environments " "variables, command line arguments (:c:member:`PyConfig.argv` is not parsed) " @@ -1014,7 +1011,7 @@ msgid "" "LC_CTYPE locale are left unchanged. Signal handlers are not installed." msgstr "" -#: ../../c-api/init_config.rst:831 +#: ../../c-api/init_config.rst:828 msgid "" "Configuration files are still used with this configuration. Set the :ref:" "`Path Configuration ` (\"output fields\") to ignore these " @@ -1022,122 +1019,122 @@ msgid "" "configuration." msgstr "" -#: ../../c-api/init_config.rst:840 +#: ../../c-api/init_config.rst:837 msgid "Python Configuration" msgstr "" -#: ../../c-api/init_config.rst:842 +#: ../../c-api/init_config.rst:839 msgid "" ":c:func:`PyPreConfig_InitPythonConfig` and :c:func:" "`PyConfig_InitPythonConfig` functions create a configuration to build a " "customized Python which behaves as the regular Python." msgstr "" -#: ../../c-api/init_config.rst:846 +#: ../../c-api/init_config.rst:843 msgid "" "Environments variables and command line arguments are used to configure " "Python, whereas global configuration variables are ignored." msgstr "" -#: ../../c-api/init_config.rst:849 +#: ../../c-api/init_config.rst:846 msgid "" "This function enables C locale coercion (:pep:`538`) and UTF-8 Mode (:pep:" "`540`) depending on the LC_CTYPE locale, :envvar:`PYTHONUTF8` and :envvar:" "`PYTHONCOERCECLOCALE` environment variables." msgstr "" -#: ../../c-api/init_config.rst:853 +#: ../../c-api/init_config.rst:850 msgid "Example of customized Python always running in isolated mode::" msgstr "" -#: ../../c-api/init_config.rst:892 +#: ../../c-api/init_config.rst:889 msgid "Path Configuration" msgstr "" -#: ../../c-api/init_config.rst:894 +#: ../../c-api/init_config.rst:891 msgid ":c:type:`PyConfig` contains multiple fields for the path configuration:" msgstr "" -#: ../../c-api/init_config.rst:896 +#: ../../c-api/init_config.rst:893 msgid "Path configuration inputs:" msgstr "" -#: ../../c-api/init_config.rst:898 +#: ../../c-api/init_config.rst:895 msgid ":c:member:`PyConfig.home`" msgstr "" -#: ../../c-api/init_config.rst:899 +#: ../../c-api/init_config.rst:896 msgid ":c:member:`PyConfig.platlibdir`" msgstr "" -#: ../../c-api/init_config.rst:900 +#: ../../c-api/init_config.rst:897 msgid ":c:member:`PyConfig.pathconfig_warnings`" msgstr "" -#: ../../c-api/init_config.rst:901 +#: ../../c-api/init_config.rst:898 msgid ":c:member:`PyConfig.program_name`" msgstr "" -#: ../../c-api/init_config.rst:902 +#: ../../c-api/init_config.rst:899 msgid ":c:member:`PyConfig.pythonpath_env`" msgstr "" -#: ../../c-api/init_config.rst:903 +#: ../../c-api/init_config.rst:900 msgid "current working directory: to get absolute paths" msgstr "" -#: ../../c-api/init_config.rst:904 +#: ../../c-api/init_config.rst:901 msgid "" "``PATH`` environment variable to get the program full path (from :c:member:" "`PyConfig.program_name`)" msgstr "" -#: ../../c-api/init_config.rst:906 +#: ../../c-api/init_config.rst:903 msgid "``__PYVENV_LAUNCHER__`` environment variable" msgstr "" -#: ../../c-api/init_config.rst:907 +#: ../../c-api/init_config.rst:904 msgid "" "(Windows only) Application paths in the registry under \"Software\\Python" "\\PythonCore\\X.Y\\PythonPath\" of HKEY_CURRENT_USER and HKEY_LOCAL_MACHINE " "(where X.Y is the Python version)." msgstr "" -#: ../../c-api/init_config.rst:911 +#: ../../c-api/init_config.rst:908 msgid "Path configuration output fields:" msgstr "" -#: ../../c-api/init_config.rst:913 +#: ../../c-api/init_config.rst:910 msgid ":c:member:`PyConfig.base_exec_prefix`" msgstr "" -#: ../../c-api/init_config.rst:914 +#: ../../c-api/init_config.rst:911 msgid ":c:member:`PyConfig.base_executable`" msgstr "" -#: ../../c-api/init_config.rst:915 +#: ../../c-api/init_config.rst:912 msgid ":c:member:`PyConfig.base_prefix`" msgstr "" -#: ../../c-api/init_config.rst:916 +#: ../../c-api/init_config.rst:913 msgid ":c:member:`PyConfig.exec_prefix`" msgstr "" -#: ../../c-api/init_config.rst:917 +#: ../../c-api/init_config.rst:914 msgid ":c:member:`PyConfig.executable`" msgstr "" -#: ../../c-api/init_config.rst:918 +#: ../../c-api/init_config.rst:915 msgid "" ":c:member:`PyConfig.module_search_paths_set`, :c:member:`PyConfig." "module_search_paths`" msgstr "" -#: ../../c-api/init_config.rst:920 +#: ../../c-api/init_config.rst:917 msgid ":c:member:`PyConfig.prefix`" msgstr "" -#: ../../c-api/init_config.rst:922 +#: ../../c-api/init_config.rst:919 msgid "" "If at least one \"output field\" is not set, Python calculates the path " "configuration to fill unset fields. If :c:member:`~PyConfig." @@ -1146,7 +1143,7 @@ msgid "" "module_search_paths_set` is set to 1." msgstr "" -#: ../../c-api/init_config.rst:928 +#: ../../c-api/init_config.rst:925 msgid "" "It is possible to completely ignore the function calculating the default " "path configuration by setting explicitly all path configuration output " @@ -1156,52 +1153,52 @@ msgid "" "well." msgstr "" -#: ../../c-api/init_config.rst:935 +#: ../../c-api/init_config.rst:932 msgid "" "Set :c:member:`~PyConfig.pathconfig_warnings` to 0 to suppress warnings when " "calculating the path configuration (Unix only, Windows does not log any " "warning)." msgstr "" -#: ../../c-api/init_config.rst:938 +#: ../../c-api/init_config.rst:935 msgid "" "If :c:member:`~PyConfig.base_prefix` or :c:member:`~PyConfig." "base_exec_prefix` fields are not set, they inherit their value from :c:" "member:`~PyConfig.prefix` and :c:member:`~PyConfig.exec_prefix` respectively." msgstr "" -#: ../../c-api/init_config.rst:942 +#: ../../c-api/init_config.rst:939 msgid ":c:func:`Py_RunMain` and :c:func:`Py_Main` modify :data:`sys.path`:" msgstr "" -#: ../../c-api/init_config.rst:944 +#: ../../c-api/init_config.rst:941 msgid "" "If :c:member:`~PyConfig.run_filename` is set and is a directory which " "contains a ``__main__.py`` script, prepend :c:member:`~PyConfig." "run_filename` to :data:`sys.path`." msgstr "" -#: ../../c-api/init_config.rst:947 +#: ../../c-api/init_config.rst:944 msgid "If :c:member:`~PyConfig.isolated` is zero:" msgstr "" -#: ../../c-api/init_config.rst:949 +#: ../../c-api/init_config.rst:946 msgid "" "If :c:member:`~PyConfig.run_module` is set, prepend the current directory " "to :data:`sys.path`. Do nothing if the current directory cannot be read." msgstr "" -#: ../../c-api/init_config.rst:951 +#: ../../c-api/init_config.rst:948 msgid "" "If :c:member:`~PyConfig.run_filename` is set, prepend the directory of the " "filename to :data:`sys.path`." msgstr "" -#: ../../c-api/init_config.rst:953 +#: ../../c-api/init_config.rst:950 msgid "Otherwise, prepend an empty string to :data:`sys.path`." msgstr "" -#: ../../c-api/init_config.rst:955 +#: ../../c-api/init_config.rst:952 msgid "" "If :c:member:`~PyConfig.site_import` is non-zero, :data:`sys.path` can be " "modified by the :mod:`site` module. If :c:member:`~PyConfig." @@ -1210,152 +1207,152 @@ msgid "" "data:`sys.path`." msgstr "" -#: ../../c-api/init_config.rst:961 +#: ../../c-api/init_config.rst:958 msgid "The following configuration files are used by the path configuration:" msgstr "" -#: ../../c-api/init_config.rst:963 +#: ../../c-api/init_config.rst:960 msgid "``pyvenv.cfg``" msgstr "" -#: ../../c-api/init_config.rst:964 +#: ../../c-api/init_config.rst:961 msgid "``python._pth`` (Windows only)" msgstr "" -#: ../../c-api/init_config.rst:965 +#: ../../c-api/init_config.rst:962 msgid "``pybuilddir.txt`` (Unix only)" msgstr "" -#: ../../c-api/init_config.rst:967 +#: ../../c-api/init_config.rst:964 msgid "" "The ``__PYVENV_LAUNCHER__`` environment variable is used to set :c:member:" "`PyConfig.base_executable`" msgstr "" -#: ../../c-api/init_config.rst:972 +#: ../../c-api/init_config.rst:969 msgid "Py_RunMain()" msgstr "" -#: ../../c-api/init_config.rst:976 +#: ../../c-api/init_config.rst:973 msgid "" "Execute the command (:c:member:`PyConfig.run_command`), the script (:c:" "member:`PyConfig.run_filename`) or the module (:c:member:`PyConfig." "run_module`) specified on the command line or in the configuration." msgstr "" -#: ../../c-api/init_config.rst:981 +#: ../../c-api/init_config.rst:978 msgid "By default and when if :option:`-i` option is used, run the REPL." msgstr "" -#: ../../c-api/init_config.rst:983 +#: ../../c-api/init_config.rst:980 msgid "" "Finally, finalizes Python and returns an exit status that can be passed to " "the ``exit()`` function." msgstr "" -#: ../../c-api/init_config.rst:986 +#: ../../c-api/init_config.rst:983 msgid "" "See :ref:`Python Configuration ` for an example of " "customized Python always running in isolated mode using :c:func:`Py_RunMain`." msgstr "" -#: ../../c-api/init_config.rst:992 +#: ../../c-api/init_config.rst:989 msgid "Py_GetArgcArgv()" msgstr "" -#: ../../c-api/init_config.rst:996 +#: ../../c-api/init_config.rst:993 msgid "Get the original command line arguments, before Python modified them." msgstr "" -#: ../../c-api/init_config.rst:1000 +#: ../../c-api/init_config.rst:997 msgid "Multi-Phase Initialization Private Provisional API" msgstr "" -#: ../../c-api/init_config.rst:1002 +#: ../../c-api/init_config.rst:999 msgid "" "This section is a private provisional API introducing multi-phase " "initialization, the core feature of the :pep:`432`:" msgstr "" -#: ../../c-api/init_config.rst:1005 +#: ../../c-api/init_config.rst:1002 msgid "\"Core\" initialization phase, \"bare minimum Python\":" msgstr "" -#: ../../c-api/init_config.rst:1007 +#: ../../c-api/init_config.rst:1004 msgid "Builtin types;" msgstr "" -#: ../../c-api/init_config.rst:1008 +#: ../../c-api/init_config.rst:1005 msgid "Builtin exceptions;" msgstr "" -#: ../../c-api/init_config.rst:1009 +#: ../../c-api/init_config.rst:1006 msgid "Builtin and frozen modules;" msgstr "" -#: ../../c-api/init_config.rst:1010 +#: ../../c-api/init_config.rst:1007 msgid "" "The :mod:`sys` module is only partially initialized (ex: :data:`sys.path` " "doesn't exist yet)." msgstr "" -#: ../../c-api/init_config.rst:1013 +#: ../../c-api/init_config.rst:1010 msgid "\"Main\" initialization phase, Python is fully initialized:" msgstr "" -#: ../../c-api/init_config.rst:1015 +#: ../../c-api/init_config.rst:1012 msgid "Install and configure :mod:`importlib`;" msgstr "" -#: ../../c-api/init_config.rst:1016 +#: ../../c-api/init_config.rst:1013 msgid "Apply the :ref:`Path Configuration `;" msgstr "" -#: ../../c-api/init_config.rst:1017 +#: ../../c-api/init_config.rst:1014 msgid "Install signal handlers;" msgstr "" -#: ../../c-api/init_config.rst:1018 +#: ../../c-api/init_config.rst:1015 msgid "" "Finish :mod:`sys` module initialization (ex: create :data:`sys.stdout` and :" "data:`sys.path`);" msgstr "" -#: ../../c-api/init_config.rst:1020 +#: ../../c-api/init_config.rst:1017 msgid "" "Enable optional features like :mod:`faulthandler` and :mod:`tracemalloc`;" msgstr "" -#: ../../c-api/init_config.rst:1021 +#: ../../c-api/init_config.rst:1018 msgid "Import the :mod:`site` module;" msgstr "" -#: ../../c-api/init_config.rst:1022 +#: ../../c-api/init_config.rst:1019 msgid "etc." msgstr "" -#: ../../c-api/init_config.rst:1024 +#: ../../c-api/init_config.rst:1021 msgid "Private provisional API:" msgstr "" -#: ../../c-api/init_config.rst:1026 +#: ../../c-api/init_config.rst:1023 msgid "" ":c:member:`PyConfig._init_main`: if set to 0, :c:func:" "`Py_InitializeFromConfig` stops at the \"Core\" initialization phase." msgstr "" -#: ../../c-api/init_config.rst:1028 +#: ../../c-api/init_config.rst:1025 msgid "" ":c:member:`PyConfig._isolated_interpreter`: if non-zero, disallow threads, " "subprocesses and fork." msgstr "" -#: ../../c-api/init_config.rst:1033 +#: ../../c-api/init_config.rst:1030 msgid "" "Move to the \"Main\" initialization phase, finish the Python initialization." msgstr "" -#: ../../c-api/init_config.rst:1035 +#: ../../c-api/init_config.rst:1032 msgid "" "No module is imported during the \"Core\" phase and the ``importlib`` module " "is not configured: the :ref:`Path Configuration ` is only " @@ -1364,14 +1361,14 @@ msgid "" "maybe install a custom :data:`sys.meta_path` importer or an import hook, etc." msgstr "" -#: ../../c-api/init_config.rst:1041 +#: ../../c-api/init_config.rst:1038 msgid "" "It may become possible to calculatin the :ref:`Path Configuration ` in Python, after the Core phase and before the Main phase, which is " "one of the :pep:`432` motivation." msgstr "" -#: ../../c-api/init_config.rst:1045 +#: ../../c-api/init_config.rst:1042 msgid "" "The \"Core\" phase is not properly defined: what should be and what should " "not be available at this phase is not specified yet. The API is marked as " @@ -1379,7 +1376,7 @@ msgid "" "until a proper public API is designed." msgstr "" -#: ../../c-api/init_config.rst:1050 +#: ../../c-api/init_config.rst:1047 msgid "" "Example running Python code between \"Core\" and \"Main\" initialization " "phases::" diff --git a/c-api/intro.po b/c-api/intro.po index f3d18873fc..a51fb164bf 100644 --- a/c-api/intro.po +++ b/c-api/intro.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.7\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2021-09-07 06:52+0000\n" +"POT-Creation-Date: 2020-06-20 18:08+0800\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-" @@ -269,13 +269,13 @@ msgstr "" #: ../../c-api/intro.rst:231 msgid "" "Most Python/C API functions have one or more arguments as well as a return " -"value of type :c:type:`PyObject*`. This type is a pointer to an opaque data " -"type representing an arbitrary Python object. Since all Python object types " -"are treated the same way by the Python language in most situations (e.g., " -"assignments, scope rules, and argument passing), it is only fitting that " +"value of type :c:type:`PyObject\\*`. This type is a pointer to an opaque " +"data type representing an arbitrary Python object. Since all Python object " +"types are treated the same way by the Python language in most situations (e." +"g., assignments, scope rules, and argument passing), it is only fitting that " "they should be represented by a single C type. Almost all Python objects " "live on the heap: you never declare an automatic or static variable of type :" -"c:type:`PyObject`, only pointer variables of type :c:type:`PyObject*` can " +"c:type:`PyObject`, only pointer variables of type :c:type:`PyObject\\*` can " "be declared. The sole exception are the type objects; since these must " "never be deallocated, they are typically static :c:type:`PyTypeObject` " "objects." @@ -489,7 +489,7 @@ msgstr "" msgid "" "There are few other data types that play a significant role in the Python/C " "API; most are simple C types such as :c:type:`int`, :c:type:`long`, :c:type:" -"`double` and :c:type:`char*`. A few structure types are used to describe " +"`double` and :c:type:`char\\*`. A few structure types are used to describe " "static tables used to list the functions exported by a module or the data " "attributes of a new object type, and another is used to describe the value " "of a complex number. These will be discussed together with the functions " diff --git a/c-api/iter.po b/c-api/iter.po index b872172feb..ff4f51cc79 100644 --- a/c-api/iter.po +++ b/c-api/iter.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.7\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2021-09-07 06:52+0000\n" +"POT-Creation-Date: 2020-06-20 18:08+0800\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-" @@ -27,12 +27,10 @@ msgid "There are two functions specifically for working with iterators." msgstr "" #: ../../c-api/iter.rst:12 -msgid "" -"Return true if the object *o* supports the iterator protocol. This function " -"always succeeds." +msgid "Return true if the object *o* supports the iterator protocol." msgstr "" -#: ../../c-api/iter.rst:18 +#: ../../c-api/iter.rst:17 msgid "" "Return the next value from the iteration *o*. The object must be an " "iterator (it is up to the caller to check this). If there are no remaining " @@ -40,7 +38,7 @@ msgid "" "retrieving the item, returns ``NULL`` and passes along the exception." msgstr "" -#: ../../c-api/iter.rst:23 +#: ../../c-api/iter.rst:22 msgid "" "To write a loop which iterates over an iterator, the C code should look " "something like this::" diff --git a/c-api/iterator.po b/c-api/iterator.po index e9e0afbe28..30d8b8ff90 100644 --- a/c-api/iterator.po +++ b/c-api/iterator.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.7\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2021-09-07 06:52+0000\n" +"POT-Creation-Date: 2018-06-26 18:54+0800\n" "PO-Revision-Date: 2017-09-22 18:26+0000\n" "Last-Translator: Leon H.\n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -40,31 +40,27 @@ msgid "" msgstr "" #: ../../c-api/iterator.rst:24 -msgid "" -"Return true if the type of *op* is :c:data:`PySeqIter_Type`. This function " -"always succeeds." +msgid "Return true if the type of *op* is :c:data:`PySeqIter_Type`." msgstr "" -#: ../../c-api/iterator.rst:30 +#: ../../c-api/iterator.rst:29 msgid "" "Return an iterator that works with a general sequence object, *seq*. The " "iteration ends when the sequence raises :exc:`IndexError` for the " "subscripting operation." msgstr "" -#: ../../c-api/iterator.rst:37 +#: ../../c-api/iterator.rst:36 msgid "" "Type object for iterator objects returned by :c:func:`PyCallIter_New` and " "the two-argument form of the :func:`iter` built-in function." msgstr "" -#: ../../c-api/iterator.rst:43 -msgid "" -"Return true if the type of *op* is :c:data:`PyCallIter_Type`. This function " -"always succeeds." +#: ../../c-api/iterator.rst:42 +msgid "Return true if the type of *op* is :c:data:`PyCallIter_Type`." msgstr "" -#: ../../c-api/iterator.rst:49 +#: ../../c-api/iterator.rst:47 msgid "" "Return a new iterator. The first parameter, *callable*, can be any Python " "callable object that can be called with no parameters; each call to it " diff --git a/c-api/list.po b/c-api/list.po index 7782989c64..5b47d4d7a0 100644 --- a/c-api/list.po +++ b/c-api/list.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.7\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2021-09-07 06:52+0000\n" +"POT-Creation-Date: 2020-06-20 18:08+0800\n" "PO-Revision-Date: 2017-09-22 18:26+0000\n" "Last-Translator: Nkeys Syu \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -36,13 +36,13 @@ msgstr "" #: ../../c-api/list.rst:24 msgid "" "Return true if *p* is a list object or an instance of a subtype of the list " -"type. This function always succeeds." +"type." msgstr "" #: ../../c-api/list.rst:30 msgid "" "Return true if *p* is a list object, but not an instance of a subtype of the " -"list type. This function always succeeds." +"list type." msgstr "" #: ../../c-api/list.rst:36 diff --git a/c-api/long.po b/c-api/long.po index 6d62b554a2..17b565e80b 100644 --- a/c-api/long.po +++ b/c-api/long.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.7\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2021-09-07 06:52+0000\n" +"POT-Creation-Date: 2020-06-20 18:08+0800\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-" @@ -48,13 +48,13 @@ msgstr "" #: ../../c-api/long.rst:29 msgid "" "Return true if its argument is a :c:type:`PyLongObject` or a subtype of :c:" -"type:`PyLongObject`. This function always succeeds." +"type:`PyLongObject`." msgstr "" #: ../../c-api/long.rst:35 msgid "" "Return true if its argument is a :c:type:`PyLongObject`, but not a subtype " -"of :c:type:`PyLongObject`. This function always succeeds." +"of :c:type:`PyLongObject`." msgstr "" #: ../../c-api/long.rst:41 @@ -119,56 +119,62 @@ msgid "" msgstr "" #: ../../c-api/long.rst:99 -msgid "Convert a sequence of Unicode digits to a Python integer value." +msgid "" +"Convert a sequence of Unicode digits to a Python integer value. The Unicode " +"string is first encoded to a byte string using :c:func:" +"`PyUnicode_EncodeDecimal` and then converted using :c:func:" +"`PyLong_FromString`." msgstr "" -#: ../../c-api/long.rst:103 +#: ../../c-api/long.rst:105 msgid "" "Part of the old-style :c:type:`Py_UNICODE` API; please migrate to using :c:" "func:`PyLong_FromUnicodeObject`." msgstr "" -#: ../../c-api/long.rst:108 +#: ../../c-api/long.rst:110 msgid "" "Convert a sequence of Unicode digits in the string *u* to a Python integer " -"value." +"value. The Unicode string is first encoded to a byte string using :c:func:" +"`PyUnicode_EncodeDecimal` and then converted using :c:func:" +"`PyLong_FromString`." msgstr "" -#: ../../c-api/long.rst:116 +#: ../../c-api/long.rst:120 msgid "" "Create a Python integer from the pointer *p*. The pointer value can be " "retrieved from the resulting value using :c:func:`PyLong_AsVoidPtr`." msgstr "" -#: ../../c-api/long.rst:127 ../../c-api/long.rst:146 +#: ../../c-api/long.rst:131 ../../c-api/long.rst:150 msgid "" "Return a C :c:type:`long` representation of *obj*. If *obj* is not an " "instance of :c:type:`PyLongObject`, first call its :meth:`__index__` or :" "meth:`__int__` method (if present) to convert it to a :c:type:`PyLongObject`." msgstr "" -#: ../../c-api/long.rst:132 +#: ../../c-api/long.rst:136 msgid "" "Raise :exc:`OverflowError` if the value of *obj* is out of range for a :c:" "type:`long`." msgstr "" -#: ../../c-api/long.rst:135 ../../c-api/long.rst:156 ../../c-api/long.rst:178 -#: ../../c-api/long.rst:199 ../../c-api/long.rst:222 +#: ../../c-api/long.rst:139 ../../c-api/long.rst:160 ../../c-api/long.rst:182 +#: ../../c-api/long.rst:203 ../../c-api/long.rst:226 msgid "Returns ``-1`` on error. Use :c:func:`PyErr_Occurred` to disambiguate." msgstr "" -#: ../../c-api/long.rst:137 ../../c-api/long.rst:158 ../../c-api/long.rst:180 -#: ../../c-api/long.rst:203 ../../c-api/long.rst:288 ../../c-api/long.rst:308 +#: ../../c-api/long.rst:141 ../../c-api/long.rst:162 ../../c-api/long.rst:184 +#: ../../c-api/long.rst:207 ../../c-api/long.rst:292 ../../c-api/long.rst:312 msgid "Use :meth:`__index__` if available." msgstr "" -#: ../../c-api/long.rst:140 ../../c-api/long.rst:161 ../../c-api/long.rst:183 -#: ../../c-api/long.rst:206 ../../c-api/long.rst:291 ../../c-api/long.rst:311 +#: ../../c-api/long.rst:144 ../../c-api/long.rst:165 ../../c-api/long.rst:187 +#: ../../c-api/long.rst:210 ../../c-api/long.rst:295 ../../c-api/long.rst:315 msgid "Using :meth:`__int__` is deprecated." msgstr "" -#: ../../c-api/long.rst:151 +#: ../../c-api/long.rst:155 msgid "" "If the value of *obj* is greater than :const:`LONG_MAX` or less than :const:" "`LONG_MIN`, set *\\*overflow* to ``1`` or ``-1``, respectively, and return " @@ -176,20 +182,20 @@ msgid "" "occurs set *\\*overflow* to ``0`` and return ``-1`` as usual." msgstr "" -#: ../../c-api/long.rst:170 ../../c-api/long.rst:189 +#: ../../c-api/long.rst:174 ../../c-api/long.rst:193 msgid "" "Return a C :c:type:`long long` representation of *obj*. If *obj* is not an " "instance of :c:type:`PyLongObject`, first call its :meth:`__index__` or :" "meth:`__int__` method (if present) to convert it to a :c:type:`PyLongObject`." msgstr "" -#: ../../c-api/long.rst:175 +#: ../../c-api/long.rst:179 msgid "" "Raise :exc:`OverflowError` if the value of *obj* is out of range for a :c:" "type:`long long`." msgstr "" -#: ../../c-api/long.rst:194 +#: ../../c-api/long.rst:198 msgid "" "If the value of *obj* is greater than :const:`LLONG_MAX` or less than :const:" "`LLONG_MIN`, set *\\*overflow* to ``1`` or ``-1``, respectively, and return " @@ -197,97 +203,97 @@ msgid "" "occurs set *\\*overflow* to ``0`` and return ``-1`` as usual." msgstr "" -#: ../../c-api/long.rst:216 +#: ../../c-api/long.rst:220 msgid "" "Return a C :c:type:`Py_ssize_t` representation of *pylong*. *pylong* must " "be an instance of :c:type:`PyLongObject`." msgstr "" -#: ../../c-api/long.rst:219 +#: ../../c-api/long.rst:223 msgid "" "Raise :exc:`OverflowError` if the value of *pylong* is out of range for a :c:" "type:`Py_ssize_t`." msgstr "" -#: ../../c-api/long.rst:231 +#: ../../c-api/long.rst:235 msgid "" "Return a C :c:type:`unsigned long` representation of *pylong*. *pylong* " "must be an instance of :c:type:`PyLongObject`." msgstr "" -#: ../../c-api/long.rst:234 +#: ../../c-api/long.rst:238 msgid "" "Raise :exc:`OverflowError` if the value of *pylong* is out of range for a :c:" "type:`unsigned long`." msgstr "" -#: ../../c-api/long.rst:237 +#: ../../c-api/long.rst:241 msgid "" "Returns ``(unsigned long)-1`` on error. Use :c:func:`PyErr_Occurred` to " "disambiguate." msgstr "" -#: ../../c-api/long.rst:247 +#: ../../c-api/long.rst:251 msgid "" "Return a C :c:type:`size_t` representation of *pylong*. *pylong* must be an " "instance of :c:type:`PyLongObject`." msgstr "" -#: ../../c-api/long.rst:250 +#: ../../c-api/long.rst:254 msgid "" "Raise :exc:`OverflowError` if the value of *pylong* is out of range for a :c:" "type:`size_t`." msgstr "" -#: ../../c-api/long.rst:253 +#: ../../c-api/long.rst:257 msgid "" "Returns ``(size_t)-1`` on error. Use :c:func:`PyErr_Occurred` to " "disambiguate." msgstr "" -#: ../../c-api/long.rst:262 +#: ../../c-api/long.rst:266 msgid "" "Return a C :c:type:`unsigned long long` representation of *pylong*. " "*pylong* must be an instance of :c:type:`PyLongObject`." msgstr "" -#: ../../c-api/long.rst:265 +#: ../../c-api/long.rst:269 msgid "" "Raise :exc:`OverflowError` if the value of *pylong* is out of range for an :" "c:type:`unsigned long long`." msgstr "" -#: ../../c-api/long.rst:268 +#: ../../c-api/long.rst:272 msgid "" "Returns ``(unsigned long long)-1`` on error. Use :c:func:`PyErr_Occurred` to " "disambiguate." msgstr "" -#: ../../c-api/long.rst:271 +#: ../../c-api/long.rst:275 msgid "" "A negative *pylong* now raises :exc:`OverflowError`, not :exc:`TypeError`." msgstr "" -#: ../../c-api/long.rst:277 +#: ../../c-api/long.rst:281 msgid "" "Return a C :c:type:`unsigned long` representation of *obj*. If *obj* is not " "an instance of :c:type:`PyLongObject`, first call its :meth:`__index__` or :" "meth:`__int__` method (if present) to convert it to a :c:type:`PyLongObject`." msgstr "" -#: ../../c-api/long.rst:282 +#: ../../c-api/long.rst:286 msgid "" "If the value of *obj* is out of range for an :c:type:`unsigned long`, return " "the reduction of that value modulo ``ULONG_MAX + 1``." msgstr "" -#: ../../c-api/long.rst:285 +#: ../../c-api/long.rst:289 msgid "" "Returns ``(unsigned long)-1`` on error. Use :c:func:`PyErr_Occurred` to " "disambiguate." msgstr "" -#: ../../c-api/long.rst:297 +#: ../../c-api/long.rst:301 msgid "" "Return a C :c:type:`unsigned long long` representation of *obj*. If *obj* " "is not an instance of :c:type:`PyLongObject`, first call its :meth:" @@ -295,36 +301,36 @@ msgid "" "type:`PyLongObject`." msgstr "" -#: ../../c-api/long.rst:302 +#: ../../c-api/long.rst:306 msgid "" "If the value of *obj* is out of range for an :c:type:`unsigned long long`, " "return the reduction of that value modulo ``ULLONG_MAX + 1``." msgstr "" -#: ../../c-api/long.rst:305 +#: ../../c-api/long.rst:309 msgid "" "Returns ``(unsigned long long)-1`` on error. Use :c:func:`PyErr_Occurred` " "to disambiguate." msgstr "" -#: ../../c-api/long.rst:317 +#: ../../c-api/long.rst:321 msgid "" "Return a C :c:type:`double` representation of *pylong*. *pylong* must be an " "instance of :c:type:`PyLongObject`." msgstr "" -#: ../../c-api/long.rst:320 +#: ../../c-api/long.rst:324 msgid "" "Raise :exc:`OverflowError` if the value of *pylong* is out of range for a :c:" "type:`double`." msgstr "" -#: ../../c-api/long.rst:323 +#: ../../c-api/long.rst:327 msgid "" "Returns ``-1.0`` on error. Use :c:func:`PyErr_Occurred` to disambiguate." msgstr "" -#: ../../c-api/long.rst:328 +#: ../../c-api/long.rst:332 msgid "" "Convert a Python integer *pylong* to a C :c:type:`void` pointer. If *pylong* " "cannot be converted, an :exc:`OverflowError` will be raised. This is only " @@ -332,7 +338,7 @@ msgid "" "c:func:`PyLong_FromVoidPtr`." msgstr "" -#: ../../c-api/long.rst:333 +#: ../../c-api/long.rst:337 msgid "" "Returns ``NULL`` on error. Use :c:func:`PyErr_Occurred` to disambiguate." msgstr "" diff --git a/c-api/marshal.po b/c-api/marshal.po index f7fccd6307..152fb163e2 100644 --- a/c-api/marshal.po +++ b/c-api/marshal.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.7\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2021-09-07 06:52+0000\n" +"POT-Creation-Date: 2020-06-20 18:08+0800\n" "PO-Revision-Date: 2018-05-23 14:06+0000\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -68,7 +68,7 @@ msgstr "" #: ../../c-api/marshal.rst:46 msgid "" -"Return a C :c:type:`long` from the data stream in a :c:type:`FILE*` opened " +"Return a C :c:type:`long` from the data stream in a :c:type:`FILE\\*` opened " "for reading. Only a 32-bit value can be read in using this function, " "regardless of the native size of :c:type:`long`." msgstr "" @@ -81,15 +81,15 @@ msgstr "" #: ../../c-api/marshal.rst:56 msgid "" -"Return a C :c:type:`short` from the data stream in a :c:type:`FILE*` opened " -"for reading. Only a 16-bit value can be read in using this function, " +"Return a C :c:type:`short` from the data stream in a :c:type:`FILE\\*` " +"opened for reading. Only a 16-bit value can be read in using this function, " "regardless of the native size of :c:type:`short`." msgstr "" #: ../../c-api/marshal.rst:66 msgid "" -"Return a Python object from the data stream in a :c:type:`FILE*` opened for " -"reading." +"Return a Python object from the data stream in a :c:type:`FILE\\*` opened " +"for reading." msgstr "" #: ../../c-api/marshal.rst:69 ../../c-api/marshal.rst:83 @@ -101,8 +101,8 @@ msgstr "" #: ../../c-api/marshal.rst:75 msgid "" -"Return a Python object from the data stream in a :c:type:`FILE*` opened for " -"reading. Unlike :c:func:`PyMarshal_ReadObjectFromFile`, this function " +"Return a Python object from the data stream in a :c:type:`FILE\\*` opened " +"for reading. Unlike :c:func:`PyMarshal_ReadObjectFromFile`, this function " "assumes that no further objects will be read from the file, allowing it to " "aggressively load file data into memory so that the de-serialization can " "operate from data in memory rather than reading a byte at a time from the " diff --git a/c-api/memory.po b/c-api/memory.po index e296428a6f..4623113dc9 100644 --- a/c-api/memory.po +++ b/c-api/memory.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.7\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2021-09-07 06:52+0000\n" +"POT-Creation-Date: 2020-06-20 18:08+0800\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-" @@ -132,7 +132,7 @@ msgstr "" #: ../../c-api/memory.rst:112 ../../c-api/memory.rst:183 #: ../../c-api/memory.rst:285 msgid "" -"Allocates *n* bytes and returns a pointer of type :c:type:`void*` to the " +"Allocates *n* bytes and returns a pointer of type :c:type:`void\\*` to the " "allocated memory, or ``NULL`` if the request fails." msgstr "" @@ -147,7 +147,7 @@ msgstr "" #: ../../c-api/memory.rst:295 msgid "" "Allocates *nelem* elements each whose size in bytes is *elsize* and returns " -"a pointer of type :c:type:`void*` to the allocated memory, or ``NULL`` if " +"a pointer of type :c:type:`void\\*` to the allocated memory, or ``NULL`` if " "the request fails. The memory is initialized to zeros." msgstr "" @@ -276,14 +276,14 @@ msgstr "" #: ../../c-api/memory.rst:235 msgid "" "Same as :c:func:`PyMem_Malloc`, but allocates ``(n * sizeof(TYPE))`` bytes " -"of memory. Returns a pointer cast to :c:type:`TYPE*`. The memory will not " -"have been initialized in any way." +"of memory. Returns a pointer cast to :c:type:`TYPE\\*`. The memory will " +"not have been initialized in any way." msgstr "" #: ../../c-api/memory.rst:242 msgid "" "Same as :c:func:`PyMem_Realloc`, but the memory block is resized to ``(n * " -"sizeof(TYPE))`` bytes. Returns a pointer cast to :c:type:`TYPE*`. On " +"sizeof(TYPE))`` bytes. Returns a pointer cast to :c:type:`TYPE\\*`. On " "return, *p* will be a pointer to the new memory area, or ``NULL`` in the " "event of failure." msgstr "" @@ -753,7 +753,7 @@ msgid "allocate an arena of size bytes" msgstr "" #: ../../c-api/memory.rst:519 -msgid "``void free(void *ctx, void *ptr, size_t size)``" +msgid "``void free(void *ctx, size_t size, void *ptr)``" msgstr "" #: ../../c-api/memory.rst:519 diff --git a/c-api/memoryview.po b/c-api/memoryview.po index fcf7269cec..b9886075e8 100644 --- a/c-api/memoryview.po +++ b/c-api/memoryview.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.7\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2021-09-07 06:52+0000\n" +"POT-Creation-Date: 2020-06-20 18:08+0800\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-" @@ -62,18 +62,17 @@ msgstr "" #: ../../c-api/memoryview.rst:47 msgid "" "Return true if the object *obj* is a memoryview object. It is not currently " -"allowed to create subclasses of :class:`memoryview`. This function always " -"succeeds." +"allowed to create subclasses of :class:`memoryview`." msgstr "" -#: ../../c-api/memoryview.rst:54 +#: ../../c-api/memoryview.rst:53 msgid "" "Return a pointer to the memoryview's private copy of the exporter's buffer. " "*mview* **must** be a memoryview instance; this macro doesn't check its " "type, you must do it yourself or you will risk crashes." msgstr "" -#: ../../c-api/memoryview.rst:60 +#: ../../c-api/memoryview.rst:59 msgid "" "Return either a pointer to the exporting object that the memoryview is based " "on or ``NULL`` if the memoryview has been created by one of the functions :c:" diff --git a/c-api/method.po b/c-api/method.po index c429400ea3..077d4d5e0c 100644 --- a/c-api/method.po +++ b/c-api/method.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.7\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2021-09-07 06:52+0000\n" +"POT-Creation-Date: 2020-06-20 18:08+0800\n" "PO-Revision-Date: 2017-09-22 18:26+0000\n" "Last-Translator: Leon H.\n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -39,70 +39,69 @@ msgstr "" #: ../../c-api/method.rst:23 msgid "" "Return true if *o* is an instance method object (has type :c:data:" -"`PyInstanceMethod_Type`). The parameter must not be ``NULL``. This function " -"always succeeds." +"`PyInstanceMethod_Type`). The parameter must not be ``NULL``." msgstr "" -#: ../../c-api/method.rst:30 +#: ../../c-api/method.rst:29 msgid "" "Return a new instance method object, with *func* being any callable object " "*func* is the function that will be called when the instance method is " "called." msgstr "" -#: ../../c-api/method.rst:37 +#: ../../c-api/method.rst:36 msgid "Return the function object associated with the instance method *im*." msgstr "" -#: ../../c-api/method.rst:42 +#: ../../c-api/method.rst:41 msgid "" "Macro version of :c:func:`PyInstanceMethod_Function` which avoids error " "checking." msgstr "" -#: ../../c-api/method.rst:48 +#: ../../c-api/method.rst:47 msgid "Method Objects" msgstr "" -#: ../../c-api/method.rst:52 +#: ../../c-api/method.rst:51 msgid "" "Methods are bound function objects. Methods are always bound to an instance " "of a user-defined class. Unbound methods (methods bound to a class object) " "are no longer available." msgstr "" -#: ../../c-api/method.rst:61 +#: ../../c-api/method.rst:60 msgid "" "This instance of :c:type:`PyTypeObject` represents the Python method type. " "This is exposed to Python programs as ``types.MethodType``." msgstr "" -#: ../../c-api/method.rst:67 +#: ../../c-api/method.rst:66 msgid "" "Return true if *o* is a method object (has type :c:data:`PyMethod_Type`). " -"The parameter must not be ``NULL``. This function always succeeds." +"The parameter must not be ``NULL``." msgstr "" -#: ../../c-api/method.rst:73 +#: ../../c-api/method.rst:72 msgid "" "Return a new method object, with *func* being any callable object and *self* " "the instance the method should be bound. *func* is the function that will be " "called when the method is called. *self* must not be ``NULL``." msgstr "" -#: ../../c-api/method.rst:80 +#: ../../c-api/method.rst:79 msgid "Return the function object associated with the method *meth*." msgstr "" -#: ../../c-api/method.rst:85 +#: ../../c-api/method.rst:84 msgid "" "Macro version of :c:func:`PyMethod_Function` which avoids error checking." msgstr "" -#: ../../c-api/method.rst:90 +#: ../../c-api/method.rst:89 msgid "Return the instance associated with the method *meth*." msgstr "" -#: ../../c-api/method.rst:95 +#: ../../c-api/method.rst:94 msgid "Macro version of :c:func:`PyMethod_Self` which avoids error checking." msgstr "" diff --git a/c-api/module.po b/c-api/module.po index 92dc2fade3..4dd1410807 100644 --- a/c-api/module.po +++ b/c-api/module.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.7\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2021-09-07 06:52+0000\n" +"POT-Creation-Date: 2020-06-20 18:08+0800\n" "PO-Revision-Date: 2018-05-23 14:32+0000\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -30,18 +30,16 @@ msgid "" msgstr "" #: ../../c-api/module.rst:21 -msgid "" -"Return true if *p* is a module object, or a subtype of a module object. This " -"function always succeeds." +msgid "Return true if *p* is a module object, or a subtype of a module object." msgstr "" -#: ../../c-api/module.rst:27 +#: ../../c-api/module.rst:26 msgid "" "Return true if *p* is a module object, but not a subtype of :c:data:" -"`PyModule_Type`. This function always succeeds." +"`PyModule_Type`." msgstr "" -#: ../../c-api/module.rst:40 +#: ../../c-api/module.rst:39 msgid "" "Return a new module object with the :attr:`__name__` attribute set to " "*name*. The module's :attr:`__name__`, :attr:`__doc__`, :attr:`__package__`, " @@ -50,17 +48,17 @@ msgid "" "`__file__` attribute." msgstr "" -#: ../../c-api/module.rst:48 +#: ../../c-api/module.rst:47 msgid ":attr:`__package__` and :attr:`__loader__` are set to ``None``." msgstr "" -#: ../../c-api/module.rst:54 +#: ../../c-api/module.rst:53 msgid "" "Similar to :c:func:`PyModule_NewObject`, but the name is a UTF-8 encoded " "string instead of a Unicode object." msgstr "" -#: ../../c-api/module.rst:62 +#: ../../c-api/module.rst:61 msgid "" "Return the dictionary object that implements *module*'s namespace; this " "object is the same as the :attr:`~object.__dict__` attribute of the module " @@ -68,40 +66,40 @@ msgid "" "object), :exc:`SystemError` is raised and ``NULL`` is returned." msgstr "" -#: ../../c-api/module.rst:67 +#: ../../c-api/module.rst:66 msgid "" "It is recommended extensions use other :c:func:`PyModule_\\*` and :c:func:" "`PyObject_\\*` functions rather than directly manipulate a module's :attr:" "`~object.__dict__`." msgstr "" -#: ../../c-api/module.rst:78 +#: ../../c-api/module.rst:77 msgid "" "Return *module*'s :attr:`__name__` value. If the module does not provide " "one, or if it is not a string, :exc:`SystemError` is raised and ``NULL`` is " "returned." msgstr "" -#: ../../c-api/module.rst:86 +#: ../../c-api/module.rst:85 msgid "" "Similar to :c:func:`PyModule_GetNameObject` but return the name encoded to " "``'utf-8'``." msgstr "" -#: ../../c-api/module.rst:91 +#: ../../c-api/module.rst:90 msgid "" "Return the \"state\" of the module, that is, a pointer to the block of " "memory allocated at module creation time, or ``NULL``. See :c:member:" "`PyModuleDef.m_size`." msgstr "" -#: ../../c-api/module.rst:98 +#: ../../c-api/module.rst:97 msgid "" "Return a pointer to the :c:type:`PyModuleDef` struct from which the module " "was created, or ``NULL`` if the module wasn't created from a definition." msgstr "" -#: ../../c-api/module.rst:108 +#: ../../c-api/module.rst:107 msgid "" "Return the name of the file from which *module* was loaded using *module*'s :" "attr:`__file__` attribute. If this is not defined, or if it is not a " @@ -109,23 +107,23 @@ msgid "" "return a reference to a Unicode object." msgstr "" -#: ../../c-api/module.rst:118 +#: ../../c-api/module.rst:117 msgid "" "Similar to :c:func:`PyModule_GetFilenameObject` but return the filename " "encoded to 'utf-8'." msgstr "" -#: ../../c-api/module.rst:121 +#: ../../c-api/module.rst:120 msgid "" ":c:func:`PyModule_GetFilename` raises :c:type:`UnicodeEncodeError` on " "unencodable filenames, use :c:func:`PyModule_GetFilenameObject` instead." msgstr "" -#: ../../c-api/module.rst:129 +#: ../../c-api/module.rst:128 msgid "Initializing C modules" msgstr "" -#: ../../c-api/module.rst:131 +#: ../../c-api/module.rst:130 msgid "" "Modules objects are usually created from extension modules (shared libraries " "which export an initialization function), or compiled-in modules (where the " @@ -133,55 +131,55 @@ msgid "" "See :ref:`building` or :ref:`extending-with-embedding` for details." msgstr "" -#: ../../c-api/module.rst:136 +#: ../../c-api/module.rst:135 msgid "" "The initialization function can either pass a module definition instance to :" "c:func:`PyModule_Create`, and return the resulting module object, or request " "\"multi-phase initialization\" by returning the definition struct itself." msgstr "" -#: ../../c-api/module.rst:142 +#: ../../c-api/module.rst:141 msgid "" "The module definition struct, which holds all information needed to create a " "module object. There is usually only one statically initialized variable of " "this type for each module." msgstr "" -#: ../../c-api/module.rst:148 +#: ../../c-api/module.rst:147 msgid "Always initialize this member to :const:`PyModuleDef_HEAD_INIT`." msgstr "" -#: ../../c-api/module.rst:152 +#: ../../c-api/module.rst:151 msgid "Name for the new module." msgstr "" -#: ../../c-api/module.rst:156 +#: ../../c-api/module.rst:155 msgid "" "Docstring for the module; usually a docstring variable created with :c:macro:" "`PyDoc_STRVAR` is used." msgstr "" -#: ../../c-api/module.rst:161 +#: ../../c-api/module.rst:160 msgid "" "Module state may be kept in a per-module memory area that can be retrieved " "with :c:func:`PyModule_GetState`, rather than in static globals. This makes " "modules safe for use in multiple sub-interpreters." msgstr "" -#: ../../c-api/module.rst:165 +#: ../../c-api/module.rst:164 msgid "" "This memory area is allocated based on *m_size* on module creation, and " "freed when the module object is deallocated, after the :c:member:`m_free` " "function has been called, if present." msgstr "" -#: ../../c-api/module.rst:169 +#: ../../c-api/module.rst:168 msgid "" "Setting ``m_size`` to ``-1`` means that the module does not support sub-" "interpreters, because it has global state." msgstr "" -#: ../../c-api/module.rst:172 +#: ../../c-api/module.rst:171 msgid "" "Setting it to a non-negative value means that the module can be re-" "initialized and specifies the additional amount of memory it requires for " @@ -189,37 +187,37 @@ msgid "" "initialization." msgstr "" -#: ../../c-api/module.rst:177 +#: ../../c-api/module.rst:176 msgid "See :PEP:`3121` for more details." msgstr "" -#: ../../c-api/module.rst:181 +#: ../../c-api/module.rst:180 msgid "" "A pointer to a table of module-level functions, described by :c:type:" "`PyMethodDef` values. Can be ``NULL`` if no functions are present." msgstr "" -#: ../../c-api/module.rst:186 +#: ../../c-api/module.rst:185 msgid "" "An array of slot definitions for multi-phase initialization, terminated by a " "``{0, NULL}`` entry. When using single-phase initialization, *m_slots* must " "be ``NULL``." msgstr "" -#: ../../c-api/module.rst:192 +#: ../../c-api/module.rst:191 msgid "" "Prior to version 3.5, this member was always set to ``NULL``, and was " "defined as:" msgstr "" -#: ../../c-api/module.rst:199 +#: ../../c-api/module.rst:198 msgid "" "A traversal function to call during GC traversal of the module object, or " "``NULL`` if not needed." msgstr "" -#: ../../c-api/module.rst:202 ../../c-api/module.rst:217 -#: ../../c-api/module.rst:238 +#: ../../c-api/module.rst:201 ../../c-api/module.rst:216 +#: ../../c-api/module.rst:231 msgid "" "This function is not called if the module state was requested but is not " "allocated yet. This is the case immediately after the module is created and " @@ -229,75 +227,66 @@ msgid "" "``NULL``." msgstr "" -#: ../../c-api/module.rst:209 ../../c-api/module.rst:230 -#: ../../c-api/module.rst:245 +#: ../../c-api/module.rst:208 ../../c-api/module.rst:223 +#: ../../c-api/module.rst:238 msgid "No longer called before the module state is allocated." msgstr "" -#: ../../c-api/module.rst:214 +#: ../../c-api/module.rst:213 msgid "" "A clear function to call during GC clearing of the module object, or " "``NULL`` if not needed." msgstr "" -#: ../../c-api/module.rst:224 -msgid "" -"Like :c:member:`PyTypeObject.tp_clear`, this function is not *always* called " -"before a module is deallocated. For example, when reference counting is " -"enough to determine that an object is no longer used, the cyclic garbage " -"collector is not involved and :c:member:`~PyModuleDef.m_free` is called " -"directly." -msgstr "" - -#: ../../c-api/module.rst:235 +#: ../../c-api/module.rst:228 msgid "" "A function to call during deallocation of the module object, or ``NULL`` if " "not needed." msgstr "" -#: ../../c-api/module.rst:249 +#: ../../c-api/module.rst:242 msgid "Single-phase initialization" msgstr "" -#: ../../c-api/module.rst:251 +#: ../../c-api/module.rst:244 msgid "" "The module initialization function may create and return the module object " "directly. This is referred to as \"single-phase initialization\", and uses " "one of the following two module creation functions:" msgstr "" -#: ../../c-api/module.rst:257 +#: ../../c-api/module.rst:250 msgid "" "Create a new module object, given the definition in *def*. This behaves " "like :c:func:`PyModule_Create2` with *module_api_version* set to :const:" "`PYTHON_API_VERSION`." msgstr "" -#: ../../c-api/module.rst:264 +#: ../../c-api/module.rst:257 msgid "" "Create a new module object, given the definition in *def*, assuming the API " "version *module_api_version*. If that version does not match the version of " "the running interpreter, a :exc:`RuntimeWarning` is emitted." msgstr "" -#: ../../c-api/module.rst:270 +#: ../../c-api/module.rst:263 msgid "" "Most uses of this function should be using :c:func:`PyModule_Create` " "instead; only use this if you are sure you need it." msgstr "" -#: ../../c-api/module.rst:273 +#: ../../c-api/module.rst:266 msgid "" "Before it is returned from in the initialization function, the resulting " "module object is typically populated using functions like :c:func:" "`PyModule_AddObject`." msgstr "" -#: ../../c-api/module.rst:279 +#: ../../c-api/module.rst:272 msgid "Multi-phase initialization" msgstr "" -#: ../../c-api/module.rst:281 +#: ../../c-api/module.rst:274 msgid "" "An alternate way to specify extensions is to request \"multi-phase " "initialization\". Extension modules created this way behave more like Python " @@ -307,7 +296,7 @@ msgid "" "methods of classes." msgstr "" -#: ../../c-api/module.rst:288 +#: ../../c-api/module.rst:281 msgid "" "Unlike modules created using single-phase initialization, these modules are " "not singletons: if the *sys.modules* entry is removed and the module is re-" @@ -320,14 +309,14 @@ msgid "" "or individual classes created with :c:func:`PyType_FromSpec`)." msgstr "" -#: ../../c-api/module.rst:298 +#: ../../c-api/module.rst:291 msgid "" "All modules created using multi-phase initialization are expected to " "support :ref:`sub-interpreters `. Making sure " "multiple modules are independent is typically enough to achieve this." msgstr "" -#: ../../c-api/module.rst:302 +#: ../../c-api/module.rst:295 msgid "" "To request multi-phase initialization, the initialization function " "(PyInit_modulename) returns a :c:type:`PyModuleDef` instance with non-empty :" @@ -335,65 +324,65 @@ msgid "" "instance must be initialized with the following function:" msgstr "" -#: ../../c-api/module.rst:309 +#: ../../c-api/module.rst:302 msgid "" "Ensures a module definition is a properly initialized Python object that " "correctly reports its type and reference count." msgstr "" -#: ../../c-api/module.rst:312 +#: ../../c-api/module.rst:305 msgid "Returns *def* cast to ``PyObject*``, or ``NULL`` if an error occurred." msgstr "" -#: ../../c-api/module.rst:316 +#: ../../c-api/module.rst:309 msgid "" "The *m_slots* member of the module definition must point to an array of " "``PyModuleDef_Slot`` structures:" msgstr "" -#: ../../c-api/module.rst:323 +#: ../../c-api/module.rst:316 msgid "A slot ID, chosen from the available values explained below." msgstr "" -#: ../../c-api/module.rst:327 +#: ../../c-api/module.rst:320 msgid "Value of the slot, whose meaning depends on the slot ID." msgstr "" -#: ../../c-api/module.rst:331 +#: ../../c-api/module.rst:324 msgid "The *m_slots* array must be terminated by a slot with id 0." msgstr "" -#: ../../c-api/module.rst:333 +#: ../../c-api/module.rst:326 msgid "The available slot types are:" msgstr "" -#: ../../c-api/module.rst:337 +#: ../../c-api/module.rst:330 msgid "" "Specifies a function that is called to create the module object itself. The " "*value* pointer of this slot must point to a function of the signature:" msgstr "" -#: ../../c-api/module.rst:342 +#: ../../c-api/module.rst:335 msgid "" "The function receives a :py:class:`~importlib.machinery.ModuleSpec` " "instance, as defined in :PEP:`451`, and the module definition. It should " "return a new module object, or set an error and return ``NULL``." msgstr "" -#: ../../c-api/module.rst:347 +#: ../../c-api/module.rst:340 msgid "" "This function should be kept minimal. In particular, it should not call " "arbitrary Python code, as trying to import the same module again may result " "in an infinite loop." msgstr "" -#: ../../c-api/module.rst:351 +#: ../../c-api/module.rst:344 msgid "" "Multiple ``Py_mod_create`` slots may not be specified in one module " "definition." msgstr "" -#: ../../c-api/module.rst:354 +#: ../../c-api/module.rst:347 msgid "" "If ``Py_mod_create`` is not specified, the import machinery will create a " "normal module object using :c:func:`PyModule_New`. The name is taken from " @@ -402,7 +391,7 @@ msgid "" "through symlinks, all while sharing a single module definition." msgstr "" -#: ../../c-api/module.rst:360 +#: ../../c-api/module.rst:353 msgid "" "There is no requirement for the returned object to be an instance of :c:type:" "`PyModule_Type`. Any type can be used, as long as it supports setting and " @@ -412,7 +401,7 @@ msgid "" "``Py_mod_create``." msgstr "" -#: ../../c-api/module.rst:369 +#: ../../c-api/module.rst:362 msgid "" "Specifies a function that is called to *execute* the module. This is " "equivalent to executing the code of a Python module: typically, this " @@ -420,21 +409,21 @@ msgid "" "function is:" msgstr "" -#: ../../c-api/module.rst:376 +#: ../../c-api/module.rst:369 msgid "" "If multiple ``Py_mod_exec`` slots are specified, they are processed in the " "order they appear in the *m_slots* array." msgstr "" -#: ../../c-api/module.rst:379 +#: ../../c-api/module.rst:372 msgid "See :PEP:`489` for more details on multi-phase initialization." msgstr "" -#: ../../c-api/module.rst:382 +#: ../../c-api/module.rst:375 msgid "Low-level module creation functions" msgstr "" -#: ../../c-api/module.rst:384 +#: ../../c-api/module.rst:377 msgid "" "The following functions are called under the hood when using multi-phase " "initialization. They can be used directly, for example when creating module " @@ -442,14 +431,14 @@ msgid "" "``PyModule_ExecDef`` must be called to fully initialize a module." msgstr "" -#: ../../c-api/module.rst:391 +#: ../../c-api/module.rst:384 msgid "" "Create a new module object, given the definition in *module* and the " "ModuleSpec *spec*. This behaves like :c:func:`PyModule_FromDefAndSpec2` " "with *module_api_version* set to :const:`PYTHON_API_VERSION`." msgstr "" -#: ../../c-api/module.rst:399 +#: ../../c-api/module.rst:392 msgid "" "Create a new module object, given the definition in *module* and the " "ModuleSpec *spec*, assuming the API version *module_api_version*. If that " @@ -457,24 +446,24 @@ msgid "" "`RuntimeWarning` is emitted." msgstr "" -#: ../../c-api/module.rst:406 +#: ../../c-api/module.rst:399 msgid "" "Most uses of this function should be using :c:func:`PyModule_FromDefAndSpec` " "instead; only use this if you are sure you need it." msgstr "" -#: ../../c-api/module.rst:413 +#: ../../c-api/module.rst:406 msgid "Process any execution slots (:c:data:`Py_mod_exec`) given in *def*." msgstr "" -#: ../../c-api/module.rst:419 +#: ../../c-api/module.rst:412 msgid "" "Set the docstring for *module* to *docstring*. This function is called " "automatically when creating a module from ``PyModuleDef``, using either " "``PyModule_Create`` or ``PyModule_FromDefAndSpec``." msgstr "" -#: ../../c-api/module.rst:428 +#: ../../c-api/module.rst:421 msgid "" "Add the functions from the ``NULL`` terminated *functions* array to " "*module*. Refer to the :c:type:`PyMethodDef` documentation for details on " @@ -486,11 +475,11 @@ msgid "" "``PyModule_FromDefAndSpec``." msgstr "" -#: ../../c-api/module.rst:440 +#: ../../c-api/module.rst:433 msgid "Support functions" msgstr "" -#: ../../c-api/module.rst:442 +#: ../../c-api/module.rst:435 msgid "" "The module initialization function (if using single phase initialization) or " "a function called from a module execution slot (if using multi-phase " @@ -498,40 +487,40 @@ msgid "" "module state:" msgstr "" -#: ../../c-api/module.rst:449 +#: ../../c-api/module.rst:442 msgid "" "Add an object to *module* as *name*. This is a convenience function which " "can be used from the module's initialization function. This steals a " "reference to *value* on success. Return ``-1`` on error, ``0`` on success." msgstr "" -#: ../../c-api/module.rst:455 +#: ../../c-api/module.rst:448 msgid "" "Unlike other functions that steal references, ``PyModule_AddObject()`` only " "decrements the reference count of *value* **on success**." msgstr "" -#: ../../c-api/module.rst:458 +#: ../../c-api/module.rst:451 msgid "" "This means that its return value must be checked, and calling code must :c:" "func:`Py_DECREF` *value* manually on error. Example usage::" msgstr "" -#: ../../c-api/module.rst:470 +#: ../../c-api/module.rst:463 msgid "" "Add an integer constant to *module* as *name*. This convenience function " "can be used from the module's initialization function. Return ``-1`` on " "error, ``0`` on success." msgstr "" -#: ../../c-api/module.rst:477 +#: ../../c-api/module.rst:470 msgid "" "Add a string constant to *module* as *name*. This convenience function can " "be used from the module's initialization function. The string *value* must " "be ``NULL``-terminated. Return ``-1`` on error, ``0`` on success." msgstr "" -#: ../../c-api/module.rst:484 +#: ../../c-api/module.rst:477 msgid "" "Add an int constant to *module*. The name and the value are taken from " "*macro*. For example ``PyModule_AddIntMacro(module, AF_INET)`` adds the int " @@ -539,11 +528,11 @@ msgid "" "error, ``0`` on success." msgstr "" -#: ../../c-api/module.rst:492 +#: ../../c-api/module.rst:485 msgid "Add a string constant to *module*." msgstr "" -#: ../../c-api/module.rst:496 +#: ../../c-api/module.rst:489 msgid "" "Add a type object to *module*. The type object is finalized by calling " "internally :c:func:`PyType_Ready`. The name of the type object is taken from " @@ -551,25 +540,25 @@ msgid "" "``-1`` on error, ``0`` on success." msgstr "" -#: ../../c-api/module.rst:506 +#: ../../c-api/module.rst:499 msgid "Module lookup" msgstr "" -#: ../../c-api/module.rst:508 +#: ../../c-api/module.rst:501 msgid "" "Single-phase initialization creates singleton modules that can be looked up " "in the context of the current interpreter. This allows the module object to " "be retrieved later with only a reference to the module definition." msgstr "" -#: ../../c-api/module.rst:512 +#: ../../c-api/module.rst:505 msgid "" "These functions will not work on modules created using multi-phase " "initialization, since multiple such modules can be created from a single " "definition." msgstr "" -#: ../../c-api/module.rst:517 +#: ../../c-api/module.rst:510 msgid "" "Returns the module object that was created from *def* for the current " "interpreter. This method requires that the module object has been attached " @@ -578,18 +567,18 @@ msgid "" "to the interpreter state yet, it returns ``NULL``." msgstr "" -#: ../../c-api/module.rst:524 +#: ../../c-api/module.rst:517 msgid "" "Attaches the module object passed to the function to the interpreter state. " "This allows the module object to be accessible via :c:func:" "`PyState_FindModule`." msgstr "" -#: ../../c-api/module.rst:527 +#: ../../c-api/module.rst:520 msgid "Only effective on modules created using single-phase initialization." msgstr "" -#: ../../c-api/module.rst:529 +#: ../../c-api/module.rst:522 msgid "" "Python calls ``PyState_AddModule`` automatically after importing a module, " "so it is unnecessary (but harmless) to call it from module initialization " @@ -600,15 +589,15 @@ msgid "" "state updates)." msgstr "" -#: ../../c-api/module.rst:537 ../../c-api/module.rst:548 +#: ../../c-api/module.rst:530 ../../c-api/module.rst:541 msgid "The caller must hold the GIL." msgstr "" -#: ../../c-api/module.rst:539 +#: ../../c-api/module.rst:532 msgid "Return 0 on success or -1 on failure." msgstr "" -#: ../../c-api/module.rst:545 +#: ../../c-api/module.rst:538 msgid "" "Removes the module object created from *def* from the interpreter state. " "Return 0 on success or -1 on failure." diff --git a/c-api/object.po b/c-api/object.po index 6e9aecd802..49fc5c4780 100644 --- a/c-api/object.po +++ b/c-api/object.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.7\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2021-09-07 06:52+0000\n" +"POT-Creation-Date: 2020-06-20 18:08+0800\n" "PO-Revision-Date: 2018-05-23 14:32+0000\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -301,8 +301,8 @@ msgid "" "``NULL``. This is equivalent to the Python expression ``type(o)``. This " "function increments the reference count of the return value. There's really " "no reason to use this function instead of the common expression ``o-" -">ob_type``, which returns a pointer of type :c:type:`PyTypeObject*`, except " -"when the incremented reference count is needed." +">ob_type``, which returns a pointer of type :c:type:`PyTypeObject\\*`, " +"except when the incremented reference count is needed." msgstr "" #: ../../c-api/object.rst:300 @@ -324,8 +324,7 @@ msgid "" "Return an estimated length for the object *o*. First try to return its " "actual length, then an estimate using :meth:`~object.__length_hint__`, and " "finally return the default value. On error return ``-1``. This is the " -"equivalent to the Python expression ``operator.length_hint(o, " -"defaultvalue)``." +"equivalent to the Python expression ``operator.length_hint(o, default)``." msgstr "" #: ../../c-api/object.rst:326 diff --git a/c-api/set.po b/c-api/set.po index 67b8ac02ec..614f2c4a6a 100644 --- a/c-api/set.po +++ b/c-api/set.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.7\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2021-09-07 06:52+0000\n" +"POT-Creation-Date: 2020-06-20 18:08+0800\n" "PO-Revision-Date: 2018-05-23 14:07+0000\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -68,35 +68,34 @@ msgstr "" #: ../../c-api/set.rst:55 msgid "" -"Return true if *p* is a :class:`set` object or an instance of a subtype. " -"This function always succeeds." +"Return true if *p* is a :class:`set` object or an instance of a subtype." msgstr "" -#: ../../c-api/set.rst:60 +#: ../../c-api/set.rst:59 msgid "" "Return true if *p* is a :class:`frozenset` object or an instance of a " -"subtype. This function always succeeds." +"subtype." msgstr "" -#: ../../c-api/set.rst:65 +#: ../../c-api/set.rst:64 msgid "" "Return true if *p* is a :class:`set` object, a :class:`frozenset` object, or " -"an instance of a subtype. This function always succeeds." +"an instance of a subtype." msgstr "" -#: ../../c-api/set.rst:71 +#: ../../c-api/set.rst:70 msgid "" "Return true if *p* is a :class:`set` object or a :class:`frozenset` object " -"but not an instance of a subtype. This function always succeeds." +"but not an instance of a subtype." msgstr "" -#: ../../c-api/set.rst:77 +#: ../../c-api/set.rst:76 msgid "" "Return true if *p* is a :class:`frozenset` object but not an instance of a " -"subtype. This function always succeeds." +"subtype." msgstr "" -#: ../../c-api/set.rst:83 +#: ../../c-api/set.rst:82 msgid "" "Return a new :class:`set` containing objects returned by the *iterable*. " "The *iterable* may be ``NULL`` to create a new empty set. Return the new " @@ -105,7 +104,7 @@ msgid "" "(``c=set(s)``)." msgstr "" -#: ../../c-api/set.rst:92 +#: ../../c-api/set.rst:91 msgid "" "Return a new :class:`frozenset` containing objects returned by the " "*iterable*. The *iterable* may be ``NULL`` to create a new empty frozenset. " @@ -113,24 +112,24 @@ msgid "" "`TypeError` if *iterable* is not actually iterable." msgstr "" -#: ../../c-api/set.rst:98 +#: ../../c-api/set.rst:97 msgid "" "The following functions and macros are available for instances of :class:" "`set` or :class:`frozenset` or instances of their subtypes." msgstr "" -#: ../../c-api/set.rst:106 +#: ../../c-api/set.rst:105 msgid "" "Return the length of a :class:`set` or :class:`frozenset` object. Equivalent " "to ``len(anyset)``. Raises a :exc:`PyExc_SystemError` if *anyset* is not a :" "class:`set`, :class:`frozenset`, or an instance of a subtype." msgstr "" -#: ../../c-api/set.rst:113 +#: ../../c-api/set.rst:112 msgid "Macro form of :c:func:`PySet_Size` without error checking." msgstr "" -#: ../../c-api/set.rst:118 +#: ../../c-api/set.rst:117 msgid "" "Return ``1`` if found, ``0`` if not found, and ``-1`` if an error is " "encountered. Unlike the Python :meth:`__contains__` method, this function " @@ -140,7 +139,7 @@ msgid "" "or an instance of a subtype." msgstr "" -#: ../../c-api/set.rst:127 +#: ../../c-api/set.rst:126 msgid "" "Add *key* to a :class:`set` instance. Also works with :class:`frozenset` " "instances (like :c:func:`PyTuple_SetItem` it can be used to fill-in the " @@ -151,13 +150,13 @@ msgid "" "`set` or its subtype." msgstr "" -#: ../../c-api/set.rst:136 +#: ../../c-api/set.rst:135 msgid "" "The following functions are available for instances of :class:`set` or its " "subtypes but not for instances of :class:`frozenset` or its subtypes." msgstr "" -#: ../../c-api/set.rst:142 +#: ../../c-api/set.rst:141 msgid "" "Return ``1`` if found and removed, ``0`` if not found (no action taken), and " "``-1`` if an error is encountered. Does not raise :exc:`KeyError` for " @@ -168,7 +167,7 @@ msgid "" "subtype." msgstr "" -#: ../../c-api/set.rst:152 +#: ../../c-api/set.rst:151 msgid "" "Return a new reference to an arbitrary object in the *set*, and removes the " "object from the *set*. Return ``NULL`` on failure. Raise :exc:`KeyError` " @@ -176,6 +175,6 @@ msgid "" "of :class:`set` or its subtype." msgstr "" -#: ../../c-api/set.rst:160 +#: ../../c-api/set.rst:159 msgid "Empty an existing set of all elements." msgstr "" diff --git a/c-api/slice.po b/c-api/slice.po index f80162a8aa..ac32d1eb21 100644 --- a/c-api/slice.po +++ b/c-api/slice.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.7\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2021-09-07 06:52+0000\n" +"POT-Creation-Date: 2020-06-20 18:08+0800\n" "PO-Revision-Date: 2018-05-23 14:07+0000\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -30,12 +30,10 @@ msgid "" msgstr "" #: ../../c-api/slice.rst:17 -msgid "" -"Return true if *ob* is a slice object; *ob* must not be ``NULL``. This " -"function always succeeds." +msgid "Return true if *ob* is a slice object; *ob* must not be ``NULL``." msgstr "" -#: ../../c-api/slice.rst:23 +#: ../../c-api/slice.rst:22 msgid "" "Return a new slice object with the given values. The *start*, *stop*, and " "*step* parameters are used as the values of the slice object attributes of " @@ -44,30 +42,30 @@ msgid "" "the new object could not be allocated." msgstr "" -#: ../../c-api/slice.rst:32 +#: ../../c-api/slice.rst:31 msgid "" "Retrieve the start, stop and step indices from the slice object *slice*, " "assuming a sequence of length *length*. Treats indices greater than *length* " "as errors." msgstr "" -#: ../../c-api/slice.rst:36 +#: ../../c-api/slice.rst:35 msgid "" "Returns ``0`` on success and ``-1`` on error with no exception set (unless " "one of the indices was not :const:`None` and failed to be converted to an " "integer, in which case ``-1`` is returned with an exception set)." msgstr "" -#: ../../c-api/slice.rst:40 +#: ../../c-api/slice.rst:39 msgid "You probably do not want to use this function." msgstr "" -#: ../../c-api/slice.rst:42 ../../c-api/slice.rst:73 +#: ../../c-api/slice.rst:41 ../../c-api/slice.rst:72 msgid "" "The parameter type for the *slice* parameter was ``PySliceObject*`` before." msgstr "" -#: ../../c-api/slice.rst:49 +#: ../../c-api/slice.rst:48 msgid "" "Usable replacement for :c:func:`PySlice_GetIndices`. Retrieve the start, " "stop, and step indices from the slice object *slice* assuming a sequence of " @@ -76,22 +74,22 @@ msgid "" "normal slices." msgstr "" -#: ../../c-api/slice.rst:55 +#: ../../c-api/slice.rst:54 msgid "Returns ``0`` on success and ``-1`` on error with exception set." msgstr "" -#: ../../c-api/slice.rst:58 +#: ../../c-api/slice.rst:57 msgid "" "This function is considered not safe for resizable sequences. Its invocation " "should be replaced by a combination of :c:func:`PySlice_Unpack` and :c:func:" "`PySlice_AdjustIndices` where ::" msgstr "" -#: ../../c-api/slice.rst:66 +#: ../../c-api/slice.rst:65 msgid "is replaced by ::" msgstr "" -#: ../../c-api/slice.rst:77 +#: ../../c-api/slice.rst:76 msgid "" "If ``Py_LIMITED_API`` is not set or set to the value between ``0x03050400`` " "and ``0x03060000`` (not including) or ``0x03060100`` or higher :c:func:`!" @@ -100,14 +98,14 @@ msgid "" "*stop* and *step* are evaluated more than once." msgstr "" -#: ../../c-api/slice.rst:84 +#: ../../c-api/slice.rst:83 msgid "" "If ``Py_LIMITED_API`` is set to the value less than ``0x03050400`` or " "between ``0x03060000`` and ``0x03060100`` (not including) :c:func:`!" "PySlice_GetIndicesEx` is a deprecated function." msgstr "" -#: ../../c-api/slice.rst:92 +#: ../../c-api/slice.rst:91 msgid "" "Extract the start, stop and step data members from a slice object as C " "integers. Silently reduce values larger than ``PY_SSIZE_T_MAX`` to " @@ -116,28 +114,28 @@ msgid "" "less than ``-PY_SSIZE_T_MAX`` to ``-PY_SSIZE_T_MAX``." msgstr "" -#: ../../c-api/slice.rst:98 +#: ../../c-api/slice.rst:97 msgid "Return ``-1`` on error, ``0`` on success." msgstr "" -#: ../../c-api/slice.rst:105 +#: ../../c-api/slice.rst:104 msgid "" "Adjust start/end slice indices assuming a sequence of the specified length. " "Out of bounds indices are clipped in a manner consistent with the handling " "of normal slices." msgstr "" -#: ../../c-api/slice.rst:109 +#: ../../c-api/slice.rst:108 msgid "" "Return the length of the slice. Always successful. Doesn't call Python " "code." msgstr "" -#: ../../c-api/slice.rst:116 +#: ../../c-api/slice.rst:115 msgid "Ellipsis Object" msgstr "" -#: ../../c-api/slice.rst:121 +#: ../../c-api/slice.rst:120 msgid "" "The Python ``Ellipsis`` object. This object has no methods. It needs to be " "treated just like any other object with respect to reference counts. Like :" diff --git a/c-api/structures.po b/c-api/structures.po index 979cee2b02..4659c47472 100644 --- a/c-api/structures.po +++ b/c-api/structures.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.7\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2021-09-07 06:52+0000\n" +"POT-Creation-Date: 2020-06-20 18:08+0800\n" "PO-Revision-Date: 2018-05-23 14:07+0000\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -140,7 +140,7 @@ msgstr "" #: ../../c-api/structures.rst:143 msgid "" "Type of the functions used to implement most Python callables in C. " -"Functions of this type take two :c:type:`PyObject*` parameters and return " +"Functions of this type take two :c:type:`PyObject\\*` parameters and return " "one such value. If the return value is ``NULL``, an exception shall have " "been set. If not ``NULL``, the return value is interpreted as the return " "value of the function as exposed in Python. The function must return a new " @@ -183,17 +183,17 @@ msgid "" msgstr "" #: ../../c-api/structures.rst:208 ../../c-api/structures.rst:364 -#: ../../c-api/structures.rst:460 +#: ../../c-api/structures.rst:445 msgid "Field" msgstr "" #: ../../c-api/structures.rst:208 ../../c-api/structures.rst:364 -#: ../../c-api/structures.rst:460 +#: ../../c-api/structures.rst:445 msgid "C Type" msgstr "C Type" #: ../../c-api/structures.rst:208 ../../c-api/structures.rst:364 -#: ../../c-api/structures.rst:460 +#: ../../c-api/structures.rst:445 msgid "Meaning" msgstr "" @@ -203,8 +203,8 @@ msgstr "" #: ../../c-api/structures.rst:210 ../../c-api/structures.rst:218 #: ../../c-api/structures.rst:366 ../../c-api/structures.rst:379 -#: ../../c-api/structures.rst:395 ../../c-api/structures.rst:462 -#: ../../c-api/structures.rst:470 +#: ../../c-api/structures.rst:395 ../../c-api/structures.rst:447 +#: ../../c-api/structures.rst:455 msgid "const char \\*" msgstr "" @@ -248,10 +248,10 @@ msgstr "" #: ../../c-api/structures.rst:222 msgid "" "The :attr:`ml_meth` is a C function pointer. The functions may be of " -"different types, but they always return :c:type:`PyObject*`. If the " +"different types, but they always return :c:type:`PyObject\\*`. If the " "function is not of the :c:type:`PyCFunction`, the compiler will require a " "cast in the method table. Even though :c:type:`PyCFunction` defines the " -"first parameter as :c:type:`PyObject*`, it is common that the method " +"first parameter as :c:type:`PyObject\\*`, it is common that the method " "implementation uses the specific C type of the *self* object." msgstr "" @@ -269,11 +269,11 @@ msgstr "" #: ../../c-api/structures.rst:237 msgid "" "This is the typical calling convention, where the methods have the type :c:" -"type:`PyCFunction`. The function expects two :c:type:`PyObject*` values. The " -"first one is the *self* object for methods; for module functions, it is the " -"module object. The second parameter (often called *args*) is a tuple object " -"representing all arguments. This parameter is typically processed using :c:" -"func:`PyArg_ParseTuple` or :c:func:`PyArg_UnpackTuple`." +"type:`PyCFunction`. The function expects two :c:type:`PyObject\\*` values. " +"The first one is the *self* object for methods; for module functions, it is " +"the module object. The second parameter (often called *args*) is a tuple " +"object representing all arguments. This parameter is typically processed " +"using :c:func:`PyArg_ParseTuple` or :c:func:`PyArg_UnpackTuple`." msgstr "" #: ../../c-api/structures.rst:247 @@ -289,7 +289,7 @@ msgstr "" msgid "" "Fast calling convention supporting only positional arguments. The methods " "have the type :c:type:`_PyCFunctionFast`. The first parameter is *self*, the " -"second parameter is a C array of :c:type:`PyObject*` values indicating the " +"second parameter is a C array of :c:type:`PyObject\\*` values indicating the " "arguments and the third parameter is the number of arguments (the length of " "the array)." msgstr "" @@ -303,10 +303,10 @@ msgid "" "Extension of :const:`METH_FASTCALL` supporting also keyword arguments, with " "methods of type :c:type:`_PyCFunctionFastWithKeywords`. Keyword arguments " "are passed the same way as in the :ref:`vectorcall protocol `: " -"there is an additional fourth :c:type:`PyObject*` parameter which is a tuple " -"representing the names of the keyword arguments (which are guaranteed to be " -"strings) or possibly ``NULL`` if there are no keywords. The values of the " -"keyword arguments are stored in the *args* array, after the positional " +"there is an additional fourth :c:type:`PyObject\\*` parameter which is a " +"tuple representing the names of the keyword arguments (which are guaranteed " +"to be strings) or possibly ``NULL`` if there are no keywords. The values of " +"the keyword arguments are stored in the *args* array, after the positional " "arguments." msgstr "" @@ -338,7 +338,7 @@ msgid "" "Methods with a single object argument can be listed with the :const:`METH_O` " "flag, instead of invoking :c:func:`PyArg_ParseTuple` with a ``\"O\"`` " "argument. They have the type :c:type:`PyCFunction`, with the *self* " -"parameter, and a :c:type:`PyObject*` parameter representing the single " +"parameter, and a :c:type:`PyObject\\*` parameter representing the single " "argument." msgstr "" @@ -600,99 +600,87 @@ msgid "" "``T_PYSSIZET`` and ``READONLY``, for example::" msgstr "" -#: ../../c-api/structures.rst:442 -msgid "" -"Get an attribute belonging to the object at address *obj_addr*. The " -"attribute is described by ``PyMemberDef`` *m*. Returns ``NULL`` on error." -msgstr "" - -#: ../../c-api/structures.rst:449 -msgid "" -"Set an attribute belonging to the object at address *obj_addr* to object " -"*o*. The attribute to set is described by ``PyMemberDef`` *m*. Returns " -"``0`` if successful and a negative value on failure." -msgstr "" - -#: ../../c-api/structures.rst:456 +#: ../../c-api/structures.rst:441 msgid "" "Structure to define property-like access for a type. See also description of " "the :c:member:`PyTypeObject.tp_getset` slot." msgstr "" -#: ../../c-api/structures.rst:462 +#: ../../c-api/structures.rst:447 msgid "name" msgstr "" -#: ../../c-api/structures.rst:462 +#: ../../c-api/structures.rst:447 msgid "attribute name" msgstr "" -#: ../../c-api/structures.rst:464 +#: ../../c-api/structures.rst:449 msgid "get" msgstr "" -#: ../../c-api/structures.rst:464 +#: ../../c-api/structures.rst:449 msgid "getter" msgstr "" -#: ../../c-api/structures.rst:464 +#: ../../c-api/structures.rst:449 msgid "C Function to get the attribute" msgstr "" -#: ../../c-api/structures.rst:466 +#: ../../c-api/structures.rst:451 msgid "set" msgstr "" -#: ../../c-api/structures.rst:466 +#: ../../c-api/structures.rst:451 msgid "setter" msgstr "" -#: ../../c-api/structures.rst:466 +#: ../../c-api/structures.rst:451 msgid "" "optional C function to set or delete the attribute, if omitted the attribute " "is readonly" msgstr "" -#: ../../c-api/structures.rst:470 +#: ../../c-api/structures.rst:455 msgid "doc" msgstr "" -#: ../../c-api/structures.rst:470 +#: ../../c-api/structures.rst:455 msgid "optional docstring" msgstr "" -#: ../../c-api/structures.rst:472 +#: ../../c-api/structures.rst:457 msgid "closure" msgstr "" -#: ../../c-api/structures.rst:472 +#: ../../c-api/structures.rst:457 msgid "void \\*" msgstr "" -#: ../../c-api/structures.rst:472 +#: ../../c-api/structures.rst:457 msgid "" "optional function pointer, providing additional data for getter and setter" msgstr "" -#: ../../c-api/structures.rst:477 +#: ../../c-api/structures.rst:462 msgid "" -"The ``get`` function takes one :c:type:`PyObject*` parameter (the instance) " -"and a function pointer (the associated ``closure``)::" +"The ``get`` function takes one :c:type:`PyObject\\*` parameter (the " +"instance) and a function pointer (the associated ``closure``)::" msgstr "" -#: ../../c-api/structures.rst:482 +#: ../../c-api/structures.rst:467 msgid "" "It should return a new reference on success or ``NULL`` with a set exception " "on failure." msgstr "" -#: ../../c-api/structures.rst:485 +#: ../../c-api/structures.rst:470 msgid "" -"``set`` functions take two :c:type:`PyObject*` parameters (the instance and " -"the value to be set) and a function pointer (the associated ``closure``)::" +"``set`` functions take two :c:type:`PyObject\\*` parameters (the instance " +"and the value to be set) and a function pointer (the associated " +"``closure``)::" msgstr "" -#: ../../c-api/structures.rst:490 +#: ../../c-api/structures.rst:475 msgid "" "In case the attribute should be deleted the second parameter is ``NULL``. " "Should return ``0`` on success or ``-1`` with a set exception on failure." diff --git a/c-api/sys.po b/c-api/sys.po index c03b7ed042..7ed447cbae 100644 --- a/c-api/sys.po +++ b/c-api/sys.po @@ -10,7 +10,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.7\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2021-09-07 06:52+0000\n" +"POT-Creation-Date: 2020-06-20 18:08+0800\n" "PO-Revision-Date: 2018-05-23 14:07+0000\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -433,7 +433,7 @@ msgid "" "events table `. Details are in each function's documentation." msgstr "" -#: ../../c-api/sys.rst:363 +#: ../../c-api/sys.rst:None msgid "" "Raises an :ref:`auditing event ` ``sys.addaudithook`` with no " "arguments." diff --git a/c-api/tuple.po b/c-api/tuple.po index 8ec80497d2..6fb8e5856c 100644 --- a/c-api/tuple.po +++ b/c-api/tuple.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.7\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2021-09-07 06:52+0000\n" +"POT-Creation-Date: 2020-06-20 18:08+0800\n" "PO-Revision-Date: 2017-09-22 18:26+0000\n" "Last-Translator: Leon H.\n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -36,13 +36,13 @@ msgstr "" #: ../../c-api/tuple.rst:24 msgid "" "Return true if *p* is a tuple object or an instance of a subtype of the " -"tuple type. This function always succeeds." +"tuple type." msgstr "" #: ../../c-api/tuple.rst:30 msgid "" "Return true if *p* is a tuple object, but not an instance of a subtype of " -"the tuple type. This function always succeeds." +"the tuple type." msgstr "" #: ../../c-api/tuple.rst:36 @@ -219,9 +219,9 @@ msgstr "" #: ../../c-api/tuple.rst:163 msgid "" "Describes a field of a struct sequence. As a struct sequence is modeled as a " -"tuple, all fields are typed as :c:type:`PyObject*`. The index in the :attr:" -"`fields` array of the :c:type:`PyStructSequence_Desc` determines which field " -"of the struct sequence is described." +"tuple, all fields are typed as :c:type:`PyObject\\*`. The index in the :" +"attr:`fields` array of the :c:type:`PyStructSequence_Desc` determines which " +"field of the struct sequence is described." msgstr "" #: ../../c-api/tuple.rst:171 diff --git a/c-api/type.po b/c-api/type.po index ca1e6953f2..614ce77e0b 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-07 06:52+0000\n" +"POT-Creation-Date: 2020-06-20 18:08+0800\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-" @@ -35,22 +35,20 @@ msgstr "" #: ../../c-api/type.rst:24 msgid "" "Return non-zero if the object *o* is a type object, including instances of " -"types derived from the standard type object. Return 0 in all other cases. " -"This function always succeeds." +"types derived from the standard type object. Return 0 in all other cases." msgstr "" -#: ../../c-api/type.rst:31 +#: ../../c-api/type.rst:30 msgid "" "Return non-zero if the object *o* is a type object, but not a subtype of the " -"standard type object. Return 0 in all other cases. This function always " -"succeeds." +"standard type object. Return 0 in all other cases." msgstr "" -#: ../../c-api/type.rst:38 +#: ../../c-api/type.rst:36 msgid "Clear the internal lookup cache. Return the current version tag." msgstr "" -#: ../../c-api/type.rst:42 +#: ../../c-api/type.rst:40 msgid "" "Return the :c:member:`~PyTypeObject.tp_flags` member of *type*. This " "function is primarily meant for use with `Py_LIMITED_API`; the individual " @@ -58,55 +56,55 @@ msgid "" "c:member:`~PyTypeObject.tp_flags` itself is not part of the limited API." msgstr "" -#: ../../c-api/type.rst:49 +#: ../../c-api/type.rst:47 msgid "The return type is now ``unsigned long`` rather than ``long``." msgstr "" -#: ../../c-api/type.rst:55 +#: ../../c-api/type.rst:53 msgid "" "Invalidate the internal lookup cache for the type and all of its subtypes. " "This function must be called after any manual modification of the attributes " "or base classes of the type." msgstr "" -#: ../../c-api/type.rst:62 +#: ../../c-api/type.rst:60 msgid "" "Return non-zero if the type object *o* sets the feature *feature*. Type " "features are denoted by single bit flags." msgstr "" -#: ../../c-api/type.rst:68 +#: ../../c-api/type.rst:66 msgid "" "Return true if the type object includes support for the cycle detector; this " "tests the type flag :const:`Py_TPFLAGS_HAVE_GC`." msgstr "" -#: ../../c-api/type.rst:74 +#: ../../c-api/type.rst:72 msgid "Return true if *a* is a subtype of *b*." msgstr "" -#: ../../c-api/type.rst:76 +#: ../../c-api/type.rst:74 msgid "" "This function only checks for actual subtypes, which means that :meth:" "`~class.__subclasscheck__` is not called on *b*. Call :c:func:" "`PyObject_IsSubclass` to do the same check that :func:`issubclass` would do." msgstr "" -#: ../../c-api/type.rst:84 +#: ../../c-api/type.rst:82 msgid "" "Generic handler for the :c:member:`~PyTypeObject.tp_alloc` slot of a type " "object. Use Python's default memory allocation mechanism to allocate a new " "instance and initialize all its contents to ``NULL``." msgstr "" -#: ../../c-api/type.rst:90 +#: ../../c-api/type.rst:88 msgid "" "Generic handler for the :c:member:`~PyTypeObject.tp_new` slot of a type " "object. Create a new instance using the type's :c:member:`~PyTypeObject." "tp_alloc` slot." msgstr "" -#: ../../c-api/type.rst:95 +#: ../../c-api/type.rst:93 msgid "" "Finalize a type object. This should be called on all type objects to finish " "their initialization. This function is responsible for adding inherited " @@ -114,17 +112,7 @@ msgid "" "and sets an exception on error." msgstr "" -#: ../../c-api/type.rst:101 -msgid "" -"If some of the base classes implements the GC protocol and the provided type " -"does not include the :const:`Py_TPFLAGS_HAVE_GC` in its flags, then the GC " -"protocol will be automatically implemented from its parents. On the " -"contrary, if the type being created does include :const:`Py_TPFLAGS_HAVE_GC` " -"in its flags then it **must** implement the GC protocol itself by at least " -"implementing the :c:member:`~PyTypeObject.tp_traverse` handle." -msgstr "" - -#: ../../c-api/type.rst:111 +#: ../../c-api/type.rst:100 msgid "" "Return the function pointer stored in the given slot. If the result is " "``NULL``, this indicates that either the slot is ``NULL``, or that the " @@ -132,141 +120,128 @@ msgid "" "result pointer into the appropriate function type." msgstr "" -#: ../../c-api/type.rst:117 +#: ../../c-api/type.rst:106 msgid "" "See :c:member:`PyType_Slot.slot` for possible values of the *slot* argument." msgstr "" -#: ../../c-api/type.rst:119 +#: ../../c-api/type.rst:108 msgid "An exception is raised if *type* is not a heap type." msgstr "" -#: ../../c-api/type.rst:125 +#: ../../c-api/type.rst:114 msgid "" "Return the module object associated with the given type when the type was " "created using :c:func:`PyType_FromModuleAndSpec`." msgstr "" -#: ../../c-api/type.rst:128 ../../c-api/type.rst:146 +#: ../../c-api/type.rst:117 ../../c-api/type.rst:128 msgid "" "If no module is associated with the given type, sets :py:class:`TypeError` " "and returns ``NULL``." msgstr "" -#: ../../c-api/type.rst:131 -msgid "" -"This function is usually used to get the module in which a method is " -"defined. Note that in such a method, ``PyType_GetModule(Py_TYPE(self))`` may " -"not return the intended result. ``Py_TYPE(self)`` may be a *subclass* of the " -"intended class, and subclasses are not necessarily defined in the same " -"module as their superclass. See :c:type:`PyCMethod` to get the class that " -"defines the method." -msgstr "" - -#: ../../c-api/type.rst:142 +#: ../../c-api/type.rst:124 msgid "" "Return the state of the module object associated with the given type. This " "is a shortcut for calling :c:func:`PyModule_GetState()` on the result of :c:" "func:`PyType_GetModule`." msgstr "" -#: ../../c-api/type.rst:149 +#: ../../c-api/type.rst:131 msgid "" "If the *type* has an associated module but its state is ``NULL``, returns " "``NULL`` without setting an exception." msgstr "" -#: ../../c-api/type.rst:156 +#: ../../c-api/type.rst:138 msgid "Creating Heap-Allocated Types" msgstr "" -#: ../../c-api/type.rst:158 +#: ../../c-api/type.rst:140 msgid "" "The following functions and structs are used to create :ref:`heap types " "`." msgstr "" -#: ../../c-api/type.rst:163 +#: ../../c-api/type.rst:145 msgid "" "Creates and returns a heap type object from the *spec* (:const:" "`Py_TPFLAGS_HEAPTYPE`)." msgstr "" -#: ../../c-api/type.rst:166 +#: ../../c-api/type.rst:148 msgid "" "If *bases* is a tuple, the created heap type contains all types contained in " "it as base types." msgstr "" -#: ../../c-api/type.rst:169 +#: ../../c-api/type.rst:151 msgid "" -"If *bases* is ``NULL``, the *Py_tp_bases* slot is used instead. If that also " -"is ``NULL``, the *Py_tp_base* slot is used instead. If that also is " -"``NULL``, the new type derives from :class:`object`." +"If *bases* is ``NULL``, the *Py_tp_base* slot is used instead. If that also " +"is ``NULL``, the new type derives from :class:`object`." msgstr "" -#: ../../c-api/type.rst:173 +#: ../../c-api/type.rst:154 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 :" -"c:func:`PyType_GetModule`. The associated module is not inherited by " -"subclasses; it must be specified for each class individually." +"The *module* must be a module object or ``NULL``. If not ``NULL``, the " +"module is associated with the new type and can later be retreived with :c:" +"func:`PyType_GetModule`." msgstr "" -#: ../../c-api/type.rst:180 +#: ../../c-api/type.rst:158 msgid "This function calls :c:func:`PyType_Ready` on the new type." msgstr "" -#: ../../c-api/type.rst:186 +#: ../../c-api/type.rst:164 msgid "Equivalent to ``PyType_FromModuleAndSpec(NULL, spec, bases)``." msgstr "" -#: ../../c-api/type.rst:192 +#: ../../c-api/type.rst:170 msgid "Equivalent to ``PyType_FromSpecWithBases(spec, NULL)``." msgstr "" -#: ../../c-api/type.rst:196 +#: ../../c-api/type.rst:174 msgid "Structure defining a type's behavior." msgstr "" -#: ../../c-api/type.rst:200 +#: ../../c-api/type.rst:178 msgid "Name of the type, used to set :c:member:`PyTypeObject.tp_name`." msgstr "" -#: ../../c-api/type.rst:205 +#: ../../c-api/type.rst:183 msgid "" "Size of the instance in bytes, used to set :c:member:`PyTypeObject." "tp_basicsize` and :c:member:`PyTypeObject.tp_itemsize`." msgstr "" -#: ../../c-api/type.rst:211 +#: ../../c-api/type.rst:189 msgid "Type flags, used to set :c:member:`PyTypeObject.tp_flags`." msgstr "" -#: ../../c-api/type.rst:213 +#: ../../c-api/type.rst:191 msgid "" "If the ``Py_TPFLAGS_HEAPTYPE`` flag is not set, :c:func:" "`PyType_FromSpecWithBases` sets it automatically." msgstr "" -#: ../../c-api/type.rst:218 +#: ../../c-api/type.rst:196 msgid "" "Array of :c:type:`PyType_Slot` structures. Terminated by the special slot " "value ``{0, NULL}``." msgstr "" -#: ../../c-api/type.rst:223 +#: ../../c-api/type.rst:201 msgid "" "Structure defining optional functionality of a type, containing a slot ID " "and a value pointer." msgstr "" -#: ../../c-api/type.rst:228 +#: ../../c-api/type.rst:206 msgid "A slot ID." msgstr "" -#: ../../c-api/type.rst:230 +#: ../../c-api/type.rst:208 msgid "" "Slot IDs are named like the field names of the structures :c:type:" "`PyTypeObject`, :c:type:`PyNumberMethods`, :c:type:`PySequenceMethods`, :c:" @@ -274,97 +249,87 @@ msgid "" "prefix. For example, use:" msgstr "" -#: ../../c-api/type.rst:236 +#: ../../c-api/type.rst:214 msgid "``Py_tp_dealloc`` to set :c:member:`PyTypeObject.tp_dealloc`" msgstr "" -#: ../../c-api/type.rst:237 +#: ../../c-api/type.rst:215 msgid "``Py_nb_add`` to set :c:member:`PyNumberMethods.nb_add`" msgstr "" -#: ../../c-api/type.rst:238 +#: ../../c-api/type.rst:216 msgid "``Py_sq_length`` to set :c:member:`PySequenceMethods.sq_length`" msgstr "" -#: ../../c-api/type.rst:240 +#: ../../c-api/type.rst:218 msgid "" -"The following fields cannot be set at all using :c:type:`PyType_Spec` and :c:" -"type:`PyType_Slot`:" +"The following fields cannot be set using :c:type:`PyType_Spec` and :c:type:" +"`PyType_Slot`:" msgstr "" -#: ../../c-api/type.rst:243 +#: ../../c-api/type.rst:220 msgid ":c:member:`~PyTypeObject.tp_dict`" msgstr "" -#: ../../c-api/type.rst:244 +#: ../../c-api/type.rst:221 msgid ":c:member:`~PyTypeObject.tp_mro`" msgstr "" -#: ../../c-api/type.rst:245 +#: ../../c-api/type.rst:222 msgid ":c:member:`~PyTypeObject.tp_cache`" msgstr "" -#: ../../c-api/type.rst:246 +#: ../../c-api/type.rst:223 msgid ":c:member:`~PyTypeObject.tp_subclasses`" msgstr "" -#: ../../c-api/type.rst:247 +#: ../../c-api/type.rst:224 msgid ":c:member:`~PyTypeObject.tp_weaklist`" msgstr "" -#: ../../c-api/type.rst:248 +#: ../../c-api/type.rst:225 msgid ":c:member:`~PyTypeObject.tp_vectorcall`" msgstr "" -#: ../../c-api/type.rst:249 +#: ../../c-api/type.rst:226 msgid "" ":c:member:`~PyTypeObject.tp_weaklistoffset` (see :ref:`PyMemberDef " "`)" msgstr "" -#: ../../c-api/type.rst:251 +#: ../../c-api/type.rst:228 msgid "" ":c:member:`~PyTypeObject.tp_dictoffset` (see :ref:`PyMemberDef `)" msgstr "" -#: ../../c-api/type.rst:253 +#: ../../c-api/type.rst:230 msgid "" ":c:member:`~PyTypeObject.tp_vectorcall_offset` (see :ref:`PyMemberDef " "`)" msgstr "" -#: ../../c-api/type.rst:256 -msgid "" -"The following fields cannot be set using :c:type:`PyType_Spec` and :c:type:" -"`PyType_Slot` under the limited API:" -msgstr "" - -#: ../../c-api/type.rst:259 +#: ../../c-api/type.rst:232 msgid ":c:member:`~PyBufferProcs.bf_getbuffer`" msgstr "" -#: ../../c-api/type.rst:260 +#: ../../c-api/type.rst:233 msgid ":c:member:`~PyBufferProcs.bf_releasebuffer`" msgstr "" -#: ../../c-api/type.rst:262 +#: ../../c-api/type.rst:235 msgid "" -"Setting :c:data:`Py_tp_bases` or :c:data:`Py_tp_base` may be problematic on " -"some platforms. To avoid issues, use the *bases* argument of :py:func:" -"`PyType_FromSpecWithBases` instead." -msgstr "" - -#: ../../c-api/type.rst:269 -msgid "Slots in :c:type:`PyBufferProcs` in may be set in the unlimited API." +"Setting :c:data:`Py_tp_bases` may be problematic on some platforms. To avoid " +"issues, use the *bases* argument of :py:func:`PyType_FromSpecWithBases` " +"instead." msgstr "" -#: ../../c-api/type.rst:273 +#: ../../c-api/type.rst:241 msgid "" "The desired value of the slot. In most cases, this is a pointer to a " "function." msgstr "" -#: ../../c-api/type.rst:276 +#: ../../c-api/type.rst:244 msgid "May not be ``NULL``." msgstr "" diff --git a/c-api/typehints.po b/c-api/typehints.po deleted file mode 100644 index 10bd5c6ce6..0000000000 --- a/c-api/typehints.po +++ /dev/null @@ -1,56 +0,0 @@ -# SOME DESCRIPTIVE TITLE. -# Copyright (C) 2001-2021, Python Software Foundation -# This file is distributed under the same license as the Python package. -# FIRST AUTHOR , YEAR. -# -#, fuzzy -msgid "" -msgstr "" -"Project-Id-Version: Python 3.9\n" -"Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2021-09-07 06:52+0000\n" -"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" -"Last-Translator: FULL NAME \n" -"Language-Team: LANGUAGE \n" -"MIME-Version: 1.0\n" -"Content-Type: text/plain; charset=UTF-8\n" -"Content-Transfer-Encoding: 8bit\n" - -#: ../../c-api/typehints.rst:6 -msgid "Objects for Type Hinting" -msgstr "" - -#: ../../c-api/typehints.rst:8 -msgid "" -"Various built-in types for type hinting are provided. Only :ref:" -"`GenericAlias ` is exposed to C." -msgstr "" - -#: ../../c-api/typehints.rst:13 -msgid "" -"Create a :ref:`GenericAlias ` object. Equivalent to " -"calling the Python class :class:`types.GenericAlias`. The *origin* and " -"*args* arguments set the ``GenericAlias``\\ 's ``__origin__`` and " -"``__args__`` attributes respectively. *origin* should be a :c:type:" -"`PyTypeObject*`, and *args* can be a :c:type:`PyTupleObject*` or any " -"``PyObject*``. If *args* passed is not a tuple, a 1-tuple is automatically " -"constructed and ``__args__`` is set to ``(args,)``. Minimal checking is done " -"for the arguments, so the function will succeed even if *origin* is not a " -"type. The ``GenericAlias``\\ 's ``__parameters__`` attribute is constructed " -"lazily from ``__args__``. On failure, an exception is raised and ``NULL`` " -"is returned." -msgstr "" - -#: ../../c-api/typehints.rst:27 -msgid "Here's an example of how to make an extension type generic::" -msgstr "" - -#: ../../c-api/typehints.rst:37 -msgid "The data model method :meth:`__class_getitem__`." -msgstr "" - -#: ../../c-api/typehints.rst:43 -msgid "" -"The C type of the object returned by :c:func:`Py_GenericAlias`. Equivalent " -"to :class:`types.GenericAlias` in Python." -msgstr "" diff --git a/c-api/typeobj.po b/c-api/typeobj.po index 2976f36003..8b3126f865 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-07 06:52+0000\n" +"POT-Creation-Date: 2020-06-20 18:08+0800\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-" @@ -1164,19 +1164,19 @@ msgstr "" #: ../../c-api/typeobj.rst:1073 ../../c-api/typeobj.rst:1092 #: ../../c-api/typeobj.rst:1115 ../../c-api/typeobj.rst:1162 #: ../../c-api/typeobj.rst:1177 ../../c-api/typeobj.rst:1245 -#: ../../c-api/typeobj.rst:1312 ../../c-api/typeobj.rst:1371 -#: ../../c-api/typeobj.rst:1401 ../../c-api/typeobj.rst:1433 -#: ../../c-api/typeobj.rst:1456 ../../c-api/typeobj.rst:1469 -#: ../../c-api/typeobj.rst:1484 ../../c-api/typeobj.rst:1498 -#: ../../c-api/typeobj.rst:1528 ../../c-api/typeobj.rst:1548 -#: ../../c-api/typeobj.rst:1574 ../../c-api/typeobj.rst:1592 -#: ../../c-api/typeobj.rst:1632 ../../c-api/typeobj.rst:1683 -#: ../../c-api/typeobj.rst:1700 ../../c-api/typeobj.rst:1738 -#: ../../c-api/typeobj.rst:1759 ../../c-api/typeobj.rst:1791 -#: ../../c-api/typeobj.rst:1808 ../../c-api/typeobj.rst:1819 -#: ../../c-api/typeobj.rst:1829 ../../c-api/typeobj.rst:1838 -#: ../../c-api/typeobj.rst:1848 ../../c-api/typeobj.rst:1862 -#: ../../c-api/typeobj.rst:1900 ../../c-api/typeobj.rst:1917 +#: ../../c-api/typeobj.rst:1306 ../../c-api/typeobj.rst:1365 +#: ../../c-api/typeobj.rst:1395 ../../c-api/typeobj.rst:1427 +#: ../../c-api/typeobj.rst:1450 ../../c-api/typeobj.rst:1463 +#: ../../c-api/typeobj.rst:1478 ../../c-api/typeobj.rst:1492 +#: ../../c-api/typeobj.rst:1522 ../../c-api/typeobj.rst:1542 +#: ../../c-api/typeobj.rst:1568 ../../c-api/typeobj.rst:1586 +#: ../../c-api/typeobj.rst:1626 ../../c-api/typeobj.rst:1677 +#: ../../c-api/typeobj.rst:1694 ../../c-api/typeobj.rst:1732 +#: ../../c-api/typeobj.rst:1753 ../../c-api/typeobj.rst:1785 +#: ../../c-api/typeobj.rst:1802 ../../c-api/typeobj.rst:1813 +#: ../../c-api/typeobj.rst:1823 ../../c-api/typeobj.rst:1832 +#: ../../c-api/typeobj.rst:1842 ../../c-api/typeobj.rst:1856 +#: ../../c-api/typeobj.rst:1894 ../../c-api/typeobj.rst:1911 msgid "**Inheritance:**" msgstr "" @@ -1220,10 +1220,10 @@ msgstr "" #: ../../c-api/typeobj.rst:533 ../../c-api/typeobj.rst:677 #: ../../c-api/typeobj.rst:799 ../../c-api/typeobj.rst:891 -#: ../../c-api/typeobj.rst:911 ../../c-api/typeobj.rst:1435 -#: ../../c-api/typeobj.rst:1458 ../../c-api/typeobj.rst:1576 -#: ../../c-api/typeobj.rst:1594 ../../c-api/typeobj.rst:1685 -#: ../../c-api/typeobj.rst:1793 ../../c-api/typeobj.rst:1902 +#: ../../c-api/typeobj.rst:911 ../../c-api/typeobj.rst:1429 +#: ../../c-api/typeobj.rst:1452 ../../c-api/typeobj.rst:1570 +#: ../../c-api/typeobj.rst:1588 ../../c-api/typeobj.rst:1679 +#: ../../c-api/typeobj.rst:1787 ../../c-api/typeobj.rst:1896 msgid "This field is inherited by subtypes." msgstr "" @@ -1540,11 +1540,11 @@ msgstr "" #: ../../c-api/typeobj.rst:801 ../../c-api/typeobj.rst:913 #: ../../c-api/typeobj.rst:938 ../../c-api/typeobj.rst:964 -#: ../../c-api/typeobj.rst:1006 ../../c-api/typeobj.rst:1380 -#: ../../c-api/typeobj.rst:1532 ../../c-api/typeobj.rst:1553 -#: ../../c-api/typeobj.rst:1651 ../../c-api/typeobj.rst:1687 -#: ../../c-api/typeobj.rst:1705 ../../c-api/typeobj.rst:1743 -#: ../../c-api/typeobj.rst:1764 ../../c-api/typeobj.rst:1795 +#: ../../c-api/typeobj.rst:1006 ../../c-api/typeobj.rst:1374 +#: ../../c-api/typeobj.rst:1526 ../../c-api/typeobj.rst:1547 +#: ../../c-api/typeobj.rst:1645 ../../c-api/typeobj.rst:1681 +#: ../../c-api/typeobj.rst:1699 ../../c-api/typeobj.rst:1737 +#: ../../c-api/typeobj.rst:1758 ../../c-api/typeobj.rst:1789 msgid "**Default:**" msgstr "" @@ -1629,7 +1629,7 @@ msgid "" "`PyObject_HashNotImplemented`." msgstr "" -#: ../../c-api/typeobj.rst:873 ../../c-api/typeobj.rst:1373 +#: ../../c-api/typeobj.rst:873 ../../c-api/typeobj.rst:1367 msgid "Group: :attr:`tp_hash`, :attr:`tp_richcompare`" msgstr "" @@ -1835,7 +1835,7 @@ msgid "" msgstr "" #: ../../c-api/typeobj.rst:1075 ../../c-api/typeobj.rst:1247 -#: ../../c-api/typeobj.rst:1314 +#: ../../c-api/typeobj.rst:1308 msgid "" "Group: :const:`Py_TPFLAGS_HAVE_GC`, :attr:`tp_traverse`, :attr:`tp_clear`" msgstr "" @@ -1944,7 +1944,7 @@ msgid "" "signature is::" msgstr "" -#: ../../c-api/typeobj.rst:1189 ../../c-api/typeobj.rst:1309 +#: ../../c-api/typeobj.rst:1189 ../../c-api/typeobj.rst:1303 msgid "" "More information about Python's garbage collection scheme can be found in " "section :ref:`supporting-cycle-detection`." @@ -2067,14 +2067,6 @@ msgstr "" #: ../../c-api/typeobj.rst:1297 msgid "" -"Note that :c:member:`~PyTypeObject.tp_clear` is not *always* called before " -"an instance is deallocated. For example, when reference counting is enough " -"to determine that an object is no longer used, the cyclic garbage collector " -"is not involved and :c:member:`~PyTypeObject.tp_dealloc` is called directly." -msgstr "" - -#: ../../c-api/typeobj.rst:1303 -msgid "" "Because the goal of :c:member:`~PyTypeObject.tp_clear` functions is to break " "reference cycles, it's not necessary to clear contained objects like Python " "strings or Python integers, which can't participate in reference cycles. On " @@ -2083,7 +2075,7 @@ msgid "" "invoke :c:member:`~PyTypeObject.tp_clear`." msgstr "" -#: ../../c-api/typeobj.rst:1316 +#: ../../c-api/typeobj.rst:1310 msgid "" "This field is inherited by subtypes together with :c:member:`~PyTypeObject." "tp_traverse` and the :const:`Py_TPFLAGS_HAVE_GC` flag bit: the flag bit, :c:" @@ -2091,18 +2083,18 @@ msgid "" "are all inherited from the base type if they are all zero in the subtype." msgstr "" -#: ../../c-api/typeobj.rst:1324 +#: ../../c-api/typeobj.rst:1318 msgid "" "An optional pointer to the rich comparison function, whose signature is::" msgstr "" -#: ../../c-api/typeobj.rst:1328 +#: ../../c-api/typeobj.rst:1322 msgid "" "The first parameter is guaranteed to be an instance of the type that is " "defined by :c:type:`PyTypeObject`." msgstr "" -#: ../../c-api/typeobj.rst:1331 +#: ../../c-api/typeobj.rst:1325 msgid "" "The function should return the result of the comparison (usually ``Py_True`` " "or ``Py_False``). If the comparison is undefined, it must return " @@ -2110,74 +2102,74 @@ msgid "" "set an exception condition." msgstr "" -#: ../../c-api/typeobj.rst:1336 +#: ../../c-api/typeobj.rst:1330 msgid "" "The following constants are defined to be used as the third argument for :c:" "member:`~PyTypeObject.tp_richcompare` and for :c:func:`PyObject_RichCompare`:" msgstr "" -#: ../../c-api/typeobj.rst:1340 +#: ../../c-api/typeobj.rst:1334 msgid "Constant" msgstr "" -#: ../../c-api/typeobj.rst:1340 +#: ../../c-api/typeobj.rst:1334 msgid "Comparison" msgstr "" -#: ../../c-api/typeobj.rst:1342 +#: ../../c-api/typeobj.rst:1336 msgid ":const:`Py_LT`" msgstr "" -#: ../../c-api/typeobj.rst:1342 +#: ../../c-api/typeobj.rst:1336 msgid "``<``" msgstr "" -#: ../../c-api/typeobj.rst:1344 +#: ../../c-api/typeobj.rst:1338 msgid ":const:`Py_LE`" msgstr "" -#: ../../c-api/typeobj.rst:1344 +#: ../../c-api/typeobj.rst:1338 msgid "``<=``" msgstr "" -#: ../../c-api/typeobj.rst:1346 +#: ../../c-api/typeobj.rst:1340 msgid ":const:`Py_EQ`" msgstr "" -#: ../../c-api/typeobj.rst:1346 +#: ../../c-api/typeobj.rst:1340 msgid "``==``" msgstr "" -#: ../../c-api/typeobj.rst:1348 +#: ../../c-api/typeobj.rst:1342 msgid ":const:`Py_NE`" msgstr "" -#: ../../c-api/typeobj.rst:1348 +#: ../../c-api/typeobj.rst:1342 msgid "``!=``" msgstr "" -#: ../../c-api/typeobj.rst:1350 +#: ../../c-api/typeobj.rst:1344 msgid ":const:`Py_GT`" msgstr "" -#: ../../c-api/typeobj.rst:1350 +#: ../../c-api/typeobj.rst:1344 msgid "``>``" msgstr "" -#: ../../c-api/typeobj.rst:1352 +#: ../../c-api/typeobj.rst:1346 msgid ":const:`Py_GE`" msgstr "" -#: ../../c-api/typeobj.rst:1352 +#: ../../c-api/typeobj.rst:1346 msgid "``>=``" msgstr "" -#: ../../c-api/typeobj.rst:1355 +#: ../../c-api/typeobj.rst:1349 msgid "" "The following macro is defined to ease writing rich comparison functions:" msgstr "" -#: ../../c-api/typeobj.rst:1359 +#: ../../c-api/typeobj.rst:1353 msgid "" "Return ``Py_True`` or ``Py_False`` from the function, depending on the " "result of a comparison. VAL_A and VAL_B must be orderable by C comparison " @@ -2185,15 +2177,15 @@ msgid "" "specifies the requested operation, as for :c:func:`PyObject_RichCompare`." msgstr "" -#: ../../c-api/typeobj.rst:1365 +#: ../../c-api/typeobj.rst:1359 msgid "The return value's reference count is properly incremented." msgstr "" -#: ../../c-api/typeobj.rst:1367 +#: ../../c-api/typeobj.rst:1361 msgid "On error, sets an exception and returns ``NULL`` from the function." msgstr "" -#: ../../c-api/typeobj.rst:1375 +#: ../../c-api/typeobj.rst:1369 msgid "" "This field is inherited by subtypes together with :c:member:`~PyTypeObject." "tp_hash`: a subtype inherits :c:member:`~PyTypeObject.tp_richcompare` and :c:" @@ -2201,7 +2193,7 @@ msgid "" "tp_richcompare` and :c:member:`~PyTypeObject.tp_hash` are both ``NULL``." msgstr "" -#: ../../c-api/typeobj.rst:1382 +#: ../../c-api/typeobj.rst:1376 msgid "" ":c:type:`PyBaseObject_Type` provides a :attr:`tp_richcompare` " "implementation, which may be inherited. However, if only :attr:`tp_hash` is " @@ -2209,23 +2201,23 @@ msgid "" "will not be able to participate in any comparisons." msgstr "" -#: ../../c-api/typeobj.rst:1391 +#: ../../c-api/typeobj.rst:1385 msgid "" "If the instances of this type are weakly referenceable, this field is " "greater than zero and contains the offset in the instance structure of the " "weak reference list head (ignoring the GC header, if present); this offset " "is used by :c:func:`PyObject_ClearWeakRefs` and the :c:func:`PyWeakref_\\*` " "functions. The instance structure needs to include a field of type :c:type:" -"`PyObject*` which is initialized to ``NULL``." +"`PyObject\\*` which is initialized to ``NULL``." msgstr "" -#: ../../c-api/typeobj.rst:1398 +#: ../../c-api/typeobj.rst:1392 msgid "" "Do not confuse this field with :c:member:`~PyTypeObject.tp_weaklist`; that " "is the list head for weak references to the type object itself." msgstr "" -#: ../../c-api/typeobj.rst:1403 +#: ../../c-api/typeobj.rst:1397 msgid "" "This field is inherited by subtypes, but see the rules listed below. A " "subtype may override this offset; this means that the subtype uses a " @@ -2234,7 +2226,7 @@ msgid "" "not be a problem." msgstr "" -#: ../../c-api/typeobj.rst:1408 +#: ../../c-api/typeobj.rst:1402 msgid "" "When a type defined by a class statement has no :attr:`~object.__slots__` " "declaration, and none of its base types are weakly referenceable, the type " @@ -2243,7 +2235,7 @@ msgid "" "tp_weaklistoffset` of that slot's offset." msgstr "" -#: ../../c-api/typeobj.rst:1413 +#: ../../c-api/typeobj.rst:1407 msgid "" "When a type's :attr:`__slots__` declaration contains a slot named :attr:" "`__weakref__`, that slot becomes the weak reference list head for instances " @@ -2251,31 +2243,31 @@ msgid "" "`~PyTypeObject.tp_weaklistoffset`." msgstr "" -#: ../../c-api/typeobj.rst:1418 +#: ../../c-api/typeobj.rst:1412 msgid "" "When a type's :attr:`__slots__` declaration does not contain a slot named :" "attr:`__weakref__`, the type inherits its :c:member:`~PyTypeObject." "tp_weaklistoffset` from its base type." msgstr "" -#: ../../c-api/typeobj.rst:1425 +#: ../../c-api/typeobj.rst:1419 msgid "" "An optional pointer to a function that returns an iterator for the object. " "Its presence normally signals that the instances of this type are iterable " "(although sequences may be iterable without this function)." msgstr "" -#: ../../c-api/typeobj.rst:1429 +#: ../../c-api/typeobj.rst:1423 msgid "This function has the same signature as :c:func:`PyObject_GetIter`::" msgstr "" -#: ../../c-api/typeobj.rst:1440 +#: ../../c-api/typeobj.rst:1434 msgid "" "An optional pointer to a function that returns the next item in an iterator. " "The signature is::" msgstr "" -#: ../../c-api/typeobj.rst:1445 +#: ../../c-api/typeobj.rst:1439 msgid "" "When the iterator is exhausted, it must return ``NULL``; a :exc:" "`StopIteration` exception may or may not be set. When another error occurs, " @@ -2283,74 +2275,74 @@ msgid "" "this type are iterators." msgstr "" -#: ../../c-api/typeobj.rst:1450 +#: ../../c-api/typeobj.rst:1444 msgid "" "Iterator types should also define the :c:member:`~PyTypeObject.tp_iter` " "function, and that function should return the iterator instance itself (not " "a new iterator instance)." msgstr "" -#: ../../c-api/typeobj.rst:1454 +#: ../../c-api/typeobj.rst:1448 msgid "This function has the same signature as :c:func:`PyIter_Next`." msgstr "" -#: ../../c-api/typeobj.rst:1463 +#: ../../c-api/typeobj.rst:1457 msgid "" "An optional pointer to a static ``NULL``-terminated array of :c:type:" "`PyMethodDef` structures, declaring regular methods of this type." msgstr "" -#: ../../c-api/typeobj.rst:1466 +#: ../../c-api/typeobj.rst:1460 msgid "" "For each entry in the array, an entry is added to the type's dictionary " "(see :c:member:`~PyTypeObject.tp_dict` below) containing a method descriptor." msgstr "" -#: ../../c-api/typeobj.rst:1471 +#: ../../c-api/typeobj.rst:1465 msgid "" "This field is not inherited by subtypes (methods are inherited through a " "different mechanism)." msgstr "" -#: ../../c-api/typeobj.rst:1477 +#: ../../c-api/typeobj.rst:1471 msgid "" "An optional pointer to a static ``NULL``-terminated array of :c:type:" "`PyMemberDef` structures, declaring regular data members (fields or slots) " "of instances of this type." msgstr "" -#: ../../c-api/typeobj.rst:1481 +#: ../../c-api/typeobj.rst:1475 msgid "" "For each entry in the array, an entry is added to the type's dictionary " "(see :c:member:`~PyTypeObject.tp_dict` below) containing a member descriptor." msgstr "" -#: ../../c-api/typeobj.rst:1486 +#: ../../c-api/typeobj.rst:1480 msgid "" "This field is not inherited by subtypes (members are inherited through a " "different mechanism)." msgstr "" -#: ../../c-api/typeobj.rst:1492 +#: ../../c-api/typeobj.rst:1486 msgid "" "An optional pointer to a static ``NULL``-terminated array of :c:type:" "`PyGetSetDef` structures, declaring computed attributes of instances of this " "type." msgstr "" -#: ../../c-api/typeobj.rst:1495 +#: ../../c-api/typeobj.rst:1489 msgid "" "For each entry in the array, an entry is added to the type's dictionary " "(see :c:member:`~PyTypeObject.tp_dict` below) containing a getset descriptor." msgstr "" -#: ../../c-api/typeobj.rst:1500 +#: ../../c-api/typeobj.rst:1494 msgid "" "This field is not inherited by subtypes (computed attributes are inherited " "through a different mechanism)." msgstr "" -#: ../../c-api/typeobj.rst:1506 +#: ../../c-api/typeobj.rst:1500 msgid "" "An optional pointer to a base type from which type properties are " "inherited. At this level, only single inheritance is supported; multiple " @@ -2358,7 +2350,7 @@ msgid "" "metatype." msgstr "" -#: ../../c-api/typeobj.rst:1514 +#: ../../c-api/typeobj.rst:1508 msgid "" "Slot initialization is subject to the rules of initializing globals. C99 " "requires the initializers to be \"address constants\". Function designators " @@ -2366,7 +2358,7 @@ msgid "" "valid C99 address constants." msgstr "" -#: ../../c-api/typeobj.rst:1519 +#: ../../c-api/typeobj.rst:1513 msgid "" "However, the unary '&' operator applied to a non-static variable like :c:" "func:`PyBaseObject_Type` is not required to produce an address constant. " @@ -2374,27 +2366,27 @@ msgid "" "strictly standard conforming in this particular behavior." msgstr "" -#: ../../c-api/typeobj.rst:1525 +#: ../../c-api/typeobj.rst:1519 msgid "" "Consequently, :c:member:`~PyTypeObject.tp_base` should be set in the " "extension module's init function." msgstr "" -#: ../../c-api/typeobj.rst:1530 +#: ../../c-api/typeobj.rst:1524 msgid "This field is not inherited by subtypes (obviously)." msgstr "" -#: ../../c-api/typeobj.rst:1534 +#: ../../c-api/typeobj.rst:1528 msgid "" "This field defaults to ``&PyBaseObject_Type`` (which to Python programmers " "is known as the type :class:`object`)." msgstr "" -#: ../../c-api/typeobj.rst:1540 +#: ../../c-api/typeobj.rst:1534 msgid "The type's dictionary is stored here by :c:func:`PyType_Ready`." msgstr "" -#: ../../c-api/typeobj.rst:1542 +#: ../../c-api/typeobj.rst:1536 msgid "" "This field should normally be initialized to ``NULL`` before PyType_Ready is " "called; it may also be initialized to a dictionary containing initial " @@ -2403,45 +2395,45 @@ msgid "" "they don't correspond to overloaded operations (like :meth:`__add__`)." msgstr "" -#: ../../c-api/typeobj.rst:1550 +#: ../../c-api/typeobj.rst:1544 msgid "" "This field is not inherited by subtypes (though the attributes defined in " "here are inherited through a different mechanism)." msgstr "" -#: ../../c-api/typeobj.rst:1555 +#: ../../c-api/typeobj.rst:1549 msgid "" "If this field is ``NULL``, :c:func:`PyType_Ready` will assign a new " "dictionary to it." msgstr "" -#: ../../c-api/typeobj.rst:1560 +#: ../../c-api/typeobj.rst:1554 msgid "" "It is not safe to use :c:func:`PyDict_SetItem` on or otherwise modify :c:" "member:`~PyTypeObject.tp_dict` with the dictionary C-API." msgstr "" -#: ../../c-api/typeobj.rst:1566 +#: ../../c-api/typeobj.rst:1560 msgid "An optional pointer to a \"descriptor get\" function." msgstr "" -#: ../../c-api/typeobj.rst:1568 ../../c-api/typeobj.rst:1584 -#: ../../c-api/typeobj.rst:1666 ../../c-api/typeobj.rst:1696 -#: ../../c-api/typeobj.rst:1720 +#: ../../c-api/typeobj.rst:1562 ../../c-api/typeobj.rst:1578 +#: ../../c-api/typeobj.rst:1660 ../../c-api/typeobj.rst:1690 +#: ../../c-api/typeobj.rst:1714 msgid "The function signature is::" msgstr "" -#: ../../c-api/typeobj.rst:1581 +#: ../../c-api/typeobj.rst:1575 msgid "" "An optional pointer to a function for setting and deleting a descriptor's " "value." msgstr "" -#: ../../c-api/typeobj.rst:1588 +#: ../../c-api/typeobj.rst:1582 msgid "The *value* argument is set to ``NULL`` to delete the value." msgstr "" -#: ../../c-api/typeobj.rst:1599 +#: ../../c-api/typeobj.rst:1593 msgid "" "If the instances of this type have a dictionary containing instance " "variables, this field is non-zero and contains the offset in the instances " @@ -2449,13 +2441,13 @@ msgid "" "func:`PyObject_GenericGetAttr`." msgstr "" -#: ../../c-api/typeobj.rst:1604 +#: ../../c-api/typeobj.rst:1598 msgid "" "Do not confuse this field with :c:member:`~PyTypeObject.tp_dict`; that is " "the dictionary for attributes of the type object itself." msgstr "" -#: ../../c-api/typeobj.rst:1607 +#: ../../c-api/typeobj.rst:1601 msgid "" "If the value of this field is greater than zero, it specifies the offset " "from the start of the instance structure. If the value is less than zero, " @@ -2471,13 +2463,13 @@ msgid "" "the very end of the structure." msgstr "" -#: ../../c-api/typeobj.rst:1619 +#: ../../c-api/typeobj.rst:1613 msgid "" "The real dictionary offset in an instance can be computed from a negative :c:" "member:`~PyTypeObject.tp_dictoffset` as follows::" msgstr "" -#: ../../c-api/typeobj.rst:1626 +#: ../../c-api/typeobj.rst:1620 msgid "" "where :c:member:`~PyTypeObject.tp_basicsize`, :c:member:`~PyTypeObject." "tp_itemsize` and :c:member:`~PyTypeObject.tp_dictoffset` are taken from the " @@ -2487,7 +2479,7 @@ msgid "" "it is done for you by :c:func:`_PyObject_GetDictPtr`.)" msgstr "" -#: ../../c-api/typeobj.rst:1634 +#: ../../c-api/typeobj.rst:1628 msgid "" "This field is inherited by subtypes, but see the rules listed below. A " "subtype may override this offset; this means that the subtype instances " @@ -2496,7 +2488,7 @@ msgid "" "should not be a problem." msgstr "" -#: ../../c-api/typeobj.rst:1639 +#: ../../c-api/typeobj.rst:1633 msgid "" "When a type defined by a class statement has no :attr:`~object.__slots__` " "declaration, and none of its base types has an instance variable dictionary, " @@ -2504,14 +2496,14 @@ msgid "" "`~PyTypeObject.tp_dictoffset` is set to that slot's offset." msgstr "" -#: ../../c-api/typeobj.rst:1644 +#: ../../c-api/typeobj.rst:1638 msgid "" "When a type defined by a class statement has a :attr:`__slots__` " "declaration, the type inherits its :c:member:`~PyTypeObject.tp_dictoffset` " "from its base type." msgstr "" -#: ../../c-api/typeobj.rst:1647 +#: ../../c-api/typeobj.rst:1641 msgid "" "(Adding a slot named :attr:`~object.__dict__` to the :attr:`__slots__` " "declaration does not have the expected effect, it just causes confusion. " @@ -2519,17 +2511,17 @@ msgid "" "though.)" msgstr "" -#: ../../c-api/typeobj.rst:1653 +#: ../../c-api/typeobj.rst:1647 msgid "" "This slot has no default. For static types, if the field is ``NULL`` then " "no :attr:`__dict__` gets created for instances." msgstr "" -#: ../../c-api/typeobj.rst:1659 +#: ../../c-api/typeobj.rst:1653 msgid "An optional pointer to an instance initialization function." msgstr "" -#: ../../c-api/typeobj.rst:1661 +#: ../../c-api/typeobj.rst:1655 msgid "" "This function corresponds to the :meth:`__init__` method of classes. Like :" "meth:`__init__`, it is possible to create an instance without calling :meth:" @@ -2537,14 +2529,14 @@ msgid "" "meth:`__init__` method again." msgstr "" -#: ../../c-api/typeobj.rst:1670 +#: ../../c-api/typeobj.rst:1664 msgid "" "The self argument is the instance to be initialized; the *args* and *kwds* " "arguments represent positional and keyword arguments of the call to :meth:" "`__init__`." msgstr "" -#: ../../c-api/typeobj.rst:1674 +#: ../../c-api/typeobj.rst:1668 msgid "" "The :c:member:`~PyTypeObject.tp_init` function, if not ``NULL``, is called " "when an instance is created normally by calling its type, after the type's :" @@ -2556,42 +2548,42 @@ msgid "" "subtype's :c:member:`~PyTypeObject.tp_init` is called." msgstr "" -#: ../../c-api/typeobj.rst:1681 +#: ../../c-api/typeobj.rst:1675 msgid "Returns ``0`` on success, ``-1`` and sets an exception on error." msgstr "" -#: ../../c-api/typeobj.rst:1689 +#: ../../c-api/typeobj.rst:1683 msgid "For static types this field does not have a default." msgstr "" -#: ../../c-api/typeobj.rst:1694 +#: ../../c-api/typeobj.rst:1688 msgid "An optional pointer to an instance allocation function." msgstr "" -#: ../../c-api/typeobj.rst:1702 +#: ../../c-api/typeobj.rst:1696 msgid "" "This field is inherited by static subtypes, but not by dynamic subtypes " "(subtypes created by a class statement)." msgstr "" -#: ../../c-api/typeobj.rst:1707 +#: ../../c-api/typeobj.rst:1701 msgid "" "For dynamic subtypes, this field is always set to :c:func:" "`PyType_GenericAlloc`, to force a standard heap allocation strategy." msgstr "" -#: ../../c-api/typeobj.rst:1711 +#: ../../c-api/typeobj.rst:1705 msgid "" "For static subtypes, :c:type:`PyBaseObject_Type` uses :c:func:" "`PyType_GenericAlloc`. That is the recommended value for all statically " "defined types." msgstr "" -#: ../../c-api/typeobj.rst:1718 +#: ../../c-api/typeobj.rst:1712 msgid "An optional pointer to an instance creation function." msgstr "" -#: ../../c-api/typeobj.rst:1724 +#: ../../c-api/typeobj.rst:1718 msgid "" "The *subtype* argument is the type of the object being created; the *args* " "and *kwds* arguments represent positional and keyword arguments of the call " @@ -2600,7 +2592,7 @@ msgid "" "that type (but not an unrelated type)." msgstr "" -#: ../../c-api/typeobj.rst:1730 +#: ../../c-api/typeobj.rst:1724 msgid "" "The :c:member:`~PyTypeObject.tp_new` function should call ``subtype-" ">tp_alloc(subtype, nitems)`` to allocate space for the object, and then do " @@ -2612,14 +2604,14 @@ msgid "" "be deferred to :c:member:`~PyTypeObject.tp_init`." msgstr "" -#: ../../c-api/typeobj.rst:1740 +#: ../../c-api/typeobj.rst:1734 msgid "" "This field is inherited by subtypes, except it is not inherited by static " "types whose :c:member:`~PyTypeObject.tp_base` is ``NULL`` or " "``&PyBaseObject_Type``." msgstr "" -#: ../../c-api/typeobj.rst:1745 +#: ../../c-api/typeobj.rst:1739 msgid "" "For static types this field has no default. This means if the slot is " "defined as ``NULL``, the type cannot be called to create new instances; " @@ -2627,39 +2619,39 @@ msgid "" "function." msgstr "" -#: ../../c-api/typeobj.rst:1753 +#: ../../c-api/typeobj.rst:1747 msgid "" "An optional pointer to an instance deallocation function. Its signature is::" msgstr "" -#: ../../c-api/typeobj.rst:1757 +#: ../../c-api/typeobj.rst:1751 msgid "" "An initializer that is compatible with this signature is :c:func:" "`PyObject_Free`." msgstr "" -#: ../../c-api/typeobj.rst:1761 +#: ../../c-api/typeobj.rst:1755 msgid "" "This field is inherited by static subtypes, but not by dynamic subtypes " "(subtypes created by a class statement)" msgstr "" -#: ../../c-api/typeobj.rst:1766 +#: ../../c-api/typeobj.rst:1760 msgid "" "In dynamic subtypes, this field is set to a deallocator suitable to match :c:" "func:`PyType_GenericAlloc` and the value of the :const:`Py_TPFLAGS_HAVE_GC` " "flag bit." msgstr "" -#: ../../c-api/typeobj.rst:1770 +#: ../../c-api/typeobj.rst:1764 msgid "For static subtypes, :c:type:`PyBaseObject_Type` uses PyObject_Del." msgstr "" -#: ../../c-api/typeobj.rst:1775 +#: ../../c-api/typeobj.rst:1769 msgid "An optional pointer to a function called by the garbage collector." msgstr "" -#: ../../c-api/typeobj.rst:1777 +#: ../../c-api/typeobj.rst:1771 msgid "" "The garbage collector needs to know whether a particular object is " "collectible or not. Normally, it is sufficient to look at the object's " @@ -2671,76 +2663,76 @@ msgid "" "instance. The signature is::" msgstr "" -#: ../../c-api/typeobj.rst:1787 +#: ../../c-api/typeobj.rst:1781 msgid "" "(The only example of this are types themselves. The metatype, :c:data:" "`PyType_Type`, defines this function to distinguish between statically and " "dynamically allocated types.)" msgstr "" -#: ../../c-api/typeobj.rst:1797 +#: ../../c-api/typeobj.rst:1791 msgid "" "This slot has no default. If this field is ``NULL``, :const:" "`Py_TPFLAGS_HAVE_GC` is used as the functional equivalent." msgstr "" -#: ../../c-api/typeobj.rst:1803 +#: ../../c-api/typeobj.rst:1797 msgid "Tuple of base types." msgstr "" -#: ../../c-api/typeobj.rst:1805 +#: ../../c-api/typeobj.rst:1799 msgid "" "This is set for types created by a class statement. It should be ``NULL`` " "for statically defined types." msgstr "" -#: ../../c-api/typeobj.rst:1810 ../../c-api/typeobj.rst:1831 -#: ../../c-api/typeobj.rst:1840 ../../c-api/typeobj.rst:1850 -#: ../../c-api/typeobj.rst:1864 +#: ../../c-api/typeobj.rst:1804 ../../c-api/typeobj.rst:1825 +#: ../../c-api/typeobj.rst:1834 ../../c-api/typeobj.rst:1844 +#: ../../c-api/typeobj.rst:1858 msgid "This field is not inherited." msgstr "" -#: ../../c-api/typeobj.rst:1815 +#: ../../c-api/typeobj.rst:1809 msgid "" "Tuple containing the expanded set of base types, starting with the type " "itself and ending with :class:`object`, in Method Resolution Order." msgstr "" -#: ../../c-api/typeobj.rst:1821 +#: ../../c-api/typeobj.rst:1815 msgid "" "This field is not inherited; it is calculated fresh by :c:func:" "`PyType_Ready`." msgstr "" -#: ../../c-api/typeobj.rst:1827 +#: ../../c-api/typeobj.rst:1821 msgid "Unused. Internal use only." msgstr "" -#: ../../c-api/typeobj.rst:1836 +#: ../../c-api/typeobj.rst:1830 msgid "List of weak references to subclasses. Internal use only." msgstr "" -#: ../../c-api/typeobj.rst:1845 +#: ../../c-api/typeobj.rst:1839 msgid "" "Weak reference list head, for weak references to this type object. Not " "inherited. Internal use only." msgstr "" -#: ../../c-api/typeobj.rst:1855 +#: ../../c-api/typeobj.rst:1849 msgid "" "This field is deprecated. Use :c:member:`~PyTypeObject.tp_finalize` instead." msgstr "" -#: ../../c-api/typeobj.rst:1860 +#: ../../c-api/typeobj.rst:1854 msgid "Used to index into the method cache. Internal use only." msgstr "" -#: ../../c-api/typeobj.rst:1869 +#: ../../c-api/typeobj.rst:1863 msgid "" "An optional pointer to an instance finalization function. Its signature is::" msgstr "" -#: ../../c-api/typeobj.rst:1873 +#: ../../c-api/typeobj.rst:1867 msgid "" "If :c:member:`~PyTypeObject.tp_finalize` is set, the interpreter calls it " "once when finalizing an instance. It is called either from the garbage " @@ -2750,24 +2742,24 @@ msgid "" "object in a sane state." msgstr "" -#: ../../c-api/typeobj.rst:1880 +#: ../../c-api/typeobj.rst:1874 msgid "" ":c:member:`~PyTypeObject.tp_finalize` should not mutate the current " "exception status; therefore, a recommended way to write a non-trivial " "finalizer is::" msgstr "" -#: ../../c-api/typeobj.rst:1897 +#: ../../c-api/typeobj.rst:1891 msgid "" "For this field to be taken into account (even through inheritance), you must " "also set the :const:`Py_TPFLAGS_HAVE_FINALIZE` flags bit." msgstr "" -#: ../../c-api/typeobj.rst:1906 +#: ../../c-api/typeobj.rst:1900 msgid "\"Safe object finalization\" (:pep:`442`)" msgstr "" -#: ../../c-api/typeobj.rst:1911 +#: ../../c-api/typeobj.rst:1905 msgid "" "Vectorcall function to use for calls of this type object. In other words, it " "is used to implement :ref:`vectorcall ` for ``type.__call__``. " @@ -2775,15 +2767,15 @@ msgid "" "attr:`__new__` and :attr:`__init__` is used." msgstr "" -#: ../../c-api/typeobj.rst:1919 +#: ../../c-api/typeobj.rst:1913 msgid "This field is never inherited." msgstr "" -#: ../../c-api/typeobj.rst:1921 +#: ../../c-api/typeobj.rst:1915 msgid "(the field exists since 3.8 but it's only used since 3.9)" msgstr "" -#: ../../c-api/typeobj.rst:1924 +#: ../../c-api/typeobj.rst:1918 msgid "" "Also, note that, in a garbage collected Python, :c:member:`~PyTypeObject." "tp_dealloc` may be called from any Python thread, not just the thread which " @@ -2796,77 +2788,77 @@ msgid "" "which called tp_dealloc will not violate any assumptions of the library." msgstr "" -#: ../../c-api/typeobj.rst:1938 +#: ../../c-api/typeobj.rst:1932 msgid "Heap Types" msgstr "" -#: ../../c-api/typeobj.rst:1940 +#: ../../c-api/typeobj.rst:1934 msgid "" "Traditionally, types defined in C code are *static*, that is, a static :c:" "type:`PyTypeObject` structure is defined directly in code and initialized " "using :c:func:`PyType_Ready`." msgstr "" -#: ../../c-api/typeobj.rst:1944 +#: ../../c-api/typeobj.rst:1938 msgid "" "This results in types that are limited relative to types defined in Python:" msgstr "" -#: ../../c-api/typeobj.rst:1946 +#: ../../c-api/typeobj.rst:1940 msgid "" "Static types are limited to one base, i.e. they cannot use multiple " "inheritance." msgstr "" -#: ../../c-api/typeobj.rst:1948 +#: ../../c-api/typeobj.rst:1942 msgid "" "Static type objects (but not necessarily their instances) are immutable. It " "is not possible to add or modify the type object's attributes from Python." msgstr "" -#: ../../c-api/typeobj.rst:1950 +#: ../../c-api/typeobj.rst:1944 msgid "" "Static type objects are shared across :ref:`sub-interpreters `, so they should not include any subinterpreter-" "specific state." msgstr "" -#: ../../c-api/typeobj.rst:1954 +#: ../../c-api/typeobj.rst:1948 msgid "" "Also, since :c:type:`PyTypeObject` is not part of the :ref:`stable ABI " "`, any extension modules using static types must be compiled for a " "specific Python minor version." msgstr "" -#: ../../c-api/typeobj.rst:1958 +#: ../../c-api/typeobj.rst:1952 msgid "" "An alternative to static types is *heap-allocated types*, or *heap types* " "for short, which correspond closely to classes created by Python's ``class`` " "statement." msgstr "" -#: ../../c-api/typeobj.rst:1962 +#: ../../c-api/typeobj.rst:1956 msgid "" "This is done by filling a :c:type:`PyType_Spec` structure and calling :c:" "func:`PyType_FromSpecWithBases`." msgstr "" -#: ../../c-api/typeobj.rst:1969 +#: ../../c-api/typeobj.rst:1963 msgid "Number Object Structures" msgstr "" -#: ../../c-api/typeobj.rst:1976 +#: ../../c-api/typeobj.rst:1970 msgid "" "This structure holds pointers to the functions which an object uses to " "implement the number protocol. Each function is used by the function of " "similar name documented in the :ref:`number` section." msgstr "" -#: ../../c-api/typeobj.rst:1982 ../../c-api/typeobj.rst:2306 +#: ../../c-api/typeobj.rst:1976 ../../c-api/typeobj.rst:2300 msgid "Here is the structure definition::" msgstr "" -#: ../../c-api/typeobj.rst:2029 +#: ../../c-api/typeobj.rst:2023 msgid "" "Binary and ternary functions must check the type of all their operands, and " "implement the necessary conversions (at least one of the operands is an " @@ -2876,30 +2868,30 @@ msgid "" "and set an exception." msgstr "" -#: ../../c-api/typeobj.rst:2038 +#: ../../c-api/typeobj.rst:2032 msgid "" "The :c:data:`nb_reserved` field should always be ``NULL``. It was " "previously called :c:data:`nb_long`, and was renamed in Python 3.0.1." msgstr "" -#: ../../c-api/typeobj.rst:2083 +#: ../../c-api/typeobj.rst:2077 msgid "Mapping Object Structures" msgstr "" -#: ../../c-api/typeobj.rst:2090 +#: ../../c-api/typeobj.rst:2084 msgid "" "This structure holds pointers to the functions which an object uses to " "implement the mapping protocol. It has three members:" msgstr "" -#: ../../c-api/typeobj.rst:2095 +#: ../../c-api/typeobj.rst:2089 msgid "" "This function is used by :c:func:`PyMapping_Size` and :c:func:" "`PyObject_Size`, and has the same signature. This slot may be set to " "``NULL`` if the object has no defined length." msgstr "" -#: ../../c-api/typeobj.rst:2101 +#: ../../c-api/typeobj.rst:2095 msgid "" "This function is used by :c:func:`PyObject_GetItem` and :c:func:" "`PySequence_GetSlice`, and has the same signature as :c:func:`!" @@ -2907,7 +2899,7 @@ msgid "" "`PyMapping_Check` function to return ``1``, it can be ``NULL`` otherwise." msgstr "" -#: ../../c-api/typeobj.rst:2109 +#: ../../c-api/typeobj.rst:2103 msgid "" "This function is used by :c:func:`PyObject_SetItem`, :c:func:" "`PyObject_DelItem`, :c:func:`PyObject_SetSlice` and :c:func:" @@ -2917,17 +2909,17 @@ msgid "" "deletion." msgstr "" -#: ../../c-api/typeobj.rst:2120 +#: ../../c-api/typeobj.rst:2114 msgid "Sequence Object Structures" msgstr "" -#: ../../c-api/typeobj.rst:2127 +#: ../../c-api/typeobj.rst:2121 msgid "" "This structure holds pointers to the functions which an object uses to " "implement the sequence protocol." msgstr "" -#: ../../c-api/typeobj.rst:2132 +#: ../../c-api/typeobj.rst:2126 msgid "" "This function is used by :c:func:`PySequence_Size` and :c:func:" "`PyObject_Size`, and has the same signature. It is also used for handling " @@ -2935,21 +2927,21 @@ msgid "" "member:`~PySequenceMethods.sq_ass_item` slots." msgstr "" -#: ../../c-api/typeobj.rst:2139 +#: ../../c-api/typeobj.rst:2133 msgid "" "This function is used by :c:func:`PySequence_Concat` and has the same " "signature. It is also used by the ``+`` operator, after trying the numeric " "addition via the :c:member:`~PyNumberMethods.nb_add` slot." msgstr "" -#: ../../c-api/typeobj.rst:2145 +#: ../../c-api/typeobj.rst:2139 msgid "" "This function is used by :c:func:`PySequence_Repeat` and has the same " "signature. It is also used by the ``*`` operator, after trying numeric " "multiplication via the :c:member:`~PyNumberMethods.nb_multiply` slot." msgstr "" -#: ../../c-api/typeobj.rst:2151 +#: ../../c-api/typeobj.rst:2145 msgid "" "This function is used by :c:func:`PySequence_GetItem` and has the same " "signature. It is also used by :c:func:`PyObject_GetItem`, after trying the " @@ -2958,7 +2950,7 @@ msgid "" "``1``, it can be ``NULL`` otherwise." msgstr "" -#: ../../c-api/typeobj.rst:2157 +#: ../../c-api/typeobj.rst:2151 msgid "" "Negative indexes are handled as follows: if the :attr:`sq_length` slot is " "filled, it is called and the sequence length is used to compute a positive " @@ -2966,7 +2958,7 @@ msgid "" "the index is passed as is to the function." msgstr "" -#: ../../c-api/typeobj.rst:2164 +#: ../../c-api/typeobj.rst:2158 msgid "" "This function is used by :c:func:`PySequence_SetItem` and has the same " "signature. It is also used by :c:func:`PyObject_SetItem` and :c:func:" @@ -2975,14 +2967,14 @@ msgid "" "``NULL`` if the object does not support item assignment and deletion." msgstr "" -#: ../../c-api/typeobj.rst:2173 +#: ../../c-api/typeobj.rst:2167 msgid "" "This function may be used by :c:func:`PySequence_Contains` and has the same " "signature. This slot may be left to ``NULL``, in this case :c:func:`!" "PySequence_Contains` simply traverses the sequence until it finds a match." msgstr "" -#: ../../c-api/typeobj.rst:2180 +#: ../../c-api/typeobj.rst:2174 msgid "" "This function is used by :c:func:`PySequence_InPlaceConcat` and has the same " "signature. It should modify its first operand, and return it. This slot " @@ -2992,7 +2984,7 @@ msgid "" "c:member:`~PyNumberMethods.nb_inplace_add` slot." msgstr "" -#: ../../c-api/typeobj.rst:2189 +#: ../../c-api/typeobj.rst:2183 msgid "" "This function is used by :c:func:`PySequence_InPlaceRepeat` and has the same " "signature. It should modify its first operand, and return it. This slot " @@ -3002,72 +2994,72 @@ msgid "" "via the :c:member:`~PyNumberMethods.nb_inplace_multiply` slot." msgstr "" -#: ../../c-api/typeobj.rst:2200 +#: ../../c-api/typeobj.rst:2194 msgid "Buffer Object Structures" msgstr "" -#: ../../c-api/typeobj.rst:2208 +#: ../../c-api/typeobj.rst:2202 msgid "" "This structure holds pointers to the functions required by the :ref:`Buffer " "protocol `. The protocol defines how an exporter object can " "expose its internal data to consumer objects." msgstr "" -#: ../../c-api/typeobj.rst:2214 ../../c-api/typeobj.rst:2263 -#: ../../c-api/typeobj.rst:2316 ../../c-api/typeobj.rst:2327 -#: ../../c-api/typeobj.rst:2338 +#: ../../c-api/typeobj.rst:2208 ../../c-api/typeobj.rst:2257 +#: ../../c-api/typeobj.rst:2310 ../../c-api/typeobj.rst:2321 +#: ../../c-api/typeobj.rst:2332 msgid "The signature of this function is::" msgstr "" -#: ../../c-api/typeobj.rst:2218 +#: ../../c-api/typeobj.rst:2212 msgid "" "Handle a request to *exporter* to fill in *view* as specified by *flags*. " "Except for point (3), an implementation of this function MUST take these " "steps:" msgstr "" -#: ../../c-api/typeobj.rst:2222 +#: ../../c-api/typeobj.rst:2216 msgid "" "Check if the request can be met. If not, raise :c:data:`PyExc_BufferError`, " "set :c:data:`view->obj` to ``NULL`` and return ``-1``." msgstr "" -#: ../../c-api/typeobj.rst:2225 +#: ../../c-api/typeobj.rst:2219 msgid "Fill in the requested fields." msgstr "" -#: ../../c-api/typeobj.rst:2227 +#: ../../c-api/typeobj.rst:2221 msgid "Increment an internal counter for the number of exports." msgstr "" -#: ../../c-api/typeobj.rst:2229 +#: ../../c-api/typeobj.rst:2223 msgid "" "Set :c:data:`view->obj` to *exporter* and increment :c:data:`view->obj`." msgstr "" -#: ../../c-api/typeobj.rst:2231 +#: ../../c-api/typeobj.rst:2225 msgid "Return ``0``." msgstr "" -#: ../../c-api/typeobj.rst:2233 +#: ../../c-api/typeobj.rst:2227 msgid "" "If *exporter* is part of a chain or tree of buffer providers, two main " "schemes can be used:" msgstr "" -#: ../../c-api/typeobj.rst:2236 +#: ../../c-api/typeobj.rst:2230 msgid "" "Re-export: Each member of the tree acts as the exporting object and sets :c:" "data:`view->obj` to a new reference to itself." msgstr "" -#: ../../c-api/typeobj.rst:2239 +#: ../../c-api/typeobj.rst:2233 msgid "" "Redirect: The buffer request is redirected to the root object of the tree. " "Here, :c:data:`view->obj` will be a new reference to the root object." msgstr "" -#: ../../c-api/typeobj.rst:2243 +#: ../../c-api/typeobj.rst:2237 msgid "" "The individual fields of *view* are described in section :ref:`Buffer " "structure `, the rules how an exporter must react to " @@ -3075,7 +3067,7 @@ msgid "" "types>`." msgstr "" -#: ../../c-api/typeobj.rst:2248 +#: ../../c-api/typeobj.rst:2242 msgid "" "All memory pointed to in the :c:type:`Py_buffer` structure belongs to the " "exporter and must remain valid until there are no consumers left. :c:member:" @@ -3084,19 +3076,19 @@ msgid "" "internal` are read-only for the consumer." msgstr "" -#: ../../c-api/typeobj.rst:2255 +#: ../../c-api/typeobj.rst:2249 msgid "" ":c:func:`PyBuffer_FillInfo` provides an easy way of exposing a simple bytes " "buffer while dealing correctly with all request types." msgstr "" -#: ../../c-api/typeobj.rst:2258 +#: ../../c-api/typeobj.rst:2252 msgid "" ":c:func:`PyObject_GetBuffer` is the interface for the consumer that wraps " "this function." msgstr "" -#: ../../c-api/typeobj.rst:2267 +#: ../../c-api/typeobj.rst:2261 msgid "" "Handle a request to release the resources of the buffer. If no resources " "need to be released, :c:member:`PyBufferProcs.bf_releasebuffer` may be " @@ -3104,15 +3096,15 @@ msgid "" "these optional steps:" msgstr "" -#: ../../c-api/typeobj.rst:2272 +#: ../../c-api/typeobj.rst:2266 msgid "Decrement an internal counter for the number of exports." msgstr "" -#: ../../c-api/typeobj.rst:2274 +#: ../../c-api/typeobj.rst:2268 msgid "If the counter is ``0``, free all memory associated with *view*." msgstr "" -#: ../../c-api/typeobj.rst:2276 +#: ../../c-api/typeobj.rst:2270 msgid "" "The exporter MUST use the :c:member:`~Py_buffer.internal` field to keep " "track of buffer-specific resources. This field is guaranteed to remain " @@ -3120,62 +3112,62 @@ msgid "" "*view* argument." msgstr "" -#: ../../c-api/typeobj.rst:2282 +#: ../../c-api/typeobj.rst:2276 msgid "" "This function MUST NOT decrement :c:data:`view->obj`, since that is done " "automatically in :c:func:`PyBuffer_Release` (this scheme is useful for " "breaking reference cycles)." msgstr "" -#: ../../c-api/typeobj.rst:2287 +#: ../../c-api/typeobj.rst:2281 msgid "" ":c:func:`PyBuffer_Release` is the interface for the consumer that wraps this " "function." msgstr "" -#: ../../c-api/typeobj.rst:2295 +#: ../../c-api/typeobj.rst:2289 msgid "Async Object Structures" msgstr "" -#: ../../c-api/typeobj.rst:2303 +#: ../../c-api/typeobj.rst:2297 msgid "" "This structure holds pointers to the functions required to implement :term:" "`awaitable` and :term:`asynchronous iterator` objects." msgstr "" -#: ../../c-api/typeobj.rst:2320 +#: ../../c-api/typeobj.rst:2314 msgid "" "The returned object must be an iterator, i.e. :c:func:`PyIter_Check` must " "return ``1`` for it." msgstr "" -#: ../../c-api/typeobj.rst:2323 +#: ../../c-api/typeobj.rst:2317 msgid "" "This slot may be set to ``NULL`` if an object is not an :term:`awaitable`." msgstr "" -#: ../../c-api/typeobj.rst:2331 +#: ../../c-api/typeobj.rst:2325 msgid "" "Must return an :term:`awaitable` object. See :meth:`__anext__` for details." msgstr "" -#: ../../c-api/typeobj.rst:2333 +#: ../../c-api/typeobj.rst:2327 msgid "" "This slot may be set to ``NULL`` if an object does not implement " "asynchronous iteration protocol." msgstr "" -#: ../../c-api/typeobj.rst:2342 +#: ../../c-api/typeobj.rst:2336 msgid "" "Must return an :term:`awaitable` object. See :meth:`__anext__` for details. " "This slot may be set to ``NULL``." msgstr "" -#: ../../c-api/typeobj.rst:2349 +#: ../../c-api/typeobj.rst:2343 msgid "Slot Type typedefs" msgstr "" -#: ../../c-api/typeobj.rst:2353 +#: ../../c-api/typeobj.rst:2347 msgid "" "The purpose of this function is to separate memory allocation from memory " "initialization. It should return a pointer to a block of memory of adequate " @@ -3189,76 +3181,76 @@ msgid "" "member:`~PyTypeObject.tp_basicsize`." msgstr "" -#: ../../c-api/typeobj.rst:2363 +#: ../../c-api/typeobj.rst:2357 msgid "" "This function should not do any other instance initialization, not even to " "allocate additional memory; that should be done by :c:member:`~PyTypeObject." "tp_new`." msgstr "" -#: ../../c-api/typeobj.rst:2370 +#: ../../c-api/typeobj.rst:2364 msgid "See :c:member:`~PyTypeObject.tp_free`." msgstr "" -#: ../../c-api/typeobj.rst:2374 +#: ../../c-api/typeobj.rst:2368 msgid "See :c:member:`~PyTypeObject.tp_new`." msgstr "" -#: ../../c-api/typeobj.rst:2378 +#: ../../c-api/typeobj.rst:2372 msgid "See :c:member:`~PyTypeObject.tp_init`." msgstr "" -#: ../../c-api/typeobj.rst:2382 +#: ../../c-api/typeobj.rst:2376 msgid "See :c:member:`~PyTypeObject.tp_repr`." msgstr "" -#: ../../c-api/typeobj.rst:2386 ../../c-api/typeobj.rst:2395 +#: ../../c-api/typeobj.rst:2380 ../../c-api/typeobj.rst:2389 msgid "Return the value of the named attribute for the object." msgstr "" -#: ../../c-api/typeobj.rst:2390 ../../c-api/typeobj.rst:2401 +#: ../../c-api/typeobj.rst:2384 ../../c-api/typeobj.rst:2395 msgid "" "Set the value of the named attribute for the object. The value argument is " "set to ``NULL`` to delete the attribute." msgstr "" -#: ../../c-api/typeobj.rst:2397 +#: ../../c-api/typeobj.rst:2391 msgid "See :c:member:`~PyTypeObject.tp_getattro`." msgstr "" -#: ../../c-api/typeobj.rst:2404 +#: ../../c-api/typeobj.rst:2398 msgid "See :c:member:`~PyTypeObject.tp_setattro`." msgstr "" -#: ../../c-api/typeobj.rst:2408 +#: ../../c-api/typeobj.rst:2402 msgid "See :c:member:`~PyTypeObject.tp_descrget`." msgstr "" -#: ../../c-api/typeobj.rst:2412 +#: ../../c-api/typeobj.rst:2406 msgid "See :c:member:`~PyTypeObject.tp_descrset`." msgstr "" -#: ../../c-api/typeobj.rst:2416 +#: ../../c-api/typeobj.rst:2410 msgid "See :c:member:`~PyTypeObject.tp_hash`." msgstr "" -#: ../../c-api/typeobj.rst:2420 +#: ../../c-api/typeobj.rst:2414 msgid "See :c:member:`~PyTypeObject.tp_richcompare`." msgstr "" -#: ../../c-api/typeobj.rst:2424 +#: ../../c-api/typeobj.rst:2418 msgid "See :c:member:`~PyTypeObject.tp_iter`." msgstr "" -#: ../../c-api/typeobj.rst:2428 +#: ../../c-api/typeobj.rst:2422 msgid "See :c:member:`~PyTypeObject.tp_iternext`." msgstr "" -#: ../../c-api/typeobj.rst:2454 +#: ../../c-api/typeobj.rst:2448 msgid "Examples" msgstr "" -#: ../../c-api/typeobj.rst:2456 +#: ../../c-api/typeobj.rst:2450 msgid "" "The following are simple examples of Python type definitions. They include " "common usage you may encounter. Some demonstrate tricky corner cases. For " @@ -3266,30 +3258,30 @@ msgid "" "and :ref:`new-types-topics`." msgstr "" -#: ../../c-api/typeobj.rst:2461 +#: ../../c-api/typeobj.rst:2455 msgid "A basic static type::" msgstr "" -#: ../../c-api/typeobj.rst:2478 +#: ../../c-api/typeobj.rst:2472 msgid "" "You may also find older code (especially in the CPython code base) with a " "more verbose initializer::" msgstr "" -#: ../../c-api/typeobj.rst:2522 +#: ../../c-api/typeobj.rst:2516 msgid "A type that supports weakrefs, instance dicts, and hashing::" msgstr "" -#: ../../c-api/typeobj.rst:2549 +#: ../../c-api/typeobj.rst:2543 msgid "" "A str subclass that cannot be subclassed and cannot be called to create " "instances (e.g. uses a separate factory func)::" msgstr "" -#: ../../c-api/typeobj.rst:2568 +#: ../../c-api/typeobj.rst:2562 msgid "The simplest static type (with fixed-length instances)::" msgstr "" -#: ../../c-api/typeobj.rst:2579 +#: ../../c-api/typeobj.rst:2573 msgid "The simplest static type (with variable-length instances)::" msgstr "" diff --git a/c-api/unicode.po b/c-api/unicode.po index 707ee2280f..2a9cd809fd 100644 --- a/c-api/unicode.po +++ b/c-api/unicode.po @@ -9,7 +9,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.7\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2021-09-07 06:52+0000\n" +"POT-Creation-Date: 2020-06-20 18:08+0800\n" "PO-Revision-Date: 2018-05-23 14:08+0000\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -42,23 +42,24 @@ msgstr "" msgid "" ":c:type:`Py_UNICODE*` and UTF-8 representations are created on demand and " "cached in the Unicode object. The :c:type:`Py_UNICODE*` representation is " -"deprecated and inefficient." +"deprecated and inefficient; it should be avoided in performance- or memory-" +"sensitive situations." msgstr "" -#: ../../c-api/unicode.rst:24 +#: ../../c-api/unicode.rst:25 msgid "" "Due to the transition between the old APIs and the new APIs, Unicode objects " "can internally be in two states depending on how they were created:" msgstr "" -#: ../../c-api/unicode.rst:27 +#: ../../c-api/unicode.rst:28 msgid "" "\"canonical\" Unicode objects are all objects created by a non-deprecated " "Unicode API. They use the most efficient representation allowed by the " "implementation." msgstr "" -#: ../../c-api/unicode.rst:31 +#: ../../c-api/unicode.rst:32 msgid "" "\"legacy\" Unicode objects have been created through one of the deprecated " "APIs (typically :c:func:`PyUnicode_FromUnicode`) and only bear the :c:type:" @@ -66,97 +67,86 @@ msgid "" "`PyUnicode_READY` on them before calling any other API." msgstr "" -#: ../../c-api/unicode.rst:37 -msgid "" -"The \"legacy\" Unicode object will be removed in Python 3.12 with deprecated " -"APIs. All Unicode objects will be \"canonical\" since then. See :pep:`623` " -"for more information." -msgstr "" - -#: ../../c-api/unicode.rst:43 +#: ../../c-api/unicode.rst:39 msgid "Unicode Type" msgstr "" -#: ../../c-api/unicode.rst:45 +#: ../../c-api/unicode.rst:41 msgid "" "These are the basic Unicode object types used for the Unicode implementation " "in Python:" msgstr "" -#: ../../c-api/unicode.rst:52 +#: ../../c-api/unicode.rst:48 msgid "" "These types are typedefs for unsigned integer types wide enough to contain " "characters of 32 bits, 16 bits and 8 bits, respectively. When dealing with " "single Unicode characters, use :c:type:`Py_UCS4`." msgstr "" -#: ../../c-api/unicode.rst:61 +#: ../../c-api/unicode.rst:57 msgid "" "This is a typedef of :c:type:`wchar_t`, which is a 16-bit type or 32-bit " "type depending on the platform." msgstr "" -#: ../../c-api/unicode.rst:64 +#: ../../c-api/unicode.rst:60 msgid "" "In previous versions, this was a 16-bit type or a 32-bit type depending on " "whether you selected a \"narrow\" or \"wide\" Unicode version of Python at " "build time." msgstr "" -#: ../../c-api/unicode.rst:74 +#: ../../c-api/unicode.rst:70 msgid "" "These subtypes of :c:type:`PyObject` represent a Python Unicode object. In " "almost all cases, they shouldn't be used directly, since all API functions " "that deal with Unicode objects take and return :c:type:`PyObject` pointers." msgstr "" -#: ../../c-api/unicode.rst:83 +#: ../../c-api/unicode.rst:79 msgid "" "This instance of :c:type:`PyTypeObject` represents the Python Unicode type. " "It is exposed to Python code as ``str``." msgstr "" -#: ../../c-api/unicode.rst:87 +#: ../../c-api/unicode.rst:83 msgid "" "The following APIs are really C macros and can be used to do fast checks and " "to access internal read-only data of Unicode objects:" msgstr "" -#: ../../c-api/unicode.rst:92 +#: ../../c-api/unicode.rst:88 msgid "" "Return true if the object *o* is a Unicode object or an instance of a " -"Unicode subtype. This function always succeeds." +"Unicode subtype." msgstr "" -#: ../../c-api/unicode.rst:98 +#: ../../c-api/unicode.rst:94 msgid "" "Return true if the object *o* is a Unicode object, but not an instance of a " -"subtype. This function always succeeds." +"subtype." msgstr "" -#: ../../c-api/unicode.rst:104 +#: ../../c-api/unicode.rst:100 msgid "" "Ensure the string object *o* is in the \"canonical\" representation. This " "is required before using any of the access macros described below." msgstr "" -#: ../../c-api/unicode.rst:109 +#: ../../c-api/unicode.rst:105 msgid "" "Returns ``0`` on success and ``-1`` with an exception set on failure, which " "in particular happens if memory allocation fails." msgstr "" -#: ../../c-api/unicode.rst:115 -msgid "This API will be removed with :c:func:`PyUnicode_FromUnicode`." -msgstr "" - -#: ../../c-api/unicode.rst:120 +#: ../../c-api/unicode.rst:113 msgid "" "Return the length of the Unicode string, in code points. *o* has to be a " "Unicode object in the \"canonical\" representation (not checked)." msgstr "" -#: ../../c-api/unicode.rst:130 +#: ../../c-api/unicode.rst:123 msgid "" "Return a pointer to the canonical representation cast to UCS1, UCS2 or UCS4 " "integer types for direct character access. No checks are performed if the " @@ -165,28 +155,24 @@ msgid "" "`PyUnicode_READY` has been called before accessing this." msgstr "" -#: ../../c-api/unicode.rst:144 +#: ../../c-api/unicode.rst:137 msgid "Return values of the :c:func:`PyUnicode_KIND` macro." msgstr "" -#: ../../c-api/unicode.rst:149 -msgid "``PyUnicode_WCHAR_KIND`` is deprecated." -msgstr "" - -#: ../../c-api/unicode.rst:154 +#: ../../c-api/unicode.rst:144 msgid "" "Return one of the PyUnicode kind constants (see above) that indicate how " "many bytes per character this Unicode object uses to store its data. *o* " "has to be a Unicode object in the \"canonical\" representation (not checked)." msgstr "" -#: ../../c-api/unicode.rst:165 +#: ../../c-api/unicode.rst:155 msgid "" "Return a void pointer to the raw Unicode buffer. *o* has to be a Unicode " "object in the \"canonical\" representation (not checked)." msgstr "" -#: ../../c-api/unicode.rst:174 +#: ../../c-api/unicode.rst:164 msgid "" "Write into a canonical representation *data* (as obtained with :c:func:" "`PyUnicode_DATA`). This macro does not do any sanity checks and is intended " @@ -196,47 +182,46 @@ msgid "" "written to that location." msgstr "" -#: ../../c-api/unicode.rst:186 +#: ../../c-api/unicode.rst:176 msgid "" "Read a code point from a canonical representation *data* (as obtained with :" "c:func:`PyUnicode_DATA`). No checks or ready calls are performed." msgstr "" -#: ../../c-api/unicode.rst:194 +#: ../../c-api/unicode.rst:184 msgid "" "Read a character from a Unicode object *o*, which must be in the \"canonical" "\" representation. This is less efficient than :c:func:`PyUnicode_READ` if " "you do multiple consecutive reads." msgstr "" -#: ../../c-api/unicode.rst:203 +#: ../../c-api/unicode.rst:193 msgid "" "Return the maximum code point that is suitable for creating another string " "based on *o*, which must be in the \"canonical\" representation. This is " "always an approximation but more efficient than iterating over the string." msgstr "" -#: ../../c-api/unicode.rst:212 +#: ../../c-api/unicode.rst:202 msgid "" "Return the size of the deprecated :c:type:`Py_UNICODE` representation, in " "code units (this includes surrogate pairs as 2 units). *o* has to be a " "Unicode object (not checked)." msgstr "" -#: ../../c-api/unicode.rst:218 ../../c-api/unicode.rst:228 -#: ../../c-api/unicode.rst:772 +#: ../../c-api/unicode.rst:208 ../../c-api/unicode.rst:218 msgid "" "Part of the old-style Unicode API, please migrate to using :c:func:" "`PyUnicode_GET_LENGTH`." msgstr "" -#: ../../c-api/unicode.rst:223 +#: ../../c-api/unicode.rst:213 msgid "" "Return the size of the deprecated :c:type:`Py_UNICODE` representation in " "bytes. *o* has to be a Unicode object (not checked)." msgstr "" -#: ../../c-api/unicode.rst:234 +#: ../../c-api/unicode.rst:224 msgid "" "Return a pointer to a :c:type:`Py_UNICODE` representation of the object. " "The returned buffer is always terminated with an extra null code point. It " @@ -246,7 +231,7 @@ msgid "" "object (not checked)." msgstr "" -#: ../../c-api/unicode.rst:241 +#: ../../c-api/unicode.rst:231 msgid "" "This macro is now inefficient -- because in many cases the :c:type:" "`Py_UNICODE` representation does not exist and needs to be created -- and " @@ -255,83 +240,83 @@ msgid "" "`PyUnicode_WRITE` or :c:func:`PyUnicode_READ`." msgstr "" -#: ../../c-api/unicode.rst:250 +#: ../../c-api/unicode.rst:240 msgid "" "Part of the old-style Unicode API, please migrate to using the :c:func:" "`PyUnicode_nBYTE_DATA` family of macros." msgstr "" -#: ../../c-api/unicode.rst:255 +#: ../../c-api/unicode.rst:245 msgid "" "Return ``1`` if the string is a valid identifier according to the language " "definition, section :ref:`identifiers`. Return ``0`` otherwise." msgstr "" -#: ../../c-api/unicode.rst:258 +#: ../../c-api/unicode.rst:248 msgid "" "The function does not call :c:func:`Py_FatalError` anymore if the string is " "not ready." msgstr "" -#: ../../c-api/unicode.rst:264 +#: ../../c-api/unicode.rst:254 msgid "Unicode Character Properties" msgstr "" -#: ../../c-api/unicode.rst:266 +#: ../../c-api/unicode.rst:256 msgid "" "Unicode provides many different character properties. The most often needed " "ones are available through these macros which are mapped to C functions " "depending on the Python configuration." msgstr "" -#: ../../c-api/unicode.rst:273 +#: ../../c-api/unicode.rst:263 msgid "" "Return ``1`` or ``0`` depending on whether *ch* is a whitespace character." msgstr "" -#: ../../c-api/unicode.rst:278 +#: ../../c-api/unicode.rst:268 msgid "" "Return ``1`` or ``0`` depending on whether *ch* is a lowercase character." msgstr "" -#: ../../c-api/unicode.rst:283 +#: ../../c-api/unicode.rst:273 msgid "" "Return ``1`` or ``0`` depending on whether *ch* is an uppercase character." msgstr "" -#: ../../c-api/unicode.rst:288 +#: ../../c-api/unicode.rst:278 msgid "" "Return ``1`` or ``0`` depending on whether *ch* is a titlecase character." msgstr "" -#: ../../c-api/unicode.rst:293 +#: ../../c-api/unicode.rst:283 msgid "" "Return ``1`` or ``0`` depending on whether *ch* is a linebreak character." msgstr "" -#: ../../c-api/unicode.rst:298 +#: ../../c-api/unicode.rst:288 msgid "Return ``1`` or ``0`` depending on whether *ch* is a decimal character." msgstr "" -#: ../../c-api/unicode.rst:303 +#: ../../c-api/unicode.rst:293 msgid "Return ``1`` or ``0`` depending on whether *ch* is a digit character." msgstr "" -#: ../../c-api/unicode.rst:308 +#: ../../c-api/unicode.rst:298 msgid "Return ``1`` or ``0`` depending on whether *ch* is a numeric character." msgstr "" -#: ../../c-api/unicode.rst:313 +#: ../../c-api/unicode.rst:303 msgid "" "Return ``1`` or ``0`` depending on whether *ch* is an alphabetic character." msgstr "" -#: ../../c-api/unicode.rst:318 +#: ../../c-api/unicode.rst:308 msgid "" "Return ``1`` or ``0`` depending on whether *ch* is an alphanumeric character." msgstr "" -#: ../../c-api/unicode.rst:323 +#: ../../c-api/unicode.rst:313 msgid "" "Return ``1`` or ``0`` depending on whether *ch* is a printable character. " "Nonprintable characters are those characters defined in the Unicode " @@ -342,92 +327,92 @@ msgid "" "to :data:`sys.stdout` or :data:`sys.stderr`.)" msgstr "" -#: ../../c-api/unicode.rst:332 +#: ../../c-api/unicode.rst:322 msgid "These APIs can be used for fast direct character conversions:" msgstr "" -#: ../../c-api/unicode.rst:337 +#: ../../c-api/unicode.rst:327 msgid "Return the character *ch* converted to lower case." msgstr "" -#: ../../c-api/unicode.rst:339 ../../c-api/unicode.rst:347 -#: ../../c-api/unicode.rst:355 +#: ../../c-api/unicode.rst:329 ../../c-api/unicode.rst:337 +#: ../../c-api/unicode.rst:345 msgid "This function uses simple case mappings." msgstr "" -#: ../../c-api/unicode.rst:345 +#: ../../c-api/unicode.rst:335 msgid "Return the character *ch* converted to upper case." msgstr "" -#: ../../c-api/unicode.rst:353 +#: ../../c-api/unicode.rst:343 msgid "Return the character *ch* converted to title case." msgstr "" -#: ../../c-api/unicode.rst:361 +#: ../../c-api/unicode.rst:351 msgid "" "Return the character *ch* converted to a decimal positive integer. Return " "``-1`` if this is not possible. This macro does not raise exceptions." msgstr "" -#: ../../c-api/unicode.rst:367 +#: ../../c-api/unicode.rst:357 msgid "" "Return the character *ch* converted to a single digit integer. Return ``-1`` " "if this is not possible. This macro does not raise exceptions." msgstr "" -#: ../../c-api/unicode.rst:373 +#: ../../c-api/unicode.rst:363 msgid "" "Return the character *ch* converted to a double. Return ``-1.0`` if this is " "not possible. This macro does not raise exceptions." msgstr "" -#: ../../c-api/unicode.rst:377 +#: ../../c-api/unicode.rst:367 msgid "These APIs can be used to work with surrogates:" msgstr "" -#: ../../c-api/unicode.rst:381 +#: ../../c-api/unicode.rst:371 msgid "Check if *ch* is a surrogate (``0xD800 <= ch <= 0xDFFF``)." msgstr "" -#: ../../c-api/unicode.rst:385 +#: ../../c-api/unicode.rst:375 msgid "Check if *ch* is a high surrogate (``0xD800 <= ch <= 0xDBFF``)." msgstr "" -#: ../../c-api/unicode.rst:389 +#: ../../c-api/unicode.rst:379 msgid "Check if *ch* is a low surrogate (``0xDC00 <= ch <= 0xDFFF``)." msgstr "" -#: ../../c-api/unicode.rst:393 +#: ../../c-api/unicode.rst:383 msgid "" "Join two surrogate characters and return a single Py_UCS4 value. *high* and " "*low* are respectively the leading and trailing surrogates in a surrogate " "pair." msgstr "" -#: ../../c-api/unicode.rst:399 +#: ../../c-api/unicode.rst:389 msgid "Creating and accessing Unicode strings" msgstr "" -#: ../../c-api/unicode.rst:401 +#: ../../c-api/unicode.rst:391 msgid "" "To create Unicode objects and access their basic sequence properties, use " "these APIs:" msgstr "" -#: ../../c-api/unicode.rst:406 +#: ../../c-api/unicode.rst:396 msgid "" "Create a new Unicode object. *maxchar* should be the true maximum code " "point to be placed in the string. As an approximation, it can be rounded up " "to the nearest value in the sequence 127, 255, 65535, 1114111." msgstr "" -#: ../../c-api/unicode.rst:410 +#: ../../c-api/unicode.rst:400 msgid "" "This is the recommended way to allocate a new Unicode object. Objects " "created using this function are not resizable." msgstr "" -#: ../../c-api/unicode.rst:419 +#: ../../c-api/unicode.rst:409 msgid "" "Create a new Unicode object with the given *kind* (possible values are :c:" "macro:`PyUnicode_1BYTE_KIND` etc., as returned by :c:func:" @@ -435,7 +420,7 @@ msgid "" "1, 2 or 4 bytes per character, as given by the kind." msgstr "" -#: ../../c-api/unicode.rst:429 +#: ../../c-api/unicode.rst:419 msgid "" "Create a Unicode object from the char buffer *u*. The bytes will be " "interpreted as being UTF-8 encoded. The buffer is copied into the new " @@ -443,20 +428,19 @@ msgid "" "object, i.e. modification of the data is not allowed." msgstr "" -#: ../../c-api/unicode.rst:434 +#: ../../c-api/unicode.rst:424 msgid "" "If *u* is ``NULL``, this function behaves like :c:func:" "`PyUnicode_FromUnicode` with the buffer set to ``NULL``. This usage is " -"deprecated in favor of :c:func:`PyUnicode_New`, and will be removed in " -"Python 3.12." +"deprecated in favor of :c:func:`PyUnicode_New`." msgstr "" -#: ../../c-api/unicode.rst:441 +#: ../../c-api/unicode.rst:431 msgid "" "Create a Unicode object from a UTF-8 encoded null-terminated char buffer *u*." msgstr "" -#: ../../c-api/unicode.rst:447 +#: ../../c-api/unicode.rst:437 msgid "" "Take a C :c:func:`printf`\\ -style *format* string and a variable number of " "arguments, calculate the size of the resulting Python Unicode string and " @@ -465,262 +449,262 @@ msgid "" "*format* ASCII-encoded string. The following format characters are allowed:" msgstr "" -#: ../../c-api/unicode.rst:462 +#: ../../c-api/unicode.rst:452 msgid "Format Characters" msgstr "" -#: ../../c-api/unicode.rst:462 +#: ../../c-api/unicode.rst:452 msgid "Type" msgstr "" -#: ../../c-api/unicode.rst:462 +#: ../../c-api/unicode.rst:452 msgid "Comment" msgstr "" -#: ../../c-api/unicode.rst:464 +#: ../../c-api/unicode.rst:454 msgid ":attr:`%%`" msgstr "" -#: ../../c-api/unicode.rst:464 +#: ../../c-api/unicode.rst:454 msgid "*n/a*" msgstr "" -#: ../../c-api/unicode.rst:464 +#: ../../c-api/unicode.rst:454 msgid "The literal % character." msgstr "" -#: ../../c-api/unicode.rst:466 +#: ../../c-api/unicode.rst:456 msgid ":attr:`%c`" msgstr "" -#: ../../c-api/unicode.rst:466 ../../c-api/unicode.rst:469 -#: ../../c-api/unicode.rst:502 ../../c-api/unicode.rst:505 +#: ../../c-api/unicode.rst:456 ../../c-api/unicode.rst:459 +#: ../../c-api/unicode.rst:492 ../../c-api/unicode.rst:495 msgid "int" msgstr "int" -#: ../../c-api/unicode.rst:466 +#: ../../c-api/unicode.rst:456 msgid "A single character, represented as a C int." msgstr "" -#: ../../c-api/unicode.rst:469 +#: ../../c-api/unicode.rst:459 msgid ":attr:`%d`" msgstr "" -#: ../../c-api/unicode.rst:469 +#: ../../c-api/unicode.rst:459 msgid "Equivalent to ``printf(\"%d\")``. [1]_" msgstr "" -#: ../../c-api/unicode.rst:472 +#: ../../c-api/unicode.rst:462 msgid ":attr:`%u`" msgstr "" -#: ../../c-api/unicode.rst:472 +#: ../../c-api/unicode.rst:462 msgid "unsigned int" msgstr "unsigned int" -#: ../../c-api/unicode.rst:472 +#: ../../c-api/unicode.rst:462 msgid "Equivalent to ``printf(\"%u\")``. [1]_" msgstr "" -#: ../../c-api/unicode.rst:475 +#: ../../c-api/unicode.rst:465 msgid ":attr:`%ld`" msgstr "" -#: ../../c-api/unicode.rst:475 ../../c-api/unicode.rst:478 +#: ../../c-api/unicode.rst:465 ../../c-api/unicode.rst:468 msgid "long" msgstr "" -#: ../../c-api/unicode.rst:475 +#: ../../c-api/unicode.rst:465 msgid "Equivalent to ``printf(\"%ld\")``. [1]_" msgstr "" -#: ../../c-api/unicode.rst:478 +#: ../../c-api/unicode.rst:468 msgid ":attr:`%li`" msgstr "" -#: ../../c-api/unicode.rst:478 +#: ../../c-api/unicode.rst:468 msgid "Equivalent to ``printf(\"%li\")``. [1]_" msgstr "" -#: ../../c-api/unicode.rst:481 +#: ../../c-api/unicode.rst:471 msgid ":attr:`%lu`" msgstr "" -#: ../../c-api/unicode.rst:481 +#: ../../c-api/unicode.rst:471 msgid "unsigned long" msgstr "unsigned long" -#: ../../c-api/unicode.rst:481 +#: ../../c-api/unicode.rst:471 msgid "Equivalent to ``printf(\"%lu\")``. [1]_" msgstr "" -#: ../../c-api/unicode.rst:484 +#: ../../c-api/unicode.rst:474 msgid ":attr:`%lld`" msgstr "" -#: ../../c-api/unicode.rst:484 ../../c-api/unicode.rst:487 +#: ../../c-api/unicode.rst:474 ../../c-api/unicode.rst:477 msgid "long long" msgstr "" -#: ../../c-api/unicode.rst:484 +#: ../../c-api/unicode.rst:474 msgid "Equivalent to ``printf(\"%lld\")``. [1]_" msgstr "" -#: ../../c-api/unicode.rst:487 +#: ../../c-api/unicode.rst:477 msgid ":attr:`%lli`" msgstr "" -#: ../../c-api/unicode.rst:487 +#: ../../c-api/unicode.rst:477 msgid "Equivalent to ``printf(\"%lli\")``. [1]_" msgstr "" -#: ../../c-api/unicode.rst:490 +#: ../../c-api/unicode.rst:480 msgid ":attr:`%llu`" msgstr "" -#: ../../c-api/unicode.rst:490 +#: ../../c-api/unicode.rst:480 msgid "unsigned long long" msgstr "unsigned long long" -#: ../../c-api/unicode.rst:490 +#: ../../c-api/unicode.rst:480 msgid "Equivalent to ``printf(\"%llu\")``. [1]_" msgstr "" -#: ../../c-api/unicode.rst:493 +#: ../../c-api/unicode.rst:483 msgid ":attr:`%zd`" msgstr "" -#: ../../c-api/unicode.rst:493 ../../c-api/unicode.rst:496 +#: ../../c-api/unicode.rst:483 ../../c-api/unicode.rst:486 msgid "Py_ssize_t" msgstr "" -#: ../../c-api/unicode.rst:493 +#: ../../c-api/unicode.rst:483 msgid "Equivalent to ``printf(\"%zd\")``. [1]_" msgstr "" -#: ../../c-api/unicode.rst:496 +#: ../../c-api/unicode.rst:486 msgid ":attr:`%zi`" msgstr "" -#: ../../c-api/unicode.rst:496 +#: ../../c-api/unicode.rst:486 msgid "Equivalent to ``printf(\"%zi\")``. [1]_" msgstr "" -#: ../../c-api/unicode.rst:499 +#: ../../c-api/unicode.rst:489 msgid ":attr:`%zu`" msgstr "" -#: ../../c-api/unicode.rst:499 +#: ../../c-api/unicode.rst:489 msgid "size_t" msgstr "" -#: ../../c-api/unicode.rst:499 +#: ../../c-api/unicode.rst:489 msgid "Equivalent to ``printf(\"%zu\")``. [1]_" msgstr "" -#: ../../c-api/unicode.rst:502 +#: ../../c-api/unicode.rst:492 msgid ":attr:`%i`" msgstr "" -#: ../../c-api/unicode.rst:502 +#: ../../c-api/unicode.rst:492 msgid "Equivalent to ``printf(\"%i\")``. [1]_" msgstr "" -#: ../../c-api/unicode.rst:505 +#: ../../c-api/unicode.rst:495 msgid ":attr:`%x`" msgstr "" -#: ../../c-api/unicode.rst:505 +#: ../../c-api/unicode.rst:495 msgid "Equivalent to ``printf(\"%x\")``. [1]_" msgstr "" -#: ../../c-api/unicode.rst:508 +#: ../../c-api/unicode.rst:498 msgid ":attr:`%s`" msgstr "" -#: ../../c-api/unicode.rst:508 +#: ../../c-api/unicode.rst:498 msgid "const char\\*" msgstr "" -#: ../../c-api/unicode.rst:508 +#: ../../c-api/unicode.rst:498 msgid "A null-terminated C character array." msgstr "" -#: ../../c-api/unicode.rst:511 +#: ../../c-api/unicode.rst:501 msgid ":attr:`%p`" msgstr "" -#: ../../c-api/unicode.rst:511 +#: ../../c-api/unicode.rst:501 msgid "const void\\*" msgstr "" -#: ../../c-api/unicode.rst:511 +#: ../../c-api/unicode.rst:501 msgid "" "The hex representation of a C pointer. Mostly equivalent to ``printf(\"%p" "\")`` except that it is guaranteed to start with the literal ``0x`` " "regardless of what the platform's ``printf`` yields." msgstr "" -#: ../../c-api/unicode.rst:519 +#: ../../c-api/unicode.rst:509 msgid ":attr:`%A`" msgstr "" -#: ../../c-api/unicode.rst:519 ../../c-api/unicode.rst:522 -#: ../../c-api/unicode.rst:531 ../../c-api/unicode.rst:534 +#: ../../c-api/unicode.rst:509 ../../c-api/unicode.rst:512 +#: ../../c-api/unicode.rst:521 ../../c-api/unicode.rst:524 msgid "PyObject\\*" msgstr "" -#: ../../c-api/unicode.rst:519 +#: ../../c-api/unicode.rst:509 msgid "The result of calling :func:`ascii`." msgstr "" -#: ../../c-api/unicode.rst:522 +#: ../../c-api/unicode.rst:512 msgid ":attr:`%U`" msgstr "" -#: ../../c-api/unicode.rst:522 +#: ../../c-api/unicode.rst:512 #, fuzzy msgid "A Unicode object." msgstr "Unicode物件與編碼" -#: ../../c-api/unicode.rst:524 +#: ../../c-api/unicode.rst:514 msgid ":attr:`%V`" msgstr "" -#: ../../c-api/unicode.rst:524 +#: ../../c-api/unicode.rst:514 msgid "PyObject\\*, const char\\*" msgstr "" -#: ../../c-api/unicode.rst:524 +#: ../../c-api/unicode.rst:514 msgid "" "A Unicode object (which may be ``NULL``) and a null-terminated C character " "array as a second parameter (which will be used, if the first parameter is " "``NULL``)." msgstr "" -#: ../../c-api/unicode.rst:531 +#: ../../c-api/unicode.rst:521 msgid ":attr:`%S`" msgstr "" -#: ../../c-api/unicode.rst:531 +#: ../../c-api/unicode.rst:521 msgid "The result of calling :c:func:`PyObject_Str`." msgstr "" -#: ../../c-api/unicode.rst:534 +#: ../../c-api/unicode.rst:524 msgid ":attr:`%R`" msgstr "" -#: ../../c-api/unicode.rst:534 +#: ../../c-api/unicode.rst:524 msgid "The result of calling :c:func:`PyObject_Repr`." msgstr "" -#: ../../c-api/unicode.rst:538 +#: ../../c-api/unicode.rst:528 msgid "" "An unrecognized format character causes all the rest of the format string to " "be copied as-is to the result string, and any extra arguments discarded." msgstr "" -#: ../../c-api/unicode.rst:542 +#: ../../c-api/unicode.rst:532 msgid "" "The width formatter unit is number of characters rather than bytes. The " "precision formatter unit is number of bytes for ``\"%s\"`` and ``\"%V\"`` " @@ -729,37 +713,37 @@ msgid "" "``PyObject*`` argument is not ``NULL``)." msgstr "" -#: ../../c-api/unicode.rst:548 +#: ../../c-api/unicode.rst:538 msgid "" "For integer specifiers (d, u, ld, li, lu, lld, lli, llu, zd, zi, zu, i, x): " "the 0-conversion flag has effect even when a precision is given." msgstr "" -#: ../../c-api/unicode.rst:551 +#: ../../c-api/unicode.rst:541 msgid "Support for ``\"%lld\"`` and ``\"%llu\"`` added." msgstr "" -#: ../../c-api/unicode.rst:554 +#: ../../c-api/unicode.rst:544 msgid "Support for ``\"%li\"``, ``\"%lli\"`` and ``\"%zi\"`` added." msgstr "" -#: ../../c-api/unicode.rst:557 +#: ../../c-api/unicode.rst:547 msgid "" "Support width and precision formatter for ``\"%s\"``, ``\"%A\"``, ``\"%U" "\"``, ``\"%V\"``, ``\"%S\"``, ``\"%R\"`` added." msgstr "" -#: ../../c-api/unicode.rst:564 +#: ../../c-api/unicode.rst:554 msgid "" "Identical to :c:func:`PyUnicode_FromFormat` except that it takes exactly two " "arguments." msgstr "" -#: ../../c-api/unicode.rst:571 +#: ../../c-api/unicode.rst:561 msgid "Decode an encoded object *obj* to a Unicode object." msgstr "" -#: ../../c-api/unicode.rst:573 +#: ../../c-api/unicode.rst:563 msgid "" ":class:`bytes`, :class:`bytearray` and other :term:`bytes-like objects " "` are decoded according to the given *encoding* and using " @@ -767,23 +751,23 @@ msgid "" "interface use the default values (see :ref:`builtincodecs` for details)." msgstr "" -#: ../../c-api/unicode.rst:579 +#: ../../c-api/unicode.rst:569 msgid "" "All other objects, including Unicode objects, cause a :exc:`TypeError` to be " "set." msgstr "" -#: ../../c-api/unicode.rst:582 +#: ../../c-api/unicode.rst:572 msgid "" "The API returns ``NULL`` if there was an error. The caller is responsible " "for decref'ing the returned objects." msgstr "" -#: ../../c-api/unicode.rst:588 +#: ../../c-api/unicode.rst:578 msgid "Return the length of the Unicode object, in code points." msgstr "" -#: ../../c-api/unicode.rst:599 +#: ../../c-api/unicode.rst:589 msgid "" "Copy characters from one Unicode object into another. This function " "performs character conversion when necessary and falls back to :c:func:" @@ -791,52 +775,52 @@ msgid "" "otherwise returns the number of copied characters." msgstr "" -#: ../../c-api/unicode.rst:610 +#: ../../c-api/unicode.rst:600 msgid "" "Fill a string with a character: write *fill_char* into ``unicode[start:start" "+length]``." msgstr "" -#: ../../c-api/unicode.rst:613 +#: ../../c-api/unicode.rst:603 msgid "" "Fail if *fill_char* is bigger than the string maximum character, or if the " "string has more than 1 reference." msgstr "" -#: ../../c-api/unicode.rst:616 +#: ../../c-api/unicode.rst:606 msgid "" "Return the number of written character, or return ``-1`` and raise an " "exception on error." msgstr "" -#: ../../c-api/unicode.rst:625 +#: ../../c-api/unicode.rst:615 msgid "" "Write a character to a string. The string must have been created through :c:" "func:`PyUnicode_New`. Since Unicode strings are supposed to be immutable, " "the string must not be shared, or have been hashed yet." msgstr "" -#: ../../c-api/unicode.rst:629 +#: ../../c-api/unicode.rst:619 msgid "" "This function checks that *unicode* is a Unicode object, that the index is " "not out of bounds, and that the object can be modified safely (i.e. that it " "its reference count is one)." msgstr "" -#: ../../c-api/unicode.rst:638 +#: ../../c-api/unicode.rst:628 msgid "" "Read a character from a string. This function checks that *unicode* is a " "Unicode object and the index is not out of bounds, in contrast to the macro " "version :c:func:`PyUnicode_READ_CHAR`." msgstr "" -#: ../../c-api/unicode.rst:648 +#: ../../c-api/unicode.rst:638 msgid "" "Return a substring of *str*, from character index *start* (included) to " "character index *end* (excluded). Negative indices are not supported." msgstr "" -#: ../../c-api/unicode.rst:657 +#: ../../c-api/unicode.rst:647 msgid "" "Copy the string *u* into a UCS4 buffer, including a null character, if " "*copy_null* is set. Returns ``NULL`` and sets an exception on error (in " @@ -844,7 +828,7 @@ msgid "" "*u*). *buffer* is returned on success." msgstr "" -#: ../../c-api/unicode.rst:667 +#: ../../c-api/unicode.rst:657 msgid "" "Copy the string *u* into a new UCS4 buffer that is allocated using :c:func:" "`PyMem_Malloc`. If this fails, ``NULL`` is returned with a :exc:" @@ -852,11 +836,11 @@ msgid "" "appended." msgstr "" -#: ../../c-api/unicode.rst:676 +#: ../../c-api/unicode.rst:666 msgid "Deprecated Py_UNICODE APIs" msgstr "" -#: ../../c-api/unicode.rst:680 +#: ../../c-api/unicode.rst:670 msgid "" "These API functions are deprecated with the implementation of :pep:`393`. " "Extension modules can continue using them, as they will not be removed in " @@ -864,7 +848,7 @@ msgid "" "and memory hits." msgstr "" -#: ../../c-api/unicode.rst:687 +#: ../../c-api/unicode.rst:677 msgid "" "Create a Unicode object from the Py_UNICODE buffer *u* of the given size. " "*u* may be ``NULL`` which causes the contents to be undefined. It is the " @@ -872,28 +856,27 @@ msgid "" "the new object." msgstr "" -#: ../../c-api/unicode.rst:692 +#: ../../c-api/unicode.rst:682 msgid "" "If the buffer is not ``NULL``, the return value might be a shared object. " "Therefore, modification of the resulting Unicode object is only allowed when " "*u* is ``NULL``." msgstr "" -#: ../../c-api/unicode.rst:696 +#: ../../c-api/unicode.rst:686 msgid "" "If the buffer is ``NULL``, :c:func:`PyUnicode_READY` must be called once the " "string content has been filled before using any of the access macros such " "as :c:func:`PyUnicode_KIND`." msgstr "" -#: ../../c-api/unicode.rst:703 +#: ../../c-api/unicode.rst:690 msgid "" -"Part of the old-style Unicode API, please migrate to using :c:func:" -"`PyUnicode_FromKindAndData`, :c:func:`PyUnicode_FromWideChar`, or :c:func:" -"`PyUnicode_New`." +"Please migrate to using :c:func:`PyUnicode_FromKindAndData`, :c:func:" +"`PyUnicode_FromWideChar` or :c:func:`PyUnicode_New`." msgstr "" -#: ../../c-api/unicode.rst:708 +#: ../../c-api/unicode.rst:696 msgid "" "Return a read-only pointer to the Unicode object's internal :c:type:" "`Py_UNICODE` buffer, or ``NULL`` on error. This will create the :c:type:" @@ -904,27 +887,20 @@ msgid "" "functions." msgstr "" -#: ../../c-api/unicode.rst:720 ../../c-api/unicode.rst:748 +#: ../../c-api/unicode.rst:704 msgid "" -"Part of the old-style Unicode API, please migrate to using :c:func:" -"`PyUnicode_AsUCS4`, :c:func:`PyUnicode_AsWideChar`, :c:func:" -"`PyUnicode_ReadChar` or similar new APIs." +"Please migrate to using :c:func:`PyUnicode_AsUCS4`, :c:func:" +"`PyUnicode_AsWideChar`, :c:func:`PyUnicode_ReadChar` or similar new APIs." msgstr "" -#: ../../c-api/unicode.rst:726 +#: ../../c-api/unicode.rst:711 msgid "" "Create a Unicode object by replacing all decimal digits in :c:type:" "`Py_UNICODE` buffer of the given *size* by ASCII digits 0--9 according to " "their decimal value. Return ``NULL`` if an exception occurs." msgstr "" -#: ../../c-api/unicode.rst:732 -msgid "" -"Part of the old-style :c:type:`Py_UNICODE` API; please migrate to using :c:" -"func:`Py_UNICODE_TODECIMAL`." -msgstr "" - -#: ../../c-api/unicode.rst:737 +#: ../../c-api/unicode.rst:718 msgid "" "Like :c:func:`PyUnicode_AsUnicode`, but also saves the :c:func:`Py_UNICODE` " "array length (excluding the extra null terminator) in *size*. Note that the " @@ -933,7 +909,7 @@ msgid "" "functions." msgstr "" -#: ../../c-api/unicode.rst:753 +#: ../../c-api/unicode.rst:729 msgid "" "Create a copy of a Unicode string ending with a null code point. Return " "``NULL`` and raise a :exc:`MemoryError` exception on memory allocation " @@ -943,40 +919,44 @@ msgid "" "truncated when used in most C functions." msgstr "" -#: ../../c-api/unicode.rst:762 +#: ../../c-api/unicode.rst:738 msgid "" "Please migrate to using :c:func:`PyUnicode_AsUCS4Copy` or similar new APIs." msgstr "" -#: ../../c-api/unicode.rst:767 +#: ../../c-api/unicode.rst:743 msgid "" "Return the size of the deprecated :c:type:`Py_UNICODE` representation, in " "code units (this includes surrogate pairs as 2 units)." msgstr "" -#: ../../c-api/unicode.rst:777 +#: ../../c-api/unicode.rst:746 +msgid "Please migrate to using :c:func:`PyUnicode_GetLength`." +msgstr "" + +#: ../../c-api/unicode.rst:751 msgid "" "Copy an instance of a Unicode subtype to a new true Unicode object if " "necessary. If *obj* is already a true Unicode object (not a subtype), return " "the reference with incremented refcount." msgstr "" -#: ../../c-api/unicode.rst:781 +#: ../../c-api/unicode.rst:755 msgid "" "Objects other than Unicode or its subtypes will cause a :exc:`TypeError`." msgstr "" -#: ../../c-api/unicode.rst:785 +#: ../../c-api/unicode.rst:759 msgid "Locale Encoding" msgstr "" -#: ../../c-api/unicode.rst:787 +#: ../../c-api/unicode.rst:761 msgid "" "The current locale encoding can be used to decode text from the operating " "system." msgstr "" -#: ../../c-api/unicode.rst:794 +#: ../../c-api/unicode.rst:768 msgid "" "Decode a string from UTF-8 on Android and VxWorks, or from the current " "locale encoding on other platforms. The supported error handlers are ``" @@ -985,22 +965,22 @@ msgid "" "null character but cannot contain embedded null characters." msgstr "" -#: ../../c-api/unicode.rst:801 +#: ../../c-api/unicode.rst:775 msgid "" "Use :c:func:`PyUnicode_DecodeFSDefaultAndSize` to decode a string from :c:" "data:`Py_FileSystemDefaultEncoding` (the locale encoding read at Python " "startup)." msgstr "" -#: ../../c-api/unicode.rst:805 ../../c-api/unicode.rst:841 +#: ../../c-api/unicode.rst:779 ../../c-api/unicode.rst:815 msgid "This function ignores the Python UTF-8 mode." msgstr "" -#: ../../c-api/unicode.rst:809 ../../c-api/unicode.rst:913 +#: ../../c-api/unicode.rst:783 ../../c-api/unicode.rst:887 msgid "The :c:func:`Py_DecodeLocale` function." msgstr "" -#: ../../c-api/unicode.rst:813 +#: ../../c-api/unicode.rst:787 msgid "" "The function now also uses the current locale encoding for the " "``surrogateescape`` error handler, except on Android. Previously, :c:func:" @@ -1008,13 +988,13 @@ msgid "" "locale encoding was used for ``strict``." msgstr "" -#: ../../c-api/unicode.rst:822 +#: ../../c-api/unicode.rst:796 msgid "" "Similar to :c:func:`PyUnicode_DecodeLocaleAndSize`, but compute the string " "length using :c:func:`strlen`." msgstr "" -#: ../../c-api/unicode.rst:830 +#: ../../c-api/unicode.rst:804 msgid "" "Encode a Unicode object to UTF-8 on Android and VxWorks, or to the current " "locale encoding on other platforms. The supported error handlers are ``" @@ -1023,17 +1003,17 @@ msgid "" "object. *unicode* cannot contain embedded null characters." msgstr "" -#: ../../c-api/unicode.rst:837 +#: ../../c-api/unicode.rst:811 msgid "" "Use :c:func:`PyUnicode_EncodeFSDefault` to encode a string to :c:data:" "`Py_FileSystemDefaultEncoding` (the locale encoding read at Python startup)." msgstr "" -#: ../../c-api/unicode.rst:845 ../../c-api/unicode.rst:949 +#: ../../c-api/unicode.rst:819 ../../c-api/unicode.rst:923 msgid "The :c:func:`Py_EncodeLocale` function." msgstr "" -#: ../../c-api/unicode.rst:849 +#: ../../c-api/unicode.rst:823 msgid "" "The function now also uses the current locale encoding for the " "``surrogateescape`` error handler, except on Android. Previously, :c:func:" @@ -1041,11 +1021,11 @@ msgid "" "locale encoding was used for ``strict``." msgstr "" -#: ../../c-api/unicode.rst:858 +#: ../../c-api/unicode.rst:832 msgid "File System Encoding" msgstr "" -#: ../../c-api/unicode.rst:860 +#: ../../c-api/unicode.rst:834 msgid "" "To encode and decode file names and other environment strings, :c:data:" "`Py_FileSystemDefaultEncoding` should be used as the encoding, and :c:data:" @@ -1055,7 +1035,7 @@ msgid "" "`PyUnicode_FSConverter` as the conversion function:" msgstr "" -#: ../../c-api/unicode.rst:869 +#: ../../c-api/unicode.rst:843 msgid "" "ParseTuple converter: encode :class:`str` objects -- obtained directly or " "through the :class:`os.PathLike` interface -- to :class:`bytes` using :c:" @@ -1064,18 +1044,18 @@ msgid "" "is no longer used." msgstr "" -#: ../../c-api/unicode.rst:877 ../../c-api/unicode.rst:894 +#: ../../c-api/unicode.rst:851 ../../c-api/unicode.rst:868 msgid "Accepts a :term:`path-like object`." msgstr "" -#: ../../c-api/unicode.rst:880 +#: ../../c-api/unicode.rst:854 msgid "" "To decode file names to :class:`str` during argument parsing, the ``\"O&\"`` " "converter should be used, passing :c:func:`PyUnicode_FSDecoder` as the " "conversion function:" msgstr "" -#: ../../c-api/unicode.rst:886 +#: ../../c-api/unicode.rst:860 msgid "" "ParseTuple converter: decode :class:`bytes` objects -- obtained either " "directly or indirectly through the :class:`os.PathLike` interface -- to :" @@ -1084,20 +1064,20 @@ msgid "" "which must be released when it is no longer used." msgstr "" -#: ../../c-api/unicode.rst:900 +#: ../../c-api/unicode.rst:874 msgid "" "Decode a string using :c:data:`Py_FileSystemDefaultEncoding` and the :c:data:" "`Py_FileSystemDefaultEncodeErrors` error handler." msgstr "" -#: ../../c-api/unicode.rst:903 ../../c-api/unicode.rst:924 -#: ../../c-api/unicode.rst:940 +#: ../../c-api/unicode.rst:877 ../../c-api/unicode.rst:898 +#: ../../c-api/unicode.rst:914 msgid "" "If :c:data:`Py_FileSystemDefaultEncoding` is not set, fall back to the " "locale encoding." msgstr "" -#: ../../c-api/unicode.rst:906 +#: ../../c-api/unicode.rst:880 msgid "" ":c:data:`Py_FileSystemDefaultEncoding` is initialized at startup from the " "locale encoding and cannot be modified later. If you need to decode a string " @@ -1105,23 +1085,23 @@ msgid "" "`PyUnicode_DecodeLocaleAndSize`." msgstr "" -#: ../../c-api/unicode.rst:915 ../../c-api/unicode.rst:929 -#: ../../c-api/unicode.rst:953 +#: ../../c-api/unicode.rst:889 ../../c-api/unicode.rst:903 +#: ../../c-api/unicode.rst:927 msgid "Use :c:data:`Py_FileSystemDefaultEncodeErrors` error handler." msgstr "" -#: ../../c-api/unicode.rst:921 +#: ../../c-api/unicode.rst:895 msgid "" "Decode a null-terminated string using :c:data:`Py_FileSystemDefaultEncoding` " "and the :c:data:`Py_FileSystemDefaultEncodeErrors` error handler." msgstr "" -#: ../../c-api/unicode.rst:927 +#: ../../c-api/unicode.rst:901 msgid "" "Use :c:func:`PyUnicode_DecodeFSDefaultAndSize` if you know the string length." msgstr "" -#: ../../c-api/unicode.rst:935 +#: ../../c-api/unicode.rst:909 msgid "" "Encode a Unicode object to :c:data:`Py_FileSystemDefaultEncoding` with the :" "c:data:`Py_FileSystemDefaultEncodeErrors` error handler, and return :class:" @@ -1129,29 +1109,29 @@ msgid "" "bytes." msgstr "" -#: ../../c-api/unicode.rst:943 +#: ../../c-api/unicode.rst:917 msgid "" ":c:data:`Py_FileSystemDefaultEncoding` is initialized at startup from the " "locale encoding and cannot be modified later. If you need to encode a string " "to the current locale encoding, use :c:func:`PyUnicode_EncodeLocale`." msgstr "" -#: ../../c-api/unicode.rst:957 +#: ../../c-api/unicode.rst:931 msgid "wchar_t Support" msgstr "" -#: ../../c-api/unicode.rst:959 +#: ../../c-api/unicode.rst:933 msgid ":c:type:`wchar_t` support for platforms which support it:" msgstr "" -#: ../../c-api/unicode.rst:963 +#: ../../c-api/unicode.rst:937 msgid "" "Create a Unicode object from the :c:type:`wchar_t` buffer *w* of the given " "*size*. Passing ``-1`` as the *size* indicates that the function must itself " "compute the length, using wcslen. Return ``NULL`` on failure." msgstr "" -#: ../../c-api/unicode.rst:971 +#: ../../c-api/unicode.rst:945 msgid "" "Copy the Unicode object contents into the :c:type:`wchar_t` buffer *w*. At " "most *size* :c:type:`wchar_t` characters are copied (excluding a possibly " @@ -1164,7 +1144,7 @@ msgid "" "would cause the string to be truncated when used with most C functions." msgstr "" -#: ../../c-api/unicode.rst:984 +#: ../../c-api/unicode.rst:958 msgid "" "Convert the Unicode object to a wide character string. The output string " "always ends with a null character. If *size* is not ``NULL``, write the " @@ -1175,7 +1155,7 @@ msgid "" "`wchar_t*` string contains null characters a :exc:`ValueError` is raised." msgstr "" -#: ../../c-api/unicode.rst:992 +#: ../../c-api/unicode.rst:966 msgid "" "Returns a buffer allocated by :c:func:`PyMem_Alloc` (use :c:func:" "`PyMem_Free` to free it) on success. On error, returns ``NULL`` and *" @@ -1183,30 +1163,30 @@ msgid "" "failed." msgstr "" -#: ../../c-api/unicode.rst:999 +#: ../../c-api/unicode.rst:973 msgid "" "Raises a :exc:`ValueError` if *size* is ``NULL`` and the :c:type:`wchar_t*` " "string contains null characters." msgstr "" -#: ../../c-api/unicode.rst:1007 +#: ../../c-api/unicode.rst:981 msgid "Built-in Codecs" msgstr "" -#: ../../c-api/unicode.rst:1009 +#: ../../c-api/unicode.rst:983 msgid "" "Python provides a set of built-in codecs which are written in C for speed. " "All of these codecs are directly usable via the following functions." msgstr "" -#: ../../c-api/unicode.rst:1012 +#: ../../c-api/unicode.rst:986 msgid "" "Many of the following APIs take two arguments encoding and errors, and they " "have the same semantics as the ones of the built-in :func:`str` string " "object constructor." msgstr "" -#: ../../c-api/unicode.rst:1016 +#: ../../c-api/unicode.rst:990 msgid "" "Setting encoding to ``NULL`` causes the default encoding to be used which is " "UTF-8. The file system calls should use :c:func:`PyUnicode_FSConverter` for " @@ -1217,28 +1197,28 @@ msgid "" "setlocale)." msgstr "" -#: ../../c-api/unicode.rst:1024 +#: ../../c-api/unicode.rst:998 msgid "" "Error handling is set by errors which may also be set to ``NULL`` meaning to " "use the default handling defined for the codec. Default error handling for " "all built-in codecs is \"strict\" (:exc:`ValueError` is raised)." msgstr "" -#: ../../c-api/unicode.rst:1028 +#: ../../c-api/unicode.rst:1002 msgid "" "The codecs all use a similar interface. Only deviation from the following " "generic ones are documented for simplicity." msgstr "" -#: ../../c-api/unicode.rst:1033 +#: ../../c-api/unicode.rst:1007 msgid "Generic Codecs" msgstr "" -#: ../../c-api/unicode.rst:1035 +#: ../../c-api/unicode.rst:1009 msgid "These are the generic codec APIs:" msgstr "" -#: ../../c-api/unicode.rst:1041 +#: ../../c-api/unicode.rst:1015 msgid "" "Create a Unicode object by decoding *size* bytes of the encoded string *s*. " "*encoding* and *errors* have the same meaning as the parameters of the same " @@ -1247,7 +1227,7 @@ msgid "" "raised by the codec." msgstr "" -#: ../../c-api/unicode.rst:1051 +#: ../../c-api/unicode.rst:1025 msgid "" "Encode a Unicode object and return the result as Python bytes object. " "*encoding* and *errors* have the same meaning as the parameters of the same " @@ -1256,7 +1236,7 @@ msgid "" "was raised by the codec." msgstr "" -#: ../../c-api/unicode.rst:1061 +#: ../../c-api/unicode.rst:1035 msgid "" "Encode the :c:type:`Py_UNICODE` buffer *s* of the given *size* and return a " "Python bytes object. *encoding* and *errors* have the same meaning as the " @@ -1265,27 +1245,27 @@ msgid "" "``NULL`` if an exception was raised by the codec." msgstr "" -#: ../../c-api/unicode.rst:1069 ../../c-api/unicode.rst:1326 +#: ../../c-api/unicode.rst:1043 ../../c-api/unicode.rst:1300 msgid "" "Part of the old-style :c:type:`Py_UNICODE` API; please migrate to using :c:" "func:`PyUnicode_AsEncodedString`." msgstr "" -#: ../../c-api/unicode.rst:1073 +#: ../../c-api/unicode.rst:1047 msgid "UTF-8 Codecs" msgstr "" -#: ../../c-api/unicode.rst:1075 +#: ../../c-api/unicode.rst:1049 msgid "These are the UTF-8 codec APIs:" msgstr "" -#: ../../c-api/unicode.rst:1080 +#: ../../c-api/unicode.rst:1054 msgid "" "Create a Unicode object by decoding *size* bytes of the UTF-8 encoded string " "*s*. Return ``NULL`` if an exception was raised by the codec." msgstr "" -#: ../../c-api/unicode.rst:1087 +#: ../../c-api/unicode.rst:1061 msgid "" "If *consumed* is ``NULL``, behave like :c:func:`PyUnicode_DecodeUTF8`. If " "*consumed* is not ``NULL``, trailing incomplete UTF-8 byte sequences will " @@ -1293,14 +1273,14 @@ msgid "" "of bytes that have been decoded will be stored in *consumed*." msgstr "" -#: ../../c-api/unicode.rst:1095 +#: ../../c-api/unicode.rst:1069 msgid "" "Encode a Unicode object using UTF-8 and return the result as Python bytes " "object. Error handling is \"strict\". Return ``NULL`` if an exception was " "raised by the codec." msgstr "" -#: ../../c-api/unicode.rst:1102 +#: ../../c-api/unicode.rst:1076 msgid "" "Return a pointer to the UTF-8 encoding of the Unicode object, and store the " "size of the encoded representation (in bytes) in *size*. The *size* " @@ -1309,63 +1289,63 @@ msgid "" "regardless of whether there are any other null code points." msgstr "" -#: ../../c-api/unicode.rst:1108 +#: ../../c-api/unicode.rst:1082 msgid "" "In the case of an error, ``NULL`` is returned with an exception set and no " "*size* is stored." msgstr "" -#: ../../c-api/unicode.rst:1111 +#: ../../c-api/unicode.rst:1085 msgid "" "This caches the UTF-8 representation of the string in the Unicode object, " "and subsequent calls will return a pointer to the same buffer. The caller " "is not responsible for deallocating the buffer." msgstr "" -#: ../../c-api/unicode.rst:1117 ../../c-api/unicode.rst:1127 +#: ../../c-api/unicode.rst:1091 ../../c-api/unicode.rst:1101 msgid "The return type is now ``const char *`` rather of ``char *``." msgstr "" -#: ../../c-api/unicode.rst:1123 +#: ../../c-api/unicode.rst:1097 msgid "As :c:func:`PyUnicode_AsUTF8AndSize`, but does not store the size." msgstr "" -#: ../../c-api/unicode.rst:1133 +#: ../../c-api/unicode.rst:1107 msgid "" "Encode the :c:type:`Py_UNICODE` buffer *s* of the given *size* using UTF-8 " "and return a Python bytes object. Return ``NULL`` if an exception was " "raised by the codec." msgstr "" -#: ../../c-api/unicode.rst:1140 +#: ../../c-api/unicode.rst:1114 msgid "" "Part of the old-style :c:type:`Py_UNICODE` API; please migrate to using :c:" "func:`PyUnicode_AsUTF8String`, :c:func:`PyUnicode_AsUTF8AndSize` or :c:func:" "`PyUnicode_AsEncodedString`." msgstr "" -#: ../../c-api/unicode.rst:1144 +#: ../../c-api/unicode.rst:1118 msgid "UTF-32 Codecs" msgstr "" -#: ../../c-api/unicode.rst:1146 +#: ../../c-api/unicode.rst:1120 msgid "These are the UTF-32 codec APIs:" msgstr "" -#: ../../c-api/unicode.rst:1152 +#: ../../c-api/unicode.rst:1126 msgid "" "Decode *size* bytes from a UTF-32 encoded buffer string and return the " "corresponding Unicode object. *errors* (if non-``NULL``) defines the error " "handling. It defaults to \"strict\"." msgstr "" -#: ../../c-api/unicode.rst:1156 ../../c-api/unicode.rst:1229 +#: ../../c-api/unicode.rst:1130 ../../c-api/unicode.rst:1203 msgid "" "If *byteorder* is non-``NULL``, the decoder starts decoding using the given " "byte order::" msgstr "" -#: ../../c-api/unicode.rst:1163 +#: ../../c-api/unicode.rst:1137 msgid "" "If ``*byteorder`` is zero, and the first four bytes of the input data are a " "byte order mark (BOM), the decoder switches to this byte order and the BOM " @@ -1373,22 +1353,22 @@ msgid "" "``-1`` or ``1``, any byte order mark is copied to the output." msgstr "" -#: ../../c-api/unicode.rst:1168 ../../c-api/unicode.rst:1242 +#: ../../c-api/unicode.rst:1142 ../../c-api/unicode.rst:1216 msgid "" "After completion, *\\*byteorder* is set to the current byte order at the end " "of input data." msgstr "" -#: ../../c-api/unicode.rst:1171 ../../c-api/unicode.rst:1245 +#: ../../c-api/unicode.rst:1145 ../../c-api/unicode.rst:1219 msgid "If *byteorder* is ``NULL``, the codec starts in native order mode." msgstr "" -#: ../../c-api/unicode.rst:1173 ../../c-api/unicode.rst:1209 -#: ../../c-api/unicode.rst:1247 ../../c-api/unicode.rst:1284 +#: ../../c-api/unicode.rst:1147 ../../c-api/unicode.rst:1183 +#: ../../c-api/unicode.rst:1221 ../../c-api/unicode.rst:1258 msgid "Return ``NULL`` if an exception was raised by the codec." msgstr "" -#: ../../c-api/unicode.rst:1179 +#: ../../c-api/unicode.rst:1153 msgid "" "If *consumed* is ``NULL``, behave like :c:func:`PyUnicode_DecodeUTF32`. If " "*consumed* is not ``NULL``, :c:func:`PyUnicode_DecodeUTF32Stateful` will not " @@ -1397,53 +1377,53 @@ msgid "" "number of bytes that have been decoded will be stored in *consumed*." msgstr "" -#: ../../c-api/unicode.rst:1188 +#: ../../c-api/unicode.rst:1162 msgid "" "Return a Python byte string using the UTF-32 encoding in native byte order. " "The string always starts with a BOM mark. Error handling is \"strict\". " "Return ``NULL`` if an exception was raised by the codec." msgstr "" -#: ../../c-api/unicode.rst:1196 +#: ../../c-api/unicode.rst:1170 msgid "" "Return a Python bytes object holding the UTF-32 encoded value of the Unicode " "data in *s*. Output is written according to the following byte order::" msgstr "" -#: ../../c-api/unicode.rst:1203 ../../c-api/unicode.rst:1277 +#: ../../c-api/unicode.rst:1177 ../../c-api/unicode.rst:1251 msgid "" "If byteorder is ``0``, the output string will always start with the Unicode " "BOM mark (U+FEFF). In the other two modes, no BOM mark is prepended." msgstr "" -#: ../../c-api/unicode.rst:1206 +#: ../../c-api/unicode.rst:1180 msgid "" "If ``Py_UNICODE_WIDE`` is not defined, surrogate pairs will be output as a " "single code point." msgstr "" -#: ../../c-api/unicode.rst:1213 +#: ../../c-api/unicode.rst:1187 msgid "" "Part of the old-style :c:type:`Py_UNICODE` API; please migrate to using :c:" "func:`PyUnicode_AsUTF32String` or :c:func:`PyUnicode_AsEncodedString`." msgstr "" -#: ../../c-api/unicode.rst:1217 +#: ../../c-api/unicode.rst:1191 msgid "UTF-16 Codecs" msgstr "" -#: ../../c-api/unicode.rst:1219 +#: ../../c-api/unicode.rst:1193 msgid "These are the UTF-16 codec APIs:" msgstr "" -#: ../../c-api/unicode.rst:1225 +#: ../../c-api/unicode.rst:1199 msgid "" "Decode *size* bytes from a UTF-16 encoded buffer string and return the " "corresponding Unicode object. *errors* (if non-``NULL``) defines the error " "handling. It defaults to \"strict\"." msgstr "" -#: ../../c-api/unicode.rst:1236 +#: ../../c-api/unicode.rst:1210 msgid "" "If ``*byteorder`` is zero, and the first two bytes of the input data are a " "byte order mark (BOM), the decoder switches to this byte order and the BOM " @@ -1452,7 +1432,7 @@ msgid "" "result in either a ``\\ufeff`` or a ``\\ufffe`` character)." msgstr "" -#: ../../c-api/unicode.rst:1253 +#: ../../c-api/unicode.rst:1227 msgid "" "If *consumed* is ``NULL``, behave like :c:func:`PyUnicode_DecodeUTF16`. If " "*consumed* is not ``NULL``, :c:func:`PyUnicode_DecodeUTF16Stateful` will not " @@ -1462,47 +1442,47 @@ msgid "" "*consumed*." msgstr "" -#: ../../c-api/unicode.rst:1262 +#: ../../c-api/unicode.rst:1236 msgid "" "Return a Python byte string using the UTF-16 encoding in native byte order. " "The string always starts with a BOM mark. Error handling is \"strict\". " "Return ``NULL`` if an exception was raised by the codec." msgstr "" -#: ../../c-api/unicode.rst:1270 +#: ../../c-api/unicode.rst:1244 msgid "" "Return a Python bytes object holding the UTF-16 encoded value of the Unicode " "data in *s*. Output is written according to the following byte order::" msgstr "" -#: ../../c-api/unicode.rst:1280 +#: ../../c-api/unicode.rst:1254 msgid "" "If ``Py_UNICODE_WIDE`` is defined, a single :c:type:`Py_UNICODE` value may " "get represented as a surrogate pair. If it is not defined, each :c:type:" "`Py_UNICODE` values is interpreted as a UCS-2 character." msgstr "" -#: ../../c-api/unicode.rst:1288 +#: ../../c-api/unicode.rst:1262 msgid "" "Part of the old-style :c:type:`Py_UNICODE` API; please migrate to using :c:" "func:`PyUnicode_AsUTF16String` or :c:func:`PyUnicode_AsEncodedString`." msgstr "" -#: ../../c-api/unicode.rst:1292 +#: ../../c-api/unicode.rst:1266 msgid "UTF-7 Codecs" msgstr "" -#: ../../c-api/unicode.rst:1294 +#: ../../c-api/unicode.rst:1268 msgid "These are the UTF-7 codec APIs:" msgstr "" -#: ../../c-api/unicode.rst:1299 +#: ../../c-api/unicode.rst:1273 msgid "" "Create a Unicode object by decoding *size* bytes of the UTF-7 encoded string " "*s*. Return ``NULL`` if an exception was raised by the codec." msgstr "" -#: ../../c-api/unicode.rst:1306 +#: ../../c-api/unicode.rst:1280 msgid "" "If *consumed* is ``NULL``, behave like :c:func:`PyUnicode_DecodeUTF7`. If " "*consumed* is not ``NULL``, trailing incomplete UTF-7 base-64 sections will " @@ -1510,14 +1490,14 @@ msgid "" "of bytes that have been decoded will be stored in *consumed*." msgstr "" -#: ../../c-api/unicode.rst:1315 +#: ../../c-api/unicode.rst:1289 msgid "" "Encode the :c:type:`Py_UNICODE` buffer of the given size using UTF-7 and " "return a Python bytes object. Return ``NULL`` if an exception was raised by " "the codec." msgstr "" -#: ../../c-api/unicode.rst:1319 +#: ../../c-api/unicode.rst:1293 msgid "" "If *base64SetO* is nonzero, \"Set O\" (punctuation that has no otherwise " "special meaning) will be encoded in base-64. If *base64WhiteSpace* is " @@ -1525,152 +1505,152 @@ msgid "" "the Python \"utf-7\" codec." msgstr "" -#: ../../c-api/unicode.rst:1330 +#: ../../c-api/unicode.rst:1304 msgid "Unicode-Escape Codecs" msgstr "" -#: ../../c-api/unicode.rst:1332 +#: ../../c-api/unicode.rst:1306 msgid "These are the \"Unicode Escape\" codec APIs:" msgstr "" -#: ../../c-api/unicode.rst:1338 +#: ../../c-api/unicode.rst:1312 msgid "" "Create a Unicode object by decoding *size* bytes of the Unicode-Escape " "encoded string *s*. Return ``NULL`` if an exception was raised by the codec." msgstr "" -#: ../../c-api/unicode.rst:1344 +#: ../../c-api/unicode.rst:1318 msgid "" "Encode a Unicode object using Unicode-Escape and return the result as a " "bytes object. Error handling is \"strict\". Return ``NULL`` if an " "exception was raised by the codec." msgstr "" -#: ../../c-api/unicode.rst:1351 +#: ../../c-api/unicode.rst:1325 msgid "" "Encode the :c:type:`Py_UNICODE` buffer of the given *size* using Unicode-" "Escape and return a bytes object. Return ``NULL`` if an exception was " "raised by the codec." msgstr "" -#: ../../c-api/unicode.rst:1356 +#: ../../c-api/unicode.rst:1330 msgid "" "Part of the old-style :c:type:`Py_UNICODE` API; please migrate to using :c:" "func:`PyUnicode_AsUnicodeEscapeString`." msgstr "" -#: ../../c-api/unicode.rst:1360 +#: ../../c-api/unicode.rst:1334 msgid "Raw-Unicode-Escape Codecs" msgstr "" -#: ../../c-api/unicode.rst:1362 +#: ../../c-api/unicode.rst:1336 msgid "These are the \"Raw Unicode Escape\" codec APIs:" msgstr "" -#: ../../c-api/unicode.rst:1368 +#: ../../c-api/unicode.rst:1342 msgid "" "Create a Unicode object by decoding *size* bytes of the Raw-Unicode-Escape " "encoded string *s*. Return ``NULL`` if an exception was raised by the codec." msgstr "" -#: ../../c-api/unicode.rst:1374 +#: ../../c-api/unicode.rst:1348 msgid "" "Encode a Unicode object using Raw-Unicode-Escape and return the result as a " "bytes object. Error handling is \"strict\". Return ``NULL`` if an " "exception was raised by the codec." msgstr "" -#: ../../c-api/unicode.rst:1382 +#: ../../c-api/unicode.rst:1356 msgid "" "Encode the :c:type:`Py_UNICODE` buffer of the given *size* using Raw-Unicode-" "Escape and return a bytes object. Return ``NULL`` if an exception was " "raised by the codec." msgstr "" -#: ../../c-api/unicode.rst:1388 +#: ../../c-api/unicode.rst:1362 msgid "" "Part of the old-style :c:type:`Py_UNICODE` API; please migrate to using :c:" "func:`PyUnicode_AsRawUnicodeEscapeString` or :c:func:" "`PyUnicode_AsEncodedString`." msgstr "" -#: ../../c-api/unicode.rst:1392 +#: ../../c-api/unicode.rst:1366 msgid "Latin-1 Codecs" msgstr "" -#: ../../c-api/unicode.rst:1394 +#: ../../c-api/unicode.rst:1368 msgid "" "These are the Latin-1 codec APIs: Latin-1 corresponds to the first 256 " "Unicode ordinals and only these are accepted by the codecs during encoding." msgstr "" -#: ../../c-api/unicode.rst:1400 +#: ../../c-api/unicode.rst:1374 msgid "" "Create a Unicode object by decoding *size* bytes of the Latin-1 encoded " "string *s*. Return ``NULL`` if an exception was raised by the codec." msgstr "" -#: ../../c-api/unicode.rst:1406 +#: ../../c-api/unicode.rst:1380 msgid "" "Encode a Unicode object using Latin-1 and return the result as Python bytes " "object. Error handling is \"strict\". Return ``NULL`` if an exception was " "raised by the codec." msgstr "" -#: ../../c-api/unicode.rst:1413 +#: ../../c-api/unicode.rst:1387 msgid "" "Encode the :c:type:`Py_UNICODE` buffer of the given *size* using Latin-1 and " "return a Python bytes object. Return ``NULL`` if an exception was raised by " "the codec." msgstr "" -#: ../../c-api/unicode.rst:1420 +#: ../../c-api/unicode.rst:1394 msgid "" "Part of the old-style :c:type:`Py_UNICODE` API; please migrate to using :c:" "func:`PyUnicode_AsLatin1String` or :c:func:`PyUnicode_AsEncodedString`." msgstr "" -#: ../../c-api/unicode.rst:1424 +#: ../../c-api/unicode.rst:1398 msgid "ASCII Codecs" msgstr "" -#: ../../c-api/unicode.rst:1426 +#: ../../c-api/unicode.rst:1400 msgid "" "These are the ASCII codec APIs. Only 7-bit ASCII data is accepted. All " "other codes generate errors." msgstr "" -#: ../../c-api/unicode.rst:1432 +#: ../../c-api/unicode.rst:1406 msgid "" "Create a Unicode object by decoding *size* bytes of the ASCII encoded string " "*s*. Return ``NULL`` if an exception was raised by the codec." msgstr "" -#: ../../c-api/unicode.rst:1438 +#: ../../c-api/unicode.rst:1412 msgid "" "Encode a Unicode object using ASCII and return the result as Python bytes " "object. Error handling is \"strict\". Return ``NULL`` if an exception was " "raised by the codec." msgstr "" -#: ../../c-api/unicode.rst:1445 +#: ../../c-api/unicode.rst:1419 msgid "" "Encode the :c:type:`Py_UNICODE` buffer of the given *size* using ASCII and " "return a Python bytes object. Return ``NULL`` if an exception was raised by " "the codec." msgstr "" -#: ../../c-api/unicode.rst:1452 +#: ../../c-api/unicode.rst:1426 msgid "" "Part of the old-style :c:type:`Py_UNICODE` API; please migrate to using :c:" "func:`PyUnicode_AsASCIIString` or :c:func:`PyUnicode_AsEncodedString`." msgstr "" -#: ../../c-api/unicode.rst:1456 +#: ../../c-api/unicode.rst:1430 msgid "Character Map Codecs" msgstr "" -#: ../../c-api/unicode.rst:1458 +#: ../../c-api/unicode.rst:1432 msgid "" "This codec is special in that it can be used to implement many different " "codecs (and this is in fact what was done to obtain most of the standard " @@ -1680,18 +1660,18 @@ msgid "" "well." msgstr "" -#: ../../c-api/unicode.rst:1464 +#: ../../c-api/unicode.rst:1438 msgid "These are the mapping codec APIs:" msgstr "" -#: ../../c-api/unicode.rst:1469 +#: ../../c-api/unicode.rst:1443 msgid "" "Create a Unicode object by decoding *size* bytes of the encoded string *s* " "using the given *mapping* object. Return ``NULL`` if an exception was " "raised by the codec." msgstr "" -#: ../../c-api/unicode.rst:1473 +#: ../../c-api/unicode.rst:1447 msgid "" "If *mapping* is ``NULL``, Latin-1 decoding will be applied. Else *mapping* " "must map bytes ordinals (integers in the range from 0 to 255) to Unicode " @@ -1701,14 +1681,14 @@ msgid "" "treated as undefined mappings and cause an error." msgstr "" -#: ../../c-api/unicode.rst:1484 +#: ../../c-api/unicode.rst:1458 msgid "" "Encode a Unicode object using the given *mapping* object and return the " "result as a bytes object. Error handling is \"strict\". Return ``NULL`` if " "an exception was raised by the codec." msgstr "" -#: ../../c-api/unicode.rst:1488 +#: ../../c-api/unicode.rst:1462 msgid "" "The *mapping* object must map Unicode ordinal integers to bytes objects, " "integers in the range from 0 to 255 or ``None``. Unmapped character " @@ -1716,68 +1696,57 @@ msgid "" "``None`` are treated as \"undefined mapping\" and cause an error." msgstr "" -#: ../../c-api/unicode.rst:1497 +#: ../../c-api/unicode.rst:1471 msgid "" "Encode the :c:type:`Py_UNICODE` buffer of the given *size* using the given " "*mapping* object and return the result as a bytes object. Return ``NULL`` " "if an exception was raised by the codec." msgstr "" -#: ../../c-api/unicode.rst:1504 +#: ../../c-api/unicode.rst:1478 msgid "" "Part of the old-style :c:type:`Py_UNICODE` API; please migrate to using :c:" "func:`PyUnicode_AsCharmapString` or :c:func:`PyUnicode_AsEncodedString`." msgstr "" -#: ../../c-api/unicode.rst:1507 +#: ../../c-api/unicode.rst:1481 msgid "The following codec API is special in that maps Unicode to Unicode." msgstr "" -#: ../../c-api/unicode.rst:1511 -msgid "" -"Translate a string by applying a character mapping table to it and return " -"the resulting Unicode object. Return ``NULL`` if an exception was raised by " -"the codec." -msgstr "" - -#: ../../c-api/unicode.rst:1515 +#: ../../c-api/unicode.rst:1486 msgid "" -"The mapping table must map Unicode ordinal integers to Unicode ordinal " -"integers or ``None`` (causing deletion of the character)." +"Translate a Unicode object using the given *mapping* object and return the " +"resulting Unicode object. Return ``NULL`` if an exception was raised by the " +"codec." msgstr "" -#: ../../c-api/unicode.rst:1518 +#: ../../c-api/unicode.rst:1490 msgid "" -"Mapping tables need only provide the :meth:`__getitem__` interface; " -"dictionaries and sequences work well. Unmapped character ordinals (ones " +"The *mapping* object must map Unicode ordinal integers to Unicode strings, " +"integers (which are then interpreted as Unicode ordinals) or ``None`` " +"(causing deletion of the character). Unmapped character ordinals (ones " "which cause a :exc:`LookupError`) are left untouched and are copied as-is." msgstr "" -#: ../../c-api/unicode.rst:1522 -msgid "" -"*errors* has the usual meaning for codecs. It may be ``NULL`` which " -"indicates to use the default error handling." -msgstr "" - -#: ../../c-api/unicode.rst:1529 +#: ../../c-api/unicode.rst:1499 msgid "" "Translate a :c:type:`Py_UNICODE` buffer of the given *size* by applying a " "character *mapping* table to it and return the resulting Unicode object. " "Return ``NULL`` when an exception was raised by the codec." msgstr "" -#: ../../c-api/unicode.rst:1536 +#: ../../c-api/unicode.rst:1506 msgid "" "Part of the old-style :c:type:`Py_UNICODE` API; please migrate to using :c:" "func:`PyUnicode_Translate`. or :ref:`generic codec based API `" msgstr "" -#: ../../c-api/unicode.rst:1540 +#: ../../c-api/unicode.rst:1510 msgid "MBCS codecs for Windows" msgstr "" -#: ../../c-api/unicode.rst:1542 +#: ../../c-api/unicode.rst:1512 msgid "" "These are the MBCS codec APIs. They are currently only available on Windows " "and use the Win32 MBCS converters to implement the conversions. Note that " @@ -1785,13 +1754,13 @@ msgid "" "is defined by the user settings on the machine running the codec." msgstr "" -#: ../../c-api/unicode.rst:1549 +#: ../../c-api/unicode.rst:1519 msgid "" "Create a Unicode object by decoding *size* bytes of the MBCS encoded string " "*s*. Return ``NULL`` if an exception was raised by the codec." msgstr "" -#: ../../c-api/unicode.rst:1556 +#: ../../c-api/unicode.rst:1526 msgid "" "If *consumed* is ``NULL``, behave like :c:func:`PyUnicode_DecodeMBCS`. If " "*consumed* is not ``NULL``, :c:func:`PyUnicode_DecodeMBCSStateful` will not " @@ -1799,58 +1768,58 @@ msgid "" "will be stored in *consumed*." msgstr "" -#: ../../c-api/unicode.rst:1564 +#: ../../c-api/unicode.rst:1534 msgid "" "Encode a Unicode object using MBCS and return the result as Python bytes " "object. Error handling is \"strict\". Return ``NULL`` if an exception was " "raised by the codec." msgstr "" -#: ../../c-api/unicode.rst:1571 +#: ../../c-api/unicode.rst:1541 msgid "" "Encode the Unicode object using the specified code page and return a Python " "bytes object. Return ``NULL`` if an exception was raised by the codec. Use :" "c:data:`CP_ACP` code page to get the MBCS encoder." msgstr "" -#: ../../c-api/unicode.rst:1580 +#: ../../c-api/unicode.rst:1550 msgid "" "Encode the :c:type:`Py_UNICODE` buffer of the given *size* using MBCS and " "return a Python bytes object. Return ``NULL`` if an exception was raised by " "the codec." msgstr "" -#: ../../c-api/unicode.rst:1587 +#: ../../c-api/unicode.rst:1557 msgid "" "Part of the old-style :c:type:`Py_UNICODE` API; please migrate to using :c:" "func:`PyUnicode_AsMBCSString`, :c:func:`PyUnicode_EncodeCodePage` or :c:func:" "`PyUnicode_AsEncodedString`." msgstr "" -#: ../../c-api/unicode.rst:1591 +#: ../../c-api/unicode.rst:1561 msgid "Methods & Slots" msgstr "" -#: ../../c-api/unicode.rst:1597 +#: ../../c-api/unicode.rst:1567 msgid "Methods and Slot Functions" msgstr "" -#: ../../c-api/unicode.rst:1599 +#: ../../c-api/unicode.rst:1569 msgid "" "The following APIs are capable of handling Unicode objects and strings on " "input (we refer to them as strings in the descriptions) and return Unicode " "objects or integers as appropriate." msgstr "" -#: ../../c-api/unicode.rst:1603 +#: ../../c-api/unicode.rst:1573 msgid "They all return ``NULL`` or ``-1`` if an exception occurs." msgstr "" -#: ../../c-api/unicode.rst:1608 +#: ../../c-api/unicode.rst:1578 msgid "Concat two strings giving a new Unicode string." msgstr "" -#: ../../c-api/unicode.rst:1613 +#: ../../c-api/unicode.rst:1583 msgid "" "Split a string giving a list of Unicode strings. If *sep* is ``NULL``, " "splitting will be done at all whitespace substrings. Otherwise, splits " @@ -1859,27 +1828,52 @@ msgid "" "list." msgstr "" -#: ../../c-api/unicode.rst:1621 +#: ../../c-api/unicode.rst:1591 msgid "" "Split a Unicode string at line breaks, returning a list of Unicode strings. " "CRLF is considered to be one line break. If *keepend* is ``0``, the Line " "break characters are not included in the resulting strings." msgstr "" -#: ../../c-api/unicode.rst:1628 +#: ../../c-api/unicode.rst:1599 +msgid "" +"Translate a string by applying a character mapping table to it and return " +"the resulting Unicode object." +msgstr "" + +#: ../../c-api/unicode.rst:1602 +msgid "" +"The mapping table must map Unicode ordinal integers to Unicode ordinal " +"integers or ``None`` (causing deletion of the character)." +msgstr "" + +#: ../../c-api/unicode.rst:1605 +msgid "" +"Mapping tables need only provide the :meth:`__getitem__` interface; " +"dictionaries and sequences work well. Unmapped character ordinals (ones " +"which cause a :exc:`LookupError`) are left untouched and are copied as-is." +msgstr "" + +#: ../../c-api/unicode.rst:1609 +msgid "" +"*errors* has the usual meaning for codecs. It may be ``NULL`` which " +"indicates to use the default error handling." +msgstr "" + +#: ../../c-api/unicode.rst:1615 msgid "" "Join a sequence of strings using the given *separator* and return the " "resulting Unicode string." msgstr "" -#: ../../c-api/unicode.rst:1635 +#: ../../c-api/unicode.rst:1622 msgid "" "Return ``1`` if *substr* matches ``str[start:end]`` at the given tail end " "(*direction* == ``-1`` means to do a prefix match, *direction* == ``1`` a " "suffix match), ``0`` otherwise. Return ``-1`` if an error occurred." msgstr "" -#: ../../c-api/unicode.rst:1643 +#: ../../c-api/unicode.rst:1630 msgid "" "Return the first position of *substr* in ``str[start:end]`` using the given " "*direction* (*direction* == ``1`` means to do a forward search, *direction* " @@ -1888,7 +1882,7 @@ msgid "" "indicates that an error occurred and an exception has been set." msgstr "" -#: ../../c-api/unicode.rst:1653 +#: ../../c-api/unicode.rst:1640 msgid "" "Return the first position of the character *ch* in ``str[start:end]`` using " "the given *direction* (*direction* == ``1`` means to do a forward search, " @@ -1897,36 +1891,36 @@ msgid "" "``-2`` indicates that an error occurred and an exception has been set." msgstr "" -#: ../../c-api/unicode.rst:1661 +#: ../../c-api/unicode.rst:1648 msgid "*start* and *end* are now adjusted to behave like ``str[start:end]``." msgstr "" -#: ../../c-api/unicode.rst:1668 +#: ../../c-api/unicode.rst:1655 msgid "" "Return the number of non-overlapping occurrences of *substr* in ``str[start:" "end]``. Return ``-1`` if an error occurred." msgstr "" -#: ../../c-api/unicode.rst:1675 +#: ../../c-api/unicode.rst:1662 msgid "" "Replace at most *maxcount* occurrences of *substr* in *str* with *replstr* " "and return the resulting Unicode object. *maxcount* == ``-1`` means replace " "all occurrences." msgstr "" -#: ../../c-api/unicode.rst:1682 +#: ../../c-api/unicode.rst:1669 msgid "" "Compare two strings and return ``-1``, ``0``, ``1`` for less than, equal, " "and greater than, respectively." msgstr "" -#: ../../c-api/unicode.rst:1685 +#: ../../c-api/unicode.rst:1672 msgid "" "This function returns ``-1`` upon failure, so one should call :c:func:" "`PyErr_Occurred` to check for errors." msgstr "" -#: ../../c-api/unicode.rst:1691 +#: ../../c-api/unicode.rst:1678 msgid "" "Compare a Unicode object, *uni*, with *string* and return ``-1``, ``0``, " "``1`` for less than, equal, and greater than, respectively. It is best to " @@ -1934,51 +1928,51 @@ msgid "" "string as ISO-8859-1 if it contains non-ASCII characters." msgstr "" -#: ../../c-api/unicode.rst:1696 +#: ../../c-api/unicode.rst:1683 msgid "This function does not raise exceptions." msgstr "" -#: ../../c-api/unicode.rst:1701 +#: ../../c-api/unicode.rst:1688 msgid "Rich compare two Unicode strings and return one of the following:" msgstr "" -#: ../../c-api/unicode.rst:1703 +#: ../../c-api/unicode.rst:1690 msgid "``NULL`` in case an exception was raised" msgstr "" -#: ../../c-api/unicode.rst:1704 +#: ../../c-api/unicode.rst:1691 msgid ":const:`Py_True` or :const:`Py_False` for successful comparisons" msgstr "" -#: ../../c-api/unicode.rst:1705 +#: ../../c-api/unicode.rst:1692 msgid ":const:`Py_NotImplemented` in case the type combination is unknown" msgstr "" -#: ../../c-api/unicode.rst:1707 +#: ../../c-api/unicode.rst:1694 msgid "" "Possible values for *op* are :const:`Py_GT`, :const:`Py_GE`, :const:" "`Py_EQ`, :const:`Py_NE`, :const:`Py_LT`, and :const:`Py_LE`." msgstr "" -#: ../../c-api/unicode.rst:1713 +#: ../../c-api/unicode.rst:1700 msgid "" "Return a new string object from *format* and *args*; this is analogous to " "``format % args``." msgstr "" -#: ../../c-api/unicode.rst:1719 +#: ../../c-api/unicode.rst:1706 msgid "" "Check whether *element* is contained in *container* and return true or false " "accordingly." msgstr "" -#: ../../c-api/unicode.rst:1722 +#: ../../c-api/unicode.rst:1709 msgid "" "*element* has to coerce to a one element Unicode string. ``-1`` is returned " "if there was an error." msgstr "" -#: ../../c-api/unicode.rst:1728 +#: ../../c-api/unicode.rst:1715 msgid "" "Intern the argument *\\*string* in place. The argument must be the address " "of a pointer variable pointing to a Python Unicode string object. If there " @@ -1991,7 +1985,7 @@ msgid "" "the object after the call if and only if you owned it before the call.)" msgstr "" -#: ../../c-api/unicode.rst:1741 +#: ../../c-api/unicode.rst:1728 msgid "" "A combination of :c:func:`PyUnicode_FromString` and :c:func:" "`PyUnicode_InternInPlace`, returning either a new Unicode string object that " diff --git a/c-api/veryhigh.po b/c-api/veryhigh.po index 66821648bc..e2adc98320 100644 --- a/c-api/veryhigh.po +++ b/c-api/veryhigh.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.7\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2021-09-07 06:52+0000\n" +"POT-Creation-Date: 2020-06-20 18:08+0800\n" "PO-Revision-Date: 2018-05-23 14:08+0000\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -39,13 +39,13 @@ msgstr "" #: ../../c-api/veryhigh.rst:19 msgid "" -"Note also that several of these functions take :c:type:`FILE*` parameters. " -"One particular issue which needs to be handled carefully is that the :c:type:" -"`FILE` structure for different C libraries can be different and " -"incompatible. Under Windows (at least), it is possible for dynamically " +"Note also that several of these functions take :c:type:`FILE\\*` " +"parameters. One particular issue which needs to be handled carefully is " +"that the :c:type:`FILE` structure for different C libraries can be different " +"and incompatible. Under Windows (at least), it is possible for dynamically " "linked extensions to actually use different libraries, so care should be " -"taken that :c:type:`FILE*` parameters are only passed to these functions if " -"it is certain that they were created by the same library that the Python " +"taken that :c:type:`FILE\\*` parameters are only passed to these functions " +"if it is certain that they were created by the same library that the Python " "runtime is using." msgstr "" @@ -230,14 +230,14 @@ msgid "" "``NULL`` and *flags* set to ``0``." msgstr "" -#: ../../c-api/veryhigh.rst:201 +#: ../../c-api/veryhigh.rst:199 msgid "" "This is a simplified interface to :c:func:" "`PyParser_SimpleParseStringFlagsFilename` below, leaving *filename* set to " "``NULL``." msgstr "" -#: ../../c-api/veryhigh.rst:210 +#: ../../c-api/veryhigh.rst:206 msgid "" "Parse Python source code from *str* using the start token *start* according " "to the *flags* argument. The result can be used to create a code object " @@ -246,25 +246,25 @@ msgid "" "(:func:`sys.getfilesystemencoding`)." msgstr "" -#: ../../c-api/veryhigh.rst:221 +#: ../../c-api/veryhigh.rst:215 msgid "" "This is a simplified interface to :c:func:`PyParser_SimpleParseFileFlags` " "below, leaving *flags* set to ``0``." msgstr "" -#: ../../c-api/veryhigh.rst:229 +#: ../../c-api/veryhigh.rst:221 msgid "" "Similar to :c:func:`PyParser_SimpleParseStringFlagsFilename`, but the Python " "source code is read from *fp* instead of an in-memory string." msgstr "" -#: ../../c-api/veryhigh.rst:237 +#: ../../c-api/veryhigh.rst:227 msgid "" "This is a simplified interface to :c:func:`PyRun_StringFlags` below, leaving " "*flags* set to ``NULL``." msgstr "" -#: ../../c-api/veryhigh.rst:243 +#: ../../c-api/veryhigh.rst:233 msgid "" "Execute Python source code from *str* in the context specified by the " "objects *globals* and *locals* with the compiler flags specified by " @@ -273,31 +273,31 @@ msgid "" "token that should be used to parse the source code." msgstr "" -#: ../../c-api/veryhigh.rst:249 +#: ../../c-api/veryhigh.rst:239 msgid "" "Returns the result of executing the code as a Python object, or ``NULL`` if " "an exception was raised." msgstr "" -#: ../../c-api/veryhigh.rst:255 +#: ../../c-api/veryhigh.rst:245 msgid "" "This is a simplified interface to :c:func:`PyRun_FileExFlags` below, leaving " "*closeit* set to ``0`` and *flags* set to ``NULL``." msgstr "" -#: ../../c-api/veryhigh.rst:261 +#: ../../c-api/veryhigh.rst:251 msgid "" "This is a simplified interface to :c:func:`PyRun_FileExFlags` below, leaving " "*flags* set to ``NULL``." msgstr "" -#: ../../c-api/veryhigh.rst:267 +#: ../../c-api/veryhigh.rst:257 msgid "" "This is a simplified interface to :c:func:`PyRun_FileExFlags` below, leaving " "*closeit* set to ``0``." msgstr "" -#: ../../c-api/veryhigh.rst:273 +#: ../../c-api/veryhigh.rst:263 msgid "" "Similar to :c:func:`PyRun_StringFlags`, but the Python source code is read " "from *fp* instead of an in-memory string. *filename* should be the name of " @@ -306,19 +306,19 @@ msgid "" "func:`PyRun_FileExFlags` returns." msgstr "" -#: ../../c-api/veryhigh.rst:282 +#: ../../c-api/veryhigh.rst:272 msgid "" "This is a simplified interface to :c:func:`Py_CompileStringFlags` below, " "leaving *flags* set to ``NULL``." msgstr "" -#: ../../c-api/veryhigh.rst:288 +#: ../../c-api/veryhigh.rst:278 msgid "" "This is a simplified interface to :c:func:`Py_CompileStringExFlags` below, " "with *optimize* set to ``-1``." msgstr "" -#: ../../c-api/veryhigh.rst:294 +#: ../../c-api/veryhigh.rst:284 msgid "" "Parse and compile the Python source code in *str*, returning the resulting " "code object. The start token is given by *start*; this can be used to " @@ -329,7 +329,7 @@ msgid "" "returns ``NULL`` if the code cannot be parsed or compiled." msgstr "" -#: ../../c-api/veryhigh.rst:302 +#: ../../c-api/veryhigh.rst:292 msgid "" "The integer *optimize* specifies the optimization level of the compiler; a " "value of ``-1`` selects the optimization level of the interpreter as given " @@ -338,20 +338,20 @@ msgid "" "or ``2`` (docstrings are removed too)." msgstr "" -#: ../../c-api/veryhigh.rst:313 +#: ../../c-api/veryhigh.rst:303 msgid "" "Like :c:func:`Py_CompileStringObject`, but *filename* is a byte string " "decoded from the filesystem encoding (:func:`os.fsdecode`)." msgstr "" -#: ../../c-api/veryhigh.rst:320 +#: ../../c-api/veryhigh.rst:310 msgid "" "This is a simplified interface to :c:func:`PyEval_EvalCodeEx`, with just the " "code object, and global and local variables. The other arguments are set to " "``NULL``." msgstr "" -#: ../../c-api/veryhigh.rst:327 +#: ../../c-api/veryhigh.rst:317 msgid "" "Evaluate a precompiled code object, given a particular environment for its " "evaluation. This environment consists of a dictionary of global variables, " @@ -360,19 +360,19 @@ msgid "" "only_parameter>` arguments and a closure tuple of cells." msgstr "" -#: ../../c-api/veryhigh.rst:336 +#: ../../c-api/veryhigh.rst:326 msgid "" "The C structure of the objects used to describe frame objects. The fields of " "this type are subject to change at any time." msgstr "" -#: ../../c-api/veryhigh.rst:342 +#: ../../c-api/veryhigh.rst:332 msgid "" "Evaluate an execution frame. This is a simplified interface to :c:func:" "`PyEval_EvalFrameEx`, for backward compatibility." msgstr "" -#: ../../c-api/veryhigh.rst:348 +#: ../../c-api/veryhigh.rst:338 msgid "" "This is the main, unvarnished function of Python interpretation. The code " "object associated with the execution frame *f* is executed, interpreting " @@ -382,39 +382,39 @@ msgid "" "of generator objects." msgstr "" -#: ../../c-api/veryhigh.rst:355 +#: ../../c-api/veryhigh.rst:345 msgid "" "This function now includes a debug assertion to help ensure that it does not " "silently discard an active exception." msgstr "" -#: ../../c-api/veryhigh.rst:362 +#: ../../c-api/veryhigh.rst:352 msgid "" "This function changes the flags of the current evaluation frame, and returns " "true on success, false on failure." msgstr "" -#: ../../c-api/veryhigh.rst:370 +#: ../../c-api/veryhigh.rst:360 msgid "" "The start symbol from the Python grammar for isolated expressions; for use " "with :c:func:`Py_CompileString`." msgstr "" -#: ../../c-api/veryhigh.rst:378 +#: ../../c-api/veryhigh.rst:368 msgid "" "The start symbol from the Python grammar for sequences of statements as read " "from a file or other source; for use with :c:func:`Py_CompileString`. This " "is the symbol to use when compiling arbitrarily long Python source code." msgstr "" -#: ../../c-api/veryhigh.rst:387 +#: ../../c-api/veryhigh.rst:377 msgid "" "The start symbol from the Python grammar for a single statement; for use " "with :c:func:`Py_CompileString`. This is the symbol used for the interactive " "interpreter loop." msgstr "" -#: ../../c-api/veryhigh.rst:394 +#: ../../c-api/veryhigh.rst:384 msgid "" "This is the structure used to hold compiler flags. In cases where code is " "only being compiled, it is passed as ``int flags``, and in cases where code " @@ -422,34 +422,34 @@ msgid "" "case, ``from __future__ import`` can modify *flags*." msgstr "" -#: ../../c-api/veryhigh.rst:399 +#: ../../c-api/veryhigh.rst:389 msgid "" "Whenever ``PyCompilerFlags *flags`` is ``NULL``, :attr:`cf_flags` is treated " "as equal to ``0``, and any modification due to ``from __future__ import`` is " "discarded." msgstr "" -#: ../../c-api/veryhigh.rst:405 +#: ../../c-api/veryhigh.rst:395 msgid "Compiler flags." msgstr "" -#: ../../c-api/veryhigh.rst:409 +#: ../../c-api/veryhigh.rst:399 msgid "" "*cf_feature_version* is the minor Python version. It should be initialized " "to ``PY_MINOR_VERSION``." msgstr "" -#: ../../c-api/veryhigh.rst:412 +#: ../../c-api/veryhigh.rst:402 msgid "" "The field is ignored by default, it is used if and only if ``PyCF_ONLY_AST`` " "flag is set in *cf_flags*." msgstr "" -#: ../../c-api/veryhigh.rst:415 +#: ../../c-api/veryhigh.rst:405 msgid "Added *cf_feature_version* field." msgstr "" -#: ../../c-api/veryhigh.rst:421 +#: ../../c-api/veryhigh.rst:411 msgid "" "This bit can be set in *flags* to cause division operator ``/`` to be " "interpreted as \"true division\" according to :pep:`238`." diff --git a/c-api/weakref.po b/c-api/weakref.po index 768faeda33..742b8759cb 100644 --- a/c-api/weakref.po +++ b/c-api/weakref.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.7\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2021-09-07 06:52+0000\n" +"POT-Creation-Date: 2020-06-20 18:08+0800\n" "PO-Revision-Date: 2017-09-22 18:26+0000\n" "Last-Translator: Leon H.\n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -32,21 +32,18 @@ msgid "" msgstr "" #: ../../c-api/weakref.rst:16 -msgid "" -"Return true if *ob* is either a reference or proxy object. This function " -"always succeeds." +msgid "Return true if *ob* is either a reference or proxy object." msgstr "" -#: ../../c-api/weakref.rst:22 -msgid "" -"Return true if *ob* is a reference object. This function always succeeds." +#: ../../c-api/weakref.rst:21 +msgid "Return true if *ob* is a reference object." msgstr "" -#: ../../c-api/weakref.rst:27 -msgid "Return true if *ob* is a proxy object. This function always succeeds." +#: ../../c-api/weakref.rst:26 +msgid "Return true if *ob* is a proxy object." msgstr "" -#: ../../c-api/weakref.rst:32 +#: ../../c-api/weakref.rst:31 msgid "" "Return a weak reference object for the object *ob*. This will always return " "a new reference, but is not guaranteed to create a new object; an existing " @@ -58,7 +55,7 @@ msgid "" "``NULL``, this will return ``NULL`` and raise :exc:`TypeError`." msgstr "" -#: ../../c-api/weakref.rst:44 +#: ../../c-api/weakref.rst:43 msgid "" "Return a weak reference proxy object for the object *ob*. This will always " "return a new reference, but is not guaranteed to create a new object; an " @@ -70,20 +67,20 @@ msgid "" "``None``, or ``NULL``, this will return ``NULL`` and raise :exc:`TypeError`." msgstr "" -#: ../../c-api/weakref.rst:56 +#: ../../c-api/weakref.rst:55 msgid "" "Return the referenced object from a weak reference, *ref*. If the referent " "is no longer live, returns :const:`Py_None`." msgstr "" -#: ../../c-api/weakref.rst:61 +#: ../../c-api/weakref.rst:60 msgid "" "This function returns a **borrowed reference** to the referenced object. " "This means that you should always call :c:func:`Py_INCREF` on the object " "except if you know that it cannot be destroyed while you are still using it." msgstr "" -#: ../../c-api/weakref.rst:69 +#: ../../c-api/weakref.rst:68 msgid "" "Similar to :c:func:`PyWeakref_GetObject`, but implemented as a macro that " "does no error checking." diff --git a/copyright.po b/copyright.po index 6ec0d1a459..0a33feffbd 100644 --- a/copyright.po +++ b/copyright.po @@ -10,7 +10,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.9\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2021-09-07 06:52+0000\n" +"POT-Creation-Date: 2020-06-20 18:08+0800\n" "PO-Revision-Date: 2021-06-25 20:17+0800\n" "Last-Translator: meowmeowcat \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -31,8 +31,7 @@ msgid "Python and this documentation is:" msgstr "Python和這些文件是:" #: ../../copyright.rst:7 -#, fuzzy -msgid "Copyright © 2001-2021 Python Software Foundation. All rights reserved." +msgid "Copyright © 2001-2020 Python Software Foundation. All rights reserved." msgstr "Copyright © 2001-2020 Python Software Foundation 保留一切權利。" #: ../../copyright.rst:9 diff --git a/distributing/index.po b/distributing/index.po index 1a849d7c5b..ea8450bbf3 100644 --- a/distributing/index.po +++ b/distributing/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-07 06:52+0000\n" +"POT-Creation-Date: 2020-06-20 18:08+0800\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-" @@ -202,59 +202,55 @@ msgstr "" msgid "`Uploading the project to the Python Packaging Index`_" msgstr "" -#: ../../distributing/index.rst:131 -msgid "`The .pypirc file`_" -msgstr "" - -#: ../../distributing/index.rst:144 +#: ../../distributing/index.rst:141 msgid "How do I...?" msgstr "" -#: ../../distributing/index.rst:146 +#: ../../distributing/index.rst:143 msgid "These are quick answers or links for some common tasks." msgstr "" -#: ../../distributing/index.rst:149 +#: ../../distributing/index.rst:146 msgid "... choose a name for my project?" msgstr "" -#: ../../distributing/index.rst:151 +#: ../../distributing/index.rst:148 msgid "This isn't an easy topic, but here are a few tips:" msgstr "" -#: ../../distributing/index.rst:153 +#: ../../distributing/index.rst:150 msgid "check the Python Packaging Index to see if the name is already in use" msgstr "" -#: ../../distributing/index.rst:154 +#: ../../distributing/index.rst:151 msgid "" "check popular hosting sites like GitHub, Bitbucket, etc to see if there is " "already a project with that name" msgstr "" -#: ../../distributing/index.rst:156 +#: ../../distributing/index.rst:153 msgid "check what comes up in a web search for the name you're considering" msgstr "" -#: ../../distributing/index.rst:157 +#: ../../distributing/index.rst:154 msgid "" "avoid particularly common words, especially ones with multiple meanings, as " "they can make it difficult for users to find your software when searching " "for it" msgstr "" -#: ../../distributing/index.rst:163 +#: ../../distributing/index.rst:160 msgid "... create and distribute binary extensions?" msgstr "" -#: ../../distributing/index.rst:165 +#: ../../distributing/index.rst:162 msgid "" "This is actually quite a complex topic, with a variety of alternatives " "available depending on exactly what you're aiming to achieve. See the Python " "Packaging User Guide for more information and recommendations." msgstr "" -#: ../../distributing/index.rst:171 +#: ../../distributing/index.rst:168 msgid "" "`Python Packaging User Guide: Binary Extensions `__" diff --git a/distutils/_setuptools_disclaimer.po b/distutils/_setuptools_disclaimer.po index 47780adf2c..b3a263c1c6 100644 --- a/distutils/_setuptools_disclaimer.po +++ b/distutils/_setuptools_disclaimer.po @@ -8,11 +8,10 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.9\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2021-09-07 06:52+0000\n" +"POT-Creation-Date: 2020-06-20 18:08+0800\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" -"Language: \n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" diff --git a/extending/newtypes_tutorial.po b/extending/newtypes_tutorial.po index 8d3b452e87..e9f1b0317f 100644 --- a/extending/newtypes_tutorial.po +++ b/extending/newtypes_tutorial.po @@ -5,7 +5,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.7\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2021-09-07 06:52+0000\n" +"POT-Creation-Date: 2020-06-20 18:08+0800\n" "PO-Revision-Date: 2018-07-15 18:56+0800\n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" "tw)\n" @@ -435,8 +435,8 @@ msgid "" "``first`` member, so it could be any kind of object. It could have a " "destructor that causes code to be executed that tries to access the " "``first`` member; or that destructor could release the :term:`Global " -"interpreter Lock ` and let arbitrary code run in other threads that " -"accesses and modifies our object." +"interpreter Lock` and let arbitrary code run in other threads that accesses " +"and modifies our object." msgstr "" #: ../../extending/newtypes_tutorial.rst:422 diff --git a/faq/design.po b/faq/design.po index 3a406570da..ab9055cd59 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-07 06:52+0000\n" +"POT-Creation-Date: 2020-06-20 18:08+0800\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-" @@ -755,10 +755,11 @@ msgstr "" #: ../../faq/design.rst:575 msgid "" "For Python, many of the advantages of interface specifications can be " -"obtained by an appropriate test discipline for components." +"obtained by an appropriate test discipline for components. There is also a " +"tool, PyChecker, which can be used to find problems due to subclassing." msgstr "" -#: ../../faq/design.rst:578 +#: ../../faq/design.rst:579 msgid "" "A good test suite for a module can both provide a regression test and serve " "as a module interface specification and a set of examples. Many Python " @@ -770,7 +771,7 @@ msgid "" "in a module." msgstr "" -#: ../../faq/design.rst:586 +#: ../../faq/design.rst:587 msgid "" "An appropriate testing discipline can help build large complex applications " "in Python as well as having interface specifications would. In fact, it can " @@ -781,7 +782,7 @@ msgid "" "correctly, but it's trivial to check this property in a test suite." msgstr "" -#: ../../faq/design.rst:594 +#: ../../faq/design.rst:595 msgid "" "Writing test suites is very helpful, and you might want to design your code " "to make it easily tested. One increasingly popular technique, test-driven " @@ -790,46 +791,36 @@ msgid "" "not write test cases at all." msgstr "" -#: ../../faq/design.rst:602 +#: ../../faq/design.rst:603 msgid "Why is there no goto?" msgstr "為何沒有goto語法?" -#: ../../faq/design.rst:604 +#: ../../faq/design.rst:605 msgid "" -"In the 1970s people realized that unrestricted goto could lead to messy " -"\"spaghetti\" code that was hard to understand and revise. In a high-level " -"language, it is also unneeded as long as there are ways to branch (in " -"Python, with ``if`` statements and ``or``, ``and``, and ``if-else`` " -"expressions) and loop (with ``while`` and ``for`` statements, possibly " -"containing ``continue`` and ``break``)." -msgstr "" - -#: ../../faq/design.rst:611 -msgid "" -"One can also use exceptions to provide a \"structured goto\" that works even " +"You can use exceptions to provide a \"structured goto\" that even works " "across function calls. Many feel that exceptions can conveniently emulate " "all reasonable uses of the \"go\" or \"goto\" constructs of C, Fortran, and " "other languages. For example::" msgstr "" -#: ../../faq/design.rst:627 +#: ../../faq/design.rst:620 msgid "" "This doesn't allow you to jump into the middle of a loop, but that's usually " "considered an abuse of goto anyway. Use sparingly." msgstr "" -#: ../../faq/design.rst:632 +#: ../../faq/design.rst:625 msgid "Why can't raw strings (r-strings) end with a backslash?" msgstr "" -#: ../../faq/design.rst:634 +#: ../../faq/design.rst:627 msgid "" "More precisely, they can't end with an odd number of backslashes: the " "unpaired backslash at the end escapes the closing quote character, leaving " "an unterminated string." msgstr "" -#: ../../faq/design.rst:638 +#: ../../faq/design.rst:631 msgid "" "Raw strings were designed to ease creating input for processors (chiefly " "regular expression engines) that want to do their own backslash escape " @@ -839,33 +830,33 @@ msgid "" "rules work well when r-strings are used for their intended purpose." msgstr "" -#: ../../faq/design.rst:645 +#: ../../faq/design.rst:638 msgid "" "If you're trying to build Windows pathnames, note that all Windows system " "calls accept forward slashes too::" msgstr "" -#: ../../faq/design.rst:650 +#: ../../faq/design.rst:643 msgid "" "If you're trying to build a pathname for a DOS command, try e.g. one of ::" msgstr "" -#: ../../faq/design.rst:658 +#: ../../faq/design.rst:651 msgid "Why doesn't Python have a \"with\" statement for attribute assignments?" msgstr "" -#: ../../faq/design.rst:660 +#: ../../faq/design.rst:653 msgid "" "Python has a 'with' statement that wraps the execution of a block, calling " "code on the entrance and exit from the block. Some languages have a " "construct that looks like this::" msgstr "" -#: ../../faq/design.rst:668 +#: ../../faq/design.rst:661 msgid "In Python, such a construct would be ambiguous." msgstr "" -#: ../../faq/design.rst:670 +#: ../../faq/design.rst:663 msgid "" "Other languages, such as Object Pascal, Delphi, and C++, use static types, " "so it's possible to know, in an unambiguous way, what member is being " @@ -873,7 +864,7 @@ msgid "" "*always* knows the scope of every variable at compile time." msgstr "" -#: ../../faq/design.rst:675 +#: ../../faq/design.rst:668 msgid "" "Python uses dynamic types. It is impossible to know in advance which " "attribute will be referenced at runtime. Member attributes may be added or " @@ -882,11 +873,11 @@ msgid "" "one, or a member attribute?" msgstr "" -#: ../../faq/design.rst:681 +#: ../../faq/design.rst:674 msgid "For instance, take the following incomplete snippet::" msgstr "" -#: ../../faq/design.rst:687 +#: ../../faq/design.rst:680 msgid "" "The snippet assumes that \"a\" must have a member attribute called \"x\". " "However, there is nothing in Python that tells the interpreter this. What " @@ -895,58 +886,46 @@ msgid "" "the dynamic nature of Python makes such choices much harder." msgstr "" -#: ../../faq/design.rst:693 +#: ../../faq/design.rst:686 msgid "" "The primary benefit of \"with\" and similar language features (reduction of " "code volume) can, however, easily be achieved in Python by assignment. " "Instead of::" msgstr "" -#: ../../faq/design.rst:700 +#: ../../faq/design.rst:693 msgid "write this::" msgstr "" -#: ../../faq/design.rst:707 +#: ../../faq/design.rst:700 msgid "" "This also has the side-effect of increasing execution speed because name " "bindings are resolved at run-time in Python, and the second version only " "needs to perform the resolution once." msgstr "" -#: ../../faq/design.rst:713 -msgid "Why don't generators support the with statement?" -msgstr "" - -#: ../../faq/design.rst:715 -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." -msgstr "" - -#: ../../faq/design.rst:722 +#: ../../faq/design.rst:706 msgid "Why are colons required for the if/while/def/class statements?" msgstr "" -#: ../../faq/design.rst:724 +#: ../../faq/design.rst:708 msgid "" "The colon is required primarily to enhance readability (one of the results " "of the experimental ABC language). Consider this::" msgstr "" -#: ../../faq/design.rst:730 +#: ../../faq/design.rst:714 msgid "versus ::" msgstr "" -#: ../../faq/design.rst:735 +#: ../../faq/design.rst:719 msgid "" "Notice how the second one is slightly easier to read. Notice further how a " "colon sets off the example in this FAQ answer; it's a standard usage in " "English." msgstr "" -#: ../../faq/design.rst:738 +#: ../../faq/design.rst:722 msgid "" "Another minor reason is that the colon makes it easier for editors with " "syntax highlighting; they can look for colons to decide when indentation " @@ -954,21 +933,21 @@ msgid "" "the program text." msgstr "" -#: ../../faq/design.rst:744 +#: ../../faq/design.rst:728 msgid "Why does Python allow commas at the end of lists and tuples?" msgstr "" -#: ../../faq/design.rst:746 +#: ../../faq/design.rst:730 msgid "" "Python lets you add a trailing comma at the end of lists, tuples, and " "dictionaries::" msgstr "" -#: ../../faq/design.rst:757 +#: ../../faq/design.rst:741 msgid "There are several reasons to allow this." msgstr "這有許多原因可被允許。" -#: ../../faq/design.rst:759 +#: ../../faq/design.rst:743 msgid "" "When you have a literal value for a list, tuple, or dictionary spread across " "multiple lines, it's easier to add more elements because you don't have to " @@ -976,20 +955,20 @@ msgid "" "reordered without creating a syntax error." msgstr "" -#: ../../faq/design.rst:764 +#: ../../faq/design.rst:748 msgid "" "Accidentally omitting the comma can lead to errors that are hard to " "diagnose. For example::" msgstr "" -#: ../../faq/design.rst:774 +#: ../../faq/design.rst:758 msgid "" "This list looks like it has four elements, but it actually contains three: " "\"fee\", \"fiefoo\" and \"fum\". Always adding the comma avoids this source " "of error." msgstr "" -#: ../../faq/design.rst:777 +#: ../../faq/design.rst:761 msgid "" "Allowing the trailing comma may also make programmatic code generation " "easier." diff --git a/faq/general.po b/faq/general.po index 3538c30a1e..d9e3797855 100644 --- a/faq/general.po +++ b/faq/general.po @@ -9,7 +9,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.7\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2021-09-07 06:52+0000\n" +"POT-Creation-Date: 2020-06-20 18:08+0800\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-" @@ -227,9 +227,9 @@ msgid "" "Alpha, beta and release candidate versions have an additional suffix. The " "suffix for an alpha version is \"aN\" for some small number N, the suffix " "for a beta version is \"bN\" for some small number N, and the suffix for a " -"release candidate version is \"rcN\" for some small number N. In other " +"release candidate version is \"cN\" for some small number N. In other " "words, all versions labeled 2.0aN precede the versions labeled 2.0bN, which " -"precede versions labeled 2.0rcN, and *those* precede 2.0." +"precede versions labeled 2.0cN, and *those* precede 2.0." msgstr "" #: ../../faq/general.rst:149 @@ -462,11 +462,10 @@ msgid "How stable is Python?" msgstr "Python穩定性如何" #: ../../faq/general.rst:298 -#, fuzzy msgid "" "Very stable. New, stable releases have been coming out roughly every 6 to " -"18 months since 1991, and this seems likely to continue. As of version 3.9, " -"Python will have a major new release every 12 months (:pep:`602`)." +"18 months since 1991, and this seems likely to continue. Currently there " +"are usually around 18 months between major releases." msgstr "" "非常穩定。自從1991年開始大約每隔6到18個月會釋出更新版,而且看起來會繼續更新下" "去。現在大約18個月會有主要的更新" @@ -487,7 +486,8 @@ msgid "" "`_. There are two production-ready " "versions of Python: 2.x and 3.x. The recommended version is 3.x, which is " "supported by most widely used libraries. Although 2.x is still widely used, " -"`it is not maintained anymore `_." +"`it will not be maintained after January 1, 2020 `_." msgstr "" #: ../../faq/general.rst:316 @@ -495,10 +495,9 @@ msgid "How many people are using Python?" msgstr "有多少人使用Python" #: ../../faq/general.rst:318 -#, fuzzy msgid "" -"There are probably millions of users, though it's difficult to obtain an " -"exact count." +"There are probably tens of thousands of users, though it's difficult to " +"obtain an exact count." msgstr "大約有超過一萬個使用者,實際上有多少人是很難準確的估算" #: ../../faq/general.rst:321 diff --git a/faq/gui.po b/faq/gui.po index 0f0c73e851..0cbd6efd71 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-07 06:52+0000\n" +"POT-Creation-Date: 2020-06-20 18:08+0800\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-" @@ -32,11 +32,22 @@ msgid "General GUI Questions" msgstr "常見圖形化使用者界面(GUI) 問題" #: ../../faq/gui.rst:18 -msgid "What GUI toolkits exist for Python?" +msgid "What platform-independent GUI toolkits exist for Python?" msgstr "" #: ../../faq/gui.rst:20 msgid "" +"Depending on what platform(s) you are aiming at, there are several. Some of " +"them haven't been ported to Python 3 yet. At least `Tkinter`_ and `Qt`_ are " +"known to be Python 3-compatible." +msgstr "" + +#: ../../faq/gui.rst:27 +msgid "Tkinter" +msgstr "" + +#: ../../faq/gui.rst:29 +msgid "" "Standard builds of Python include an object-oriented interface to the Tcl/Tk " "widget set, called :ref:`tkinter `. This is probably the easiest " "to install (since it comes included with most `binary distributions `_ is the Python binding for wxwidgets. " +"While it often lags slightly behind the official wxWidgets releases, it also " +"offers a number of features via pure Python extensions that are not " +"available in other language bindings. There is an active wxPython user and " +"developer community." +msgstr "" + +#: ../../faq/gui.rst:52 +msgid "" +"Both wxWidgets and wxPython are free, open source, software with permissive " +"licences that allow their use in commercial products as well as in freeware " +"or shareware." +msgstr "" + +#: ../../faq/gui.rst:58 +msgid "Qt" +msgstr "Qt" + +#: ../../faq/gui.rst:60 +msgid "" +"There are bindings available for the Qt toolkit (using either `PyQt `_ or `PySide `_) and for KDE (`PyKDE4 `__). PyQt is currently more mature than PySide, but you must " +"buy a PyQt license from `Riverbank Computing `_ if you want to write proprietary " +"applications. PySide is free for all applications." +msgstr "" + +#: ../../faq/gui.rst:67 +msgid "" +"Qt 4.5 upwards is licensed under the LGPL license; also, commercial licenses " +"are available from `The Qt Company `_." +msgstr "" + +#: ../../faq/gui.rst:71 +msgid "Gtk+" +msgstr "Gtk+" + +#: ../../faq/gui.rst:73 +msgid "" +"The `GObject introspection bindings `_ for Python allow you to write GTK+ 3 applications. There is " +"also a `Python GTK+ 3 Tutorial `_." +msgstr "" + +#: ../../faq/gui.rst:77 msgid "" -"Depending on what platform(s) you are aiming at, there are also several " -"alternatives. A `list of cross-platform `_ and `platform-specific `_ GUI " -"frameworks can be found on the python wiki." +"The older PyGtk bindings for the `Gtk+ 2 toolkit `_ " +"have been implemented by James Henstridge; see ." msgstr "" -#: ../../faq/gui.rst:36 +#: ../../faq/gui.rst:81 +msgid "Kivy" +msgstr "" + +#: ../../faq/gui.rst:83 +msgid "" +"`Kivy `_ is a cross-platform GUI library supporting both " +"desktop operating systems (Windows, macOS, Linux) and mobile devices " +"(Android, iOS). It is written in Python and Cython, and can use a range of " +"windowing backends." +msgstr "" + +#: ../../faq/gui.rst:88 +msgid "" +"Kivy is free and open source software distributed under the MIT license." +msgstr "" + +#: ../../faq/gui.rst:91 +msgid "FLTK" +msgstr "FLTK" + +#: ../../faq/gui.rst:93 +msgid "" +"Python bindings for `the FLTK toolkit `_, a simple yet " +"powerful and mature cross-platform windowing system, are available from `the " +"PyFLTK project `_." +msgstr "" + +#: ../../faq/gui.rst:98 +msgid "OpenGL" +msgstr "開放圖形庫(OpenGL)" + +#: ../../faq/gui.rst:100 +msgid "For OpenGL bindings, see `PyOpenGL `_." +msgstr "" + +#: ../../faq/gui.rst:104 +msgid "What platform-specific GUI toolkits exist for Python?" +msgstr "" + +#: ../../faq/gui.rst:106 +msgid "" +"By installing the `PyObjc Objective-C bridge `_, Python programs can use Mac OS X's Cocoa libraries." +msgstr "" + +#: ../../faq/gui.rst:110 +msgid "" +":ref:`Pythonwin ` by Mark Hammond includes an interface to the " +"Microsoft Foundation Classes and a Python programming environment that's " +"written mostly in Python using the MFC classes." +msgstr "" + +#: ../../faq/gui.rst:116 msgid "Tkinter questions" msgstr "" -#: ../../faq/gui.rst:39 +#: ../../faq/gui.rst:119 msgid "How do I freeze Tkinter applications?" msgstr "" -#: ../../faq/gui.rst:41 +#: ../../faq/gui.rst:121 msgid "" "Freeze is a tool to create stand-alone applications. When freezing Tkinter " "applications, the applications will not be truly stand-alone, as the " "application will still need the Tcl and Tk libraries." msgstr "" -#: ../../faq/gui.rst:45 +#: ../../faq/gui.rst:125 msgid "" "One solution is to ship the application with the Tcl and Tk libraries, and " "point to them at run-time using the :envvar:`TCL_LIBRARY` and :envvar:" "`TK_LIBRARY` environment variables." msgstr "" -#: ../../faq/gui.rst:49 +#: ../../faq/gui.rst:129 msgid "" "To get truly stand-alone applications, the Tcl scripts that form the library " "have to be integrated into the application as well. One tool supporting that " @@ -85,18 +208,18 @@ msgid "" "tix.sourceforge.net/)." msgstr "" -#: ../../faq/gui.rst:54 +#: ../../faq/gui.rst:134 msgid "" "Build Tix with SAM enabled, perform the appropriate call to :c:func:" "`Tclsam_init`, etc. inside Python's :file:`Modules/tkappinit.c`, and link " "with libtclsam and libtksam (you might include the Tix libraries as well)." msgstr "" -#: ../../faq/gui.rst:61 +#: ../../faq/gui.rst:141 msgid "Can I have Tk events handled while waiting for I/O?" msgstr "" -#: ../../faq/gui.rst:63 +#: ../../faq/gui.rst:143 msgid "" "On platforms other than Windows, yes, and you don't even need threads! But " "you'll have to restructure your I/O code a bit. Tk has the equivalent of " @@ -105,33 +228,21 @@ msgid "" "file descriptor. See :ref:`tkinter-file-handlers`." msgstr "" -#: ../../faq/gui.rst:71 +#: ../../faq/gui.rst:151 msgid "I can't get key bindings to work in Tkinter: why?" msgstr "" -#: ../../faq/gui.rst:73 +#: ../../faq/gui.rst:153 msgid "" "An often-heard complaint is that event handlers bound to events with the :" "meth:`bind` method don't get handled even when the appropriate key is " "pressed." msgstr "" -#: ../../faq/gui.rst:76 +#: ../../faq/gui.rst:156 msgid "" "The most common cause is that the widget to which the binding applies " "doesn't have \"keyboard focus\". Check out the Tk documentation for the " "focus command. Usually a widget is given the keyboard focus by clicking in " "it (but not for labels; see the takefocus option)." msgstr "" - -#~ msgid "Qt" -#~ msgstr "Qt" - -#~ msgid "Gtk+" -#~ msgstr "Gtk+" - -#~ msgid "FLTK" -#~ msgstr "FLTK" - -#~ msgid "OpenGL" -#~ msgstr "開放圖形庫(OpenGL)" diff --git a/faq/programming.po b/faq/programming.po index 28fce88c88..432d38d330 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-07 06:52+0000\n" +"POT-Creation-Date: 2020-06-20 18:08+0800\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-" @@ -39,7 +39,7 @@ msgid "" "etc.?" msgstr "是否有可以使用在程式碼階段,具有中斷點,步驟執行等功能的除錯器?" -#: ../../faq/programming.rst:17 ../../faq/programming.rst:57 +#: ../../faq/programming.rst:17 ../../faq/programming.rst:63 msgid "Yes." msgstr "有的" @@ -67,73 +67,88 @@ msgstr "" #: ../../faq/programming.rst:31 msgid "" "PythonWin is a Python IDE that includes a GUI debugger based on pdb. The " -"PythonWin debugger colors breakpoints and has quite a few cool features such " -"as debugging non-PythonWin programs. PythonWin is available as part of " -"`pywin32 `_ project and as a part of " -"the `ActivePython `_ " -"distribution." +"Pythonwin debugger colors breakpoints and has quite a few cool features such " +"as debugging non-Pythonwin programs. Pythonwin is available as part of the " +"`Python for Windows Extensions `__ project and as a part of the ActivePython distribution (see https://www." +"activestate.com/activepython\\ )." msgstr "" #: ../../faq/programming.rst:38 msgid "" -"`Eric `_ is an IDE built on PyQt and " -"the Scintilla editing component." +"`Boa Constructor `_ is an IDE and " +"GUI builder that uses wxWidgets. It offers visual frame creation and " +"manipulation, an object inspector, many views on the source like object " +"browsers, inheritance hierarchies, doc string generated html documentation, " +"an advanced debugger, integrated help, and Zope support." msgstr "" -#: ../../faq/programming.rst:41 +#: ../../faq/programming.rst:44 msgid "" -"`trepan3k `_ is a gdb-like " -"debugger." +"`Eric `_ is an IDE built on PyQt and " +"the Scintilla editing component." msgstr "" -#: ../../faq/programming.rst:43 +#: ../../faq/programming.rst:47 msgid "" -"`Visual Studio Code `_ is an IDE with " -"debugging tools that integrates with version-control software." +"Pydb is a version of the standard Python debugger pdb, modified for use with " +"DDD (Data Display Debugger), a popular graphical debugger front end. Pydb " +"can be found at http://bashdb.sourceforge.net/pydb/ and DDD can be found at " +"https://www.gnu.org/software/ddd." msgstr "" -#: ../../faq/programming.rst:46 +#: ../../faq/programming.rst:52 msgid "" "There are a number of commercial Python IDEs that include graphical " "debuggers. They include:" msgstr "有數個商業化Python整合化開發工具包含圖形除錯功能。這些包含:" -#: ../../faq/programming.rst:49 -msgid "`Wing IDE `_" +#: ../../faq/programming.rst:55 +msgid "Wing IDE (https://wingware.com/)" msgstr "" -#: ../../faq/programming.rst:50 -msgid "`Komodo IDE `_" +#: ../../faq/programming.rst:56 +msgid "Komodo IDE (https://komodoide.com/)" msgstr "" -#: ../../faq/programming.rst:51 -#, fuzzy -msgid "`PyCharm `_" +#: ../../faq/programming.rst:57 +msgid "PyCharm (https://www.jetbrains.com/pycharm/)" msgstr "PyCharm (https://www.jetbrains.com/pycharm/)" -#: ../../faq/programming.rst:55 -#, fuzzy -msgid "Are there tools to help find bugs or perform static analysis?" +#: ../../faq/programming.rst:61 +msgid "Is there a tool to help find bugs or perform static analysis?" msgstr "有沒有工具幫忙找 bug或執行靜態分析" -#: ../../faq/programming.rst:59 +#: ../../faq/programming.rst:65 msgid "" -"`Pylint `_ and `Pyflakes `_ do basic checking that will help you catch bugs sooner." +"PyChecker is a static analysis tool that finds bugs in Python source code " +"and warns about code complexity and style. You can get PyChecker from " +"http://pychecker.sourceforge.net/" msgstr "" -#: ../../faq/programming.rst:63 +#: ../../faq/programming.rst:69 +msgid "" +"`Pylint `_ is another tool that checks if a module " +"satisfies a coding standard, and also makes it possible to write plug-ins to " +"add a custom feature. In addition to the bug checking that PyChecker " +"performs, Pylint offers some additional features such as checking line " +"length, whether variable names are well-formed according to your coding " +"standard, whether declared interfaces are fully implemented, and more. " +"https://docs.pylint.org/%20provides%20a%20full%20list%20of%20Pylint's features." +msgstr "" + +#: ../../faq/programming.rst:77 msgid "" "Static type checkers such as `Mypy `_, `Pyre `_, and `Pytype `_ can " "check type hints in Python source code." msgstr "" -#: ../../faq/programming.rst:72 +#: ../../faq/programming.rst:84 msgid "How can I create a stand-alone binary from a Python script?" msgstr "" -#: ../../faq/programming.rst:74 +#: ../../faq/programming.rst:86 msgid "" "You don't need the ability to compile Python to C code if all you want is a " "stand-alone program that users can download and run without having to " @@ -142,7 +157,7 @@ msgid "" "together with a Python binary to produce a single executable." msgstr "" -#: ../../faq/programming.rst:80 +#: ../../faq/programming.rst:92 msgid "" "One is to use the freeze tool, which is included in the Python source tree " "as ``Tools/freeze``. It converts Python byte code to C arrays; a C compiler " @@ -150,7 +165,7 @@ msgid "" "the standard Python modules." msgstr "" -#: ../../faq/programming.rst:85 +#: ../../faq/programming.rst:97 msgid "" "It works by scanning your source recursively for import statements (in both " "forms) and looking for the modules in the standard Python path as well as in " @@ -163,77 +178,60 @@ msgid "" "exactly like your script." msgstr "" -#: ../../faq/programming.rst:94 +#: ../../faq/programming.rst:106 msgid "" -"The following packages can help with the creation of console and GUI " -"executables:" -msgstr "" - -#: ../../faq/programming.rst:97 -msgid "`Nuitka `_ (Cross-platform)" +"Obviously, freeze requires a C compiler. There are several other utilities " +"which don't. One is Thomas Heller's py2exe (Windows only) at" msgstr "" -#: ../../faq/programming.rst:98 -msgid "`PyInstaller `_ (Cross-platform)" -msgstr "" - -#: ../../faq/programming.rst:99 -msgid "" -"`PyOxidizer `_ (Cross-platform)" -msgstr "" +#: ../../faq/programming.rst:109 +msgid "http://www.py2exe.org/" +msgstr "http://www.py2exe.org/" -#: ../../faq/programming.rst:100 +#: ../../faq/programming.rst:111 msgid "" -"`cx_Freeze `_ (Cross-platform)" -msgstr "" - -#: ../../faq/programming.rst:101 -msgid "`py2app `_ (macOS only)" +"Another tool is Anthony Tuininga's `cx_Freeze `_." msgstr "" -#: ../../faq/programming.rst:102 -#, fuzzy -msgid "`py2exe `_ (Windows only)" -msgstr "http://www.py2exe.org/" - -#: ../../faq/programming.rst:105 +#: ../../faq/programming.rst:115 msgid "Are there coding standards or a style guide for Python programs?" msgstr "" -#: ../../faq/programming.rst:107 +#: ../../faq/programming.rst:117 msgid "" "Yes. The coding style required for standard library modules is documented " "as :pep:`8`." msgstr "" -#: ../../faq/programming.rst:112 +#: ../../faq/programming.rst:122 msgid "Core Language" msgstr "" -#: ../../faq/programming.rst:115 +#: ../../faq/programming.rst:125 msgid "Why am I getting an UnboundLocalError when the variable has a value?" msgstr "為什麼當變數有值時我得到錯誤訊息 UnboundLocalError" -#: ../../faq/programming.rst:117 +#: ../../faq/programming.rst:127 msgid "" "It can be a surprise to get the UnboundLocalError in previously working code " "when it is modified by adding an assignment statement somewhere in the body " "of a function." msgstr "" -#: ../../faq/programming.rst:121 +#: ../../faq/programming.rst:131 msgid "This code:" msgstr "這段程式碼:" -#: ../../faq/programming.rst:129 +#: ../../faq/programming.rst:139 msgid "works, but this code:" msgstr "可以執行,但是這段程式:" -#: ../../faq/programming.rst:136 +#: ../../faq/programming.rst:146 msgid "results in an UnboundLocalError:" msgstr "導致UnboundLocalError" -#: ../../faq/programming.rst:143 +#: ../../faq/programming.rst:153 msgid "" "This is because when you make an assignment to a variable in a scope, that " "variable becomes local to that scope and shadows any similarly named " @@ -243,30 +241,30 @@ msgid "" "uninitialized local variable and an error results." msgstr "" -#: ../../faq/programming.rst:150 +#: ../../faq/programming.rst:160 msgid "" "In the example above you can access the outer scope variable by declaring it " "global:" msgstr "" -#: ../../faq/programming.rst:161 +#: ../../faq/programming.rst:171 msgid "" "This explicit declaration is required in order to remind you that (unlike " "the superficially analogous situation with class and instance variables) you " "are actually modifying the value of the variable in the outer scope:" msgstr "" -#: ../../faq/programming.rst:168 +#: ../../faq/programming.rst:178 msgid "" "You can do a similar thing in a nested scope using the :keyword:`nonlocal` " "keyword:" msgstr "" -#: ../../faq/programming.rst:185 +#: ../../faq/programming.rst:195 msgid "What are the rules for local and global variables in Python?" msgstr "Python 的區域變數和全域變數有什麼規則?" -#: ../../faq/programming.rst:187 +#: ../../faq/programming.rst:197 msgid "" "In Python, variables that are only referenced inside a function are " "implicitly global. If a variable is assigned a value anywhere within the " @@ -274,7 +272,7 @@ msgid "" "global." msgstr "" -#: ../../faq/programming.rst:191 +#: ../../faq/programming.rst:201 msgid "" "Though a bit surprising at first, a moment's consideration explains this. " "On one hand, requiring :keyword:`global` for assigned variables provides a " @@ -285,19 +283,19 @@ msgid "" "of the ``global`` declaration for identifying side-effects." msgstr "" -#: ../../faq/programming.rst:201 +#: ../../faq/programming.rst:211 msgid "" "Why do lambdas defined in a loop with different values all return the same " "result?" msgstr "" -#: ../../faq/programming.rst:203 +#: ../../faq/programming.rst:213 msgid "" "Assume you use a for loop to define a few different lambdas (or even plain " "functions), e.g.::" msgstr "" -#: ../../faq/programming.rst:210 +#: ../../faq/programming.rst:220 msgid "" "This gives you a list that contains 5 lambdas that calculate ``x**2``. You " "might expect that, when called, they would return, respectively, ``0``, " @@ -305,7 +303,7 @@ msgid "" "see that they all return ``16``::" msgstr "" -#: ../../faq/programming.rst:220 +#: ../../faq/programming.rst:230 msgid "" "This happens because ``x`` is not local to the lambdas, but is defined in " "the outer scope, and it is accessed when the lambda is called --- not when " @@ -314,13 +312,13 @@ msgid "" "changing the value of ``x`` and see how the results of the lambdas change::" msgstr "" -#: ../../faq/programming.rst:230 +#: ../../faq/programming.rst:240 msgid "" "In order to avoid this, you need to save the values in variables local to " "the lambdas, so that they don't rely on the value of the global ``x``::" msgstr "" -#: ../../faq/programming.rst:237 +#: ../../faq/programming.rst:247 msgid "" "Here, ``n=x`` creates a new variable ``n`` local to the lambda and computed " "when the lambda is defined so that it has the same value that ``x`` had at " @@ -329,17 +327,17 @@ msgid "" "Therefore each lambda will now return the correct result::" msgstr "" -#: ../../faq/programming.rst:248 +#: ../../faq/programming.rst:258 msgid "" "Note that this behaviour is not peculiar to lambdas, but applies to regular " "functions too." msgstr "" -#: ../../faq/programming.rst:253 +#: ../../faq/programming.rst:263 msgid "How do I share global variables across modules?" msgstr "" -#: ../../faq/programming.rst:255 +#: ../../faq/programming.rst:265 msgid "" "The canonical way to share information across modules within a single " "program is to create a special module (often called config or cfg). Just " @@ -349,36 +347,36 @@ msgid "" "everywhere. For example:" msgstr "" -#: ../../faq/programming.rst:261 +#: ../../faq/programming.rst:271 msgid "config.py::" msgstr "" -#: ../../faq/programming.rst:265 +#: ../../faq/programming.rst:275 msgid "mod.py::" msgstr "" -#: ../../faq/programming.rst:270 +#: ../../faq/programming.rst:280 msgid "main.py::" msgstr "" -#: ../../faq/programming.rst:276 +#: ../../faq/programming.rst:286 msgid "" "Note that using a module is also the basis for implementing the Singleton " "design pattern, for the same reason." msgstr "" -#: ../../faq/programming.rst:281 +#: ../../faq/programming.rst:291 msgid "What are the \"best practices\" for using import in a module?" msgstr "" -#: ../../faq/programming.rst:283 +#: ../../faq/programming.rst:293 msgid "" "In general, don't use ``from modulename import *``. Doing so clutters the " "importer's namespace, and makes it much harder for linters to detect " "undefined names." msgstr "" -#: ../../faq/programming.rst:287 +#: ../../faq/programming.rst:297 msgid "" "Import modules at the top of a file. Doing so makes it clear what other " "modules your code requires and avoids questions of whether the module name " @@ -386,31 +384,31 @@ msgid "" "module imports, but using multiple imports per line uses less screen space." msgstr "" -#: ../../faq/programming.rst:292 +#: ../../faq/programming.rst:302 msgid "It's good practice if you import modules in the following order:" msgstr "" -#: ../../faq/programming.rst:294 +#: ../../faq/programming.rst:304 msgid "standard library modules -- e.g. ``sys``, ``os``, ``getopt``, ``re``" msgstr "" -#: ../../faq/programming.rst:295 +#: ../../faq/programming.rst:305 msgid "" "third-party library modules (anything installed in Python's site-packages " "directory) -- e.g. mx.DateTime, ZODB, PIL.Image, etc." msgstr "" -#: ../../faq/programming.rst:297 +#: ../../faq/programming.rst:307 msgid "locally-developed modules" msgstr "" -#: ../../faq/programming.rst:299 +#: ../../faq/programming.rst:309 msgid "" "It is sometimes necessary to move imports to a function or class to avoid " "problems with circular imports. Gordon McMillan says:" msgstr "" -#: ../../faq/programming.rst:302 +#: ../../faq/programming.rst:312 msgid "" "Circular imports are fine where both modules use the \"import \" " "form of import. They fail when the 2nd module wants to grab a name out of " @@ -419,7 +417,7 @@ msgid "" "module is busy importing the 2nd." msgstr "" -#: ../../faq/programming.rst:308 +#: ../../faq/programming.rst:318 msgid "" "In this case, if the second module is only used in one function, then the " "import can easily be moved into that function. By the time the import is " @@ -427,7 +425,7 @@ msgid "" "module can do its import." msgstr "" -#: ../../faq/programming.rst:313 +#: ../../faq/programming.rst:323 msgid "" "It may also be necessary to move imports out of the top level of code if " "some of the modules are platform-specific. In that case, it may not even be " @@ -436,7 +434,7 @@ msgid "" "a good option." msgstr "" -#: ../../faq/programming.rst:318 +#: ../../faq/programming.rst:328 msgid "" "Only move imports into a local scope, such as inside a function definition, " "if it's necessary to solve a problem such as avoiding a circular import or " @@ -450,24 +448,24 @@ msgid "" "of scope, the module is probably available in :data:`sys.modules`." msgstr "" -#: ../../faq/programming.rst:331 +#: ../../faq/programming.rst:341 msgid "Why are default values shared between objects?" msgstr "" -#: ../../faq/programming.rst:333 +#: ../../faq/programming.rst:343 msgid "" "This type of bug commonly bites neophyte programmers. Consider this " "function::" msgstr "" -#: ../../faq/programming.rst:340 +#: ../../faq/programming.rst:350 msgid "" "The first time you call this function, ``mydict`` contains a single item. " "The second time, ``mydict`` contains two items because when ``foo()`` begins " "executing, ``mydict`` starts out with an item already in it." msgstr "" -#: ../../faq/programming.rst:344 +#: ../../faq/programming.rst:354 msgid "" "It is often expected that a function call creates new objects for default " "values. This is not what happens. Default values are created exactly once, " @@ -476,14 +474,14 @@ msgid "" "this changed object." msgstr "" -#: ../../faq/programming.rst:349 +#: ../../faq/programming.rst:359 msgid "" "By definition, immutable objects such as numbers, strings, tuples, and " "``None``, are safe from change. Changes to mutable objects such as " "dictionaries, lists, and class instances can lead to confusion." msgstr "" -#: ../../faq/programming.rst:353 +#: ../../faq/programming.rst:363 msgid "" "Because of this feature, it is good programming practice to not use mutable " "objects as default values. Instead, use ``None`` as the default value and " @@ -491,11 +489,11 @@ msgid "" "list/dictionary/whatever if it is. For example, don't write::" msgstr "" -#: ../../faq/programming.rst:361 +#: ../../faq/programming.rst:371 msgid "but::" msgstr "" -#: ../../faq/programming.rst:367 +#: ../../faq/programming.rst:377 msgid "" "This feature can be useful. When you have a function that's time-consuming " "to compute, a common technique is to cache the parameters and the resulting " @@ -504,18 +502,18 @@ msgid "" "implemented like this::" msgstr "" -#: ../../faq/programming.rst:382 +#: ../../faq/programming.rst:392 msgid "" "You could use a global variable containing a dictionary instead of the " "default value; it's a matter of taste." msgstr "" -#: ../../faq/programming.rst:387 +#: ../../faq/programming.rst:397 msgid "" "How can I pass optional or keyword parameters from one function to another?" msgstr "" -#: ../../faq/programming.rst:389 +#: ../../faq/programming.rst:399 msgid "" "Collect the arguments using the ``*`` and ``**`` specifiers in the " "function's parameter list; this gives you the positional arguments as a " @@ -523,11 +521,11 @@ msgid "" "arguments when calling another function by using ``*`` and ``**``::" msgstr "" -#: ../../faq/programming.rst:408 +#: ../../faq/programming.rst:418 msgid "What is the difference between arguments and parameters?" msgstr "" -#: ../../faq/programming.rst:410 +#: ../../faq/programming.rst:420 msgid "" ":term:`Parameters ` are defined by the names that appear in a " "function definition, whereas :term:`arguments ` are the values " @@ -536,34 +534,34 @@ msgid "" "definition::" msgstr "" -#: ../../faq/programming.rst:418 +#: ../../faq/programming.rst:428 msgid "" "*foo*, *bar* and *kwargs* are parameters of ``func``. However, when calling " "``func``, for example::" msgstr "" -#: ../../faq/programming.rst:423 +#: ../../faq/programming.rst:433 msgid "the values ``42``, ``314``, and ``somevar`` are arguments." msgstr "" -#: ../../faq/programming.rst:427 +#: ../../faq/programming.rst:437 msgid "Why did changing list 'y' also change list 'x'?" msgstr "" -#: ../../faq/programming.rst:429 +#: ../../faq/programming.rst:439 msgid "If you wrote code like::" msgstr "" -#: ../../faq/programming.rst:439 +#: ../../faq/programming.rst:449 msgid "" "you might be wondering why appending an element to ``y`` changed ``x`` too." msgstr "" -#: ../../faq/programming.rst:441 +#: ../../faq/programming.rst:451 msgid "There are two factors that produce this result:" msgstr "" -#: ../../faq/programming.rst:443 +#: ../../faq/programming.rst:453 msgid "" "Variables are simply names that refer to objects. Doing ``y = x`` doesn't " "create a copy of the list -- it creates a new variable ``y`` that refers to " @@ -571,23 +569,23 @@ msgid "" "(the list), and both ``x`` and ``y`` refer to it." msgstr "" -#: ../../faq/programming.rst:447 +#: ../../faq/programming.rst:457 msgid "" "Lists are :term:`mutable`, which means that you can change their content." msgstr "" -#: ../../faq/programming.rst:449 +#: ../../faq/programming.rst:459 msgid "" "After the call to :meth:`~list.append`, the content of the mutable object " "has changed from ``[]`` to ``[10]``. Since both the variables refer to the " "same object, using either name accesses the modified value ``[10]``." msgstr "" -#: ../../faq/programming.rst:453 +#: ../../faq/programming.rst:463 msgid "If we instead assign an immutable object to ``x``::" msgstr "" -#: ../../faq/programming.rst:463 +#: ../../faq/programming.rst:473 msgid "" "we can see that in this case ``x`` and ``y`` are not equal anymore. This is " "because integers are :term:`immutable`, and when we do ``x = x + 1`` we are " @@ -598,7 +596,7 @@ msgid "" "(``x`` now refers to ``6`` but ``y`` still refers to ``5``)." msgstr "" -#: ../../faq/programming.rst:471 +#: ../../faq/programming.rst:481 msgid "" "Some operations (for example ``y.append(10)`` and ``y.sort()``) mutate the " "object, whereas superficially similar operations (for example ``y = y + " @@ -610,7 +608,7 @@ msgid "" "your program to generate an easily diagnosed error." msgstr "" -#: ../../faq/programming.rst:480 +#: ../../faq/programming.rst:490 msgid "" "However, there is one class of operations where the same operation sometimes " "has different behaviors with different types: the augmented assignment " @@ -620,18 +618,18 @@ msgid "" "1`` create new objects)." msgstr "" -#: ../../faq/programming.rst:487 +#: ../../faq/programming.rst:497 msgid "In other words:" msgstr "" -#: ../../faq/programming.rst:489 +#: ../../faq/programming.rst:499 msgid "" "If we have a mutable object (:class:`list`, :class:`dict`, :class:`set`, " "etc.), we can use some specific operations to mutate it and all the " "variables that refer to it will see the change." msgstr "" -#: ../../faq/programming.rst:492 +#: ../../faq/programming.rst:502 msgid "" "If we have an immutable object (:class:`str`, :class:`int`, :class:`tuple`, " "etc.), all the variables that refer to it will always see the same value, " @@ -639,17 +637,17 @@ msgid "" "new object." msgstr "" -#: ../../faq/programming.rst:497 +#: ../../faq/programming.rst:507 msgid "" "If you want to know if two variables refer to the same object or not, you " "can use the :keyword:`is` operator, or the built-in function :func:`id`." msgstr "" -#: ../../faq/programming.rst:502 +#: ../../faq/programming.rst:512 msgid "How do I write a function with output parameters (call by reference)?" msgstr "" -#: ../../faq/programming.rst:504 +#: ../../faq/programming.rst:514 msgid "" "Remember that arguments are passed by assignment in Python. Since " "assignment just creates references to objects, there's no alias between an " @@ -657,44 +655,44 @@ msgid "" "You can achieve the desired effect in a number of ways." msgstr "" -#: ../../faq/programming.rst:509 +#: ../../faq/programming.rst:519 msgid "By returning a tuple of the results::" msgstr "" -#: ../../faq/programming.rst:520 +#: ../../faq/programming.rst:530 msgid "This is almost always the clearest solution." msgstr "" -#: ../../faq/programming.rst:522 +#: ../../faq/programming.rst:532 msgid "" "By using global variables. This isn't thread-safe, and is not recommended." msgstr "" -#: ../../faq/programming.rst:524 +#: ../../faq/programming.rst:534 msgid "By passing a mutable (changeable in-place) object::" msgstr "" -#: ../../faq/programming.rst:535 +#: ../../faq/programming.rst:544 msgid "By passing in a dictionary that gets mutated::" msgstr "" -#: ../../faq/programming.rst:546 +#: ../../faq/programming.rst:554 msgid "Or bundle up values in a class instance::" msgstr "" -#: ../../faq/programming.rst:563 +#: ../../faq/programming.rst:570 msgid "There's almost never a good reason to get this complicated." msgstr "" -#: ../../faq/programming.rst:565 +#: ../../faq/programming.rst:572 msgid "Your best choice is to return a tuple containing the multiple results." msgstr "" -#: ../../faq/programming.rst:569 +#: ../../faq/programming.rst:576 msgid "How do you make a higher order function in Python?" msgstr "" -#: ../../faq/programming.rst:571 +#: ../../faq/programming.rst:578 msgid "" "You have two choices: you can use nested scopes or you can use callable " "objects. For example, suppose you wanted to define ``linear(a,b)`` which " @@ -702,71 +700,71 @@ msgid "" "scopes::" msgstr "" -#: ../../faq/programming.rst:580 +#: ../../faq/programming.rst:587 msgid "Or using a callable object::" msgstr "" -#: ../../faq/programming.rst:590 +#: ../../faq/programming.rst:597 msgid "In both cases, ::" msgstr "" -#: ../../faq/programming.rst:594 +#: ../../faq/programming.rst:601 msgid "gives a callable object where ``taxes(10e6) == 0.3 * 10e6 + 2``." msgstr "" -#: ../../faq/programming.rst:596 +#: ../../faq/programming.rst:603 msgid "" "The callable object approach has the disadvantage that it is a bit slower " "and results in slightly longer code. However, note that a collection of " "callables can share their signature via inheritance::" msgstr "" -#: ../../faq/programming.rst:605 +#: ../../faq/programming.rst:612 msgid "Object can encapsulate state for several methods::" msgstr "" -#: ../../faq/programming.rst:623 +#: ../../faq/programming.rst:630 msgid "" "Here ``inc()``, ``dec()`` and ``reset()`` act like functions which share the " "same counting variable." msgstr "" -#: ../../faq/programming.rst:628 +#: ../../faq/programming.rst:635 msgid "How do I copy an object in Python?" msgstr "" -#: ../../faq/programming.rst:630 +#: ../../faq/programming.rst:637 msgid "" "In general, try :func:`copy.copy` or :func:`copy.deepcopy` for the general " "case. Not all objects can be copied, but most can." msgstr "" -#: ../../faq/programming.rst:633 +#: ../../faq/programming.rst:640 msgid "" "Some objects can be copied more easily. Dictionaries have a :meth:`~dict." "copy` method::" msgstr "" -#: ../../faq/programming.rst:638 +#: ../../faq/programming.rst:645 msgid "Sequences can be copied by slicing::" msgstr "" -#: ../../faq/programming.rst:644 +#: ../../faq/programming.rst:651 msgid "How can I find the methods or attributes of an object?" msgstr "" -#: ../../faq/programming.rst:646 +#: ../../faq/programming.rst:653 msgid "" "For an instance x of a user-defined class, ``dir(x)`` returns an " "alphabetized list of the names containing the instance attributes and " "methods and attributes defined by its class." msgstr "" -#: ../../faq/programming.rst:652 +#: ../../faq/programming.rst:659 msgid "How can my code discover the name of an object?" msgstr "" -#: ../../faq/programming.rst:654 +#: ../../faq/programming.rst:661 msgid "" "Generally speaking, it can't, because objects don't really have names. " "Essentially, assignment always binds a name to a value; the same is true of " @@ -774,7 +772,7 @@ msgid "" "Consider the following code::" msgstr "" -#: ../../faq/programming.rst:670 +#: ../../faq/programming.rst:677 msgid "" "Arguably the class has a name: even though it is bound to two names and " "invoked through the name B the created instance is still reported as an " @@ -782,7 +780,7 @@ msgid "" "instance's name is a or b, since both names are bound to the same value." msgstr "" -#: ../../faq/programming.rst:675 +#: ../../faq/programming.rst:682 msgid "" "Generally speaking it should not be necessary for your code to \"know the " "names\" of particular values. Unless you are deliberately writing " @@ -790,13 +788,13 @@ msgid "" "approach might be beneficial." msgstr "" -#: ../../faq/programming.rst:680 +#: ../../faq/programming.rst:687 msgid "" "In comp.lang.python, Fredrik Lundh once gave an excellent analogy in answer " "to this question:" msgstr "" -#: ../../faq/programming.rst:683 +#: ../../faq/programming.rst:690 msgid "" "The same way as you get the name of that cat you found on your porch: the " "cat (object) itself cannot tell you its name, and it doesn't really care -- " @@ -804,77 +802,77 @@ msgid "" "(namespaces) if it's their cat (object)..." msgstr "" -#: ../../faq/programming.rst:688 +#: ../../faq/programming.rst:695 msgid "" "....and don't be surprised if you'll find that it's known by many names, or " "no name at all!" msgstr "" -#: ../../faq/programming.rst:693 +#: ../../faq/programming.rst:700 msgid "What's up with the comma operator's precedence?" msgstr "" -#: ../../faq/programming.rst:695 +#: ../../faq/programming.rst:702 msgid "Comma is not an operator in Python. Consider this session::" msgstr "" -#: ../../faq/programming.rst:700 +#: ../../faq/programming.rst:707 msgid "" "Since the comma is not an operator, but a separator between expressions the " "above is evaluated as if you had entered::" msgstr "" -#: ../../faq/programming.rst:705 +#: ../../faq/programming.rst:712 msgid "not::" msgstr "" -#: ../../faq/programming.rst:709 +#: ../../faq/programming.rst:716 msgid "" "The same is true of the various assignment operators (``=``, ``+=`` etc). " "They are not truly operators but syntactic delimiters in assignment " "statements." msgstr "" -#: ../../faq/programming.rst:714 +#: ../../faq/programming.rst:721 msgid "Is there an equivalent of C's \"?:\" ternary operator?" msgstr "" -#: ../../faq/programming.rst:716 +#: ../../faq/programming.rst:723 msgid "Yes, there is. The syntax is as follows::" msgstr "" -#: ../../faq/programming.rst:723 +#: ../../faq/programming.rst:730 msgid "" "Before this syntax was introduced in Python 2.5, a common idiom was to use " "logical operators::" msgstr "" -#: ../../faq/programming.rst:728 +#: ../../faq/programming.rst:735 msgid "" "However, this idiom is unsafe, as it can give wrong results when *on_true* " "has a false boolean value. Therefore, it is always better to use the ``... " "if ... else ...`` form." msgstr "" -#: ../../faq/programming.rst:734 +#: ../../faq/programming.rst:741 msgid "Is it possible to write obfuscated one-liners in Python?" msgstr "" -#: ../../faq/programming.rst:736 +#: ../../faq/programming.rst:743 msgid "" "Yes. Usually this is done by nesting :keyword:`lambda` within :keyword:`!" "lambda`. See the following three examples, due to Ulf Bartelt::" msgstr "" -#: ../../faq/programming.rst:763 +#: ../../faq/programming.rst:770 msgid "Don't try this at home, kids!" msgstr "" -#: ../../faq/programming.rst:769 +#: ../../faq/programming.rst:776 msgid "What does the slash(/) in the parameter list of a function mean?" msgstr "" -#: ../../faq/programming.rst:771 +#: ../../faq/programming.rst:778 msgid "" "A slash in the argument list of a function denotes that the parameters prior " "to it are positional-only. Positional-only parameters are the ones without " @@ -884,53 +882,53 @@ msgid "" "only parameters. Its documentation looks like this::" msgstr "" -#: ../../faq/programming.rst:784 +#: ../../faq/programming.rst:791 msgid "" "The slash at the end of the parameter list means that both parameters are " "positional-only. Thus, calling :func:`divmod` with keyword arguments would " "lead to an error::" msgstr "" -#: ../../faq/programming.rst:795 +#: ../../faq/programming.rst:802 msgid "Numbers and strings" msgstr "" -#: ../../faq/programming.rst:798 +#: ../../faq/programming.rst:805 msgid "How do I specify hexadecimal and octal integers?" msgstr "" -#: ../../faq/programming.rst:800 +#: ../../faq/programming.rst:807 msgid "" "To specify an octal digit, precede the octal value with a zero, and then a " "lower or uppercase \"o\". For example, to set the variable \"a\" to the " "octal value \"10\" (8 in decimal), type::" msgstr "" -#: ../../faq/programming.rst:808 +#: ../../faq/programming.rst:815 msgid "" "Hexadecimal is just as easy. Simply precede the hexadecimal number with a " "zero, and then a lower or uppercase \"x\". Hexadecimal digits can be " "specified in lower or uppercase. For example, in the Python interpreter::" msgstr "" -#: ../../faq/programming.rst:821 +#: ../../faq/programming.rst:828 msgid "Why does -22 // 10 return -3?" msgstr "" -#: ../../faq/programming.rst:823 +#: ../../faq/programming.rst:830 msgid "" "It's primarily driven by the desire that ``i % j`` have the same sign as " "``j``. If you want that, and also want::" msgstr "" -#: ../../faq/programming.rst:828 +#: ../../faq/programming.rst:835 msgid "" "then integer division has to return the floor. C also requires that " "identity to hold, and then compilers that truncate ``i // j`` need to make " "``i % j`` have the same sign as ``i``." msgstr "" -#: ../../faq/programming.rst:832 +#: ../../faq/programming.rst:839 msgid "" "There are few real use cases for ``i % j`` when ``j`` is negative. When " "``j`` is positive, there are many, and in virtually all of them it's more " @@ -939,18 +937,18 @@ msgid "" "bug waiting to bite." msgstr "" -#: ../../faq/programming.rst:840 +#: ../../faq/programming.rst:847 msgid "How do I convert a string to a number?" msgstr "" -#: ../../faq/programming.rst:842 +#: ../../faq/programming.rst:849 msgid "" "For integers, use the built-in :func:`int` type constructor, e.g. " "``int('144') == 144``. Similarly, :func:`float` converts to floating-point, " "e.g. ``float('144') == 144.0``." msgstr "" -#: ../../faq/programming.rst:846 +#: ../../faq/programming.rst:853 msgid "" "By default, these interpret the number as decimal, so that ``int('0144') == " "144`` holds true, and ``int('0x144')`` raises :exc:`ValueError`. " @@ -960,7 +958,7 @@ msgid "" "octal, and '0x' indicates a hex number." msgstr "" -#: ../../faq/programming.rst:853 +#: ../../faq/programming.rst:860 msgid "" "Do not use the built-in function :func:`eval` if all you need is to convert " "strings to numbers. :func:`eval` will be significantly slower and it " @@ -970,18 +968,18 @@ msgid "" "directory." msgstr "" -#: ../../faq/programming.rst:860 +#: ../../faq/programming.rst:867 msgid "" ":func:`eval` also has the effect of interpreting numbers as Python " "expressions, so that e.g. ``eval('09')`` gives a syntax error because Python " "does not allow leading '0' in a decimal number (except '0')." msgstr "" -#: ../../faq/programming.rst:866 +#: ../../faq/programming.rst:873 msgid "How do I convert a number to a string?" msgstr "" -#: ../../faq/programming.rst:868 +#: ../../faq/programming.rst:875 msgid "" "To convert, e.g., the number 144 to the string '144', use the built-in type " "constructor :func:`str`. If you want a hexadecimal or octal representation, " @@ -991,11 +989,11 @@ msgid "" "format(1.0/3.0)`` yields ``'0.333'``." msgstr "" -#: ../../faq/programming.rst:877 +#: ../../faq/programming.rst:884 msgid "How do I modify a string in place?" msgstr "" -#: ../../faq/programming.rst:879 +#: ../../faq/programming.rst:886 msgid "" "You can't, because strings are immutable. In most situations, you should " "simply construct a new string from the various parts you want to assemble it " @@ -1004,15 +1002,15 @@ msgid "" "module::" msgstr "" -#: ../../faq/programming.rst:909 +#: ../../faq/programming.rst:916 msgid "How do I use strings to call functions/methods?" msgstr "" -#: ../../faq/programming.rst:911 +#: ../../faq/programming.rst:918 msgid "There are various techniques." msgstr "" -#: ../../faq/programming.rst:913 +#: ../../faq/programming.rst:920 msgid "" "The best is to use a dictionary that maps strings to functions. The primary " "advantage of this technique is that the strings do not need to match the " @@ -1020,31 +1018,38 @@ msgid "" "a case construct::" msgstr "" -#: ../../faq/programming.rst:928 +#: ../../faq/programming.rst:935 msgid "Use the built-in function :func:`getattr`::" msgstr "" -#: ../../faq/programming.rst:933 +#: ../../faq/programming.rst:940 msgid "" "Note that :func:`getattr` works on any object, including classes, class " "instances, modules, and so on." msgstr "" -#: ../../faq/programming.rst:936 +#: ../../faq/programming.rst:943 msgid "This is used in several places in the standard library, like this::" msgstr "" -#: ../../faq/programming.rst:949 -msgid "Use :func:`locals` to resolve the function name::" +#: ../../faq/programming.rst:956 +msgid "Use :func:`locals` or :func:`eval` to resolve the function name::" +msgstr "" + +#: ../../faq/programming.rst:969 +msgid "" +"Note: Using :func:`eval` is slow and dangerous. If you don't have absolute " +"control over the contents of the string, someone could pass a string that " +"resulted in an arbitrary function being executed." msgstr "" -#: ../../faq/programming.rst:961 +#: ../../faq/programming.rst:974 msgid "" "Is there an equivalent to Perl's chomp() for removing trailing newlines from " "strings?" msgstr "" -#: ../../faq/programming.rst:963 +#: ../../faq/programming.rst:976 msgid "" "You can use ``S.rstrip(\"\\r\\n\")`` to remove all occurrences of any line " "terminator from the end of the string ``S`` without removing other trailing " @@ -1053,21 +1058,21 @@ msgid "" "removed::" msgstr "" -#: ../../faq/programming.rst:975 +#: ../../faq/programming.rst:988 msgid "" "Since this is typically only desired when reading text one line at a time, " "using ``S.rstrip()`` this way works well." msgstr "" -#: ../../faq/programming.rst:980 +#: ../../faq/programming.rst:993 msgid "Is there a scanf() or sscanf() equivalent?" msgstr "" -#: ../../faq/programming.rst:982 +#: ../../faq/programming.rst:995 msgid "Not as such." msgstr "" -#: ../../faq/programming.rst:984 +#: ../../faq/programming.rst:997 msgid "" "For simple input parsing, the easiest approach is usually to split the line " "into whitespace-delimited words using the :meth:`~str.split` method of " @@ -1077,86 +1082,86 @@ msgid "" "as a separator." msgstr "" -#: ../../faq/programming.rst:990 +#: ../../faq/programming.rst:1003 msgid "" "For more complicated input parsing, regular expressions are more powerful " "than C's :c:func:`sscanf` and better suited for the task." msgstr "" -#: ../../faq/programming.rst:995 +#: ../../faq/programming.rst:1008 msgid "What does 'UnicodeDecodeError' or 'UnicodeEncodeError' error mean?" msgstr "" -#: ../../faq/programming.rst:997 +#: ../../faq/programming.rst:1010 msgid "See the :ref:`unicode-howto`." msgstr "" -#: ../../faq/programming.rst:1001 +#: ../../faq/programming.rst:1014 msgid "Performance" msgstr "" -#: ../../faq/programming.rst:1004 +#: ../../faq/programming.rst:1017 msgid "My program is too slow. How do I speed it up?" msgstr "" -#: ../../faq/programming.rst:1006 +#: ../../faq/programming.rst:1019 msgid "" "That's a tough one, in general. First, here are a list of things to " "remember before diving further:" msgstr "" -#: ../../faq/programming.rst:1009 +#: ../../faq/programming.rst:1022 msgid "" "Performance characteristics vary across Python implementations. This FAQ " "focuses on :term:`CPython`." msgstr "" -#: ../../faq/programming.rst:1011 +#: ../../faq/programming.rst:1024 msgid "" "Behaviour can vary across operating systems, especially when talking about I/" "O or multi-threading." msgstr "" -#: ../../faq/programming.rst:1013 +#: ../../faq/programming.rst:1026 msgid "" "You should always find the hot spots in your program *before* attempting to " "optimize any code (see the :mod:`profile` module)." msgstr "" -#: ../../faq/programming.rst:1015 +#: ../../faq/programming.rst:1028 msgid "" "Writing benchmark scripts will allow you to iterate quickly when searching " "for improvements (see the :mod:`timeit` module)." msgstr "" -#: ../../faq/programming.rst:1017 +#: ../../faq/programming.rst:1030 msgid "" "It is highly recommended to have good code coverage (through unit testing or " "any other technique) before potentially introducing regressions hidden in " "sophisticated optimizations." msgstr "" -#: ../../faq/programming.rst:1021 +#: ../../faq/programming.rst:1034 msgid "" "That being said, there are many tricks to speed up Python code. Here are " "some general principles which go a long way towards reaching acceptable " "performance levels:" msgstr "" -#: ../../faq/programming.rst:1025 +#: ../../faq/programming.rst:1038 msgid "" "Making your algorithms faster (or changing to faster ones) can yield much " "larger benefits than trying to sprinkle micro-optimization tricks all over " "your code." msgstr "" -#: ../../faq/programming.rst:1029 +#: ../../faq/programming.rst:1042 msgid "" "Use the right data structures. Study documentation for the :ref:`bltin-" "types` and the :mod:`collections` module." msgstr "" -#: ../../faq/programming.rst:1032 +#: ../../faq/programming.rst:1045 msgid "" "When the standard library provides a primitive for doing something, it is " "likely (although not guaranteed) to be faster than any alternative you may " @@ -1167,7 +1172,7 @@ msgid "" "advanced usage)." msgstr "" -#: ../../faq/programming.rst:1040 +#: ../../faq/programming.rst:1053 msgid "" "Abstractions tend to create indirections and force the interpreter to work " "more. If the levels of indirection outweigh the amount of useful work done, " @@ -1176,7 +1181,7 @@ msgid "" "detrimental to readability)." msgstr "" -#: ../../faq/programming.rst:1046 +#: ../../faq/programming.rst:1059 msgid "" "If you have reached the limit of what pure Python can allow, there are tools " "to take you further away. For example, `Cython `_ can " @@ -1188,17 +1193,17 @@ msgid "" "yourself." msgstr "" -#: ../../faq/programming.rst:1056 +#: ../../faq/programming.rst:1069 msgid "" "The wiki page devoted to `performance tips `_." msgstr "" -#: ../../faq/programming.rst:1062 +#: ../../faq/programming.rst:1075 msgid "What is the most efficient way to concatenate many strings together?" msgstr "" -#: ../../faq/programming.rst:1064 +#: ../../faq/programming.rst:1077 msgid "" ":class:`str` and :class:`bytes` objects are immutable, therefore " "concatenating many strings together is inefficient as each concatenation " @@ -1206,38 +1211,38 @@ msgid "" "quadratic in the total string length." msgstr "" -#: ../../faq/programming.rst:1069 +#: ../../faq/programming.rst:1082 msgid "" "To accumulate many :class:`str` objects, the recommended idiom is to place " "them into a list and call :meth:`str.join` at the end::" msgstr "" -#: ../../faq/programming.rst:1077 +#: ../../faq/programming.rst:1090 msgid "(another reasonably efficient idiom is to use :class:`io.StringIO`)" msgstr "" -#: ../../faq/programming.rst:1079 +#: ../../faq/programming.rst:1092 msgid "" "To accumulate many :class:`bytes` objects, the recommended idiom is to " "extend a :class:`bytearray` object using in-place concatenation (the ``+=`` " "operator)::" msgstr "" -#: ../../faq/programming.rst:1088 +#: ../../faq/programming.rst:1101 msgid "Sequences (Tuples/Lists)" msgstr "" -#: ../../faq/programming.rst:1091 +#: ../../faq/programming.rst:1104 msgid "How do I convert between tuples and lists?" msgstr "" -#: ../../faq/programming.rst:1093 +#: ../../faq/programming.rst:1106 msgid "" "The type constructor ``tuple(seq)`` converts any sequence (actually, any " "iterable) into a tuple with the same items in the same order." msgstr "" -#: ../../faq/programming.rst:1096 +#: ../../faq/programming.rst:1109 msgid "" "For example, ``tuple([1, 2, 3])`` yields ``(1, 2, 3)`` and ``tuple('abc')`` " "yields ``('a', 'b', 'c')``. If the argument is a tuple, it does not make a " @@ -1245,7 +1250,7 @@ msgid "" "you aren't sure that an object is already a tuple." msgstr "" -#: ../../faq/programming.rst:1101 +#: ../../faq/programming.rst:1114 msgid "" "The type constructor ``list(seq)`` converts any sequence or iterable into a " "list with the same items in the same order. For example, ``list((1, 2, " @@ -1253,11 +1258,11 @@ msgid "" "If the argument is a list, it makes a copy just like ``seq[:]`` would." msgstr "" -#: ../../faq/programming.rst:1108 +#: ../../faq/programming.rst:1121 msgid "What's a negative index?" msgstr "" -#: ../../faq/programming.rst:1110 +#: ../../faq/programming.rst:1123 msgid "" "Python sequences are indexed with positive numbers and negative numbers. " "For positive numbers 0 is the first index 1 is the second index and so " @@ -1266,89 +1271,78 @@ msgid "" "``seq[len(seq)-n]``." msgstr "" -#: ../../faq/programming.rst:1115 +#: ../../faq/programming.rst:1128 msgid "" "Using negative indices can be very convenient. For example ``S[:-1]`` is " "all of the string except for its last character, which is useful for " "removing the trailing newline from a string." msgstr "" -#: ../../faq/programming.rst:1121 +#: ../../faq/programming.rst:1134 msgid "How do I iterate over a sequence in reverse order?" msgstr "" -#: ../../faq/programming.rst:1123 -msgid "Use the :func:`reversed` built-in function::" +#: ../../faq/programming.rst:1136 +msgid "" +"Use the :func:`reversed` built-in function, which is new in Python 2.4::" msgstr "" -#: ../../faq/programming.rst:1128 +#: ../../faq/programming.rst:1141 msgid "" "This won't touch your original sequence, but build a new copy with reversed " "order to iterate over." msgstr "" -#: ../../faq/programming.rst:1133 +#: ../../faq/programming.rst:1144 +msgid "With Python 2.3, you can use an extended slice syntax::" +msgstr "" + +#: ../../faq/programming.rst:1151 msgid "How do you remove duplicates from a list?" msgstr "" -#: ../../faq/programming.rst:1135 +#: ../../faq/programming.rst:1153 msgid "See the Python Cookbook for a long discussion of many ways to do this:" msgstr "" -#: ../../faq/programming.rst:1137 +#: ../../faq/programming.rst:1155 msgid "https://code.activestate.com/recipes/52560/" msgstr "" -#: ../../faq/programming.rst:1139 +#: ../../faq/programming.rst:1157 msgid "" "If you don't mind reordering the list, sort it and then scan from the end of " "the list, deleting duplicates as you go::" msgstr "" -#: ../../faq/programming.rst:1151 +#: ../../faq/programming.rst:1169 msgid "" "If all elements of the list may be used as set keys (i.e. they are all :term:" "`hashable`) this is often faster ::" msgstr "" -#: ../../faq/programming.rst:1156 +#: ../../faq/programming.rst:1174 msgid "" "This converts the list into a set, thereby removing duplicates, and then " "back into a list." msgstr "" -#: ../../faq/programming.rst:1161 -msgid "How do you remove multiple items from a list" -msgstr "" - -#: ../../faq/programming.rst:1163 -msgid "" -"As with removing duplicates, explicitly iterating in reverse with a delete " -"condition is one possibility. However, it is easier and faster to use slice " -"replacement with an implicit or explicit forward iteration. Here are three " -"variations.::" -msgstr "" - -#: ../../faq/programming.rst:1172 -msgid "The list comprehension may be fastest." -msgstr "" - -#: ../../faq/programming.rst:1176 +#: ../../faq/programming.rst:1179 msgid "How do you make an array in Python?" msgstr "" -#: ../../faq/programming.rst:1178 +#: ../../faq/programming.rst:1181 msgid "Use a list::" msgstr "" -#: ../../faq/programming.rst:1182 +#: ../../faq/programming.rst:1185 msgid "" "Lists are equivalent to C or Pascal arrays in their time complexity; the " "primary difference is that a Python list can contain objects of many " "different types." msgstr "" -#: ../../faq/programming.rst:1185 +#: ../../faq/programming.rst:1188 msgid "" "The ``array`` module also provides methods for creating arrays of fixed " "types with compact representations, but they are slower to index than " @@ -1356,12 +1350,12 @@ msgid "" "structures with various characteristics as well." msgstr "" -#: ../../faq/programming.rst:1190 +#: ../../faq/programming.rst:1193 msgid "" "To get Lisp-style linked lists, you can emulate cons cells using tuples::" msgstr "" -#: ../../faq/programming.rst:1194 +#: ../../faq/programming.rst:1197 msgid "" "If mutability is desired, you could use lists instead of tuples. Here the " "analogue of lisp car is ``lisp_list[0]`` and the analogue of cdr is " @@ -1369,23 +1363,23 @@ msgid "" "it's usually a lot slower than using Python lists." msgstr "" -#: ../../faq/programming.rst:1203 +#: ../../faq/programming.rst:1206 msgid "How do I create a multidimensional list?" msgstr "" -#: ../../faq/programming.rst:1205 +#: ../../faq/programming.rst:1208 msgid "You probably tried to make a multidimensional array like this::" msgstr "" -#: ../../faq/programming.rst:1209 +#: ../../faq/programming.rst:1212 msgid "This looks correct if you print it:" msgstr "" -#: ../../faq/programming.rst:1220 +#: ../../faq/programming.rst:1223 msgid "But when you assign a value, it shows up in multiple places:" msgstr "" -#: ../../faq/programming.rst:1232 +#: ../../faq/programming.rst:1235 msgid "" "The reason is that replicating a list with ``*`` doesn't create copies, it " "only creates references to the existing objects. The ``*3`` creates a list " @@ -1393,56 +1387,56 @@ msgid "" "will show in all rows, which is almost certainly not what you want." msgstr "" -#: ../../faq/programming.rst:1237 +#: ../../faq/programming.rst:1240 msgid "" "The suggested approach is to create a list of the desired length first and " "then fill in each element with a newly created list::" msgstr "" -#: ../../faq/programming.rst:1244 +#: ../../faq/programming.rst:1247 msgid "" "This generates a list containing 3 different lists of length two. You can " "also use a list comprehension::" msgstr "" -#: ../../faq/programming.rst:1250 +#: ../../faq/programming.rst:1253 msgid "" "Or, you can use an extension that provides a matrix datatype; `NumPy `_ is the best known." msgstr "" -#: ../../faq/programming.rst:1255 +#: ../../faq/programming.rst:1258 msgid "How do I apply a method to a sequence of objects?" msgstr "" -#: ../../faq/programming.rst:1257 +#: ../../faq/programming.rst:1260 msgid "Use a list comprehension::" msgstr "" -#: ../../faq/programming.rst:1264 +#: ../../faq/programming.rst:1267 msgid "" "Why does a_tuple[i] += ['item'] raise an exception when the addition works?" msgstr "" -#: ../../faq/programming.rst:1266 +#: ../../faq/programming.rst:1269 msgid "" "This is because of a combination of the fact that augmented assignment " "operators are *assignment* operators, and the difference between mutable and " "immutable objects in Python." msgstr "" -#: ../../faq/programming.rst:1270 +#: ../../faq/programming.rst:1273 msgid "" "This discussion applies in general when augmented assignment operators are " "applied to elements of a tuple that point to mutable objects, but we'll use " "a ``list`` and ``+=`` as our exemplar." msgstr "" -#: ../../faq/programming.rst:1274 +#: ../../faq/programming.rst:1277 msgid "If you wrote::" msgstr "" -#: ../../faq/programming.rst:1282 +#: ../../faq/programming.rst:1285 msgid "" "The reason for the exception should be immediately clear: ``1`` is added to " "the object ``a_tuple[0]`` points to (``1``), producing the result object, " @@ -1451,29 +1445,29 @@ msgid "" "an element of a tuple points to." msgstr "" -#: ../../faq/programming.rst:1288 +#: ../../faq/programming.rst:1291 msgid "" "Under the covers, what this augmented assignment statement is doing is " "approximately this::" msgstr "" -#: ../../faq/programming.rst:1297 +#: ../../faq/programming.rst:1300 msgid "" "It is the assignment part of the operation that produces the error, since a " "tuple is immutable." msgstr "" -#: ../../faq/programming.rst:1300 +#: ../../faq/programming.rst:1303 msgid "When you write something like::" msgstr "" -#: ../../faq/programming.rst:1308 +#: ../../faq/programming.rst:1311 msgid "" "The exception is a bit more surprising, and even more surprising is the fact " "that even though there was an error, the append worked::" msgstr "" -#: ../../faq/programming.rst:1314 +#: ../../faq/programming.rst:1317 msgid "" "To see why this happens, you need to know that (a) if an object implements " "an ``__iadd__`` magic method, it gets called when the ``+=`` augmented " @@ -1483,11 +1477,11 @@ msgid "" "that for lists, ``+=`` is a \"shorthand\" for ``list.extend``::" msgstr "" -#: ../../faq/programming.rst:1326 +#: ../../faq/programming.rst:1329 msgid "This is equivalent to::" msgstr "" -#: ../../faq/programming.rst:1331 +#: ../../faq/programming.rst:1334 msgid "" "The object pointed to by a_list has been mutated, and the pointer to the " "mutated object is assigned back to ``a_list``. The end result of the " @@ -1495,11 +1489,11 @@ msgid "" "``a_list`` was previously pointing to, but the assignment still happens." msgstr "" -#: ../../faq/programming.rst:1336 +#: ../../faq/programming.rst:1339 msgid "Thus, in our tuple example what is happening is equivalent to::" msgstr "" -#: ../../faq/programming.rst:1344 +#: ../../faq/programming.rst:1347 msgid "" "The ``__iadd__`` succeeds, and thus the list is extended, but even though " "``result`` points to the same object that ``a_tuple[0]`` already points to, " @@ -1507,13 +1501,13 @@ msgid "" "immutable." msgstr "" -#: ../../faq/programming.rst:1350 +#: ../../faq/programming.rst:1353 msgid "" "I want to do a complicated sort: can you do a Schwartzian Transform in " "Python?" msgstr "" -#: ../../faq/programming.rst:1352 +#: ../../faq/programming.rst:1355 msgid "" "The technique, attributed to Randal Schwartz of the Perl community, sorts " "the elements of a list by a metric which maps each element to its \"sort " @@ -1521,25 +1515,40 @@ msgid "" "method::" msgstr "" -#: ../../faq/programming.rst:1361 +#: ../../faq/programming.rst:1364 msgid "How can I sort one list by values from another list?" msgstr "" -#: ../../faq/programming.rst:1363 +#: ../../faq/programming.rst:1366 msgid "" "Merge them into an iterator of tuples, sort the resulting list, and then " "pick out the element you want. ::" msgstr "" -#: ../../faq/programming.rst:1378 +#: ../../faq/programming.rst:1380 +msgid "An alternative for the last step is::" +msgstr "" + +#: ../../faq/programming.rst:1385 +msgid "" +"If you find this more legible, you might prefer to use this instead of the " +"final list comprehension. However, it is almost twice as slow for long " +"lists. Why? First, the ``append()`` operation has to reallocate memory, and " +"while it uses some tricks to avoid doing that each time, it still has to do " +"it occasionally, and that costs quite a bit. Second, the expression " +"\"result.append\" requires an extra attribute lookup, and third, there's a " +"speed reduction from having to make all those function calls." +msgstr "" + +#: ../../faq/programming.rst:1395 msgid "Objects" msgstr "" -#: ../../faq/programming.rst:1381 +#: ../../faq/programming.rst:1398 msgid "What is a class?" msgstr "" -#: ../../faq/programming.rst:1383 +#: ../../faq/programming.rst:1400 msgid "" "A class is the particular object type created by executing a class " "statement. Class objects are used as templates to create instance objects, " @@ -1547,7 +1556,7 @@ msgid "" "datatype." msgstr "" -#: ../../faq/programming.rst:1387 +#: ../../faq/programming.rst:1404 msgid "" "A class can be based on one or more other classes, called its base " "class(es). It then inherits the attributes and methods of its base classes. " @@ -1557,22 +1566,22 @@ msgid "" "``OutlookMailbox`` that handle various specific mailbox formats." msgstr "" -#: ../../faq/programming.rst:1396 +#: ../../faq/programming.rst:1413 msgid "What is a method?" msgstr "" -#: ../../faq/programming.rst:1398 +#: ../../faq/programming.rst:1415 msgid "" "A method is a function on some object ``x`` that you normally call as ``x." "name(arguments...)``. Methods are defined as functions inside the class " "definition::" msgstr "" -#: ../../faq/programming.rst:1408 +#: ../../faq/programming.rst:1425 msgid "What is self?" msgstr "" -#: ../../faq/programming.rst:1410 +#: ../../faq/programming.rst:1427 msgid "" "Self is merely a conventional name for the first argument of a method. A " "method defined as ``meth(self, a, b, c)`` should be called as ``x.meth(a, b, " @@ -1580,17 +1589,17 @@ msgid "" "the called method will think it is called as ``meth(x, a, b, c)``." msgstr "" -#: ../../faq/programming.rst:1415 +#: ../../faq/programming.rst:1432 msgid "See also :ref:`why-self`." msgstr "" -#: ../../faq/programming.rst:1419 +#: ../../faq/programming.rst:1436 msgid "" "How do I check if an object is an instance of a given class or of a subclass " "of it?" msgstr "" -#: ../../faq/programming.rst:1421 +#: ../../faq/programming.rst:1438 msgid "" "Use the built-in function ``isinstance(obj, cls)``. You can check if an " "object is an instance of any of a number of classes by providing a tuple " @@ -1599,15 +1608,7 @@ msgid "" "``isinstance(obj, str)`` or ``isinstance(obj, (int, float, complex))``." msgstr "" -#: ../../faq/programming.rst:1427 -msgid "" -"Note that :func:`isinstance` also checks for virtual inheritance from an :" -"term:`abstract base class`. So, the test will return ``True`` for a " -"registered class even if hasn't directly or indirectly inherited from it. " -"To test for \"true inheritance\", scan the :term:`MRO` of the class:" -msgstr "" - -#: ../../faq/programming.rst:1462 +#: ../../faq/programming.rst:1444 msgid "" "Note that most programs do not use :func:`isinstance` on user-defined " "classes very often. If you are developing the classes yourself, a more " @@ -1617,17 +1618,17 @@ msgid "" "have a function that does something::" msgstr "" -#: ../../faq/programming.rst:1476 +#: ../../faq/programming.rst:1458 msgid "" "A better approach is to define a ``search()`` method on all the classes and " "just call it::" msgstr "" -#: ../../faq/programming.rst:1491 +#: ../../faq/programming.rst:1473 msgid "What is delegation?" msgstr "" -#: ../../faq/programming.rst:1493 +#: ../../faq/programming.rst:1475 msgid "" "Delegation is an object oriented technique (also called a design pattern). " "Let's say you have an object ``x`` and want to change the behaviour of just " @@ -1636,14 +1637,14 @@ msgid "" "other methods to the corresponding method of ``x``." msgstr "" -#: ../../faq/programming.rst:1499 +#: ../../faq/programming.rst:1481 msgid "" "Python programmers can easily implement delegation. For example, the " "following class implements a class that behaves like a file but converts all " "written data to uppercase::" msgstr "" -#: ../../faq/programming.rst:1514 +#: ../../faq/programming.rst:1496 msgid "" "Here the ``UpperOut`` class redefines the ``write()`` method to convert the " "argument string to uppercase before calling the underlying ``self._outfile." @@ -1653,7 +1654,7 @@ msgid "" "information about controlling attribute access." msgstr "" -#: ../../faq/programming.rst:1521 +#: ../../faq/programming.rst:1503 msgid "" "Note that for more general cases delegation can get trickier. When " "attributes must be set as well as retrieved, the class must define a :meth:" @@ -1662,23 +1663,23 @@ msgid "" "following::" msgstr "" -#: ../../faq/programming.rst:1532 +#: ../../faq/programming.rst:1514 msgid "" "Most :meth:`__setattr__` implementations must modify ``self.__dict__`` to " "store local state for self without causing an infinite recursion." msgstr "" -#: ../../faq/programming.rst:1537 +#: ../../faq/programming.rst:1519 msgid "" "How do I call a method defined in a base class from a derived class that " "overrides it?" msgstr "" -#: ../../faq/programming.rst:1539 +#: ../../faq/programming.rst:1521 msgid "Use the built-in :func:`super` function::" msgstr "" -#: ../../faq/programming.rst:1545 +#: ../../faq/programming.rst:1527 msgid "" "For version prior to 3.0, you may be using classic classes: For a class " "definition such as ``class Derived(Base): ...`` you can call method " @@ -1687,42 +1688,44 @@ msgid "" "you need to provide the ``self`` argument." msgstr "" -#: ../../faq/programming.rst:1553 +#: ../../faq/programming.rst:1535 msgid "How can I organize my code to make it easier to change the base class?" msgstr "" -#: ../../faq/programming.rst:1555 +#: ../../faq/programming.rst:1537 msgid "" -"You could assign the base class to an alias and derive from the alias. Then " -"all you have to change is the value assigned to the alias. Incidentally, " -"this trick is also handy if you want to decide dynamically (e.g. depending " -"on availability of resources) which base class to use. Example::" +"You could define an alias for the base class, assign the real base class to " +"it before your class definition, and use the alias throughout your class. " +"Then all you have to change is the value assigned to the alias. " +"Incidentally, this trick is also handy if you want to decide dynamically (e." +"g. depending on availability of resources) which base class to use. " +"Example::" msgstr "" -#: ../../faq/programming.rst:1570 +#: ../../faq/programming.rst:1552 msgid "How do I create static class data and static class methods?" msgstr "" -#: ../../faq/programming.rst:1572 +#: ../../faq/programming.rst:1554 msgid "" "Both static data and static methods (in the sense of C++ or Java) are " "supported in Python." msgstr "" -#: ../../faq/programming.rst:1575 +#: ../../faq/programming.rst:1557 msgid "" "For static data, simply define a class attribute. To assign a new value to " "the attribute, you have to explicitly use the class name in the assignment::" msgstr "" -#: ../../faq/programming.rst:1587 +#: ../../faq/programming.rst:1569 msgid "" "``c.count`` also refers to ``C.count`` for any ``c`` such that " "``isinstance(c, C)`` holds, unless overridden by ``c`` itself or by some " "class on the base-class search path from ``c.__class__`` back to ``C``." msgstr "" -#: ../../faq/programming.rst:1591 +#: ../../faq/programming.rst:1573 msgid "" "Caution: within a method of C, an assignment like ``self.count = 42`` " "creates a new and unrelated instance named \"count\" in ``self``'s own " @@ -1730,59 +1733,59 @@ msgid "" "whether inside a method or not::" msgstr "" -#: ../../faq/programming.rst:1598 +#: ../../faq/programming.rst:1580 msgid "Static methods are possible::" msgstr "" -#: ../../faq/programming.rst:1606 +#: ../../faq/programming.rst:1588 msgid "" "However, a far more straightforward way to get the effect of a static method " "is via a simple module-level function::" msgstr "" -#: ../../faq/programming.rst:1612 +#: ../../faq/programming.rst:1594 msgid "" "If your code is structured so as to define one class (or tightly related " "class hierarchy) per module, this supplies the desired encapsulation." msgstr "" -#: ../../faq/programming.rst:1617 +#: ../../faq/programming.rst:1599 msgid "How can I overload constructors (or methods) in Python?" msgstr "" -#: ../../faq/programming.rst:1619 +#: ../../faq/programming.rst:1601 msgid "" "This answer actually applies to all methods, but the question usually comes " "up first in the context of constructors." msgstr "" -#: ../../faq/programming.rst:1622 +#: ../../faq/programming.rst:1604 msgid "In C++ you'd write" msgstr "" -#: ../../faq/programming.rst:1631 +#: ../../faq/programming.rst:1613 msgid "" "In Python you have to write a single constructor that catches all cases " "using default arguments. For example::" msgstr "" -#: ../../faq/programming.rst:1641 +#: ../../faq/programming.rst:1623 msgid "This is not entirely equivalent, but close enough in practice." msgstr "" -#: ../../faq/programming.rst:1643 +#: ../../faq/programming.rst:1625 msgid "You could also try a variable-length argument list, e.g. ::" msgstr "" -#: ../../faq/programming.rst:1648 +#: ../../faq/programming.rst:1630 msgid "The same approach works for all method definitions." msgstr "" -#: ../../faq/programming.rst:1652 +#: ../../faq/programming.rst:1634 msgid "I try to use __spam and I get an error about _SomeClassName__spam." msgstr "" -#: ../../faq/programming.rst:1654 +#: ../../faq/programming.rst:1636 msgid "" "Variable names with double leading underscores are \"mangled\" to provide a " "simple but effective way to define class private variables. Any identifier " @@ -1792,7 +1795,7 @@ msgid "" "stripped." msgstr "" -#: ../../faq/programming.rst:1660 +#: ../../faq/programming.rst:1642 msgid "" "This doesn't guarantee privacy: an outside user can still deliberately " "access the \"_classname__spam\" attribute, and private values are visible in " @@ -1800,22 +1803,22 @@ msgid "" "private variable names at all." msgstr "" -#: ../../faq/programming.rst:1667 +#: ../../faq/programming.rst:1649 msgid "My class defines __del__ but it is not called when I delete the object." msgstr "" -#: ../../faq/programming.rst:1669 +#: ../../faq/programming.rst:1651 msgid "There are several possible reasons for this." msgstr "" -#: ../../faq/programming.rst:1671 +#: ../../faq/programming.rst:1653 msgid "" "The del statement does not necessarily call :meth:`__del__` -- it simply " "decrements the object's reference count, and if this reaches zero :meth:" "`__del__` is called." msgstr "" -#: ../../faq/programming.rst:1675 +#: ../../faq/programming.rst:1657 msgid "" "If your data structures contain circular links (e.g. a tree where each child " "has a parent reference and each parent has a list of children) the reference " @@ -1829,7 +1832,7 @@ msgid "" "cases where objects will never be collected." msgstr "" -#: ../../faq/programming.rst:1686 +#: ../../faq/programming.rst:1668 msgid "" "Despite the cycle collector, it's still a good idea to define an explicit " "``close()`` method on objects to be called whenever you're done with them. " @@ -1839,7 +1842,7 @@ msgid "" "once for the same object." msgstr "" -#: ../../faq/programming.rst:1693 +#: ../../faq/programming.rst:1675 msgid "" "Another way to avoid cyclical references is to use the :mod:`weakref` " "module, which allows you to point to objects without incrementing their " @@ -1847,28 +1850,28 @@ msgid "" "references for their parent and sibling references (if they need them!)." msgstr "" -#: ../../faq/programming.rst:1706 +#: ../../faq/programming.rst:1688 msgid "" "Finally, if your :meth:`__del__` method raises an exception, a warning " "message is printed to :data:`sys.stderr`." msgstr "" -#: ../../faq/programming.rst:1711 +#: ../../faq/programming.rst:1693 msgid "How do I get a list of all instances of a given class?" msgstr "" -#: ../../faq/programming.rst:1713 +#: ../../faq/programming.rst:1695 msgid "" "Python does not keep track of all instances of a class (or of a built-in " "type). You can program the class's constructor to keep track of all " "instances by keeping a list of weak references to each instance." msgstr "" -#: ../../faq/programming.rst:1719 +#: ../../faq/programming.rst:1701 msgid "Why does the result of ``id()`` appear to be not unique?" msgstr "" -#: ../../faq/programming.rst:1721 +#: ../../faq/programming.rst:1703 msgid "" "The :func:`id` builtin returns an integer that is guaranteed to be unique " "during the lifetime of the object. Since in CPython, this is the object's " @@ -1877,7 +1880,7 @@ msgid "" "memory. This is illustrated by this example:" msgstr "" -#: ../../faq/programming.rst:1732 +#: ../../faq/programming.rst:1714 msgid "" "The two ids belong to different integer objects that are created before, and " "deleted immediately after execution of the ``id()`` call. To be sure that " @@ -1885,130 +1888,15 @@ msgid "" "reference to the object:" msgstr "" -#: ../../faq/programming.rst:1745 -msgid "When can I rely on identity tests with the *is* operator?" -msgstr "" - -#: ../../faq/programming.rst:1747 -msgid "" -"The ``is`` operator tests for object identity. The test ``a is b`` is " -"equivalent to ``id(a) == id(b)``." -msgstr "" - -#: ../../faq/programming.rst:1750 -msgid "" -"The most important property of an identity test is that an object is always " -"identical to itself, ``a is a`` always returns ``True``. Identity tests are " -"usually faster than equality tests. And unlike equality tests, identity " -"tests are guaranteed to return a boolean ``True`` or ``False``." -msgstr "" - -#: ../../faq/programming.rst:1755 -msgid "" -"However, identity tests can *only* be substituted for equality tests when " -"object identity is assured. Generally, there are three circumstances where " -"identity is guaranteed:" -msgstr "" - -#: ../../faq/programming.rst:1759 -msgid "" -"1) Assignments create new names but do not change object identity. After " -"the assignment ``new = old``, it is guaranteed that ``new is old``." -msgstr "" - -#: ../../faq/programming.rst:1762 -msgid "" -"2) Putting an object in a container that stores object references does not " -"change object identity. After the list assignment ``s[0] = x``, it is " -"guaranteed that ``s[0] is x``." -msgstr "" - -#: ../../faq/programming.rst:1766 -msgid "" -"3) If an object is a singleton, it means that only one instance of that " -"object can exist. After the assignments ``a = None`` and ``b = None``, it " -"is guaranteed that ``a is b`` because ``None`` is a singleton." -msgstr "" - -#: ../../faq/programming.rst:1770 -msgid "" -"In most other circumstances, identity tests are inadvisable and equality " -"tests are preferred. In particular, identity tests should not be used to " -"check constants such as :class:`int` and :class:`str` which aren't " -"guaranteed to be singletons::" -msgstr "" - -#: ../../faq/programming.rst:1787 -msgid "Likewise, new instances of mutable containers are never identical::" -msgstr "" - -#: ../../faq/programming.rst:1794 -msgid "" -"In the standard library code, you will see several common patterns for " -"correctly using identity tests:" -msgstr "" - -#: ../../faq/programming.rst:1797 -msgid "" -"1) As recommended by :pep:`8`, an identity test is the preferred way to " -"check for ``None``. This reads like plain English in code and avoids " -"confusion with other objects that may have boolean values that evaluate to " -"false." -msgstr "" - -#: ../../faq/programming.rst:1801 -msgid "" -"2) Detecting optional arguments can be tricky when ``None`` is a valid input " -"value. In those situations, you can create an singleton sentinel object " -"guaranteed to be distinct from other objects. For example, here is how to " -"implement a method that behaves like :meth:`dict.pop`::" -msgstr "" - -#: ../../faq/programming.rst:1817 -msgid "" -"3) Container implementations sometimes need to augment equality tests with " -"identity tests. This prevents the code from being confused by objects such " -"as ``float('NaN')`` that are not equal to themselves." -msgstr "" - -#: ../../faq/programming.rst:1821 -msgid "" -"For example, here is the implementation of :meth:`collections.abc.Sequence." -"__contains__`::" -msgstr "" - -#: ../../faq/programming.rst:1832 -msgid "" -"How can a subclass control what data is stored in an immutable instance?" -msgstr "" - -#: ../../faq/programming.rst:1834 -msgid "" -"When subclassing an immutable type, override the :meth:`__new__` method " -"instead of the :meth:`__init__` method. The latter only runs *after* an " -"instance is created, which is too late to alter data in an immutable " -"instance." -msgstr "" - -#: ../../faq/programming.rst:1839 -msgid "" -"All of these immutable classes have a different signature than their parent " -"class:" -msgstr "" - -#: ../../faq/programming.rst:1865 -msgid "The classes can be used like this:" -msgstr "" - -#: ../../faq/programming.rst:1880 +#: ../../faq/programming.rst:1727 msgid "Modules" msgstr "" -#: ../../faq/programming.rst:1883 +#: ../../faq/programming.rst:1730 msgid "How do I create a .pyc file?" msgstr "" -#: ../../faq/programming.rst:1885 +#: ../../faq/programming.rst:1732 msgid "" "When a module is imported for the first time (or when the source file has " "changed since the current compiled file was created) a ``.pyc`` file " @@ -2019,7 +1907,7 @@ msgid "" "particular ``python`` binary that created it. (See :pep:`3147` for details.)" msgstr "" -#: ../../faq/programming.rst:1893 +#: ../../faq/programming.rst:1740 msgid "" "One reason that a ``.pyc`` file may not be created is a permissions problem " "with the directory containing the source file, meaning that the " @@ -2028,7 +1916,7 @@ msgid "" "testing with a web server." msgstr "" -#: ../../faq/programming.rst:1898 +#: ../../faq/programming.rst:1745 msgid "" "Unless the :envvar:`PYTHONDONTWRITEBYTECODE` environment variable is set, " "creation of a .pyc file is automatic if you're importing a module and Python " @@ -2037,7 +1925,7 @@ msgid "" "subdirectory." msgstr "" -#: ../../faq/programming.rst:1903 +#: ../../faq/programming.rst:1750 msgid "" "Running Python on a top level script is not considered an import and no ``." "pyc`` will be created. For example, if you have a top-level module ``foo." @@ -2047,27 +1935,27 @@ msgid "" "for ``foo`` since ``foo.py`` isn't being imported." msgstr "" -#: ../../faq/programming.rst:1910 +#: ../../faq/programming.rst:1757 msgid "" "If you need to create a ``.pyc`` file for ``foo`` -- that is, to create a ``." "pyc`` file for a module that is not imported -- you can, using the :mod:" "`py_compile` and :mod:`compileall` modules." msgstr "" -#: ../../faq/programming.rst:1914 +#: ../../faq/programming.rst:1761 msgid "" "The :mod:`py_compile` module can manually compile any module. One way is to " "use the ``compile()`` function in that module interactively::" msgstr "" -#: ../../faq/programming.rst:1920 +#: ../../faq/programming.rst:1767 msgid "" "This will write the ``.pyc`` to a ``__pycache__`` subdirectory in the same " "location as ``foo.py`` (or you can override that with the optional parameter " "``cfile``)." msgstr "" -#: ../../faq/programming.rst:1924 +#: ../../faq/programming.rst:1771 msgid "" "You can also automatically compile all files in a directory or directories " "using the :mod:`compileall` module. You can do it from the shell prompt by " @@ -2075,11 +1963,11 @@ msgid "" "Python files to compile::" msgstr "" -#: ../../faq/programming.rst:1933 +#: ../../faq/programming.rst:1780 msgid "How do I find the current module name?" msgstr "" -#: ../../faq/programming.rst:1935 +#: ../../faq/programming.rst:1782 msgid "" "A module can find out its own module name by looking at the predefined " "global variable ``__name__``. If this has the value ``'__main__'``, the " @@ -2088,76 +1976,76 @@ msgid "" "only execute this code after checking ``__name__``::" msgstr "" -#: ../../faq/programming.rst:1950 +#: ../../faq/programming.rst:1797 msgid "How can I have modules that mutually import each other?" msgstr "" -#: ../../faq/programming.rst:1952 +#: ../../faq/programming.rst:1799 msgid "Suppose you have the following modules:" msgstr "" -#: ../../faq/programming.rst:1954 +#: ../../faq/programming.rst:1801 msgid "foo.py::" msgstr "" -#: ../../faq/programming.rst:1959 +#: ../../faq/programming.rst:1806 msgid "bar.py::" msgstr "" -#: ../../faq/programming.rst:1964 +#: ../../faq/programming.rst:1811 msgid "The problem is that the interpreter will perform the following steps:" msgstr "" -#: ../../faq/programming.rst:1966 +#: ../../faq/programming.rst:1813 msgid "main imports foo" msgstr "" -#: ../../faq/programming.rst:1967 +#: ../../faq/programming.rst:1814 msgid "Empty globals for foo are created" msgstr "" -#: ../../faq/programming.rst:1968 +#: ../../faq/programming.rst:1815 msgid "foo is compiled and starts executing" msgstr "" -#: ../../faq/programming.rst:1969 +#: ../../faq/programming.rst:1816 msgid "foo imports bar" msgstr "" -#: ../../faq/programming.rst:1970 +#: ../../faq/programming.rst:1817 msgid "Empty globals for bar are created" msgstr "" -#: ../../faq/programming.rst:1971 +#: ../../faq/programming.rst:1818 msgid "bar is compiled and starts executing" msgstr "" -#: ../../faq/programming.rst:1972 +#: ../../faq/programming.rst:1819 msgid "" "bar imports foo (which is a no-op since there already is a module named foo)" msgstr "" -#: ../../faq/programming.rst:1973 +#: ../../faq/programming.rst:1820 msgid "bar.foo_var = foo.foo_var" msgstr "" -#: ../../faq/programming.rst:1975 +#: ../../faq/programming.rst:1822 msgid "" "The last step fails, because Python isn't done with interpreting ``foo`` yet " "and the global symbol dictionary for ``foo`` is still empty." msgstr "" -#: ../../faq/programming.rst:1978 +#: ../../faq/programming.rst:1825 msgid "" "The same thing happens when you use ``import foo``, and then try to access " "``foo.foo_var`` in global code." msgstr "" -#: ../../faq/programming.rst:1981 +#: ../../faq/programming.rst:1828 msgid "There are (at least) three possible workarounds for this problem." msgstr "" -#: ../../faq/programming.rst:1983 +#: ../../faq/programming.rst:1830 msgid "" "Guido van Rossum recommends avoiding all uses of ``from import ..." "``, and placing all code inside functions. Initializations of global " @@ -2166,59 +2054,59 @@ msgid "" "``.``." msgstr "" -#: ../../faq/programming.rst:1988 +#: ../../faq/programming.rst:1835 msgid "" "Jim Roskind suggests performing steps in the following order in each module:" msgstr "" -#: ../../faq/programming.rst:1990 +#: ../../faq/programming.rst:1837 msgid "" "exports (globals, functions, and classes that don't need imported base " "classes)" msgstr "" -#: ../../faq/programming.rst:1992 +#: ../../faq/programming.rst:1839 msgid "``import`` statements" msgstr "" -#: ../../faq/programming.rst:1993 +#: ../../faq/programming.rst:1840 msgid "" "active code (including globals that are initialized from imported values)." msgstr "" -#: ../../faq/programming.rst:1995 +#: ../../faq/programming.rst:1842 msgid "" "van Rossum doesn't like this approach much because the imports appear in a " "strange place, but it does work." msgstr "" -#: ../../faq/programming.rst:1998 +#: ../../faq/programming.rst:1845 msgid "" "Matthias Urlichs recommends restructuring your code so that the recursive " "import is not necessary in the first place." msgstr "" -#: ../../faq/programming.rst:2001 +#: ../../faq/programming.rst:1848 msgid "These solutions are not mutually exclusive." msgstr "" -#: ../../faq/programming.rst:2005 +#: ../../faq/programming.rst:1852 msgid "__import__('x.y.z') returns ; how do I get z?" msgstr "" -#: ../../faq/programming.rst:2007 +#: ../../faq/programming.rst:1854 msgid "" "Consider using the convenience function :func:`~importlib.import_module` " "from :mod:`importlib` instead::" msgstr "" -#: ../../faq/programming.rst:2014 +#: ../../faq/programming.rst:1861 msgid "" "When I edit an imported module and reimport it, the changes don't show up. " "Why does this happen?" msgstr "" -#: ../../faq/programming.rst:2016 +#: ../../faq/programming.rst:1863 msgid "" "For reasons of efficiency as well as consistency, Python only reads the " "module file on the first time a module is imported. If it didn't, in a " @@ -2227,13 +2115,13 @@ msgid "" "re-reading of a changed module, do this::" msgstr "" -#: ../../faq/programming.rst:2026 +#: ../../faq/programming.rst:1873 msgid "" "Warning: this technique is not 100% fool-proof. In particular, modules " "containing statements like ::" msgstr "" -#: ../../faq/programming.rst:2031 +#: ../../faq/programming.rst:1878 msgid "" "will continue to work with the old version of the imported objects. If the " "module contains class definitions, existing class instances will *not* be " @@ -2241,7 +2129,7 @@ msgid "" "paradoxical behaviour::" msgstr "" -#: ../../faq/programming.rst:2044 +#: ../../faq/programming.rst:1891 msgid "" "The nature of the problem is made clear if you print out the \"identity\" of " "the class objects::" diff --git a/faq/windows.po b/faq/windows.po index cbdc82b56f..f12a84a010 100644 --- a/faq/windows.po +++ b/faq/windows.po @@ -9,7 +9,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.7\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2021-09-07 06:52+0000\n" +"POT-Creation-Date: 2020-06-20 18:08+0800\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-" @@ -170,15 +170,18 @@ msgstr "" #: ../../faq/windows.rst:143 msgid "" -"See :ref:`faq-create-standalone-binary` for a list of tools that can be used " -"to make executables." +"See `cx_Freeze `_ for a " +"distutils extension that allows you to create console and GUI executables " +"from Python code. `py2exe `_, the most popular " +"extension for building Python 2.x-based executables, does not yet support " +"Python 3 but a version that does is in development." msgstr "" -#: ../../faq/windows.rst:148 +#: ../../faq/windows.rst:151 msgid "Is a ``*.pyd`` file the same as a DLL?" msgstr "" -#: ../../faq/windows.rst:150 +#: ../../faq/windows.rst:153 msgid "" "Yes, .pyd files are dll's, but there are a few differences. If you have a " "DLL named ``foo.pyd``, then it must have a function ``PyInit_foo()``. You " @@ -188,7 +191,7 @@ msgid "" "as that would cause Windows to require the DLL to be present." msgstr "" -#: ../../faq/windows.rst:157 +#: ../../faq/windows.rst:160 msgid "" "Note that the search path for foo.pyd is PYTHONPATH, not the same as the " "path that Windows uses to search for foo.dll. Also, foo.pyd need not be " @@ -199,17 +202,17 @@ msgid "" "available functions." msgstr "" -#: ../../faq/windows.rst:166 +#: ../../faq/windows.rst:169 msgid "How can I embed Python into a Windows application?" msgstr "" -#: ../../faq/windows.rst:168 +#: ../../faq/windows.rst:171 msgid "" "Embedding the Python interpreter in a Windows app can be summarized as " "follows:" msgstr "" -#: ../../faq/windows.rst:170 +#: ../../faq/windows.rst:173 msgid "" "Do _not_ build Python into your .exe file directly. On Windows, Python must " "be a DLL to handle importing modules that are themselves DLL's. (This is " @@ -218,7 +221,7 @@ msgid "" "version, a number such as \"33\" for Python 3.3." msgstr "" -#: ../../faq/windows.rst:176 +#: ../../faq/windows.rst:179 msgid "" "You can link to Python in two different ways. Load-time linking means " "linking against :file:`python{NN}.lib`, while run-time linking means linking " @@ -227,7 +230,7 @@ msgid "" "merely defines symbols for the linker.)" msgstr "" -#: ../../faq/windows.rst:182 +#: ../../faq/windows.rst:185 msgid "" "Run-time linking greatly simplifies link options; everything happens at run " "time. Your code must load :file:`python{NN}.dll` using the Windows " @@ -238,13 +241,13 @@ msgid "" "API." msgstr "" -#: ../../faq/windows.rst:189 +#: ../../faq/windows.rst:192 msgid "" "Borland note: convert :file:`python{NN}.lib` to OMF format using Coff2Omf." "exe first." msgstr "" -#: ../../faq/windows.rst:194 +#: ../../faq/windows.rst:197 msgid "" "If you use SWIG, it is easy to create a Python \"extension module\" that " "will make the app's data and methods available to Python. SWIG will handle " @@ -253,7 +256,7 @@ msgid "" "this also simplifies linking." msgstr "" -#: ../../faq/windows.rst:200 +#: ../../faq/windows.rst:203 msgid "" "SWIG will create an init function (a C function) whose name depends on the " "name of the extension module. For example, if the name of the module is " @@ -262,26 +265,26 @@ msgid "" "initializes a mostly hidden helper class used by the shadow class." msgstr "" -#: ../../faq/windows.rst:206 +#: ../../faq/windows.rst:209 msgid "" "The reason you can link the C code in step 2 into your .exe file is that " "calling the initialization function is equivalent to importing the module " "into Python! (This is the second key undocumented fact.)" msgstr "" -#: ../../faq/windows.rst:210 +#: ../../faq/windows.rst:213 msgid "" "In short, you can use the following code to initialize the Python " "interpreter with your extension module." msgstr "" -#: ../../faq/windows.rst:221 +#: ../../faq/windows.rst:224 msgid "" "There are two problems with Python's C API which will become apparent if you " "use a compiler other than MSVC, the compiler used to build pythonNN.dll." msgstr "" -#: ../../faq/windows.rst:224 +#: ../../faq/windows.rst:227 msgid "" "Problem 1: The so-called \"Very High Level\" functions that take FILE * " "arguments will not work in a multi-compiler environment because each " @@ -289,27 +292,27 @@ msgid "" "implementation standpoint these are very _low_ level functions." msgstr "" -#: ../../faq/windows.rst:229 +#: ../../faq/windows.rst:232 msgid "" "Problem 2: SWIG generates the following code when generating wrappers to " "void functions:" msgstr "" -#: ../../faq/windows.rst:238 +#: ../../faq/windows.rst:241 msgid "" "Alas, Py_None is a macro that expands to a reference to a complex data " "structure called _Py_NoneStruct inside pythonNN.dll. Again, this code will " "fail in a mult-compiler environment. Replace such code by:" msgstr "" -#: ../../faq/windows.rst:246 +#: ../../faq/windows.rst:249 msgid "" "It may be possible to use SWIG's ``%typemap`` command to make the change " "automatically, though I have not been able to get this to work (I'm a " "complete SWIG newbie)." msgstr "" -#: ../../faq/windows.rst:250 +#: ../../faq/windows.rst:253 msgid "" "Using a Python shell script to put up a Python interpreter window from " "inside your Windows app is not a good idea; the resulting window will be " @@ -321,18 +324,18 @@ msgid "" "and write() methods." msgstr "" -#: ../../faq/windows.rst:259 +#: ../../faq/windows.rst:262 msgid "How do I keep editors from inserting tabs into my Python source?" msgstr "" -#: ../../faq/windows.rst:261 +#: ../../faq/windows.rst:264 msgid "" "The FAQ does not recommend using tabs, and the Python style guide, :pep:`8`, " "recommends 4 spaces for distributed Python code; this is also the Emacs " "python-mode default." msgstr "" -#: ../../faq/windows.rst:265 +#: ../../faq/windows.rst:268 msgid "" "Under any editor, mixing tabs and spaces is a bad idea. MSVC is no " "different in this respect, and is easily configured to use spaces: Take :" @@ -341,20 +344,20 @@ msgid "" "radio button." msgstr "" -#: ../../faq/windows.rst:270 +#: ../../faq/windows.rst:273 msgid "" "Python raises :exc:`IndentationError` or :exc:`TabError` if mixed tabs and " "spaces are causing problems in leading whitespace. You may also run the :mod:" "`tabnanny` module to check a directory tree in batch mode." msgstr "" -#: ../../faq/windows.rst:277 +#: ../../faq/windows.rst:280 msgid "How do I check for a keypress without blocking?" msgstr "" -#: ../../faq/windows.rst:279 +#: ../../faq/windows.rst:282 msgid "" -"Use the :mod:`msvcrt` module. This is a standard Windows-specific extension " +"Use the msvcrt module. This is a standard Windows-specific extension " "module. It defines a function ``kbhit()`` which checks whether a keyboard " "hit is present, and ``getch()`` which gets one character without echoing it." msgstr "" diff --git a/glossary.po b/glossary.po index cc440af6b8..4d6efa66f8 100644 --- a/glossary.po +++ b/glossary.po @@ -5,7 +5,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.7\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2021-09-07 06:52+0000\n" +"POT-Creation-Date: 2020-06-20 18:08+0800\n" "PO-Revision-Date: 2018-07-15 18:56+0800\n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" "tw)\n" @@ -333,40 +333,30 @@ msgid "" msgstr "" #: ../../glossary.rst:191 -msgid "callback" -msgstr "" - -#: ../../glossary.rst:193 -msgid "" -"A subroutine function which is passed as an argument to be executed at some " -"point in the future." -msgstr "" - -#: ../../glossary.rst:195 msgid "class" msgstr "" -#: ../../glossary.rst:197 +#: ../../glossary.rst:193 msgid "" "A template for creating user-defined objects. Class definitions normally " "contain method definitions which operate on instances of the class." msgstr "" -#: ../../glossary.rst:200 +#: ../../glossary.rst:196 msgid "class variable" msgstr "" -#: ../../glossary.rst:202 +#: ../../glossary.rst:198 msgid "" "A variable defined in a class and intended to be modified only at class " "level (i.e., not in an instance of the class)." msgstr "" -#: ../../glossary.rst:204 +#: ../../glossary.rst:200 msgid "coercion" msgstr "" -#: ../../glossary.rst:206 +#: ../../glossary.rst:202 msgid "" "The implicit conversion of an instance of one type to another during an " "operation which involves two arguments of the same type. For example, " @@ -378,11 +368,11 @@ msgid "" "programmer, e.g., ``float(3)+4.5`` rather than just ``3+4.5``." msgstr "" -#: ../../glossary.rst:214 +#: ../../glossary.rst:210 msgid "complex number" msgstr "" -#: ../../glossary.rst:216 +#: ../../glossary.rst:212 msgid "" "An extension of the familiar real number system in which all numbers are " "expressed as a sum of a real part and an imaginary part. Imaginary numbers " @@ -395,21 +385,21 @@ msgid "" "not aware of a need for them, it's almost certain you can safely ignore them." msgstr "" -#: ../../glossary.rst:226 +#: ../../glossary.rst:222 msgid "context manager" msgstr "" -#: ../../glossary.rst:228 +#: ../../glossary.rst:224 msgid "" "An object which controls the environment seen in a :keyword:`with` statement " "by defining :meth:`__enter__` and :meth:`__exit__` methods. See :pep:`343`." msgstr "" -#: ../../glossary.rst:231 +#: ../../glossary.rst:227 msgid "context variable" msgstr "" -#: ../../glossary.rst:233 +#: ../../glossary.rst:229 msgid "" "A variable which can have different values depending on its context. This is " "similar to Thread-Local Storage in which each execution thread may have a " @@ -419,11 +409,11 @@ msgid "" "See :mod:`contextvars`." msgstr "" -#: ../../glossary.rst:240 +#: ../../glossary.rst:236 msgid "contiguous" msgstr "" -#: ../../glossary.rst:244 +#: ../../glossary.rst:240 msgid "" "A buffer is considered contiguous exactly if it is either *C-contiguous* or " "*Fortran contiguous*. Zero-dimensional buffers are C and Fortran " @@ -434,11 +424,11 @@ msgid "" "arrays, the first index varies the fastest." msgstr "" -#: ../../glossary.rst:252 +#: ../../glossary.rst:248 msgid "coroutine" msgstr "" -#: ../../glossary.rst:254 +#: ../../glossary.rst:250 msgid "" "Coroutines are a more generalized form of subroutines. Subroutines are " "entered at one point and exited at another point. Coroutines can be " @@ -446,11 +436,11 @@ msgid "" "implemented with the :keyword:`async def` statement. See also :pep:`492`." msgstr "" -#: ../../glossary.rst:259 +#: ../../glossary.rst:255 msgid "coroutine function" msgstr "" -#: ../../glossary.rst:261 +#: ../../glossary.rst:257 msgid "" "A function which returns a :term:`coroutine` object. A coroutine function " "may be defined with the :keyword:`async def` statement, and may contain :" @@ -458,11 +448,11 @@ msgid "" "These were introduced by :pep:`492`." msgstr "" -#: ../../glossary.rst:266 +#: ../../glossary.rst:262 msgid "CPython" msgstr "" -#: ../../glossary.rst:268 +#: ../../glossary.rst:264 msgid "" "The canonical implementation of the Python programming language, as " "distributed on `python.org `_. The term \"CPython\" " @@ -470,35 +460,35 @@ msgid "" "as Jython or IronPython." msgstr "" -#: ../../glossary.rst:272 +#: ../../glossary.rst:268 msgid "decorator" msgstr "" -#: ../../glossary.rst:274 +#: ../../glossary.rst:270 msgid "" "A function returning another function, usually applied as a function " "transformation using the ``@wrapper`` syntax. Common examples for " "decorators are :func:`classmethod` and :func:`staticmethod`." msgstr "" -#: ../../glossary.rst:278 +#: ../../glossary.rst:274 msgid "" "The decorator syntax is merely syntactic sugar, the following two function " "definitions are semantically equivalent::" msgstr "" -#: ../../glossary.rst:289 +#: ../../glossary.rst:285 msgid "" "The same concept exists for classes, but is less commonly used there. See " "the documentation for :ref:`function definitions ` and :ref:`class " "definitions ` for more about decorators." msgstr "" -#: ../../glossary.rst:292 +#: ../../glossary.rst:288 msgid "descriptor" msgstr "" -#: ../../glossary.rst:294 +#: ../../glossary.rst:290 msgid "" "Any object which defines the methods :meth:`__get__`, :meth:`__set__`, or :" "meth:`__delete__`. When a class attribute is a descriptor, its special " @@ -511,40 +501,27 @@ msgid "" "reference to super classes." msgstr "" -#: ../../glossary.rst:304 +#: ../../glossary.rst:300 msgid "" -"For more information about descriptors' methods, see :ref:`descriptors` or " -"the :ref:`Descriptor How To Guide `." +"For more information about descriptors' methods, see :ref:`descriptors`." msgstr "" -#: ../../glossary.rst:306 +#: ../../glossary.rst:301 msgid "dictionary" msgstr "" -#: ../../glossary.rst:308 +#: ../../glossary.rst:303 msgid "" "An associative array, where arbitrary keys are mapped to values. The keys " "can be any object with :meth:`__hash__` and :meth:`__eq__` methods. Called a " "hash in Perl." msgstr "" -#: ../../glossary.rst:311 -msgid "dictionary comprehension" -msgstr "" - -#: ../../glossary.rst:313 -msgid "" -"A compact way to process all or part of the elements in an iterable and " -"return a dictionary with the results. ``results = {n: n ** 2 for n in " -"range(10)}`` generates a dictionary containing key ``n`` mapped to value ``n " -"** 2``. See :ref:`comprehensions`." -msgstr "" - -#: ../../glossary.rst:317 +#: ../../glossary.rst:306 msgid "dictionary view" msgstr "" -#: ../../glossary.rst:319 +#: ../../glossary.rst:308 msgid "" "The objects returned from :meth:`dict.keys`, :meth:`dict.values`, and :meth:" "`dict.items` are called dictionary views. They provide a dynamic view on the " @@ -553,11 +530,11 @@ msgid "" "use ``list(dictview)``. See :ref:`dict-views`." msgstr "" -#: ../../glossary.rst:325 +#: ../../glossary.rst:314 msgid "docstring" msgstr "" -#: ../../glossary.rst:327 +#: ../../glossary.rst:316 msgid "" "A string literal which appears as the first expression in a class, function " "or module. While ignored when the suite is executed, it is recognized by " @@ -566,11 +543,11 @@ msgid "" "the canonical place for documentation of the object." msgstr "" -#: ../../glossary.rst:333 +#: ../../glossary.rst:322 msgid "duck-typing" msgstr "" -#: ../../glossary.rst:335 +#: ../../glossary.rst:324 msgid "" "A programming style which does not look at an object's type to determine if " "it has the right interface; instead, the method or attribute is simply " @@ -583,11 +560,11 @@ msgid "" "employs :func:`hasattr` tests or :term:`EAFP` programming." msgstr "" -#: ../../glossary.rst:344 +#: ../../glossary.rst:333 msgid "EAFP" msgstr "" -#: ../../glossary.rst:346 +#: ../../glossary.rst:335 msgid "" "Easier to ask for forgiveness than permission. This common Python coding " "style assumes the existence of valid keys or attributes and catches " @@ -597,11 +574,11 @@ msgid "" "many other languages such as C." msgstr "" -#: ../../glossary.rst:352 +#: ../../glossary.rst:341 msgid "expression" msgstr "" -#: ../../glossary.rst:354 +#: ../../glossary.rst:343 msgid "" "A piece of syntax which can be evaluated to some value. In other words, an " "expression is an accumulation of expression elements like literals, names, " @@ -612,32 +589,32 @@ msgid "" "expressions." msgstr "" -#: ../../glossary.rst:361 +#: ../../glossary.rst:350 msgid "extension module" msgstr "" -#: ../../glossary.rst:363 +#: ../../glossary.rst:352 msgid "" "A module written in C or C++, using Python's C API to interact with the core " "and with user code." msgstr "" -#: ../../glossary.rst:365 +#: ../../glossary.rst:354 msgid "f-string" msgstr "" -#: ../../glossary.rst:367 +#: ../../glossary.rst:356 msgid "" "String literals prefixed with ``'f'`` or ``'F'`` are commonly called \"f-" "strings\" which is short for :ref:`formatted string literals `. " "See also :pep:`498`." msgstr "" -#: ../../glossary.rst:370 +#: ../../glossary.rst:359 msgid "file object" msgstr "" -#: ../../glossary.rst:372 +#: ../../glossary.rst:361 msgid "" "An object exposing a file-oriented API (with methods such as :meth:`read()` " "or :meth:`write()`) to an underlying resource. Depending on the way it was " @@ -647,7 +624,7 @@ msgid "" "called :dfn:`file-like objects` or :dfn:`streams`." msgstr "" -#: ../../glossary.rst:380 +#: ../../glossary.rst:369 msgid "" "There are actually three categories of file objects: raw :term:`binary files " "`, buffered :term:`binary files ` and :term:`text " @@ -656,40 +633,40 @@ msgid "" "function." msgstr "" -#: ../../glossary.rst:385 +#: ../../glossary.rst:374 msgid "file-like object" msgstr "" -#: ../../glossary.rst:387 +#: ../../glossary.rst:376 msgid "A synonym for :term:`file object`." msgstr "" -#: ../../glossary.rst:388 +#: ../../glossary.rst:377 msgid "finder" msgstr "" -#: ../../glossary.rst:390 +#: ../../glossary.rst:379 msgid "" "An object that tries to find the :term:`loader` for a module that is being " "imported." msgstr "" -#: ../../glossary.rst:393 +#: ../../glossary.rst:382 msgid "" "Since Python 3.3, there are two types of finder: :term:`meta path finders " "` for use with :data:`sys.meta_path`, and :term:`path " "entry finders ` for use with :data:`sys.path_hooks`." msgstr "" -#: ../../glossary.rst:397 +#: ../../glossary.rst:386 msgid "See :pep:`302`, :pep:`420` and :pep:`451` for much more detail." msgstr "" -#: ../../glossary.rst:398 +#: ../../glossary.rst:387 msgid "floor division" msgstr "" -#: ../../glossary.rst:400 +#: ../../glossary.rst:389 msgid "" "Mathematical division that rounds down to nearest integer. The floor " "division operator is ``//``. For example, the expression ``11 // 4`` " @@ -698,11 +675,11 @@ msgid "" "rounded *downward*. See :pep:`238`." msgstr "" -#: ../../glossary.rst:405 +#: ../../glossary.rst:394 msgid "function" msgstr "" -#: ../../glossary.rst:407 +#: ../../glossary.rst:396 msgid "" "A series of statements which returns some value to a caller. It can also be " "passed zero or more :term:`arguments ` which may be used in the " @@ -710,51 +687,53 @@ msgid "" "ref:`function` section." msgstr "" -#: ../../glossary.rst:411 +#: ../../glossary.rst:400 msgid "function annotation" msgstr "" -#: ../../glossary.rst:413 +#: ../../glossary.rst:402 msgid "An :term:`annotation` of a function parameter or return value." msgstr "" -#: ../../glossary.rst:415 +#: ../../glossary.rst:404 msgid "" "Function annotations are usually used for :term:`type hints `: " "for example, this function is expected to take two :class:`int` arguments " "and is also expected to have an :class:`int` return value::" msgstr "" -#: ../../glossary.rst:423 +#: ../../glossary.rst:412 msgid "Function annotation syntax is explained in section :ref:`function`." msgstr "" -#: ../../glossary.rst:425 +#: ../../glossary.rst:414 msgid "" "See :term:`variable annotation` and :pep:`484`, which describe this " "functionality." msgstr "" -#: ../../glossary.rst:427 +#: ../../glossary.rst:416 msgid "__future__" msgstr "" -#: ../../glossary.rst:429 +#: ../../glossary.rst:418 +msgid "" +"A pseudo-module which programmers can use to enable new language features " +"which are not compatible with the current interpreter." +msgstr "" + +#: ../../glossary.rst:421 msgid "" -"A :ref:`future statement `, ``from __future__ import ``, " -"directs the compiler to compile the current module using syntax or semantics " -"that will become standard in a future release of Python. The :mod:" -"`__future__` module documents the possible values of *feature*. By " -"importing this module and evaluating its variables, you can see when a new " -"feature was first added to the language and when it will (or did) become the " -"default::" +"By importing the :mod:`__future__` module and evaluating its variables, you " +"can see when a new feature was first added to the language and when it " +"becomes the default::" msgstr "" -#: ../../glossary.rst:440 +#: ../../glossary.rst:428 msgid "garbage collection" msgstr "" -#: ../../glossary.rst:442 +#: ../../glossary.rst:430 msgid "" "The process of freeing memory when it is not used anymore. Python performs " "garbage collection via reference counting and a cyclic garbage collector " @@ -762,11 +741,11 @@ msgid "" "can be controlled using the :mod:`gc` module." msgstr "" -#: ../../glossary.rst:448 +#: ../../glossary.rst:436 msgid "generator" msgstr "" -#: ../../glossary.rst:450 +#: ../../glossary.rst:438 msgid "" "A function which returns a :term:`generator iterator`. It looks like a " "normal function except that it contains :keyword:`yield` expressions for " @@ -774,22 +753,22 @@ msgid "" "one at a time with the :func:`next` function." msgstr "" -#: ../../glossary.rst:455 +#: ../../glossary.rst:443 msgid "" "Usually refers to a generator function, but may refer to a *generator " "iterator* in some contexts. In cases where the intended meaning isn't " "clear, using the full terms avoids ambiguity." msgstr "" -#: ../../glossary.rst:458 +#: ../../glossary.rst:446 msgid "generator iterator" msgstr "" -#: ../../glossary.rst:460 +#: ../../glossary.rst:448 msgid "An object created by a :term:`generator` function." msgstr "" -#: ../../glossary.rst:462 +#: ../../glossary.rst:450 msgid "" "Each :keyword:`yield` temporarily suspends processing, remembering the " "location execution state (including local variables and pending try-" @@ -797,11 +776,11 @@ msgid "" "left off (in contrast to functions which start fresh on every invocation)." msgstr "" -#: ../../glossary.rst:469 +#: ../../glossary.rst:457 msgid "generator expression" msgstr "" -#: ../../glossary.rst:471 +#: ../../glossary.rst:459 msgid "" "An expression that returns an iterator. It looks like a normal expression " "followed by a :keyword:`!for` clause defining a loop variable, range, and an " @@ -809,53 +788,36 @@ msgid "" "for an enclosing function::" msgstr "" -#: ../../glossary.rst:478 +#: ../../glossary.rst:466 msgid "generic function" msgstr "" -#: ../../glossary.rst:480 +#: ../../glossary.rst:468 msgid "" "A function composed of multiple functions implementing the same operation " "for different types. Which implementation should be used during a call is " "determined by the dispatch algorithm." msgstr "" -#: ../../glossary.rst:484 +#: ../../glossary.rst:472 msgid "" "See also the :term:`single dispatch` glossary entry, the :func:`functools." "singledispatch` decorator, and :pep:`443`." msgstr "" -#: ../../glossary.rst:486 -msgid "generic type" -msgstr "" - -#: ../../glossary.rst:488 -msgid "" -"A :term:`type` that can be parameterized; typically a container like :class:" -"`list`. Used for :term:`type hints ` and :term:`annotations " -"`." -msgstr "" - -#: ../../glossary.rst:492 -msgid "" -"See :pep:`483` for more details, and :mod:`typing` or :ref:`generic alias " -"type ` for its uses." -msgstr "" - -#: ../../glossary.rst:494 +#: ../../glossary.rst:475 msgid "GIL" msgstr "" -#: ../../glossary.rst:496 +#: ../../glossary.rst:477 msgid "See :term:`global interpreter lock`." msgstr "" -#: ../../glossary.rst:497 +#: ../../glossary.rst:478 msgid "global interpreter lock" msgstr "" -#: ../../glossary.rst:499 +#: ../../glossary.rst:480 msgid "" "The mechanism used by the :term:`CPython` interpreter to assure that only " "one thread executes Python :term:`bytecode` at a time. This simplifies the " @@ -866,7 +828,7 @@ msgid "" "processor machines." msgstr "" -#: ../../glossary.rst:508 +#: ../../glossary.rst:489 msgid "" "However, some extension modules, either standard or third-party, are " "designed so as to release the GIL when doing computationally-intensive tasks " @@ -874,7 +836,7 @@ msgid "" "I/O." msgstr "" -#: ../../glossary.rst:513 +#: ../../glossary.rst:494 msgid "" "Past efforts to create a \"free-threaded\" interpreter (one which locks " "shared data at a much finer granularity) have not been successful because " @@ -883,22 +845,22 @@ msgid "" "more complicated and therefore costlier to maintain." msgstr "" -#: ../../glossary.rst:519 +#: ../../glossary.rst:500 msgid "hash-based pyc" msgstr "" -#: ../../glossary.rst:521 +#: ../../glossary.rst:502 msgid "" "A bytecode cache file that uses the hash rather than the last-modified time " "of the corresponding source file to determine its validity. See :ref:`pyc-" "invalidation`." msgstr "" -#: ../../glossary.rst:524 +#: ../../glossary.rst:505 msgid "hashable" msgstr "" -#: ../../glossary.rst:526 +#: ../../glossary.rst:507 msgid "" "An object is *hashable* if it has a hash value which never changes during " "its lifetime (it needs a :meth:`__hash__` method), and can be compared to " @@ -906,13 +868,13 @@ msgid "" "compare equal must have the same hash value." msgstr "" -#: ../../glossary.rst:531 +#: ../../glossary.rst:512 msgid "" "Hashability makes an object usable as a dictionary key and a set member, " "because these data structures use the hash value internally." msgstr "" -#: ../../glossary.rst:534 +#: ../../glossary.rst:515 msgid "" "Most of Python's immutable built-in objects are hashable; mutable containers " "(such as lists or dictionaries) are not; immutable containers (such as " @@ -922,22 +884,22 @@ msgid "" "value is derived from their :func:`id`." msgstr "" -#: ../../glossary.rst:541 +#: ../../glossary.rst:522 msgid "IDLE" msgstr "" -#: ../../glossary.rst:543 +#: ../../glossary.rst:524 msgid "" "An Integrated Development Environment for Python. IDLE is a basic editor " "and interpreter environment which ships with the standard distribution of " "Python." msgstr "" -#: ../../glossary.rst:546 +#: ../../glossary.rst:527 msgid "immutable" msgstr "" -#: ../../glossary.rst:548 +#: ../../glossary.rst:529 msgid "" "An object with a fixed value. Immutable objects include numbers, strings " "and tuples. Such an object cannot be altered. A new object has to be " @@ -946,11 +908,11 @@ msgid "" "dictionary." msgstr "" -#: ../../glossary.rst:553 +#: ../../glossary.rst:534 msgid "import path" msgstr "" -#: ../../glossary.rst:555 +#: ../../glossary.rst:536 msgid "" "A list of locations (or :term:`path entries `) that are searched " "by the :term:`path based finder` for modules to import. During import, this " @@ -958,31 +920,31 @@ msgid "" "it may also come from the parent package's ``__path__`` attribute." msgstr "" -#: ../../glossary.rst:560 +#: ../../glossary.rst:541 msgid "importing" msgstr "" -#: ../../glossary.rst:562 +#: ../../glossary.rst:543 msgid "" "The process by which Python code in one module is made available to Python " "code in another module." msgstr "" -#: ../../glossary.rst:564 +#: ../../glossary.rst:545 msgid "importer" msgstr "" -#: ../../glossary.rst:566 +#: ../../glossary.rst:547 msgid "" "An object that both finds and loads a module; both a :term:`finder` and :" "term:`loader` object." msgstr "" -#: ../../glossary.rst:568 +#: ../../glossary.rst:549 msgid "interactive" msgstr "" -#: ../../glossary.rst:570 +#: ../../glossary.rst:551 msgid "" "Python has an interactive interpreter which means you can enter statements " "and expressions at the interpreter prompt, immediately execute them and see " @@ -991,11 +953,11 @@ msgid "" "test out new ideas or inspect modules and packages (remember ``help(x)``)." msgstr "" -#: ../../glossary.rst:576 +#: ../../glossary.rst:557 msgid "interpreted" msgstr "" -#: ../../glossary.rst:578 +#: ../../glossary.rst:559 msgid "" "Python is an interpreted language, as opposed to a compiled one, though the " "distinction can be blurry because of the presence of the bytecode compiler. " @@ -1005,11 +967,11 @@ msgid "" "generally also run more slowly. See also :term:`interactive`." msgstr "" -#: ../../glossary.rst:585 +#: ../../glossary.rst:566 msgid "interpreter shutdown" msgstr "" -#: ../../glossary.rst:587 +#: ../../glossary.rst:568 msgid "" "When asked to shut down, the Python interpreter enters a special phase where " "it gradually releases all allocated resources, such as modules and various " @@ -1021,27 +983,27 @@ msgid "" "the warnings machinery)." msgstr "" -#: ../../glossary.rst:596 +#: ../../glossary.rst:577 msgid "" "The main reason for interpreter shutdown is that the ``__main__`` module or " "the script being run has finished executing." msgstr "" -#: ../../glossary.rst:598 +#: ../../glossary.rst:579 msgid "iterable" msgstr "" -#: ../../glossary.rst:600 +#: ../../glossary.rst:581 msgid "" "An object capable of returning its members one at a time. Examples of " "iterables include all sequence types (such as :class:`list`, :class:`str`, " "and :class:`tuple`) and some non-sequence types like :class:`dict`, :term:" "`file objects `, and objects of any classes you define with an :" "meth:`__iter__` method or with a :meth:`__getitem__` method that implements :" -"term:`Sequence ` semantics." +"term:`Sequence` semantics." msgstr "" -#: ../../glossary.rst:607 +#: ../../glossary.rst:588 msgid "" "Iterables can be used in a :keyword:`for` loop and in many other places " "where a sequence is needed (:func:`zip`, :func:`map`, ...). When an " @@ -1054,11 +1016,11 @@ msgid "" "also :term:`iterator`, :term:`sequence`, and :term:`generator`." msgstr "" -#: ../../glossary.rst:617 +#: ../../glossary.rst:598 msgid "iterator" msgstr "" -#: ../../glossary.rst:619 +#: ../../glossary.rst:600 msgid "" "An object representing a stream of data. Repeated calls to the iterator's :" "meth:`~iterator.__next__` method (or passing it to the built-in function :" @@ -1076,22 +1038,22 @@ msgid "" "previous iteration pass, making it appear like an empty container." msgstr "" -#: ../../glossary.rst:634 +#: ../../glossary.rst:615 msgid "More information can be found in :ref:`typeiter`." msgstr "" -#: ../../glossary.rst:635 +#: ../../glossary.rst:616 msgid "key function" msgstr "" -#: ../../glossary.rst:637 +#: ../../glossary.rst:618 msgid "" "A key function or collation function is a callable that returns a value used " "for sorting or ordering. For example, :func:`locale.strxfrm` is used to " "produce a sort key that is aware of locale specific sort conventions." msgstr "" -#: ../../glossary.rst:642 +#: ../../glossary.rst:623 msgid "" "A number of tools in Python accept key functions to control how elements are " "ordered or grouped. They include :func:`min`, :func:`max`, :func:`sorted`, :" @@ -1099,7 +1061,7 @@ msgid "" "nlargest`, and :func:`itertools.groupby`." msgstr "" -#: ../../glossary.rst:648 +#: ../../glossary.rst:629 msgid "" "There are several ways to create a key function. For example. the :meth:" "`str.lower` method can serve as a key function for case insensitive sorts. " @@ -1111,30 +1073,30 @@ msgid "" "how to create and use key functions." msgstr "" -#: ../../glossary.rst:656 +#: ../../glossary.rst:637 msgid "keyword argument" msgstr "" -#: ../../glossary.rst:658 ../../glossary.rst:935 +#: ../../glossary.rst:639 ../../glossary.rst:916 msgid "See :term:`argument`." msgstr "" -#: ../../glossary.rst:659 +#: ../../glossary.rst:640 msgid "lambda" msgstr "" -#: ../../glossary.rst:661 +#: ../../glossary.rst:642 msgid "" "An anonymous inline function consisting of a single :term:`expression` which " "is evaluated when the function is called. The syntax to create a lambda " "function is ``lambda [parameters]: expression``" msgstr "" -#: ../../glossary.rst:664 +#: ../../glossary.rst:645 msgid "LBYL" msgstr "" -#: ../../glossary.rst:666 +#: ../../glossary.rst:647 msgid "" "Look before you leap. This coding style explicitly tests for pre-conditions " "before making calls or lookups. This style contrasts with the :term:`EAFP` " @@ -1142,7 +1104,7 @@ msgid "" "statements." msgstr "" -#: ../../glossary.rst:671 +#: ../../glossary.rst:652 msgid "" "In a multi-threaded environment, the LBYL approach can risk introducing a " "race condition between \"the looking\" and \"the leaping\". For example, " @@ -1151,22 +1113,22 @@ msgid "" "This issue can be solved with locks or by using the EAFP approach." msgstr "" -#: ../../glossary.rst:676 +#: ../../glossary.rst:657 msgid "list" msgstr "" -#: ../../glossary.rst:678 +#: ../../glossary.rst:659 msgid "" "A built-in Python :term:`sequence`. Despite its name it is more akin to an " "array in other languages than to a linked list since access to elements is " "O(1)." msgstr "" -#: ../../glossary.rst:681 +#: ../../glossary.rst:662 msgid "list comprehension" msgstr "" -#: ../../glossary.rst:683 +#: ../../glossary.rst:664 msgid "" "A compact way to process all or part of the elements in a sequence and " "return a list with the results. ``result = ['{:#04x}'.format(x) for x in " @@ -1175,11 +1137,11 @@ msgid "" "optional. If omitted, all elements in ``range(256)`` are processed." msgstr "" -#: ../../glossary.rst:689 +#: ../../glossary.rst:670 msgid "loader" msgstr "" -#: ../../glossary.rst:691 +#: ../../glossary.rst:672 msgid "" "An object that loads a module. It must define a method named :meth:" "`load_module`. A loader is typically returned by a :term:`finder`. See :pep:" @@ -1187,19 +1149,19 @@ msgid "" "base class`." msgstr "" -#: ../../glossary.rst:695 +#: ../../glossary.rst:676 msgid "magic method" msgstr "" -#: ../../glossary.rst:699 +#: ../../glossary.rst:680 msgid "An informal synonym for :term:`special method`." msgstr "" -#: ../../glossary.rst:700 +#: ../../glossary.rst:681 msgid "mapping" msgstr "" -#: ../../glossary.rst:702 +#: ../../glossary.rst:683 msgid "" "A container object that supports arbitrary key lookups and implements the " "methods specified in the :class:`~collections.abc.Mapping` or :class:" @@ -1209,28 +1171,28 @@ msgid "" "`collections.Counter`." msgstr "" -#: ../../glossary.rst:708 +#: ../../glossary.rst:689 msgid "meta path finder" msgstr "" -#: ../../glossary.rst:710 +#: ../../glossary.rst:691 msgid "" "A :term:`finder` returned by a search of :data:`sys.meta_path`. Meta path " "finders are related to, but different from :term:`path entry finders `." msgstr "" -#: ../../glossary.rst:714 +#: ../../glossary.rst:695 msgid "" "See :class:`importlib.abc.MetaPathFinder` for the methods that meta path " "finders implement." msgstr "" -#: ../../glossary.rst:716 +#: ../../glossary.rst:697 msgid "metaclass" msgstr "" -#: ../../glossary.rst:718 +#: ../../glossary.rst:699 msgid "" "The class of a class. Class definitions create a class name, a class " "dictionary, and a list of base classes. The metaclass is responsible for " @@ -1243,15 +1205,15 @@ msgid "" "singletons, and many other tasks." msgstr "" -#: ../../glossary.rst:728 +#: ../../glossary.rst:709 msgid "More information can be found in :ref:`metaclasses`." msgstr "" -#: ../../glossary.rst:729 +#: ../../glossary.rst:710 msgid "method" msgstr "" -#: ../../glossary.rst:731 +#: ../../glossary.rst:712 msgid "" "A function which is defined inside a class body. If called as an attribute " "of an instance of that class, the method will get the instance object as its " @@ -1259,11 +1221,11 @@ msgid "" "`function` and :term:`nested scope`." msgstr "" -#: ../../glossary.rst:735 +#: ../../glossary.rst:716 msgid "method resolution order" msgstr "" -#: ../../glossary.rst:737 +#: ../../glossary.rst:718 msgid "" "Method Resolution Order is the order in which base classes are searched for " "a member during lookup. See `The Python 2.3 Method Resolution Order ` or as a :term:`keyword argument " @@ -1445,7 +1407,7 @@ msgid "" "*bar* in the following::" msgstr "" -#: ../../glossary.rst:845 +#: ../../glossary.rst:826 msgid "" ":dfn:`positional-only`: specifies an argument that can be supplied only by " "position. Positional-only parameters can be defined by including a ``/`` " @@ -1453,7 +1415,7 @@ msgid "" "example *posonly1* and *posonly2* in the following::" msgstr "" -#: ../../glossary.rst:854 +#: ../../glossary.rst:835 msgid "" ":dfn:`keyword-only`: specifies an argument that can be supplied only by " "keyword. Keyword-only parameters can be defined by including a single var-" @@ -1462,7 +1424,7 @@ msgid "" "following::" msgstr "" -#: ../../glossary.rst:862 +#: ../../glossary.rst:843 msgid "" ":dfn:`var-positional`: specifies that an arbitrary sequence of positional " "arguments can be provided (in addition to any positional arguments already " @@ -1471,7 +1433,7 @@ msgid "" "following::" msgstr "" -#: ../../glossary.rst:870 +#: ../../glossary.rst:851 msgid "" ":dfn:`var-keyword`: specifies that arbitrarily many keyword arguments can be " "provided (in addition to any keyword arguments already accepted by other " @@ -1479,13 +1441,13 @@ msgid "" "name with ``**``, for example *kwargs* in the example above." msgstr "" -#: ../../glossary.rst:876 +#: ../../glossary.rst:857 msgid "" "Parameters can specify both optional and required arguments, as well as " "default values for some optional arguments." msgstr "" -#: ../../glossary.rst:879 +#: ../../glossary.rst:860 msgid "" "See also the :term:`argument` glossary entry, the FAQ question on :ref:`the " "difference between arguments and parameters `, " @@ -1493,59 +1455,59 @@ msgid "" "`362`." msgstr "" -#: ../../glossary.rst:883 +#: ../../glossary.rst:864 msgid "path entry" msgstr "" -#: ../../glossary.rst:885 +#: ../../glossary.rst:866 msgid "" "A single location on the :term:`import path` which the :term:`path based " "finder` consults to find modules for importing." msgstr "" -#: ../../glossary.rst:887 +#: ../../glossary.rst:868 msgid "path entry finder" msgstr "" -#: ../../glossary.rst:889 +#: ../../glossary.rst:870 msgid "" "A :term:`finder` returned by a callable on :data:`sys.path_hooks` (i.e. a :" "term:`path entry hook`) which knows how to locate modules given a :term:" "`path entry`." msgstr "" -#: ../../glossary.rst:893 +#: ../../glossary.rst:874 msgid "" "See :class:`importlib.abc.PathEntryFinder` for the methods that path entry " "finders implement." msgstr "" -#: ../../glossary.rst:895 +#: ../../glossary.rst:876 msgid "path entry hook" msgstr "" -#: ../../glossary.rst:897 +#: ../../glossary.rst:878 msgid "" "A callable on the :data:`sys.path_hook` list which returns a :term:`path " "entry finder` if it knows how to find modules on a specific :term:`path " "entry`." msgstr "" -#: ../../glossary.rst:900 +#: ../../glossary.rst:881 msgid "path based finder" msgstr "" -#: ../../glossary.rst:902 +#: ../../glossary.rst:883 msgid "" "One of the default :term:`meta path finders ` which " "searches an :term:`import path` for modules." msgstr "" -#: ../../glossary.rst:904 +#: ../../glossary.rst:885 msgid "path-like object" msgstr "" -#: ../../glossary.rst:906 +#: ../../glossary.rst:887 msgid "" "An object representing a file system path. A path-like object is either a :" "class:`str` or :class:`bytes` object representing a path, or an object " @@ -1557,11 +1519,11 @@ msgid "" "`519`." msgstr "" -#: ../../glossary.rst:914 +#: ../../glossary.rst:895 msgid "PEP" msgstr "" -#: ../../glossary.rst:916 +#: ../../glossary.rst:897 msgid "" "Python Enhancement Proposal. A PEP is a design document providing " "information to the Python community, or describing a new feature for Python " @@ -1569,7 +1531,7 @@ msgid "" "specification and a rationale for proposed features." msgstr "" -#: ../../glossary.rst:922 +#: ../../glossary.rst:903 msgid "" "PEPs are intended to be the primary mechanisms for proposing major new " "features, for collecting community input on an issue, and for documenting " @@ -1578,29 +1540,29 @@ msgid "" "dissenting opinions." msgstr "" -#: ../../glossary.rst:928 +#: ../../glossary.rst:909 msgid "See :pep:`1`." msgstr "" -#: ../../glossary.rst:929 +#: ../../glossary.rst:910 msgid "portion" msgstr "" -#: ../../glossary.rst:931 +#: ../../glossary.rst:912 msgid "" "A set of files in a single directory (possibly stored in a zip file) that " "contribute to a namespace package, as defined in :pep:`420`." msgstr "" -#: ../../glossary.rst:933 +#: ../../glossary.rst:914 msgid "positional argument" msgstr "" -#: ../../glossary.rst:936 +#: ../../glossary.rst:917 msgid "provisional API" msgstr "" -#: ../../glossary.rst:938 +#: ../../glossary.rst:919 msgid "" "A provisional API is one which has been deliberately excluded from the " "standard library's backwards compatibility guarantees. While major changes " @@ -1611,44 +1573,44 @@ msgid "" "flaws are uncovered that were missed prior to the inclusion of the API." msgstr "" -#: ../../glossary.rst:947 +#: ../../glossary.rst:928 msgid "" "Even for provisional APIs, backwards incompatible changes are seen as a " "\"solution of last resort\" - every attempt will still be made to find a " "backwards compatible resolution to any identified problems." msgstr "" -#: ../../glossary.rst:951 +#: ../../glossary.rst:932 msgid "" "This process allows the standard library to continue to evolve over time, " "without locking in problematic design errors for extended periods of time. " "See :pep:`411` for more details." msgstr "" -#: ../../glossary.rst:954 +#: ../../glossary.rst:935 msgid "provisional package" msgstr "" -#: ../../glossary.rst:956 +#: ../../glossary.rst:937 msgid "See :term:`provisional API`." msgstr "" -#: ../../glossary.rst:957 +#: ../../glossary.rst:938 msgid "Python 3000" msgstr "" -#: ../../glossary.rst:959 +#: ../../glossary.rst:940 msgid "" "Nickname for the Python 3.x release line (coined long ago when the release " "of version 3 was something in the distant future.) This is also abbreviated " "\"Py3k\"." msgstr "" -#: ../../glossary.rst:962 +#: ../../glossary.rst:943 msgid "Pythonic" msgstr "" -#: ../../glossary.rst:964 +#: ../../glossary.rst:945 msgid "" "An idea or piece of code which closely follows the most common idioms of the " "Python language, rather than implementing code using concepts common to " @@ -1658,15 +1620,15 @@ msgid "" "Python sometimes use a numerical counter instead::" msgstr "" -#: ../../glossary.rst:974 +#: ../../glossary.rst:955 msgid "As opposed to the cleaner, Pythonic method::" msgstr "" -#: ../../glossary.rst:978 +#: ../../glossary.rst:959 msgid "qualified name" msgstr "" -#: ../../glossary.rst:980 +#: ../../glossary.rst:961 msgid "" "A dotted name showing the \"path\" from a module's global scope to a class, " "function or method defined in that module, as defined in :pep:`3155`. For " @@ -1674,18 +1636,18 @@ msgid "" "object's name::" msgstr "" -#: ../../glossary.rst:997 +#: ../../glossary.rst:978 msgid "" "When used to refer to modules, the *fully qualified name* means the entire " "dotted path to the module, including any parent packages, e.g. ``email.mime." "text``::" msgstr "" -#: ../../glossary.rst:1004 +#: ../../glossary.rst:985 msgid "reference count" msgstr "" -#: ../../glossary.rst:1006 +#: ../../glossary.rst:987 msgid "" "The number of references to an object. When the reference count of an " "object drops to zero, it is deallocated. Reference counting is generally " @@ -1695,25 +1657,25 @@ msgid "" "particular object." msgstr "" -#: ../../glossary.rst:1012 +#: ../../glossary.rst:993 msgid "regular package" msgstr "" -#: ../../glossary.rst:1014 +#: ../../glossary.rst:995 msgid "" "A traditional :term:`package`, such as a directory containing an ``__init__." "py`` file." msgstr "" -#: ../../glossary.rst:1017 +#: ../../glossary.rst:998 msgid "See also :term:`namespace package`." msgstr "" -#: ../../glossary.rst:1018 +#: ../../glossary.rst:999 msgid "__slots__" msgstr "" -#: ../../glossary.rst:1020 +#: ../../glossary.rst:1001 msgid "" "A declaration inside a class that saves memory by pre-declaring space for " "instance attributes and eliminating instance dictionaries. Though popular, " @@ -1722,11 +1684,11 @@ msgid "" "application." msgstr "" -#: ../../glossary.rst:1025 +#: ../../glossary.rst:1006 msgid "sequence" msgstr "" -#: ../../glossary.rst:1027 +#: ../../glossary.rst:1008 msgid "" "An :term:`iterable` which supports efficient element access using integer " "indices via the :meth:`__getitem__` special method and defines a :meth:" @@ -1737,42 +1699,30 @@ msgid "" "lookups use arbitrary :term:`immutable` keys rather than integers." msgstr "" -#: ../../glossary.rst:1036 +#: ../../glossary.rst:1017 msgid "" "The :class:`collections.abc.Sequence` abstract base class defines a much " "richer interface that goes beyond just :meth:`__getitem__` and :meth:" "`__len__`, adding :meth:`count`, :meth:`index`, :meth:`__contains__`, and :" "meth:`__reversed__`. Types that implement this expanded interface can be " -"registered explicitly using :func:`~abc.ABCMeta.register`." -msgstr "" - -#: ../../glossary.rst:1043 -msgid "set comprehension" +"registered explicitly using :func:`~abc.register`." msgstr "" -#: ../../glossary.rst:1045 -msgid "" -"A compact way to process all or part of the elements in an iterable and " -"return a set with the results. ``results = {c for c in 'abracadabra' if c " -"not in 'abc'}`` generates the set of strings ``{'r', 'd'}``. See :ref:" -"`comprehensions`." -msgstr "" - -#: ../../glossary.rst:1049 +#: ../../glossary.rst:1024 msgid "single dispatch" msgstr "" -#: ../../glossary.rst:1051 +#: ../../glossary.rst:1026 msgid "" "A form of :term:`generic function` dispatch where the implementation is " "chosen based on the type of a single argument." msgstr "" -#: ../../glossary.rst:1053 +#: ../../glossary.rst:1028 msgid "slice" msgstr "" -#: ../../glossary.rst:1055 +#: ../../glossary.rst:1030 msgid "" "An object usually containing a portion of a :term:`sequence`. A slice is " "created using the subscript notation, ``[]`` with colons between numbers " @@ -1780,11 +1730,11 @@ msgid "" "(subscript) notation uses :class:`slice` objects internally." msgstr "" -#: ../../glossary.rst:1059 +#: ../../glossary.rst:1034 msgid "special method" msgstr "" -#: ../../glossary.rst:1063 +#: ../../glossary.rst:1038 msgid "" "A method that is called implicitly by Python to execute a certain operation " "on a type, such as addition. Such methods have names starting and ending " @@ -1792,30 +1742,30 @@ msgid "" "`specialnames`." msgstr "" -#: ../../glossary.rst:1067 +#: ../../glossary.rst:1042 msgid "statement" msgstr "" -#: ../../glossary.rst:1069 +#: ../../glossary.rst:1044 msgid "" "A statement is part of a suite (a \"block\" of code). A statement is either " "an :term:`expression` or one of several constructs with a keyword, such as :" "keyword:`if`, :keyword:`while` or :keyword:`for`." msgstr "" -#: ../../glossary.rst:1072 +#: ../../glossary.rst:1047 msgid "text encoding" msgstr "" -#: ../../glossary.rst:1074 +#: ../../glossary.rst:1049 msgid "A codec which encodes Unicode strings to bytes." msgstr "" -#: ../../glossary.rst:1075 +#: ../../glossary.rst:1050 msgid "text file" msgstr "" -#: ../../glossary.rst:1077 +#: ../../glossary.rst:1052 msgid "" "A :term:`file object` able to read and write :class:`str` objects. Often, a " "text file actually accesses a byte-oriented datastream and handles the :term:" @@ -1824,17 +1774,17 @@ msgid "" "instances of :class:`io.StringIO`." msgstr "" -#: ../../glossary.rst:1084 +#: ../../glossary.rst:1059 msgid "" "See also :term:`binary file` for a file object able to read and write :term:" "`bytes-like objects `." msgstr "" -#: ../../glossary.rst:1086 +#: ../../glossary.rst:1061 msgid "triple-quoted string" msgstr "" -#: ../../glossary.rst:1088 +#: ../../glossary.rst:1063 msgid "" "A string which is bound by three instances of either a quotation mark (\") " "or an apostrophe ('). While they don't provide any functionality not " @@ -1845,67 +1795,67 @@ msgid "" "docstrings." msgstr "" -#: ../../glossary.rst:1095 +#: ../../glossary.rst:1070 msgid "type" msgstr "" -#: ../../glossary.rst:1097 +#: ../../glossary.rst:1072 msgid "" "The type of a Python object determines what kind of object it is; every " "object has a type. An object's type is accessible as its :attr:`~instance." "__class__` attribute or can be retrieved with ``type(obj)``." msgstr "" -#: ../../glossary.rst:1101 +#: ../../glossary.rst:1076 msgid "type alias" msgstr "" -#: ../../glossary.rst:1103 +#: ../../glossary.rst:1078 msgid "A synonym for a type, created by assigning the type to an identifier." msgstr "" -#: ../../glossary.rst:1105 +#: ../../glossary.rst:1080 msgid "" "Type aliases are useful for simplifying :term:`type hints `. For " "example::" msgstr "" -#: ../../glossary.rst:1112 +#: ../../glossary.rst:1089 msgid "could be made more readable like this::" msgstr "" -#: ../../glossary.rst:1119 ../../glossary.rst:1133 +#: ../../glossary.rst:1098 ../../glossary.rst:1112 msgid "See :mod:`typing` and :pep:`484`, which describe this functionality." msgstr "" -#: ../../glossary.rst:1120 +#: ../../glossary.rst:1099 msgid "type hint" msgstr "" -#: ../../glossary.rst:1122 +#: ../../glossary.rst:1101 msgid "" "An :term:`annotation` that specifies the expected type for a variable, a " "class attribute, or a function parameter or return value." msgstr "" -#: ../../glossary.rst:1125 +#: ../../glossary.rst:1104 msgid "" "Type hints are optional and are not enforced by Python but they are useful " "to static type analysis tools, and aid IDEs with code completion and " "refactoring." msgstr "" -#: ../../glossary.rst:1129 +#: ../../glossary.rst:1108 msgid "" "Type hints of global variables, class attributes, and functions, but not " "local variables, can be accessed using :func:`typing.get_type_hints`." msgstr "" -#: ../../glossary.rst:1134 +#: ../../glossary.rst:1113 msgid "universal newlines" msgstr "" -#: ../../glossary.rst:1136 +#: ../../glossary.rst:1115 msgid "" "A manner of interpreting text streams in which all of the following are " "recognized as ending a line: the Unix end-of-line convention ``'\\n'``, the " @@ -1914,40 +1864,40 @@ msgid "" "splitlines` for an additional use." msgstr "" -#: ../../glossary.rst:1141 +#: ../../glossary.rst:1120 msgid "variable annotation" msgstr "" -#: ../../glossary.rst:1143 +#: ../../glossary.rst:1122 msgid "An :term:`annotation` of a variable or a class attribute." msgstr "" -#: ../../glossary.rst:1145 +#: ../../glossary.rst:1124 msgid "" "When annotating a variable or a class attribute, assignment is optional::" msgstr "" -#: ../../glossary.rst:1150 +#: ../../glossary.rst:1129 msgid "" "Variable annotations are usually used for :term:`type hints `: " "for example this variable is expected to take :class:`int` values::" msgstr "" -#: ../../glossary.rst:1156 +#: ../../glossary.rst:1135 msgid "Variable annotation syntax is explained in section :ref:`annassign`." msgstr "" -#: ../../glossary.rst:1158 +#: ../../glossary.rst:1137 msgid "" "See :term:`function annotation`, :pep:`484` and :pep:`526`, which describe " "this functionality." msgstr "" -#: ../../glossary.rst:1160 +#: ../../glossary.rst:1139 msgid "virtual environment" msgstr "" -#: ../../glossary.rst:1162 +#: ../../glossary.rst:1141 msgid "" "A cooperatively isolated runtime environment that allows Python users and " "applications to install and upgrade Python distribution packages without " @@ -1955,25 +1905,25 @@ msgid "" "same system." msgstr "" -#: ../../glossary.rst:1167 +#: ../../glossary.rst:1146 msgid "See also :mod:`venv`." msgstr "" -#: ../../glossary.rst:1168 +#: ../../glossary.rst:1147 msgid "virtual machine" msgstr "" -#: ../../glossary.rst:1170 +#: ../../glossary.rst:1149 msgid "" "A computer defined entirely in software. Python's virtual machine executes " "the :term:`bytecode` emitted by the bytecode compiler." msgstr "" -#: ../../glossary.rst:1172 +#: ../../glossary.rst:1151 msgid "Zen of Python" msgstr "" -#: ../../glossary.rst:1174 +#: ../../glossary.rst:1153 msgid "" "Listing of Python design principles and philosophies that are helpful in " "understanding and using the language. The listing can be found by typing " diff --git a/howto/descriptor.po b/howto/descriptor.po index 4511049034..6e65a051c8 100644 --- a/howto/descriptor.po +++ b/howto/descriptor.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.7\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2021-09-07 06:52+0000\n" +"POT-Creation-Date: 2020-06-20 18:08+0800\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-" @@ -19,7 +19,7 @@ msgstr "" "Content-Transfer-Encoding: 8bit\n" "Plural-Forms: nplurals=1; plural=0;\n" -#: ../../howto/descriptor.rst:5 +#: ../../howto/descriptor.rst:3 msgid "Descriptor HowTo Guide" msgstr "修飾器 HowTo 指南" @@ -27,7 +27,7 @@ msgstr "修飾器 HowTo 指南" msgid "Author" msgstr "" -#: ../../howto/descriptor.rst:7 +#: ../../howto/descriptor.rst:5 msgid "Raymond Hettinger" msgstr "" @@ -35,420 +35,101 @@ msgstr "" msgid "Contact" msgstr "" -#: ../../howto/descriptor.rst:8 +#: ../../howto/descriptor.rst:6 msgid "" msgstr "" -#: ../../howto/descriptor.rst:11 +#: ../../howto/descriptor.rst:8 msgid "Contents" msgstr "" -#: ../../howto/descriptor.rst:13 -msgid "" -":term:`Descriptors ` let objects customize attribute lookup, " -"storage, and deletion." -msgstr "" - -#: ../../howto/descriptor.rst:16 -msgid "This guide has four major sections:" -msgstr "" - -#: ../../howto/descriptor.rst:18 -msgid "" -"The \"primer\" gives a basic overview, moving gently from simple examples, " -"adding one feature at a time. Start here if you're new to descriptors." -msgstr "" - -#: ../../howto/descriptor.rst:21 -msgid "" -"The second section shows a complete, practical descriptor example. If you " -"already know the basics, start there." -msgstr "" - -#: ../../howto/descriptor.rst:24 -msgid "" -"The third section provides a more technical tutorial that goes into the " -"detailed mechanics of how descriptors work. Most people don't need this " -"level of detail." -msgstr "" - -#: ../../howto/descriptor.rst:28 -msgid "" -"The last section has pure Python equivalents for built-in descriptors that " -"are written in C. Read this if you're curious about how functions turn into " -"bound methods or about the implementation of common tools like :func:" -"`classmethod`, :func:`staticmethod`, :func:`property`, and :term:`__slots__`." -msgstr "" - -#: ../../howto/descriptor.rst:36 -msgid "Primer" -msgstr "" - -#: ../../howto/descriptor.rst:38 -msgid "" -"In this primer, we start with the most basic possible example and then we'll " -"add new capabilities one by one." -msgstr "" - -#: ../../howto/descriptor.rst:43 -msgid "Simple example: A descriptor that returns a constant" -msgstr "" - -#: ../../howto/descriptor.rst:45 -msgid "" -"The :class:`Ten` class is a descriptor that always returns the constant " -"``10`` from its :meth:`__get__` method:" -msgstr "" - -#: ../../howto/descriptor.rst:54 -msgid "" -"To use the descriptor, it must be stored as a class variable in another " -"class:" -msgstr "" - -#: ../../howto/descriptor.rst:62 -msgid "" -"An interactive session shows the difference between normal attribute lookup " -"and descriptor lookup:" -msgstr "" - -#: ../../howto/descriptor.rst:73 -msgid "" -"In the ``a.x`` attribute lookup, the dot operator finds the key ``x`` and " -"the value ``5`` in the class dictionary. In the ``a.y`` lookup, the dot " -"operator finds a descriptor instance, recognized by its ``__get__`` method, " -"and calls that method which returns ``10``." -msgstr "" - -#: ../../howto/descriptor.rst:78 -msgid "" -"Note that the value ``10`` is not stored in either the class dictionary or " -"the instance dictionary. Instead, the value ``10`` is computed on demand." -msgstr "" - -#: ../../howto/descriptor.rst:81 -msgid "" -"This example shows how a simple descriptor works, but it isn't very useful. " -"For retrieving constants, normal attribute lookup would be better." -msgstr "" - -#: ../../howto/descriptor.rst:84 -msgid "" -"In the next section, we'll create something more useful, a dynamic lookup." -msgstr "" - -#: ../../howto/descriptor.rst:88 -msgid "Dynamic lookups" -msgstr "" - -#: ../../howto/descriptor.rst:90 -msgid "" -"Interesting descriptors typically run computations instead of returning " -"constants:" -msgstr "" - -#: ../../howto/descriptor.rst:109 -msgid "" -"An interactive session shows that the lookup is dynamic — it computes " -"different, updated answers each time::" -msgstr "" - -#: ../../howto/descriptor.rst:122 -msgid "" -"Besides showing how descriptors can run computations, this example also " -"reveals the purpose of the parameters to :meth:`__get__`. The *self* " -"parameter is *size*, an instance of *DirectorySize*. The *obj* parameter is " -"either *g* or *s*, an instance of *Directory*. It is the *obj* parameter " -"that lets the :meth:`__get__` method learn the target directory. The " -"*objtype* parameter is the class *Directory*." -msgstr "" - -#: ../../howto/descriptor.rst:131 -msgid "Managed attributes" -msgstr "" - -#: ../../howto/descriptor.rst:133 -msgid "" -"A popular use for descriptors is managing access to instance data. The " -"descriptor is assigned to a public attribute in the class dictionary while " -"the actual data is stored as a private attribute in the instance " -"dictionary. The descriptor's :meth:`__get__` and :meth:`__set__` methods " -"are triggered when the public attribute is accessed." -msgstr "" - -#: ../../howto/descriptor.rst:139 -msgid "" -"In the following example, *age* is the public attribute and *_age* is the " -"private attribute. When the public attribute is accessed, the descriptor " -"logs the lookup or update:" -msgstr "" - -#: ../../howto/descriptor.rst:172 -msgid "" -"An interactive session shows that all access to the managed attribute *age* " -"is logged, but that the regular attribute *name* is not logged:" -msgstr "" - -#: ../../howto/descriptor.rst:206 -msgid "" -"One major issue with this example is that the private name *_age* is " -"hardwired in the *LoggedAgeAccess* class. That means that each instance can " -"only have one logged attribute and that its name is unchangeable. In the " -"next example, we'll fix that problem." -msgstr "" - -#: ../../howto/descriptor.rst:213 -msgid "Customized names" -msgstr "" - -#: ../../howto/descriptor.rst:215 -msgid "" -"When a class uses descriptors, it can inform each descriptor about which " -"variable name was used." -msgstr "" - -#: ../../howto/descriptor.rst:218 -msgid "" -"In this example, the :class:`Person` class has two descriptor instances, " -"*name* and *age*. When the :class:`Person` class is defined, it makes a " -"callback to :meth:`__set_name__` in *LoggedAccess* so that the field names " -"can be recorded, giving each descriptor its own *public_name* and " -"*private_name*:" -msgstr "" - -#: ../../howto/descriptor.rst:256 -msgid "" -"An interactive session shows that the :class:`Person` class has called :meth:" -"`__set_name__` so that the field names would be recorded. Here we call :" -"func:`vars` to look up the descriptor without triggering it:" -msgstr "" - -#: ../../howto/descriptor.rst:267 -msgid "The new class now logs access to both *name* and *age*:" -msgstr "" - -#: ../../howto/descriptor.rst:284 -msgid "The two *Person* instances contain only the private names:" -msgstr "" - -#: ../../howto/descriptor.rst:295 -msgid "Closing thoughts" -msgstr "" - -#: ../../howto/descriptor.rst:297 -msgid "" -"A :term:`descriptor` is what we call any object that defines :meth:" -"`__get__`, :meth:`__set__`, or :meth:`__delete__`." -msgstr "" - -#: ../../howto/descriptor.rst:300 -msgid "" -"Optionally, descriptors can have a :meth:`__set_name__` method. This is " -"only used in cases where a descriptor needs to know either the class where " -"it was created or the name of class variable it was assigned to. (This " -"method, if present, is called even if the class is not a descriptor.)" -msgstr "" - -#: ../../howto/descriptor.rst:305 -msgid "" -"Descriptors get invoked by the dot \"operator\" during attribute lookup. If " -"a descriptor is accessed indirectly with ``vars(some_class)" -"[descriptor_name]``, the descriptor instance is returned without invoking it." -msgstr "" - -#: ../../howto/descriptor.rst:309 -msgid "" -"Descriptors only work when used as class variables. When put in instances, " -"they have no effect." -msgstr "" - -#: ../../howto/descriptor.rst:312 -msgid "" -"The main motivation for descriptors is to provide a hook allowing objects " -"stored in class variables to control what happens during attribute lookup." -msgstr "" - -#: ../../howto/descriptor.rst:315 -msgid "" -"Traditionally, the calling class controls what happens during lookup. " -"Descriptors invert that relationship and allow the data being looked-up to " -"have a say in the matter." -msgstr "" - -#: ../../howto/descriptor.rst:319 -msgid "" -"Descriptors are used throughout the language. It is how functions turn into " -"bound methods. Common tools like :func:`classmethod`, :func:" -"`staticmethod`, :func:`property`, and :func:`functools.cached_property` are " -"all implemented as descriptors." -msgstr "" - -#: ../../howto/descriptor.rst:326 -msgid "Complete Practical Example" -msgstr "" - -#: ../../howto/descriptor.rst:328 -msgid "" -"In this example, we create a practical and powerful tool for locating " -"notoriously hard to find data corruption bugs." -msgstr "" - -#: ../../howto/descriptor.rst:333 -msgid "Validator class" -msgstr "" - -#: ../../howto/descriptor.rst:335 -msgid "" -"A validator is a descriptor for managed attribute access. Prior to storing " -"any data, it verifies that the new value meets various type and range " -"restrictions. If those restrictions aren't met, it raises an exception to " -"prevent data corruption at its source." -msgstr "" - -#: ../../howto/descriptor.rst:340 -msgid "" -"This :class:`Validator` class is both an :term:`abstract base class` and a " -"managed attribute descriptor:" -msgstr "" - -#: ../../howto/descriptor.rst:363 -msgid "" -"Custom validators need to inherit from :class:`Validator` and must supply a :" -"meth:`validate` method to test various restrictions as needed." -msgstr "" - -#: ../../howto/descriptor.rst:368 -msgid "Custom validators" -msgstr "" - -#: ../../howto/descriptor.rst:370 -msgid "Here are three practical data validation utilities:" -msgstr "" - -#: ../../howto/descriptor.rst:372 -msgid "" -":class:`OneOf` verifies that a value is one of a restricted set of options." -msgstr "" - -#: ../../howto/descriptor.rst:374 -msgid "" -":class:`Number` verifies that a value is either an :class:`int` or :class:" -"`float`. Optionally, it verifies that a value is between a given minimum or " -"maximum." -msgstr "" - -#: ../../howto/descriptor.rst:378 -msgid "" -":class:`String` verifies that a value is a :class:`str`. Optionally, it " -"validates a given minimum or maximum length. It can validate a user-defined " -"`predicate `_ " -"as well." -msgstr "" - -#: ../../howto/descriptor.rst:437 -msgid "Practical application" -msgstr "" - -#: ../../howto/descriptor.rst:439 -msgid "Here's how the data validators can be used in a real class:" -msgstr "" - -#: ../../howto/descriptor.rst:454 -msgid "The descriptors prevent invalid instances from being created:" -msgstr "" - -#: ../../howto/descriptor.rst:481 -msgid "Technical Tutorial" -msgstr "" - -#: ../../howto/descriptor.rst:483 -msgid "" -"What follows is a more technical tutorial for the mechanics and details of " -"how descriptors work." -msgstr "" - -#: ../../howto/descriptor.rst:488 +#: ../../howto/descriptor.rst:11 msgid "Abstract" msgstr "摘要" -#: ../../howto/descriptor.rst:490 +#: ../../howto/descriptor.rst:13 msgid "" "Defines descriptors, summarizes the protocol, and shows how descriptors are " -"called. Provides an example showing how object relational mappings work." +"called. Examines a custom descriptor and several built-in Python " +"descriptors including functions, properties, static methods, and class " +"methods. Shows how each works by giving a pure Python equivalent and a " +"sample application." msgstr "" -#: ../../howto/descriptor.rst:493 +#: ../../howto/descriptor.rst:18 msgid "" "Learning about descriptors not only provides access to a larger toolset, it " -"creates a deeper understanding of how Python works." +"creates a deeper understanding of how Python works and an appreciation for " +"the elegance of its design." msgstr "" -#: ../../howto/descriptor.rst:498 -msgid "Definition and introduction" +#: ../../howto/descriptor.rst:24 +msgid "Definition and Introduction" msgstr "" -#: ../../howto/descriptor.rst:500 +#: ../../howto/descriptor.rst:26 msgid "" -"In general, a descriptor is an attribute value that has one of the methods " -"in the descriptor protocol. Those methods are :meth:`__get__`, :meth:" -"`__set__`, and :meth:`__delete__`. If any of those methods are defined for " -"an attribute, it is said to be a :term:`descriptor`." +"In general, a descriptor is an object attribute with \"binding behavior\", " +"one whose attribute access has been overridden by methods in the descriptor " +"protocol. Those methods are :meth:`__get__`, :meth:`__set__`, and :meth:" +"`__delete__`. If any of those methods are defined for an object, it is said " +"to be a descriptor." msgstr "" -#: ../../howto/descriptor.rst:505 +#: ../../howto/descriptor.rst:32 msgid "" "The default behavior for attribute access is to get, set, or delete the " "attribute from an object's dictionary. For instance, ``a.x`` has a lookup " "chain starting with ``a.__dict__['x']``, then ``type(a).__dict__['x']``, and " -"continuing through the method resolution order of ``type(a)``. If the looked-" -"up value is an object defining one of the descriptor methods, then Python " -"may override the default behavior and invoke the descriptor method instead. " -"Where this occurs in the precedence chain depends on which descriptor " -"methods were defined." +"continuing through the base classes of ``type(a)`` excluding metaclasses. If " +"the looked-up value is an object defining one of the descriptor methods, " +"then Python may override the default behavior and invoke the descriptor " +"method instead. Where this occurs in the precedence chain depends on which " +"descriptor methods were defined." msgstr "" -#: ../../howto/descriptor.rst:514 +#: ../../howto/descriptor.rst:41 msgid "" "Descriptors are a powerful, general purpose protocol. They are the " "mechanism behind properties, methods, static methods, class methods, and :" -"func:`super()`. They are used throughout Python itself. Descriptors " -"simplify the underlying C code and offer a flexible set of new tools for " -"everyday Python programs." +"func:`super()`. They are used throughout Python itself to implement the new " +"style classes introduced in version 2.2. Descriptors simplify the " +"underlying C-code and offer a flexible set of new tools for everyday Python " +"programs." msgstr "" -#: ../../howto/descriptor.rst:522 -#, fuzzy -msgid "Descriptor protocol" -msgstr "修飾器 HowTo 指南" +#: ../../howto/descriptor.rst:49 +msgid "Descriptor Protocol" +msgstr "" -#: ../../howto/descriptor.rst:524 +#: ../../howto/descriptor.rst:51 msgid "``descr.__get__(self, obj, type=None) -> value``" msgstr "" -#: ../../howto/descriptor.rst:526 +#: ../../howto/descriptor.rst:53 msgid "``descr.__set__(self, obj, value) -> None``" msgstr "" -#: ../../howto/descriptor.rst:528 +#: ../../howto/descriptor.rst:55 msgid "``descr.__delete__(self, obj) -> None``" msgstr "" -#: ../../howto/descriptor.rst:530 +#: ../../howto/descriptor.rst:57 msgid "" "That is all there is to it. Define any of these methods and an object is " "considered a descriptor and can override default behavior upon being looked " "up as an attribute." msgstr "" -#: ../../howto/descriptor.rst:534 +#: ../../howto/descriptor.rst:61 msgid "" "If an object defines :meth:`__set__` or :meth:`__delete__`, it is considered " "a data descriptor. Descriptors that only define :meth:`__get__` are called " -"non-data descriptors (they are often used for methods but other uses are " +"non-data descriptors (they are typically used for methods but other uses are " "possible)." msgstr "" -#: ../../howto/descriptor.rst:539 +#: ../../howto/descriptor.rst:66 msgid "" "Data and non-data descriptors differ in how overrides are calculated with " "respect to entries in an instance's dictionary. If an instance's dictionary " @@ -457,7 +138,7 @@ msgid "" "name as a non-data descriptor, the dictionary entry takes precedence." msgstr "" -#: ../../howto/descriptor.rst:545 +#: ../../howto/descriptor.rst:72 msgid "" "To make a read-only data descriptor, define both :meth:`__get__` and :meth:" "`__set__` with the :meth:`__set__` raising an :exc:`AttributeError` when " @@ -465,433 +146,256 @@ msgid "" "placeholder is enough to make it a data descriptor." msgstr "" -#: ../../howto/descriptor.rst:552 -msgid "Overview of descriptor invocation" -msgstr "" - -#: ../../howto/descriptor.rst:554 -msgid "" -"A descriptor can be called directly with ``desc.__get__(obj)`` or ``desc." -"__get__(None, cls)``." -msgstr "" - -#: ../../howto/descriptor.rst:557 -msgid "" -"But it is more common for a descriptor to be invoked automatically from " -"attribute access." -msgstr "" - -#: ../../howto/descriptor.rst:560 -msgid "" -"The expression ``obj.x`` looks up the attribute ``x`` in the chain of " -"namespaces for ``obj``. If the search finds a descriptor outside of the " -"instance ``__dict__``, its :meth:`__get__` method is invoked according to " -"the precedence rules listed below." +#: ../../howto/descriptor.rst:79 +msgid "Invoking Descriptors" msgstr "" -#: ../../howto/descriptor.rst:565 -msgid "" -"The details of invocation depend on whether ``obj`` is an object, class, or " -"instance of super." -msgstr "" - -#: ../../howto/descriptor.rst:570 -msgid "Invocation from an instance" -msgstr "" - -#: ../../howto/descriptor.rst:572 -msgid "" -"Instance lookup scans through a chain of namespaces giving data descriptors " -"the highest priority, followed by instance variables, then non-data " -"descriptors, then class variables, and lastly :meth:`__getattr__` if it is " -"provided." -msgstr "" - -#: ../../howto/descriptor.rst:577 -msgid "" -"If a descriptor is found for ``a.x``, then it is invoked with: ``desc." -"__get__(a, type(a))``." -msgstr "" - -#: ../../howto/descriptor.rst:580 -msgid "" -"The logic for a dotted lookup is in :meth:`object.__getattribute__`. Here " -"is a pure Python equivalent:" -msgstr "" - -#: ../../howto/descriptor.rst:700 -msgid "" -"Interestingly, attribute lookup doesn't call :meth:`object.__getattribute__` " -"directly. Instead, both the dot operator and the :func:`getattr` function " -"perform attribute lookup by way of a helper function:" -msgstr "" - -#: ../../howto/descriptor.rst:747 -msgid "" -"So if :meth:`__getattr__` exists, it is called whenever :meth:" -"`__getattribute__` raises :exc:`AttributeError` (either directly or in one " -"of the descriptor calls)." -msgstr "" - -#: ../../howto/descriptor.rst:750 -msgid "" -"Also, if a user calls :meth:`object.__getattribute__` directly, the :meth:" -"`__getattr__` hook is bypassed entirely." -msgstr "" - -#: ../../howto/descriptor.rst:755 -msgid "Invocation from a class" -msgstr "" - -#: ../../howto/descriptor.rst:757 -msgid "" -"The logic for a dotted lookup such as ``A.x`` is in :meth:`type." -"__getattribute__`. The steps are similar to those for :meth:`object." -"__getattribute__` but the instance dictionary lookup is replaced by a search " -"through the class's :term:`method resolution order`." -msgstr "" - -#: ../../howto/descriptor.rst:762 -msgid "If a descriptor is found, it is invoked with ``desc.__get__(None, A)``." -msgstr "" - -#: ../../howto/descriptor.rst:764 +#: ../../howto/descriptor.rst:81 msgid "" -"The full C implementation can be found in :c:func:`type_getattro()` and :c:" -"func:`_PyType_Lookup()` in :source:`Objects/typeobject.c`." +"A descriptor can be called directly by its method name. For example, ``d." +"__get__(obj)``." msgstr "" -#: ../../howto/descriptor.rst:769 -msgid "Invocation from super" -msgstr "" - -#: ../../howto/descriptor.rst:771 +#: ../../howto/descriptor.rst:84 msgid "" -"The logic for super's dotted lookup is in the :meth:`__getattribute__` " -"method for object returned by :class:`super()`." +"Alternatively, it is more common for a descriptor to be invoked " +"automatically upon attribute access. For example, ``obj.d`` looks up ``d`` " +"in the dictionary of ``obj``. If ``d`` defines the method :meth:`__get__`, " +"then ``d.__get__(obj)`` is invoked according to the precedence rules listed " +"below." msgstr "" -#: ../../howto/descriptor.rst:774 +#: ../../howto/descriptor.rst:89 msgid "" -"A dotted lookup such as ``super(A, obj).m`` searches ``obj.__class__." -"__mro__`` for the base class ``B`` immediately following ``A`` and then " -"returns ``B.__dict__['m'].__get__(obj, A)``. If not a descriptor, ``m`` is " -"returned unchanged." +"The details of invocation depend on whether ``obj`` is an object or a class." msgstr "" -#: ../../howto/descriptor.rst:779 +#: ../../howto/descriptor.rst:91 msgid "" -"The full C implementation can be found in :c:func:`super_getattro()` in :" -"source:`Objects/typeobject.c`. A pure Python equivalent can be found in " -"`Guido's Tutorial `_." +"For objects, the machinery is in :meth:`object.__getattribute__` which " +"transforms ``b.x`` into ``type(b).__dict__['x'].__get__(b, type(b))``. The " +"implementation works through a precedence chain that gives data descriptors " +"priority over instance variables, instance variables priority over non-data " +"descriptors, and assigns lowest priority to :meth:`__getattr__` if provided. " +"The full C implementation can be found in :c:func:" +"`PyObject_GenericGetAttr()` in :source:`Objects/object.c`." msgstr "" -#: ../../howto/descriptor.rst:786 -msgid "Summary of invocation logic" -msgstr "" - -#: ../../howto/descriptor.rst:788 +#: ../../howto/descriptor.rst:99 msgid "" -"The mechanism for descriptors is embedded in the :meth:`__getattribute__()` " -"methods for :class:`object`, :class:`type`, and :func:`super`." +"For classes, the machinery is in :meth:`type.__getattribute__` which " +"transforms ``B.x`` into ``B.__dict__['x'].__get__(None, B)``. In pure " +"Python, it looks like::" msgstr "" -#: ../../howto/descriptor.rst:791 +#: ../../howto/descriptor.rst:110 msgid "The important points to remember are:" msgstr "" -#: ../../howto/descriptor.rst:793 -msgid "Descriptors are invoked by the :meth:`__getattribute__` method." +#: ../../howto/descriptor.rst:112 +msgid "descriptors are invoked by the :meth:`__getattribute__` method" msgstr "" -#: ../../howto/descriptor.rst:795 -msgid "" -"Classes inherit this machinery from :class:`object`, :class:`type`, or :func:" -"`super`." +#: ../../howto/descriptor.rst:113 +msgid "overriding :meth:`__getattribute__` prevents automatic descriptor calls" msgstr "" -#: ../../howto/descriptor.rst:798 -msgid "" -"Overriding :meth:`__getattribute__` prevents automatic descriptor calls " -"because all the descriptor logic is in that method." -msgstr "" - -#: ../../howto/descriptor.rst:801 +#: ../../howto/descriptor.rst:114 msgid "" ":meth:`object.__getattribute__` and :meth:`type.__getattribute__` make " -"different calls to :meth:`__get__`. The first includes the instance and may " -"include the class. The second puts in ``None`` for the instance and always " -"includes the class." -msgstr "" - -#: ../../howto/descriptor.rst:806 -msgid "Data descriptors always override instance dictionaries." -msgstr "" - -#: ../../howto/descriptor.rst:808 -msgid "Non-data descriptors may be overridden by instance dictionaries." -msgstr "" - -#: ../../howto/descriptor.rst:812 -msgid "Automatic name notification" -msgstr "" - -#: ../../howto/descriptor.rst:814 -msgid "" -"Sometimes it is desirable for a descriptor to know what class variable name " -"it was assigned to. When a new class is created, the :class:`type` " -"metaclass scans the dictionary of the new class. If any of the entries are " -"descriptors and if they define :meth:`__set_name__`, that method is called " -"with two arguments. The *owner* is the class where the descriptor is used, " -"and the *name* is the class variable the descriptor was assigned to." -msgstr "" - -#: ../../howto/descriptor.rst:821 -msgid "" -"The implementation details are in :c:func:`type_new()` and :c:func:" -"`set_names()` in :source:`Objects/typeobject.c`." +"different calls to :meth:`__get__`." msgstr "" -#: ../../howto/descriptor.rst:824 -msgid "" -"Since the update logic is in :meth:`type.__new__`, notifications only take " -"place at the time of class creation. If descriptors are added to the class " -"afterwards, :meth:`__set_name__` will need to be called manually." +#: ../../howto/descriptor.rst:116 +msgid "data descriptors always override instance dictionaries." msgstr "" -#: ../../howto/descriptor.rst:830 -msgid "ORM example" +#: ../../howto/descriptor.rst:117 +msgid "non-data descriptors may be overridden by instance dictionaries." msgstr "" -#: ../../howto/descriptor.rst:832 +#: ../../howto/descriptor.rst:119 msgid "" -"The following code is simplified skeleton showing how data descriptors could " -"be used to implement an `object relational mapping `_." +"The object returned by ``super()`` also has a custom :meth:" +"`__getattribute__` method for invoking descriptors. The attribute lookup " +"``super(B, obj).m`` searches ``obj.__class__.__mro__`` for the base class " +"``A`` immediately following ``B`` and then returns ``A.__dict__['m']." +"__get__(obj, B)``. If not a descriptor, ``m`` is returned unchanged. If " +"not in the dictionary, ``m`` reverts to a search using :meth:`object." +"__getattribute__`." msgstr "" -#: ../../howto/descriptor.rst:836 +#: ../../howto/descriptor.rst:126 msgid "" -"The essential idea is that the data is stored in an external database. The " -"Python instances only hold keys to the database's tables. Descriptors take " -"care of lookups or updates:" +"The implementation details are in :c:func:`super_getattro()` in :source:" +"`Objects/typeobject.c`. and a pure Python equivalent can be found in " +"`Guido's Tutorial`_." msgstr "" -#: ../../howto/descriptor.rst:855 +#: ../../howto/descriptor.rst:132 msgid "" -"We can use the :class:`Field` class to define `models `_ that describe the schema for each table in a " -"database:" +"The details above show that the mechanism for descriptors is embedded in " +"the :meth:`__getattribute__()` methods for :class:`object`, :class:`type`, " +"and :func:`super`. Classes inherit this machinery when they derive from :" +"class:`object` or if they have a meta-class providing similar functionality. " +"Likewise, classes can turn-off descriptor invocation by overriding :meth:" +"`__getattribute__()`." msgstr "" -#: ../../howto/descriptor.rst:880 -msgid "To use the models, first connect to the database::" +#: ../../howto/descriptor.rst:141 +msgid "Descriptor Example" msgstr "" -#: ../../howto/descriptor.rst:885 +#: ../../howto/descriptor.rst:143 msgid "" -"An interactive session shows how data is retrieved from the database and how " -"it can be updated:" -msgstr "" - -#: ../../howto/descriptor.rst:930 -msgid "Pure Python Equivalents" +"The following code creates a class whose objects are data descriptors which " +"print a message for each get or set. Overriding :meth:`__getattribute__` is " +"alternate approach that could do this for every attribute. However, this " +"descriptor is useful for monitoring just a few chosen attributes::" msgstr "" -#: ../../howto/descriptor.rst:932 +#: ../../howto/descriptor.rst:181 msgid "" -"The descriptor protocol is simple and offers exciting possibilities. " -"Several use cases are so common that they have been prepackaged into built-" -"in tools. Properties, bound methods, static methods, class methods, and \\_" -"\\_slots\\_\\_ are all based on the descriptor protocol." +"The protocol is simple and offers exciting possibilities. Several use cases " +"are so common that they have been packaged into individual function calls. " +"Properties, bound methods, static methods, and class methods are all based " +"on the descriptor protocol." msgstr "" -#: ../../howto/descriptor.rst:939 +#: ../../howto/descriptor.rst:188 msgid "Properties" msgstr "" -#: ../../howto/descriptor.rst:941 +#: ../../howto/descriptor.rst:190 msgid "" "Calling :func:`property` is a succinct way of building a data descriptor " -"that triggers a function call upon access to an attribute. Its signature " -"is::" +"that triggers function calls upon access to an attribute. Its signature is::" msgstr "" -#: ../../howto/descriptor.rst:946 +#: ../../howto/descriptor.rst:195 msgid "" -"The documentation shows a typical use to define a managed attribute ``x``:" +"The documentation shows a typical use to define a managed attribute ``x``::" msgstr "" -#: ../../howto/descriptor.rst:970 +#: ../../howto/descriptor.rst:203 msgid "" "To see how :func:`property` is implemented in terms of the descriptor " -"protocol, here is a pure Python equivalent:" +"protocol, here is a pure Python equivalent::" msgstr "" -#: ../../howto/descriptor.rst:1063 +#: ../../howto/descriptor.rst:243 msgid "" "The :func:`property` builtin helps whenever a user interface has granted " "attribute access and then subsequent changes require the intervention of a " "method." msgstr "" -#: ../../howto/descriptor.rst:1067 +#: ../../howto/descriptor.rst:247 msgid "" "For instance, a spreadsheet class may grant access to a cell value through " "``Cell('b10').value``. Subsequent improvements to the program require the " "cell to be recalculated on every access; however, the programmer does not " "want to affect existing client code accessing the attribute directly. The " "solution is to wrap access to the value attribute in a property data " -"descriptor:" +"descriptor::" msgstr "" -#: ../../howto/descriptor.rst:1084 -msgid "" -"Either the built-in :func:`property` or our :func:`Property` equivalent " -"would work in this example." -msgstr "" - -#: ../../howto/descriptor.rst:1089 -msgid "Functions and methods" +#: ../../howto/descriptor.rst:263 +msgid "Functions and Methods" msgstr "" -#: ../../howto/descriptor.rst:1091 +#: ../../howto/descriptor.rst:265 msgid "" "Python's object oriented features are built upon a function based " "environment. Using non-data descriptors, the two are merged seamlessly." msgstr "" -#: ../../howto/descriptor.rst:1094 -msgid "" -"Functions stored in class dictionaries get turned into methods when invoked. " -"Methods only differ from regular functions in that the object instance is " -"prepended to the other arguments. By convention, the instance is called " -"*self* but could be called *this* or any other variable name." -msgstr "" - -#: ../../howto/descriptor.rst:1099 -msgid "" -"Methods can be created manually with :class:`types.MethodType` which is " -"roughly equivalent to:" -msgstr "" - -#: ../../howto/descriptor.rst:1116 -msgid "" -"To support automatic creation of methods, functions include the :meth:" -"`__get__` method for binding methods during attribute access. This means " -"that functions are non-data descriptors that return bound methods during " -"dotted lookup from an instance. Here's how it works:" -msgstr "" - -#: ../../howto/descriptor.rst:1132 -msgid "" -"Running the following class in the interpreter shows how the function " -"descriptor works in practice:" -msgstr "" - -#: ../../howto/descriptor.rst:1141 -msgid "" -"The function has a :term:`qualified name` attribute to support introspection:" -msgstr "" - -#: ../../howto/descriptor.rst:1148 -msgid "" -"Accessing the function through the class dictionary does not invoke :meth:" -"`__get__`. Instead, it just returns the underlying function object::" -msgstr "" - -#: ../../howto/descriptor.rst:1154 -msgid "" -"Dotted access from a class calls :meth:`__get__` which just returns the " -"underlying function unchanged::" -msgstr "" - -#: ../../howto/descriptor.rst:1160 +#: ../../howto/descriptor.rst:268 msgid "" -"The interesting behavior occurs during dotted access from an instance. The " -"dotted lookup calls :meth:`__get__` which returns a bound method object::" +"Class dictionaries store methods as functions. In a class definition, " +"methods are written using :keyword:`def` or :keyword:`lambda`, the usual " +"tools for creating functions. Methods only differ from regular functions in " +"that the first argument is reserved for the object instance. By Python " +"convention, the instance reference is called *self* but may be called *this* " +"or any other variable name." msgstr "" -#: ../../howto/descriptor.rst:1167 +#: ../../howto/descriptor.rst:275 msgid "" -"Internally, the bound method stores the underlying function and the bound " -"instance::" +"To support method calls, functions include the :meth:`__get__` method for " +"binding methods during attribute access. This means that all functions are " +"non-data descriptors which return bound methods when they are invoked from " +"an object. In pure Python, it works like this::" msgstr "" -#: ../../howto/descriptor.rst:1176 +#: ../../howto/descriptor.rst:288 msgid "" -"If you have ever wondered where *self* comes from in regular methods or " -"where *cls* comes from in class methods, this is it!" +"Running the interpreter shows how the function descriptor works in practice::" msgstr "" -#: ../../howto/descriptor.rst:1181 -msgid "Kinds of methods" +#: ../../howto/descriptor.rst:326 +msgid "Static Methods and Class Methods" msgstr "" -#: ../../howto/descriptor.rst:1183 +#: ../../howto/descriptor.rst:328 msgid "" "Non-data descriptors provide a simple mechanism for variations on the usual " "patterns of binding functions into methods." msgstr "" -#: ../../howto/descriptor.rst:1186 +#: ../../howto/descriptor.rst:331 msgid "" "To recap, functions have a :meth:`__get__` method so that they can be " "converted to a method when accessed as attributes. The non-data descriptor " -"transforms an ``obj.f(*args)`` call into ``f(obj, *args)``. Calling ``cls." +"transforms an ``obj.f(*args)`` call into ``f(obj, *args)``. Calling ``klass." "f(*args)`` becomes ``f(*args)``." msgstr "" -#: ../../howto/descriptor.rst:1191 +#: ../../howto/descriptor.rst:336 msgid "This chart summarizes the binding and its two most useful variants:" msgstr "" -#: ../../howto/descriptor.rst:1194 +#: ../../howto/descriptor.rst:339 msgid "Transformation" msgstr "" -#: ../../howto/descriptor.rst:1194 -msgid "Called from an object" +#: ../../howto/descriptor.rst:339 +msgid "Called from an Object" msgstr "" -#: ../../howto/descriptor.rst:1194 -msgid "Called from a class" +#: ../../howto/descriptor.rst:339 +msgid "Called from a Class" msgstr "" -#: ../../howto/descriptor.rst:1197 +#: ../../howto/descriptor.rst:342 msgid "function" msgstr "" -#: ../../howto/descriptor.rst:1197 +#: ../../howto/descriptor.rst:342 msgid "f(obj, \\*args)" msgstr "" -#: ../../howto/descriptor.rst:1197 ../../howto/descriptor.rst:1199 +#: ../../howto/descriptor.rst:342 ../../howto/descriptor.rst:344 msgid "f(\\*args)" msgstr "" -#: ../../howto/descriptor.rst:1199 +#: ../../howto/descriptor.rst:344 msgid "staticmethod" msgstr "" -#: ../../howto/descriptor.rst:1201 +#: ../../howto/descriptor.rst:346 msgid "classmethod" msgstr "" -#: ../../howto/descriptor.rst:1201 +#: ../../howto/descriptor.rst:346 msgid "f(type(obj), \\*args)" msgstr "" -#: ../../howto/descriptor.rst:1201 -msgid "f(cls, \\*args)" +#: ../../howto/descriptor.rst:346 +msgid "f(klass, \\*args)" msgstr "" -#: ../../howto/descriptor.rst:1206 -msgid "Static methods" -msgstr "" - -#: ../../howto/descriptor.rst:1208 +#: ../../howto/descriptor.rst:349 msgid "" "Static methods return the underlying function without changes. Calling " "either ``c.f`` or ``C.f`` is the equivalent of a direct lookup into ``object." @@ -900,13 +404,13 @@ msgid "" "a class." msgstr "" -#: ../../howto/descriptor.rst:1214 +#: ../../howto/descriptor.rst:355 msgid "" "Good candidates for static methods are methods that do not reference the " "``self`` variable." msgstr "" -#: ../../howto/descriptor.rst:1217 +#: ../../howto/descriptor.rst:358 msgid "" "For instance, a statistics package may include a container class for " "experimental data. The class provides normal methods for computing the " @@ -918,133 +422,40 @@ msgid "" "``s.erf(1.5) --> .9332`` or ``Sample.erf(1.5) --> .9332``." msgstr "" -#: ../../howto/descriptor.rst:1226 +#: ../../howto/descriptor.rst:367 msgid "" -"Since static methods return the underlying function with no changes, the " -"example calls are unexciting:" +"Since staticmethods return the underlying function with no changes, the " +"example calls are unexciting::" msgstr "" -#: ../../howto/descriptor.rst:1243 +#: ../../howto/descriptor.rst:380 msgid "" "Using the non-data descriptor protocol, a pure Python version of :func:" -"`staticmethod` would look like this:" +"`staticmethod` would look like this::" msgstr "" -#: ../../howto/descriptor.rst:1275 -msgid "Class methods" -msgstr "" - -#: ../../howto/descriptor.rst:1277 +#: ../../howto/descriptor.rst:392 msgid "" "Unlike static methods, class methods prepend the class reference to the " "argument list before calling the function. This format is the same for " -"whether the caller is an object or a class:" +"whether the caller is an object or a class::" msgstr "" -#: ../../howto/descriptor.rst:1295 +#: ../../howto/descriptor.rst:407 msgid "" -"This behavior is useful whenever the method only needs to have a class " -"reference and does not rely on data stored in a specific instance. One use " -"for class methods is to create alternate class constructors. For example, " -"the classmethod :func:`dict.fromkeys` creates a new dictionary from a list " -"of keys. The pure Python equivalent is:" +"This behavior is useful whenever the function only needs to have a class " +"reference and does not care about any underlying data. One use for " +"classmethods is to create alternate class constructors. In Python 2.3, the " +"classmethod :func:`dict.fromkeys` creates a new dictionary from a list of " +"keys. The pure Python equivalent is::" msgstr "" -#: ../../howto/descriptor.rst:1312 -msgid "Now a new dictionary of unique keys can be constructed like this:" +#: ../../howto/descriptor.rst:423 +msgid "Now a new dictionary of unique keys can be constructed like this::" msgstr "" -#: ../../howto/descriptor.rst:1322 +#: ../../howto/descriptor.rst:428 msgid "" "Using the non-data descriptor protocol, a pure Python version of :func:" -"`classmethod` would look like this:" -msgstr "" - -#: ../../howto/descriptor.rst:1371 -msgid "" -"The code path for ``hasattr(type(self.f), '__get__')`` was added in Python " -"3.9 and makes it possible for :func:`classmethod` to support chained " -"decorators. For example, a classmethod and property could be chained " -"together:" -msgstr "" - -#: ../../howto/descriptor.rst:1391 -msgid "Member objects and __slots__" -msgstr "" - -#: ../../howto/descriptor.rst:1393 -msgid "" -"When a class defines ``__slots__``, it replaces instance dictionaries with a " -"fixed-length array of slot values. From a user point of view that has " -"several effects:" -msgstr "" - -#: ../../howto/descriptor.rst:1397 -msgid "" -"1. Provides immediate detection of bugs due to misspelled attribute " -"assignments. Only attribute names specified in ``__slots__`` are allowed:" -msgstr "" - -#: ../../howto/descriptor.rst:1413 -msgid "" -"2. Helps create immutable objects where descriptors manage access to private " -"attributes stored in ``__slots__``:" -msgstr "" - -#: ../../howto/descriptor.rst:1448 -msgid "" -"3. Saves memory. On a 64-bit Linux build, an instance with two attributes " -"takes 48 bytes with ``__slots__`` and 152 bytes without. This `flyweight " -"design pattern `_ likely " -"only matters when a large number of instances are going to be created." -msgstr "" - -#: ../../howto/descriptor.rst:1453 -msgid "" -"4. Blocks tools like :func:`functools.cached_property` which require an " -"instance dictionary to function correctly:" -msgstr "" - -#: ../../howto/descriptor.rst:1475 -msgid "" -"It is not possible to create an exact drop-in pure Python version of " -"``__slots__`` because it requires direct access to C structures and control " -"over object memory allocation. However, we can build a mostly faithful " -"simulation where the actual C structure for slots is emulated by a private " -"``_slotvalues`` list. Reads and writes to that private structure are " -"managed by member descriptors:" -msgstr "" - -#: ../../howto/descriptor.rst:1518 -msgid "" -"The :meth:`type.__new__` method takes care of adding member objects to class " -"variables:" -msgstr "" - -#: ../../howto/descriptor.rst:1534 -msgid "" -"The :meth:`object.__new__` method takes care of creating instances that have " -"slots instead of an instance dictionary. Here is a rough simulation in pure " -"Python:" -msgstr "" - -#: ../../howto/descriptor.rst:1569 -msgid "" -"To use the simulation in a real class, just inherit from :class:`Object` and " -"set the :term:`metaclass` to :class:`Type`:" -msgstr "" - -#: ../../howto/descriptor.rst:1583 -msgid "" -"At this point, the metaclass has loaded member objects for *x* and *y*::" -msgstr "" - -#: ../../howto/descriptor.rst:1604 -msgid "" -"When instances are created, they have a ``slot_values`` list where the " -"attributes are stored:" -msgstr "" - -#: ../../howto/descriptor.rst:1616 -msgid "Misspelled or unassigned attributes will raise an exception:" +"`classmethod` would look like this::" msgstr "" diff --git a/howto/instrumentation.po b/howto/instrumentation.po index 161f6c91a0..97118a4e81 100644 --- a/howto/instrumentation.po +++ b/howto/instrumentation.po @@ -5,7 +5,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.7\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2021-09-07 06:52+0000\n" +"POT-Creation-Date: 2020-06-20 18:08+0800\n" "PO-Revision-Date: 2018-07-15 18:56+0800\n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" "tw)\n" @@ -195,135 +195,135 @@ msgstr "" msgid "Available static markers" msgstr "" -#: ../../howto/instrumentation.rst:277 +#: ../../howto/instrumentation.rst:279 msgid "" "This marker indicates that execution of a Python function has begun. It is " "only triggered for pure-Python (bytecode) functions." msgstr "" -#: ../../howto/instrumentation.rst:280 +#: ../../howto/instrumentation.rst:282 msgid "" "The filename, function name, and line number are provided back to the " "tracing script as positional arguments, which must be accessed using ``" "$arg1``, ``$arg2``, ``$arg3``:" msgstr "" -#: ../../howto/instrumentation.rst:284 +#: ../../howto/instrumentation.rst:286 msgid "" "``$arg1`` : ``(const char *)`` filename, accessible using " "``user_string($arg1)``" msgstr "" -#: ../../howto/instrumentation.rst:286 +#: ../../howto/instrumentation.rst:288 msgid "" "``$arg2`` : ``(const char *)`` function name, accessible using " "``user_string($arg2)``" msgstr "" -#: ../../howto/instrumentation.rst:289 +#: ../../howto/instrumentation.rst:291 msgid "``$arg3`` : ``int`` line number" msgstr "" -#: ../../howto/instrumentation.rst:293 +#: ../../howto/instrumentation.rst:295 msgid "" "This marker is the converse of :c:func:`function__entry`, and indicates that " "execution of a Python function has ended (either via ``return``, or via an " "exception). It is only triggered for pure-Python (bytecode) functions." msgstr "" -#: ../../howto/instrumentation.rst:297 +#: ../../howto/instrumentation.rst:299 msgid "The arguments are the same as for :c:func:`function__entry`" msgstr "" -#: ../../howto/instrumentation.rst:301 +#: ../../howto/instrumentation.rst:303 msgid "" "This marker indicates a Python line is about to be executed. It is the " "equivalent of line-by-line tracing with a Python profiler. It is not " "triggered within C functions." msgstr "" -#: ../../howto/instrumentation.rst:305 +#: ../../howto/instrumentation.rst:307 msgid "The arguments are the same as for :c:func:`function__entry`." msgstr "" -#: ../../howto/instrumentation.rst:309 +#: ../../howto/instrumentation.rst:311 msgid "" "Fires when the Python interpreter starts a garbage collection cycle. " "``arg0`` is the generation to scan, like :func:`gc.collect()`." msgstr "" -#: ../../howto/instrumentation.rst:314 +#: ../../howto/instrumentation.rst:316 msgid "" "Fires when the Python interpreter finishes a garbage collection cycle. " "``arg0`` is the number of collected objects." msgstr "" -#: ../../howto/instrumentation.rst:319 +#: ../../howto/instrumentation.rst:321 msgid "" "Fires before :mod:`importlib` attempts to find and load the module. ``arg0`` " "is the module name." msgstr "" -#: ../../howto/instrumentation.rst:326 +#: ../../howto/instrumentation.rst:328 msgid "" "Fires after :mod:`importlib`'s find_and_load function is called. ``arg0`` is " "the module name, ``arg1`` indicates if module was successfully loaded." msgstr "" -#: ../../howto/instrumentation.rst:335 +#: ../../howto/instrumentation.rst:337 msgid "" "Fires when :func:`sys.audit` or :c:func:`PySys_Audit` is called. ``arg0`` is " "the event name as C string, ``arg1`` is a :c:type:`PyObject` pointer to a " "tuple object." msgstr "" -#: ../../howto/instrumentation.rst:343 +#: ../../howto/instrumentation.rst:345 msgid "SystemTap Tapsets" msgstr "" -#: ../../howto/instrumentation.rst:345 +#: ../../howto/instrumentation.rst:347 msgid "" "The higher-level way to use the SystemTap integration is to use a \"tapset" "\": SystemTap's equivalent of a library, which hides some of the lower-level " "details of the static markers." msgstr "" -#: ../../howto/instrumentation.rst:349 +#: ../../howto/instrumentation.rst:351 msgid "Here is a tapset file, based on a non-shared build of CPython:" msgstr "" -#: ../../howto/instrumentation.rst:372 +#: ../../howto/instrumentation.rst:374 msgid "" "If this file is installed in SystemTap's tapset directory (e.g. ``/usr/share/" "systemtap/tapset``), then these additional probepoints become available:" msgstr "" -#: ../../howto/instrumentation.rst:378 +#: ../../howto/instrumentation.rst:380 msgid "" "This probe point indicates that execution of a Python function has begun. It " "is only triggered for pure-Python (bytecode) functions." msgstr "" -#: ../../howto/instrumentation.rst:383 +#: ../../howto/instrumentation.rst:385 msgid "" -"This probe point is the converse of ``python.function.return``, and " +"This probe point is the converse of :c:func:`python.function.return`, and " "indicates that execution of a Python function has ended (either via " "``return``, or via an exception). It is only triggered for pure-Python " "(bytecode) functions." msgstr "" -#: ../../howto/instrumentation.rst:390 +#: ../../howto/instrumentation.rst:392 msgid "Examples" msgstr "" -#: ../../howto/instrumentation.rst:391 +#: ../../howto/instrumentation.rst:393 msgid "" "This SystemTap script uses the tapset above to more cleanly implement the " "example given above of tracing the Python function-call hierarchy, without " "needing to directly name the static markers:" msgstr "" -#: ../../howto/instrumentation.rst:410 +#: ../../howto/instrumentation.rst:412 msgid "" "The following script uses the tapset above to provide a top-like view of all " "running CPython code, showing the top 20 most frequently-entered bytecode " diff --git a/howto/logging-cookbook.po b/howto/logging-cookbook.po index 539165a65a..a6fe02e422 100644 --- a/howto/logging-cookbook.po +++ b/howto/logging-cookbook.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.7\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2021-09-07 06:52+0000\n" +"POT-Creation-Date: 2020-06-20 18:08+0800\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-" @@ -789,16 +789,16 @@ msgstr "" #: ../../howto/logging-cookbook.rst:1370 msgid "" "Below is an example of a logging configuration dictionary - it's taken from " -"the `documentation on the Django project `_. This dictionary is passed to :" +"the `documentation on the Django project `_. This dictionary is passed to :" "func:`~config.dictConfig` to put the configuration into effect::" msgstr "" #: ../../howto/logging-cookbook.rst:1426 msgid "" "For more information about this configuration, you can see the `relevant " -"section `_ of the Django documentation." +"section `_ of the Django documentation." msgstr "" #: ../../howto/logging-cookbook.rst:1433 @@ -1525,118 +1525,3 @@ msgid "" "Qt. Please refer to the comments in the code snippet for more detailed " "information." msgstr "" - -#: ../../howto/logging-cookbook.rst:2987 -msgid "Patterns to avoid" -msgstr "" - -#: ../../howto/logging-cookbook.rst:2989 -msgid "" -"Although the preceding sections have described ways of doing things you " -"might need to do or deal with, it is worth mentioning some usage patterns " -"which are *unhelpful*, and which should therefore be avoided in most cases. " -"The following sections are in no particular order." -msgstr "" - -#: ../../howto/logging-cookbook.rst:2996 -msgid "Opening the same log file multiple times" -msgstr "" - -#: ../../howto/logging-cookbook.rst:2998 -msgid "" -"On Windows, you will generally not be able to open the same file multiple " -"times as this will lead to a \"file is in use by another process\" error. " -"However, on POSIX platforms you'll not get any errors if you open the same " -"file multiple times. This could be done accidentally, for example by:" -msgstr "" - -#: ../../howto/logging-cookbook.rst:3003 -msgid "" -"Adding a file handler more than once which references the same file (e.g. by " -"a copy/paste/forget-to-change error)." -msgstr "" - -#: ../../howto/logging-cookbook.rst:3006 -msgid "" -"Opening two files that look different, as they have different names, but are " -"the same because one is a symbolic link to the other." -msgstr "" - -#: ../../howto/logging-cookbook.rst:3009 -msgid "" -"Forking a process, following which both parent and child have a reference to " -"the same file. This might be through use of the :mod:`multiprocessing` " -"module, for example." -msgstr "" - -#: ../../howto/logging-cookbook.rst:3013 -msgid "" -"Opening a file multiple times might *appear* to work most of the time, but " -"can lead to a number of problems in practice:" -msgstr "" - -#: ../../howto/logging-cookbook.rst:3016 -msgid "" -"Logging output can be garbled because multiple threads or processes try to " -"write to the same file. Although logging guards against concurrent use of " -"the same handler instance by multiple threads, there is no such protection " -"if concurrent writes are attempted by two different threads using two " -"different handler instances which happen to point to the same file." -msgstr "" - -#: ../../howto/logging-cookbook.rst:3022 -msgid "" -"An attempt to delete a file (e.g. during file rotation) silently fails, " -"because there is another reference pointing to it. This can lead to " -"confusion and wasted debugging time - log entries end up in unexpected " -"places, or are lost altogether." -msgstr "" - -#: ../../howto/logging-cookbook.rst:3027 -msgid "" -"Use the techniques outlined in :ref:`multiple-processes` to circumvent such " -"issues." -msgstr "" - -#: ../../howto/logging-cookbook.rst:3031 -msgid "Using loggers as attributes in a class or passing them as parameters" -msgstr "" - -#: ../../howto/logging-cookbook.rst:3033 -msgid "" -"While there might be unusual cases where you'll need to do this, in general " -"there is no point because loggers are singletons. Code can always access a " -"given logger instance by name using ``logging.getLogger(name)``, so passing " -"instances around and holding them as instance attributes is pointless. Note " -"that in other languages such as Java and C#, loggers are often static class " -"attributes. However, this pattern doesn't make sense in Python, where the " -"module (and not the class) is the unit of software decomposition." -msgstr "" - -#: ../../howto/logging-cookbook.rst:3043 -msgid "" -"Adding handlers other than :class:`NullHandler` to a logger in a library" -msgstr "" - -#: ../../howto/logging-cookbook.rst:3045 -msgid "" -"Configuring logging by adding handlers, formatters and filters is the " -"responsibility of the application developer, not the library developer. If " -"you are maintaining a library, ensure that you don't add handlers to any of " -"your loggers other than a :class:`~logging.NullHandler` instance." -msgstr "" - -#: ../../howto/logging-cookbook.rst:3052 -msgid "Creating a lot of loggers" -msgstr "" - -#: ../../howto/logging-cookbook.rst:3054 -msgid "" -"Loggers are singletons that are never freed during a script execution, and " -"so creating lots of loggers will use up memory which can't then be freed. " -"Rather than create a logger per e.g. file processed or network connection " -"made, use the :ref:`existing mechanisms ` for passing " -"contextual information into your logs and restrict the loggers created to " -"those describing areas within your application (generally modules, but " -"occasionally slightly more fine-grained than that)." -msgstr "" diff --git a/howto/pyporting.po b/howto/pyporting.po index 8664ea3a82..e32ea12ae5 100644 --- a/howto/pyporting.po +++ b/howto/pyporting.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.7\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2021-09-07 06:52+0000\n" +"POT-Creation-Date: 2020-06-20 18:08+0800\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-" @@ -56,10 +56,10 @@ msgid "" "Cannon's `Why Python 3 exists`_." msgstr "" -#: ../../howto/pyporting.rst:24 +#: ../../howto/pyporting.rst:23 msgid "" -"For help with porting, you can view the archived python-porting_ mailing " -"list." +"For help with porting, you can email the python-porting_ mailing list with " +"questions." msgstr "" #: ../../howto/pyporting.rst:27 diff --git a/howto/urllib2.po b/howto/urllib2.po index f4c612cbba..48dface6ab 100644 --- a/howto/urllib2.po +++ b/howto/urllib2.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.7\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2021-09-07 06:52+0000\n" +"POT-Creation-Date: 2018-06-26 18:54+0800\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-" @@ -147,7 +147,7 @@ msgstr "" msgid "" "In the case of HTTP, there are two extra things that Request objects allow " "you to do: First, you can pass data to be sent to the server. Second, you " -"can pass extra information (\"metadata\") *about* the data or about the " +"can pass extra information (\"metadata\") *about* the data or the about " "request itself, to the server - this information is sent as HTTP \"headers" "\". Let's look at each of these in turn." msgstr "" diff --git a/install/index.po b/install/index.po index cd71b52980..8a6eede1ca 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-07 06:52+0000\n" +"POT-Creation-Date: 2020-06-20 18:08+0800\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-" @@ -1461,10 +1461,12 @@ msgid "" msgstr "" #: ../../install/index.rst:1067 -msgid "Check https://www.sourceware.org/cygwin/ for more information" +msgid "" +"Check https://www.sourceware.org/cygwin/ and http://www.mingw.org/ for more " +"information" msgstr "" -#: ../../install/index.rst:1069 +#: ../../install/index.rst:1070 msgid "" "Then you have no POSIX emulation available, but you also don't need :file:" "`cygwin1.dll`." diff --git a/library/__future__.po b/library/__future__.po index 5df535ff63..1b107eec4b 100644 --- a/library/__future__.po +++ b/library/__future__.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.7\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2021-09-07 06:52+0000\n" +"POT-Creation-Date: 2018-06-26 18:54+0800\n" "PO-Revision-Date: 2016-01-31 07:12+0000\n" "Last-Translator: Liang-Bo Wang \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -243,7 +243,7 @@ msgid "3.7.0b1" msgstr "" #: ../../library/__future__.rst:93 -msgid "3.10" +msgid "4.0" msgstr "" #: ../../library/__future__.rst:93 diff --git a/library/aifc.po b/library/aifc.po index 5a44eb7510..2aa10e298e 100644 --- a/library/aifc.po +++ b/library/aifc.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.7\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2021-09-07 06:52+0000\n" +"POT-Creation-Date: 2020-06-20 18:08+0800\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-" @@ -224,29 +224,29 @@ msgid "" "given position. This method can be called at any time before :meth:`close`." msgstr "" -#: ../../library/aifc.rst:213 +#: ../../library/aifc.rst:212 msgid "" "Return the current write position in the output file. Useful in combination " "with :meth:`setmark`." msgstr "" -#: ../../library/aifc.rst:219 +#: ../../library/aifc.rst:218 msgid "" "Write data to the output file. This method can only be called after the " "audio file parameters have been set." msgstr "" -#: ../../library/aifc.rst:222 ../../library/aifc.rst:231 +#: ../../library/aifc.rst:221 ../../library/aifc.rst:230 msgid "Any :term:`bytes-like object` is now accepted." msgstr "" -#: ../../library/aifc.rst:228 +#: ../../library/aifc.rst:227 msgid "" "Like :meth:`writeframes`, except that the header of the audio file is not " "updated." msgstr "" -#: ../../library/aifc.rst:238 +#: ../../library/aifc.rst:236 msgid "" "Close the AIFF file. The header of the file is updated to reflect the " "actual size of the audio data. After calling this method, the object can no " diff --git a/library/argparse.po b/library/argparse.po index 4964eac604..f58398d389 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-07 06:52+0000\n" +"POT-Creation-Date: 2020-06-20 18:08+0800\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-" @@ -554,8 +554,8 @@ msgstr "" #: ../../library/argparse.rst:662 msgid "" -"If the user would like to catch errors manually, the feature can be enabled " -"by setting ``exit_on_error`` to ``False``::" +"If the user would like catch errors manually, the feature can be enable by " +"setting ``exit_on_error`` to ``False``::" msgstr "" #: ../../library/argparse.rst:679 @@ -592,7 +592,7 @@ msgstr "" #: ../../library/argparse.rst:698 msgid "" "default_ - The value produced if the argument is absent from the command " -"line and if it is absent from the namespace object." +"line." msgstr "" #: ../../library/argparse.rst:701 @@ -739,26 +739,26 @@ msgid "" "boolean actions such as ``--foo`` and ``--no-foo``::" msgstr "" -#: ../../library/argparse.rst:858 +#: ../../library/argparse.rst:856 msgid "" "The recommended way to create a custom action is to extend :class:`Action`, " "overriding the ``__call__`` method and optionally the ``__init__`` and " "``format_usage`` methods." msgstr "" -#: ../../library/argparse.rst:862 +#: ../../library/argparse.rst:860 msgid "An example of a custom action::" msgstr "" -#: ../../library/argparse.rst:882 +#: ../../library/argparse.rst:880 msgid "For more details, see :class:`Action`." msgstr "" -#: ../../library/argparse.rst:885 +#: ../../library/argparse.rst:883 msgid "nargs" msgstr "" -#: ../../library/argparse.rst:887 +#: ../../library/argparse.rst:885 msgid "" "ArgumentParser objects usually associate a single command-line argument with " "a single action to be taken. The ``nargs`` keyword argument associates a " @@ -766,19 +766,19 @@ msgid "" "supported values are:" msgstr "" -#: ../../library/argparse.rst:892 +#: ../../library/argparse.rst:890 msgid "" "``N`` (an integer). ``N`` arguments from the command line will be gathered " "together into a list. For example::" msgstr "" -#: ../../library/argparse.rst:901 +#: ../../library/argparse.rst:899 msgid "" "Note that ``nargs=1`` produces a list of one item. This is different from " "the default, in which the item is produced by itself." msgstr "" -#: ../../library/argparse.rst:906 +#: ../../library/argparse.rst:904 msgid "" "``'?'``. One argument will be consumed from the command line if possible, " "and produced as a single item. If no command-line argument is present, the " @@ -788,13 +788,13 @@ msgid "" "produced. Some examples to illustrate this::" msgstr "" -#: ../../library/argparse.rst:923 +#: ../../library/argparse.rst:921 msgid "" "One of the more common uses of ``nargs='?'`` is to allow optional input and " "output files::" msgstr "" -#: ../../library/argparse.rst:940 +#: ../../library/argparse.rst:938 msgid "" "``'*'``. All command-line arguments present are gathered into a list. Note " "that it generally doesn't make much sense to have more than one positional " @@ -802,14 +802,14 @@ msgid "" "``nargs='*'`` is possible. For example::" msgstr "" -#: ../../library/argparse.rst:954 +#: ../../library/argparse.rst:952 msgid "" "``'+'``. Just like ``'*'``, all command-line args present are gathered into " "a list. Additionally, an error message will be generated if there wasn't at " "least one command-line argument present. For example::" msgstr "" -#: ../../library/argparse.rst:966 +#: ../../library/argparse.rst:964 msgid "" "If the ``nargs`` keyword argument is not provided, the number of arguments " "consumed is determined by the action_. Generally this means a single " @@ -817,11 +817,11 @@ msgid "" "be produced." msgstr "" -#: ../../library/argparse.rst:972 +#: ../../library/argparse.rst:970 msgid "const" msgstr "" -#: ../../library/argparse.rst:974 +#: ../../library/argparse.rst:972 msgid "" "The ``const`` argument of :meth:`~ArgumentParser.add_argument` is used to " "hold constant values that are not read from the command line but are " @@ -829,7 +829,7 @@ msgid "" "common uses of it are:" msgstr "" -#: ../../library/argparse.rst:978 +#: ../../library/argparse.rst:976 msgid "" "When :meth:`~ArgumentParser.add_argument` is called with " "``action='https://github.com/store_const'`` or ``action='https://github.com/append_const'``. These actions add " @@ -837,7 +837,7 @@ msgid "" "`~ArgumentParser.parse_args`. See the action_ description for examples." msgstr "" -#: ../../library/argparse.rst:983 +#: ../../library/argparse.rst:981 msgid "" "When :meth:`~ArgumentParser.add_argument` is called with option strings " "(like ``-f`` or ``--foo``) and ``nargs='?'``. This creates an optional " @@ -847,17 +847,17 @@ msgid "" "instead. See the nargs_ description for examples." msgstr "" -#: ../../library/argparse.rst:990 +#: ../../library/argparse.rst:988 msgid "" "With the ``'store_const'`` and ``'append_const'`` actions, the ``const`` " "keyword argument must be given. For other actions, it defaults to ``None``." msgstr "" -#: ../../library/argparse.rst:995 +#: ../../library/argparse.rst:993 msgid "default" msgstr "" -#: ../../library/argparse.rst:997 +#: ../../library/argparse.rst:995 msgid "" "All optional arguments and some positional arguments may be omitted at the " "command line. The ``default`` keyword argument of :meth:`~ArgumentParser." @@ -867,13 +867,7 @@ msgid "" "command line::" msgstr "" -#: ../../library/argparse.rst:1011 -msgid "" -"If the target namespace already has an attribute set, the action *default* " -"will not over write it::" -msgstr "" - -#: ../../library/argparse.rst:1019 +#: ../../library/argparse.rst:1009 msgid "" "If the ``default`` value is a string, the parser parses the value as if it " "were a command-line argument. In particular, the parser applies any type_ " @@ -881,96 +875,68 @@ msgid "" "`Namespace` return value. Otherwise, the parser uses the value as is::" msgstr "" -#: ../../library/argparse.rst:1030 +#: ../../library/argparse.rst:1020 msgid "" "For positional arguments with nargs_ equal to ``?`` or ``*``, the " "``default`` value is used when no command-line argument was present::" msgstr "" -#: ../../library/argparse.rst:1041 +#: ../../library/argparse.rst:1031 msgid "" "Providing ``default=argparse.SUPPRESS`` causes no attribute to be added if " "the command-line argument was not present::" msgstr "" -#: ../../library/argparse.rst:1053 +#: ../../library/argparse.rst:1043 msgid "type" msgstr "" -#: ../../library/argparse.rst:1055 -msgid "" -"By default, the parser reads command-line arguments in as simple strings. " -"However, quite often the command-line string should instead be interpreted " -"as another type, such as a :class:`float` or :class:`int`. The ``type`` " -"keyword for :meth:`~ArgumentParser.add_argument` allows any necessary type-" -"checking and type conversions to be performed." -msgstr "" - -#: ../../library/argparse.rst:1061 +#: ../../library/argparse.rst:1045 msgid "" -"If the type_ keyword is used with the default_ keyword, the type converter " -"is only applied if the default is a string." +"By default, :class:`ArgumentParser` objects read command-line arguments in " +"as simple strings. However, quite often the command-line string should " +"instead be interpreted as another type, like a :class:`float` or :class:" +"`int`. The ``type`` keyword argument of :meth:`~ArgumentParser." +"add_argument` allows any necessary type-checking and type conversions to be " +"performed. Common built-in types and functions can be used directly as the " +"value of the ``type`` argument::" msgstr "" -#: ../../library/argparse.rst:1064 +#: ../../library/argparse.rst:1058 msgid "" -"The argument to ``type`` can be any callable that accepts a single string. " -"If the function raises :exc:`ArgumentTypeError`, :exc:`TypeError`, or :exc:" -"`ValueError`, the exception is caught and a nicely formatted error message " -"is displayed. No other exception types are handled." -msgstr "" - -#: ../../library/argparse.rst:1069 -msgid "Common built-in types and functions can be used as type converters:" -msgstr "" - -#: ../../library/argparse.rst:1085 -msgid "User defined functions can be used as well:" +"See the section on the default_ keyword argument for information on when the " +"``type`` argument is applied to default arguments." msgstr "" -#: ../../library/argparse.rst:1097 -msgid "" -"The :func:`bool` function is not recommended as a type converter. All it " -"does is convert empty strings to ``False`` and non-empty strings to " -"``True``. This is usually not what is desired." -msgstr "" - -#: ../../library/argparse.rst:1101 +#: ../../library/argparse.rst:1061 msgid "" -"In general, the ``type`` keyword is a convenience that should only be used " -"for simple conversions that can only raise one of the three supported " -"exceptions. Anything with more interesting error-handling or resource " -"management should be done downstream after the arguments are parsed." +"To ease the use of various types of files, the argparse module provides the " +"factory FileType which takes the ``mode=``, ``bufsize=``, ``encoding=`` and " +"``errors=`` arguments of the :func:`open` function. For example, " +"``FileType('w')`` can be used to create a writable file::" msgstr "" -#: ../../library/argparse.rst:1106 +#: ../../library/argparse.rst:1071 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." -"JSONDecodeError` would not be well formatted and a :exc:`FileNotFound` " -"exception would not be handled at all." +"``type=`` can take any callable that takes a single string argument and " +"returns the converted value::" msgstr "" -#: ../../library/argparse.rst:1111 +#: ../../library/argparse.rst:1090 msgid "" -"Even :class:`~argparse.FileType` has its limitations for use with the " -"``type`` keyword. If one argument uses *FileType* and then a subsequent " -"argument fails, an error is reported but the file is not automatically " -"closed. In this case, it would be better to wait until after the parser has " -"run and then use the :keyword:`with`-statement to manage the files." +"The choices_ keyword argument may be more convenient for type checkers that " +"simply check against a range of values::" msgstr "" -#: ../../library/argparse.rst:1117 -msgid "" -"For type checkers that simply check against a fixed set of values, consider " -"using the choices_ keyword instead." +#: ../../library/argparse.rst:1101 +msgid "See the choices_ section for more details." msgstr "" -#: ../../library/argparse.rst:1122 +#: ../../library/argparse.rst:1105 msgid "choices" msgstr "" -#: ../../library/argparse.rst:1124 +#: ../../library/argparse.rst:1107 msgid "" "Some command-line arguments should be selected from a restricted set of " "values. These can be handled by passing a container object as the *choices* " @@ -979,38 +945,24 @@ msgid "" "be displayed if the argument was not one of the acceptable values::" msgstr "" -#: ../../library/argparse.rst:1139 +#: ../../library/argparse.rst:1122 msgid "" "Note that inclusion in the *choices* container is checked after any type_ " "conversions have been performed, so the type of the objects in the *choices* " "container should match the type_ specified::" msgstr "" -#: ../../library/argparse.rst:1151 +#: ../../library/argparse.rst:1134 msgid "" "Any container can be passed as the *choices* value, so :class:`list` " "objects, :class:`set` objects, and custom containers are all supported." msgstr "" -#: ../../library/argparse.rst:1154 -msgid "" -"Use of :class:`enum.Enum` is not recommended because it is difficult to " -"control its appearance in usage, help, and error messages." -msgstr "" - -#: ../../library/argparse.rst:1157 -msgid "" -"Formatted choices overrides the default *metavar* which is normally derived " -"from *dest*. This is usually what you want because the user never sees the " -"*dest* parameter. If this display isn't desirable (perhaps because there " -"are many choices), just specify an explicit metavar_." -msgstr "" - -#: ../../library/argparse.rst:1164 +#: ../../library/argparse.rst:1139 msgid "required" msgstr "" -#: ../../library/argparse.rst:1166 +#: ../../library/argparse.rst:1141 msgid "" "In general, the :mod:`argparse` module assumes that flags like ``-f`` and " "``--bar`` indicate *optional* arguments, which can always be omitted at the " @@ -1018,24 +970,24 @@ msgid "" "the ``required=`` keyword argument to :meth:`~ArgumentParser.add_argument`::" msgstr "" -#: ../../library/argparse.rst:1179 +#: ../../library/argparse.rst:1154 msgid "" "As the example shows, if an option is marked as ``required``, :meth:" "`~ArgumentParser.parse_args` will report an error if that option is not " "present at the command line." msgstr "" -#: ../../library/argparse.rst:1185 +#: ../../library/argparse.rst:1160 msgid "" "Required options are generally considered bad form because users expect " "*options* to be *optional*, and thus they should be avoided when possible." msgstr "" -#: ../../library/argparse.rst:1190 +#: ../../library/argparse.rst:1165 msgid "help" msgstr "" -#: ../../library/argparse.rst:1192 +#: ../../library/argparse.rst:1167 msgid "" "The ``help`` value is a string containing a brief description of the " "argument. When a user requests help (usually by using ``-h`` or ``--help`` " @@ -1043,7 +995,7 @@ msgid "" "each argument::" msgstr "" -#: ../../library/argparse.rst:1212 +#: ../../library/argparse.rst:1187 msgid "" "The ``help`` strings can include various format specifiers to avoid " "repetition of things like the program name or the argument default_. The " @@ -1052,23 +1004,23 @@ msgid "" "%(type)s``, etc.::" msgstr "" -#: ../../library/argparse.rst:1229 +#: ../../library/argparse.rst:1204 msgid "" "As the help string supports %-formatting, if you want a literal ``%`` to " "appear in the help string, you must escape it as ``%%``." msgstr "" -#: ../../library/argparse.rst:1232 +#: ../../library/argparse.rst:1207 msgid "" ":mod:`argparse` supports silencing the help entry for certain options, by " "setting the ``help`` value to ``argparse.SUPPRESS``::" msgstr "" -#: ../../library/argparse.rst:1245 +#: ../../library/argparse.rst:1220 msgid "metavar" msgstr "" -#: ../../library/argparse.rst:1247 +#: ../../library/argparse.rst:1222 msgid "" "When :class:`ArgumentParser` generates help messages, it needs some way to " "refer to each expected argument. By default, ArgumentParser objects use the " @@ -1080,29 +1032,29 @@ msgid "" "argument will be referred to as ``FOO``. An example::" msgstr "" -#: ../../library/argparse.rst:1271 +#: ../../library/argparse.rst:1246 msgid "An alternative name can be specified with ``metavar``::" msgstr "" -#: ../../library/argparse.rst:1288 +#: ../../library/argparse.rst:1263 msgid "" "Note that ``metavar`` only changes the *displayed* name - the name of the " "attribute on the :meth:`~ArgumentParser.parse_args` object is still " "determined by the dest_ value." msgstr "" -#: ../../library/argparse.rst:1292 +#: ../../library/argparse.rst:1267 msgid "" "Different values of ``nargs`` may cause the metavar to be used multiple " "times. Providing a tuple to ``metavar`` specifies a different display for " "each of the arguments::" msgstr "" -#: ../../library/argparse.rst:1309 +#: ../../library/argparse.rst:1284 msgid "dest" msgstr "" -#: ../../library/argparse.rst:1311 +#: ../../library/argparse.rst:1286 msgid "" "Most :class:`ArgumentParser` actions add some value as an attribute of the " "object returned by :meth:`~ArgumentParser.parse_args`. The name of this " @@ -1112,7 +1064,7 @@ msgid "" "add_argument`::" msgstr "" -#: ../../library/argparse.rst:1323 +#: ../../library/argparse.rst:1298 msgid "" "For optional argument actions, the value of ``dest`` is normally inferred " "from the option strings. :class:`ArgumentParser` generates the value of " @@ -1124,22 +1076,22 @@ msgid "" "below illustrate this behavior::" msgstr "" -#: ../../library/argparse.rst:1340 +#: ../../library/argparse.rst:1315 msgid "``dest`` allows a custom attribute name to be provided::" msgstr "" -#: ../../library/argparse.rst:1348 +#: ../../library/argparse.rst:1323 msgid "Action classes" msgstr "" -#: ../../library/argparse.rst:1350 +#: ../../library/argparse.rst:1325 msgid "" "Action classes implement the Action API, a callable which returns a callable " "which processes arguments from the command-line. Any object which follows " "this API may be passed as the ``action`` parameter to :meth:`add_argument`." msgstr "" -#: ../../library/argparse.rst:1359 +#: ../../library/argparse.rst:1334 msgid "" "Action objects are used by an ArgumentParser to represent the information " "needed to parse a single argument from one or more strings from the command " @@ -1148,7 +1100,7 @@ msgid "" "the ``action`` itself." msgstr "" -#: ../../library/argparse.rst:1365 +#: ../../library/argparse.rst:1340 msgid "" "Instances of Action (or return value of any callable to the ``action`` " "parameter) should have attributes \"dest\", \"option_strings\", \"default\", " @@ -1156,114 +1108,114 @@ msgid "" "these attributes are defined is to call ``Action.__init__``." msgstr "" -#: ../../library/argparse.rst:1370 +#: ../../library/argparse.rst:1345 msgid "" "Action instances should be callable, so subclasses must override the " "``__call__`` method, which should accept four parameters:" msgstr "" -#: ../../library/argparse.rst:1373 +#: ../../library/argparse.rst:1348 msgid "``parser`` - The ArgumentParser object which contains this action." msgstr "" -#: ../../library/argparse.rst:1375 +#: ../../library/argparse.rst:1350 msgid "" "``namespace`` - The :class:`Namespace` object that will be returned by :meth:" "`~ArgumentParser.parse_args`. Most actions add an attribute to this object " "using :func:`setattr`." msgstr "" -#: ../../library/argparse.rst:1379 +#: ../../library/argparse.rst:1354 msgid "" "``values`` - The associated command-line arguments, with any type " "conversions applied. Type conversions are specified with the type_ keyword " "argument to :meth:`~ArgumentParser.add_argument`." msgstr "" -#: ../../library/argparse.rst:1383 +#: ../../library/argparse.rst:1358 msgid "" "``option_string`` - The option string that was used to invoke this action. " "The ``option_string`` argument is optional, and will be absent if the action " "is associated with a positional argument." msgstr "" -#: ../../library/argparse.rst:1387 +#: ../../library/argparse.rst:1362 msgid "" "The ``__call__`` method may perform arbitrary actions, but will typically " "set attributes on the ``namespace`` based on ``dest`` and ``values``." msgstr "" -#: ../../library/argparse.rst:1390 +#: ../../library/argparse.rst:1365 msgid "" "Action subclasses can define a ``format_usage`` method that takes no " "argument and return a string which will be used when printing the usage of " "the program. If such method is not provided, a sensible default will be used." msgstr "" -#: ../../library/argparse.rst:1395 +#: ../../library/argparse.rst:1370 msgid "The parse_args() method" msgstr "" -#: ../../library/argparse.rst:1399 +#: ../../library/argparse.rst:1374 msgid "" "Convert argument strings to objects and assign them as attributes of the " "namespace. Return the populated namespace." msgstr "" -#: ../../library/argparse.rst:1402 +#: ../../library/argparse.rst:1377 msgid "" "Previous calls to :meth:`add_argument` determine exactly what objects are " "created and how they are assigned. See the documentation for :meth:" "`add_argument` for details." msgstr "" -#: ../../library/argparse.rst:1406 +#: ../../library/argparse.rst:1381 msgid "" "args_ - List of strings to parse. The default is taken from :data:`sys." "argv`." msgstr "" -#: ../../library/argparse.rst:1409 +#: ../../library/argparse.rst:1384 msgid "" "namespace_ - An object to take the attributes. The default is a new empty :" "class:`Namespace` object." msgstr "" -#: ../../library/argparse.rst:1414 +#: ../../library/argparse.rst:1389 msgid "Option value syntax" msgstr "" -#: ../../library/argparse.rst:1416 +#: ../../library/argparse.rst:1391 msgid "" "The :meth:`~ArgumentParser.parse_args` method supports several ways of " "specifying the value of an option (if it takes one). In the simplest case, " "the option and its value are passed as two separate arguments::" msgstr "" -#: ../../library/argparse.rst:1428 +#: ../../library/argparse.rst:1403 msgid "" "For long options (options with names longer than a single character), the " "option and value can also be passed as a single command-line argument, using " "``=`` to separate them::" msgstr "" -#: ../../library/argparse.rst:1435 +#: ../../library/argparse.rst:1410 msgid "" "For short options (options only one character long), the option and its " "value can be concatenated::" msgstr "" -#: ../../library/argparse.rst:1441 +#: ../../library/argparse.rst:1416 msgid "" "Several short options can be joined together, using only a single ``-`` " "prefix, as long as only the last option (or none of them) requires a value::" msgstr "" -#: ../../library/argparse.rst:1453 +#: ../../library/argparse.rst:1428 msgid "Invalid arguments" msgstr "" -#: ../../library/argparse.rst:1455 +#: ../../library/argparse.rst:1430 msgid "" "While parsing the command line, :meth:`~ArgumentParser.parse_args` checks " "for a variety of errors, including ambiguous options, invalid types, invalid " @@ -1271,11 +1223,11 @@ msgid "" "an error, it exits and prints the error along with a usage message::" msgstr "" -#: ../../library/argparse.rst:1481 +#: ../../library/argparse.rst:1456 msgid "Arguments containing ``-``" msgstr "" -#: ../../library/argparse.rst:1483 +#: ../../library/argparse.rst:1458 msgid "" "The :meth:`~ArgumentParser.parse_args` method attempts to give errors " "whenever the user has clearly made a mistake, but some situations are " @@ -1287,7 +1239,7 @@ msgid "" "negative numbers::" msgstr "" -#: ../../library/argparse.rst:1521 +#: ../../library/argparse.rst:1496 msgid "" "If you have positional arguments that must begin with ``-`` and don't look " "like negative numbers, you can insert the pseudo-argument ``'--'`` which " @@ -1295,28 +1247,28 @@ msgid "" "positional argument::" msgstr "" -#: ../../library/argparse.rst:1532 +#: ../../library/argparse.rst:1507 msgid "Argument abbreviations (prefix matching)" msgstr "" -#: ../../library/argparse.rst:1534 +#: ../../library/argparse.rst:1509 msgid "" "The :meth:`~ArgumentParser.parse_args` method :ref:`by default " "` allows long options to be abbreviated to a prefix, if the " "abbreviation is unambiguous (the prefix matches a unique option)::" msgstr "" -#: ../../library/argparse.rst:1549 +#: ../../library/argparse.rst:1524 msgid "" "An error is produced for arguments that could produce more than one options. " "This feature can be disabled by setting :ref:`allow_abbrev` to ``False``." msgstr "" -#: ../../library/argparse.rst:1555 +#: ../../library/argparse.rst:1530 msgid "Beyond ``sys.argv``" msgstr "" -#: ../../library/argparse.rst:1557 +#: ../../library/argparse.rst:1532 msgid "" "Sometimes it may be useful to have an ArgumentParser parse arguments other " "than those of :data:`sys.argv`. This can be accomplished by passing a list " @@ -1324,39 +1276,39 @@ msgid "" "testing at the interactive prompt::" msgstr "" -#: ../../library/argparse.rst:1577 +#: ../../library/argparse.rst:1552 msgid "The Namespace object" msgstr "" -#: ../../library/argparse.rst:1581 +#: ../../library/argparse.rst:1556 msgid "" "Simple class used by default by :meth:`~ArgumentParser.parse_args` to create " "an object holding attributes and return it." msgstr "" -#: ../../library/argparse.rst:1584 +#: ../../library/argparse.rst:1559 msgid "" "This class is deliberately simple, just an :class:`object` subclass with a " "readable string representation. If you prefer to have dict-like view of the " "attributes, you can use the standard Python idiom, :func:`vars`::" msgstr "" -#: ../../library/argparse.rst:1594 +#: ../../library/argparse.rst:1569 msgid "" "It may also be useful to have an :class:`ArgumentParser` assign attributes " "to an already existing object, rather than a new :class:`Namespace` object. " "This can be achieved by specifying the ``namespace=`` keyword argument::" msgstr "" -#: ../../library/argparse.rst:1610 +#: ../../library/argparse.rst:1585 msgid "Other utilities" msgstr "" -#: ../../library/argparse.rst:1613 +#: ../../library/argparse.rst:1588 msgid "Sub-commands" msgstr "" -#: ../../library/argparse.rst:1620 +#: ../../library/argparse.rst:1595 msgid "" "Many programs split up their functionality into a number of sub-commands, " "for example, the ``svn`` program can invoke sub-commands like ``svn " @@ -1372,69 +1324,69 @@ msgid "" "can be modified as usual." msgstr "" -#: ../../library/argparse.rst:1632 +#: ../../library/argparse.rst:1607 msgid "Description of parameters:" msgstr "" -#: ../../library/argparse.rst:1634 +#: ../../library/argparse.rst:1609 msgid "" "title - title for the sub-parser group in help output; by default " "\"subcommands\" if description is provided, otherwise uses title for " "positional arguments" msgstr "" -#: ../../library/argparse.rst:1638 +#: ../../library/argparse.rst:1613 msgid "" "description - description for the sub-parser group in help output, by " "default ``None``" msgstr "" -#: ../../library/argparse.rst:1641 +#: ../../library/argparse.rst:1616 msgid "" "prog - usage information that will be displayed with sub-command help, by " "default the name of the program and any positional arguments before the " "subparser argument" msgstr "" -#: ../../library/argparse.rst:1645 +#: ../../library/argparse.rst:1620 msgid "" "parser_class - class which will be used to create sub-parser instances, by " "default the class of the current parser (e.g. ArgumentParser)" msgstr "" -#: ../../library/argparse.rst:1648 +#: ../../library/argparse.rst:1623 msgid "" "action_ - the basic type of action to be taken when this argument is " "encountered at the command line" msgstr "" -#: ../../library/argparse.rst:1651 +#: ../../library/argparse.rst:1626 msgid "" "dest_ - name of the attribute under which sub-command name will be stored; " "by default ``None`` and no value is stored" msgstr "" -#: ../../library/argparse.rst:1654 +#: ../../library/argparse.rst:1629 msgid "" "required_ - Whether or not a subcommand must be provided, by default " "``False`` (added in 3.7)" msgstr "" -#: ../../library/argparse.rst:1657 +#: ../../library/argparse.rst:1632 msgid "help_ - help for sub-parser group in help output, by default ``None``" msgstr "" -#: ../../library/argparse.rst:1659 +#: ../../library/argparse.rst:1634 msgid "" "metavar_ - string presenting available sub-commands in help; by default it " "is ``None`` and presents sub-commands in form {cmd1, cmd2, ..}" msgstr "" -#: ../../library/argparse.rst:1662 +#: ../../library/argparse.rst:1637 msgid "Some example usage::" msgstr "" -#: ../../library/argparse.rst:1683 +#: ../../library/argparse.rst:1658 msgid "" "Note that the object returned by :meth:`parse_args` will only contain " "attributes for the main parser and the subparser that was selected by the " @@ -1444,7 +1396,7 @@ msgid "" "``baz`` attributes are present." msgstr "" -#: ../../library/argparse.rst:1690 +#: ../../library/argparse.rst:1665 msgid "" "Similarly, when a help message is requested from a subparser, only the help " "for that particular parser will be printed. The help message will not " @@ -1453,21 +1405,21 @@ msgid "" "to :meth:`add_parser` as above.)" msgstr "" -#: ../../library/argparse.rst:1726 +#: ../../library/argparse.rst:1701 msgid "" "The :meth:`add_subparsers` method also supports ``title`` and " "``description`` keyword arguments. When either is present, the subparser's " "commands will appear in their own group in the help output. For example::" msgstr "" -#: ../../library/argparse.rst:1747 +#: ../../library/argparse.rst:1722 msgid "" "Furthermore, ``add_parser`` supports an additional ``aliases`` argument, " "which allows multiple strings to refer to the same subparser. This example, " "like ``svn``, aliases ``co`` as a shorthand for ``checkout``::" msgstr "" -#: ../../library/argparse.rst:1758 +#: ../../library/argparse.rst:1733 msgid "" "One particularly effective way of handling sub-commands is to combine the " "use of the :meth:`add_subparsers` method with calls to :meth:`set_defaults` " @@ -1475,7 +1427,7 @@ msgid "" "example::" msgstr "" -#: ../../library/argparse.rst:1795 +#: ../../library/argparse.rst:1770 msgid "" "This way, you can let :meth:`parse_args` do the job of calling the " "appropriate function after argument parsing is complete. Associating " @@ -1485,15 +1437,15 @@ msgid "" "argument to the :meth:`add_subparsers` call will work::" msgstr "" -#: ../../library/argparse.rst:1811 +#: ../../library/argparse.rst:1786 msgid "New *required* keyword argument." msgstr "" -#: ../../library/argparse.rst:1816 +#: ../../library/argparse.rst:1791 msgid "FileType objects" msgstr "" -#: ../../library/argparse.rst:1820 +#: ../../library/argparse.rst:1795 msgid "" "The :class:`FileType` factory creates objects that can be passed to the type " "argument of :meth:`ArgumentParser.add_argument`. Arguments that have :class:" @@ -1502,22 +1454,22 @@ msgid "" "the :func:`open` function for more details)::" msgstr "" -#: ../../library/argparse.rst:1832 +#: ../../library/argparse.rst:1807 msgid "" "FileType objects understand the pseudo-argument ``'-'`` and automatically " "convert this into ``sys.stdin`` for readable :class:`FileType` objects and " "``sys.stdout`` for writable :class:`FileType` objects::" msgstr "" -#: ../../library/argparse.rst:1841 +#: ../../library/argparse.rst:1816 msgid "The *encodings* and *errors* keyword arguments." msgstr "" -#: ../../library/argparse.rst:1846 +#: ../../library/argparse.rst:1821 msgid "Argument groups" msgstr "" -#: ../../library/argparse.rst:1850 +#: ../../library/argparse.rst:1825 msgid "" "By default, :class:`ArgumentParser` groups command-line arguments into " "\"positional arguments\" and \"optional arguments\" when displaying help " @@ -1526,7 +1478,7 @@ msgid "" "`add_argument_group` method::" msgstr "" -#: ../../library/argparse.rst:1867 +#: ../../library/argparse.rst:1842 msgid "" "The :meth:`add_argument_group` method returns an argument group object which " "has an :meth:`~ArgumentParser.add_argument` method just like a regular :" @@ -1537,42 +1489,42 @@ msgid "" "this display::" msgstr "" -#: ../../library/argparse.rst:1893 +#: ../../library/argparse.rst:1868 msgid "" "Note that any arguments not in your user-defined groups will end up back in " "the usual \"positional arguments\" and \"optional arguments\" sections." msgstr "" -#: ../../library/argparse.rst:1898 +#: ../../library/argparse.rst:1873 msgid "Mutual exclusion" msgstr "" -#: ../../library/argparse.rst:1902 +#: ../../library/argparse.rst:1877 msgid "" "Create a mutually exclusive group. :mod:`argparse` will make sure that only " "one of the arguments in the mutually exclusive group was present on the " "command line::" msgstr "" -#: ../../library/argparse.rst:1918 +#: ../../library/argparse.rst:1893 msgid "" "The :meth:`add_mutually_exclusive_group` method also accepts a *required* " "argument, to indicate that at least one of the mutually exclusive arguments " "is required::" msgstr "" -#: ../../library/argparse.rst:1930 +#: ../../library/argparse.rst:1905 msgid "" "Note that currently mutually exclusive argument groups do not support the " "*title* and *description* arguments of :meth:`~ArgumentParser." "add_argument_group`." msgstr "" -#: ../../library/argparse.rst:1936 +#: ../../library/argparse.rst:1911 msgid "Parser defaults" msgstr "" -#: ../../library/argparse.rst:1940 +#: ../../library/argparse.rst:1915 msgid "" "Most of the time, the attributes of the object returned by :meth:" "`parse_args` will be fully determined by inspecting the command-line " @@ -1581,72 +1533,72 @@ msgid "" "command line to be added::" msgstr "" -#: ../../library/argparse.rst:1952 +#: ../../library/argparse.rst:1927 msgid "" "Note that parser-level defaults always override argument-level defaults::" msgstr "" -#: ../../library/argparse.rst:1960 +#: ../../library/argparse.rst:1935 msgid "" "Parser-level defaults can be particularly useful when working with multiple " "parsers. See the :meth:`~ArgumentParser.add_subparsers` method for an " "example of this type." msgstr "" -#: ../../library/argparse.rst:1966 +#: ../../library/argparse.rst:1941 msgid "" "Get the default value for a namespace attribute, as set by either :meth:" "`~ArgumentParser.add_argument` or by :meth:`~ArgumentParser.set_defaults`::" msgstr "" -#: ../../library/argparse.rst:1977 +#: ../../library/argparse.rst:1952 msgid "Printing help" msgstr "" -#: ../../library/argparse.rst:1979 +#: ../../library/argparse.rst:1954 msgid "" "In most typical applications, :meth:`~ArgumentParser.parse_args` will take " "care of formatting and printing any usage or error messages. However, " "several formatting methods are available:" msgstr "" -#: ../../library/argparse.rst:1985 +#: ../../library/argparse.rst:1960 msgid "" "Print a brief description of how the :class:`ArgumentParser` should be " "invoked on the command line. If *file* is ``None``, :data:`sys.stdout` is " "assumed." msgstr "" -#: ../../library/argparse.rst:1991 +#: ../../library/argparse.rst:1966 msgid "" "Print a help message, including the program usage and information about the " "arguments registered with the :class:`ArgumentParser`. If *file* is " "``None``, :data:`sys.stdout` is assumed." msgstr "" -#: ../../library/argparse.rst:1995 +#: ../../library/argparse.rst:1970 msgid "" "There are also variants of these methods that simply return a string instead " "of printing it:" msgstr "" -#: ../../library/argparse.rst:2000 +#: ../../library/argparse.rst:1975 msgid "" "Return a string containing a brief description of how the :class:" "`ArgumentParser` should be invoked on the command line." msgstr "" -#: ../../library/argparse.rst:2005 +#: ../../library/argparse.rst:1980 msgid "" "Return a string containing a help message, including the program usage and " "information about the arguments registered with the :class:`ArgumentParser`." msgstr "" -#: ../../library/argparse.rst:2010 +#: ../../library/argparse.rst:1985 msgid "Partial parsing" msgstr "" -#: ../../library/argparse.rst:2014 +#: ../../library/argparse.rst:1989 msgid "" "Sometimes a script may only parse a few of the command-line arguments, " "passing the remaining arguments on to another script or program. In these " @@ -1657,7 +1609,7 @@ msgid "" "remaining argument strings." msgstr "" -#: ../../library/argparse.rst:2030 +#: ../../library/argparse.rst:2005 msgid "" ":ref:`Prefix matching ` rules apply to :meth:" "`parse_known_args`. The parser may consume an option even if it's just a " @@ -1665,11 +1617,11 @@ msgid "" "arguments list." msgstr "" -#: ../../library/argparse.rst:2037 +#: ../../library/argparse.rst:2012 msgid "Customizing file parsing" msgstr "" -#: ../../library/argparse.rst:2041 +#: ../../library/argparse.rst:2016 msgid "" "Arguments that are read from a file (see the *fromfile_prefix_chars* keyword " "argument to the :class:`ArgumentParser` constructor) are read one argument " @@ -1677,41 +1629,41 @@ msgid "" "reading." msgstr "" -#: ../../library/argparse.rst:2046 +#: ../../library/argparse.rst:2021 msgid "" "This method takes a single argument *arg_line* which is a string read from " "the argument file. It returns a list of arguments parsed from this string. " "The method is called once per line read from the argument file, in order." msgstr "" -#: ../../library/argparse.rst:2050 +#: ../../library/argparse.rst:2025 msgid "" "A useful override of this method is one that treats each space-separated " "word as an argument. The following example demonstrates how to do this::" msgstr "" -#: ../../library/argparse.rst:2059 +#: ../../library/argparse.rst:2034 msgid "Exiting methods" msgstr "" -#: ../../library/argparse.rst:2063 +#: ../../library/argparse.rst:2038 msgid "" "This method terminates the program, exiting with the specified *status* and, " "if given, it prints a *message* before that. The user can override this " "method to handle these steps differently::" msgstr "" -#: ../../library/argparse.rst:2075 +#: ../../library/argparse.rst:2050 msgid "" "This method prints a usage message including the *message* to the standard " "error and terminates the program with a status code of 2." msgstr "" -#: ../../library/argparse.rst:2080 +#: ../../library/argparse.rst:2055 msgid "Intermixed parsing" msgstr "" -#: ../../library/argparse.rst:2085 +#: ../../library/argparse.rst:2060 msgid "" "A number of Unix commands allow the user to intermix optional arguments with " "positional arguments. The :meth:`~ArgumentParser.parse_intermixed_args` " @@ -1719,7 +1671,7 @@ msgid "" "parsing style." msgstr "" -#: ../../library/argparse.rst:2090 +#: ../../library/argparse.rst:2065 msgid "" "These parsers do not support all the argparse features, and will raise " "exceptions if unsupported features are used. In particular, subparsers, " @@ -1727,7 +1679,7 @@ msgid "" "optionals and positionals are not supported." msgstr "" -#: ../../library/argparse.rst:2095 +#: ../../library/argparse.rst:2070 msgid "" "The following example shows the difference between :meth:`~ArgumentParser." "parse_known_args` and :meth:`~ArgumentParser.parse_intermixed_args`: the " @@ -1735,7 +1687,7 @@ msgid "" "collects all the positionals into ``rest``. ::" msgstr "" -#: ../../library/argparse.rst:2110 +#: ../../library/argparse.rst:2085 msgid "" ":meth:`~ArgumentParser.parse_known_intermixed_args` returns a two item tuple " "containing the populated namespace and the list of remaining argument " @@ -1743,11 +1695,11 @@ msgid "" "there are any remaining unparsed argument strings." msgstr "" -#: ../../library/argparse.rst:2120 +#: ../../library/argparse.rst:2095 msgid "Upgrading optparse code" msgstr "" -#: ../../library/argparse.rst:2122 +#: ../../library/argparse.rst:2097 msgid "" "Originally, the :mod:`argparse` module had attempted to maintain " "compatibility with :mod:`optparse`. However, :mod:`optparse` was difficult " @@ -1758,47 +1710,47 @@ msgid "" "compatibility." msgstr "" -#: ../../library/argparse.rst:2129 +#: ../../library/argparse.rst:2104 msgid "" "The :mod:`argparse` module improves on the standard library :mod:`optparse` " "module in a number of ways including:" msgstr "" -#: ../../library/argparse.rst:2132 +#: ../../library/argparse.rst:2107 msgid "Handling positional arguments." msgstr "" -#: ../../library/argparse.rst:2133 +#: ../../library/argparse.rst:2108 msgid "Supporting sub-commands." msgstr "" -#: ../../library/argparse.rst:2134 +#: ../../library/argparse.rst:2109 msgid "Allowing alternative option prefixes like ``+`` and ``/``." msgstr "" -#: ../../library/argparse.rst:2135 +#: ../../library/argparse.rst:2110 msgid "Handling zero-or-more and one-or-more style arguments." msgstr "" -#: ../../library/argparse.rst:2136 +#: ../../library/argparse.rst:2111 msgid "Producing more informative usage messages." msgstr "" -#: ../../library/argparse.rst:2137 +#: ../../library/argparse.rst:2112 msgid "Providing a much simpler interface for custom ``type`` and ``action``." msgstr "" -#: ../../library/argparse.rst:2139 +#: ../../library/argparse.rst:2114 msgid "A partial upgrade path from :mod:`optparse` to :mod:`argparse`:" msgstr "" -#: ../../library/argparse.rst:2141 +#: ../../library/argparse.rst:2116 msgid "" "Replace all :meth:`optparse.OptionParser.add_option` calls with :meth:" "`ArgumentParser.add_argument` calls." msgstr "" -#: ../../library/argparse.rst:2144 +#: ../../library/argparse.rst:2119 msgid "" "Replace ``(options, args) = parser.parse_args()`` with ``args = parser." "parse_args()`` and add additional :meth:`ArgumentParser.add_argument` calls " @@ -1806,39 +1758,39 @@ msgid "" "``options``, now in the :mod:`argparse` context is called ``args``." msgstr "" -#: ../../library/argparse.rst:2149 +#: ../../library/argparse.rst:2124 msgid "" "Replace :meth:`optparse.OptionParser.disable_interspersed_args` by using :" "meth:`~ArgumentParser.parse_intermixed_args` instead of :meth:" "`~ArgumentParser.parse_args`." msgstr "" -#: ../../library/argparse.rst:2153 +#: ../../library/argparse.rst:2128 msgid "" "Replace callback actions and the ``callback_*`` keyword arguments with " "``type`` or ``action`` arguments." msgstr "" -#: ../../library/argparse.rst:2156 +#: ../../library/argparse.rst:2131 msgid "" "Replace string names for ``type`` keyword arguments with the corresponding " "type objects (e.g. int, float, complex, etc)." msgstr "" -#: ../../library/argparse.rst:2159 +#: ../../library/argparse.rst:2134 msgid "" "Replace :class:`optparse.Values` with :class:`Namespace` and :exc:`optparse." "OptionError` and :exc:`optparse.OptionValueError` with :exc:`ArgumentError`." msgstr "" -#: ../../library/argparse.rst:2163 +#: ../../library/argparse.rst:2138 msgid "" "Replace strings with implicit arguments such as ``%default`` or ``%prog`` " "with the standard Python syntax to use dictionaries to format strings, that " "is, ``%(default)s`` and ``%(prog)s``." msgstr "" -#: ../../library/argparse.rst:2167 +#: ../../library/argparse.rst:2142 msgid "" "Replace the OptionParser constructor ``version`` argument with a call to " "``parser.add_argument('--version', action='https://github.com/version', version='\n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -354,19 +354,19 @@ msgid ":meth:`fromstring` is renamed to :meth:`frombytes` for clarity." msgstr "為了更明確,之前的 :meth:`fromstring` 被更名為 :meth:`frombytes` 。" #: ../../library/array.rst:160 -#, fuzzy msgid "" "Read *n* items (as machine values) from the :term:`file object` *f* and " "append them to the end of the array. If less than *n* items are available, :" "exc:`EOFError` is raised, but the items that were available are still " -"inserted into the array." +"inserted into the array. *f* must be a real built-in file object; something " +"else with a :meth:`read` method won't do." msgstr "" "從 :term:`file object` *f* 讀取 *n* 個 machine value 類型的元素,接著將這些元" "素加入陣列的最尾端。如果只有少於 *n* 個有效的元素會產生 :exc:`EOFError` 錯" "誤,但有效的元素仍然會被加入陣列中。 *f* 必須是一個真正的內建檔案物件,其他擁" "有 :meth:`read` 方法的不行。" -#: ../../library/array.rst:168 +#: ../../library/array.rst:169 msgid "" "Append items from the list. This is equivalent to ``for x in list: a." "append(x)`` except that if there is a type error, the array is unchanged." @@ -374,7 +374,7 @@ msgstr "" "從 list 中新增元素。這等價於 ``for x in list: a.append(x)`` ,除了有型態錯誤" "產生時,陣列會保持原狀不會被更改。" -#: ../../library/array.rst:174 +#: ../../library/array.rst:175 msgid "" "Extends this array with data from the given unicode string. The array must " "be a type ``'u'`` array; otherwise a :exc:`ValueError` is raised. Use " @@ -385,19 +385,19 @@ msgstr "" "產生 :exc:`ValueError` 錯誤。使用 ``array.frombytes(unicodestring." "encode(enc))`` 來新增 Unicode 資料到一個其他型態的陣列。" -#: ../../library/array.rst:182 +#: ../../library/array.rst:183 msgid "" "Return the smallest *i* such that *i* is the index of the first occurrence " "of *x* in the array." msgstr "回傳最小的 *i* ,使得 *i* 是陣列中第一個 *x* 出現的索引值。" -#: ../../library/array.rst:188 +#: ../../library/array.rst:189 msgid "" "Insert a new item with value *x* in the array before position *i*. Negative " "values are treated as being relative to the end of the array." msgstr "在位置 *i* 之前插入一個元素 *x* 。負數的索引值會從陣列尾端開始數。" -#: ../../library/array.rst:194 +#: ../../library/array.rst:195 msgid "" "Removes the item with the index *i* from the array and returns it. The " "optional argument defaults to ``-1``, so that by default the last item is " @@ -406,15 +406,15 @@ msgstr "" "移除並回傳陣列索引值 *i* 的元素。選擇性的參數 *i* 預設為 ``-1`` ,所以預設會" "刪除並回傳最後一個元素。" -#: ../../library/array.rst:201 +#: ../../library/array.rst:202 msgid "Remove the first occurrence of *x* from the array." msgstr "從陣列中刪除第一個出現的 *x* 。" -#: ../../library/array.rst:206 +#: ../../library/array.rst:207 msgid "Reverse the order of the items in the array." msgstr "將整個陣列的元素按照順序逆轉。" -#: ../../library/array.rst:211 +#: ../../library/array.rst:212 msgid "" "Convert the array to an array of machine values and return the bytes " "representation (the same sequence of bytes that would be written to a file " @@ -423,19 +423,19 @@ msgstr "" "將陣列轉為另一個 machine values 的陣列並回傳他的位元組表示(跟用 :meth:" "`tofile` 方法寫入檔案時的位元序列相同)。" -#: ../../library/array.rst:215 +#: ../../library/array.rst:216 msgid ":meth:`tostring` is renamed to :meth:`tobytes` for clarity." msgstr "為了明確性,過去的 :meth:`tostring` 已更名為 :meth:`tobytes` 。" -#: ../../library/array.rst:221 +#: ../../library/array.rst:222 msgid "Write all items (as machine values) to the :term:`file object` *f*." msgstr "將所有元素 (以 machine code 的形式)寫入 :term:`file object` *f* 。" -#: ../../library/array.rst:226 +#: ../../library/array.rst:227 msgid "Convert the array to an ordinary list with the same items." msgstr "不更改元素,將陣列轉為一般的 list 。" -#: ../../library/array.rst:231 +#: ../../library/array.rst:232 msgid "" "Convert the array to a unicode string. The array must be a type ``'u'`` " "array; otherwise a :exc:`ValueError` is raised. Use ``array.tobytes()." @@ -445,7 +445,7 @@ msgstr "" "`ValueError` 錯誤。使用 ``array.tobytes().decode(enc)`` 將其他型態的陣列轉為" "字串。" -#: ../../library/array.rst:236 +#: ../../library/array.rst:237 msgid "" "When an array object is printed or converted to a string, it is represented " "as ``array(typecode, initializer)``. The *initializer* is omitted if the " @@ -456,19 +456,19 @@ msgid "" "``from array import array``. Examples::" msgstr "" -#: ../../library/array.rst:253 +#: ../../library/array.rst:254 msgid "Module :mod:`struct`" msgstr "模組 :mod:`struct`" -#: ../../library/array.rst:253 +#: ../../library/array.rst:254 msgid "Packing and unpacking of heterogeneous binary data." msgstr "將包含不同資料類型的二進位資料包裝與解開包裝。" -#: ../../library/array.rst:257 +#: ../../library/array.rst:258 msgid "Module :mod:`xdrlib`" msgstr "模組 :mod:`xdrlib`" -#: ../../library/array.rst:256 +#: ../../library/array.rst:257 msgid "" "Packing and unpacking of External Data Representation (XDR) data as used in " "some remote procedure call systems." @@ -476,11 +476,11 @@ msgstr "" "將 External Data Representation (XDR) 的資料包裝與解開包裝,這用在一些遠端操" "作的系統 ( remote procedure call systems ) 。" -#: ../../library/array.rst:260 +#: ../../library/array.rst:261 msgid "`The Numerical Python Documentation `_" msgstr "" -#: ../../library/array.rst:260 +#: ../../library/array.rst:261 msgid "" "The Numeric Python extension (NumPy) defines another array type; see http://" "www.numpy.org/ for further information about Numerical Python." diff --git a/library/ast.po b/library/ast.po index 81453315f1..182f472a07 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-07 06:52+0000\n" +"POT-Creation-Date: 2020-06-20 18:08+0800\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-" @@ -100,16 +100,16 @@ msgstr "" #: ../../library/ast.rst:82 msgid "" "Instances of :class:`ast.expr` and :class:`ast.stmt` subclasses have :attr:" -"`lineno`, :attr:`col_offset`, :attr:`end_lineno`, and :attr:`end_col_offset` " +"`lineno`, :attr:`col_offset`, :attr:`lineno`, and :attr:`col_offset` " "attributes. The :attr:`lineno` and :attr:`end_lineno` are the first and " -"last line numbers of the source text span (1-indexed so the first line is " -"line 1), and the :attr:`col_offset` and :attr:`end_col_offset` are the " +"last line numbers of source text span (1-indexed so the first line is line " +"1) and the :attr:`col_offset` and :attr:`end_col_offset` are the " "corresponding UTF-8 byte offsets of the first and last tokens that generated " "the node. The UTF-8 offset is recorded because the parser uses UTF-8 " "internally." msgstr "" -#: ../../library/ast.rst:91 +#: ../../library/ast.rst:90 msgid "" "Note that the end positions are not required by the compiler and are " "therefore optional. The end offset is *after* the last symbol, for example " @@ -117,44 +117,44 @@ msgid "" "``source_line[node.col_offset : node.end_col_offset]``." msgstr "" -#: ../../library/ast.rst:96 +#: ../../library/ast.rst:95 msgid "" "The constructor of a class :class:`ast.T` parses its arguments as follows:" msgstr "" -#: ../../library/ast.rst:98 +#: ../../library/ast.rst:97 msgid "" "If there are positional arguments, there must be as many as there are items " "in :attr:`T._fields`; they will be assigned as attributes of these names." msgstr "" -#: ../../library/ast.rst:100 +#: ../../library/ast.rst:99 msgid "" "If there are keyword arguments, they will set the attributes of the same " "names to the given values." msgstr "" -#: ../../library/ast.rst:103 +#: ../../library/ast.rst:102 msgid "" "For example, to create and populate an :class:`ast.UnaryOp` node, you could " "use ::" msgstr "" -#: ../../library/ast.rst:115 +#: ../../library/ast.rst:114 msgid "or the more compact ::" msgstr "" -#: ../../library/ast.rst:122 +#: ../../library/ast.rst:121 msgid "Class :class:`ast.Constant` is now used for all constants." msgstr "" -#: ../../library/ast.rst:126 +#: ../../library/ast.rst:125 msgid "" "Simple indices are represented by their value, extended slices are " "represented as tuples." msgstr "" -#: ../../library/ast.rst:131 +#: ../../library/ast.rst:130 msgid "" "Old classes :class:`ast.Num`, :class:`ast.Str`, :class:`ast.Bytes`, :class:" "`ast.NameConstant` and :class:`ast.Ellipsis` are still available, but they " @@ -162,7 +162,7 @@ msgid "" "them will return an instance of a different class." msgstr "" -#: ../../library/ast.rst:138 +#: ../../library/ast.rst:137 msgid "" "Old classes :class:`ast.Index` and :class:`ast.ExtSlice` are still " "available, but they will be removed in future Python releases. In the " @@ -170,17 +170,10 @@ msgid "" msgstr "" #: ../../library/ast.rst:144 -msgid "" -"The descriptions of the specific node classes displayed here were initially " -"adapted from the fantastic `Green Tree Snakes `__ project and all its contributors." -msgstr "" - -#: ../../library/ast.rst:150 msgid "Literals" msgstr "" -#: ../../library/ast.rst:154 +#: ../../library/ast.rst:148 msgid "" "A constant value. The ``value`` attribute of the ``Constant`` literal " "contains the Python object it represents. The values represented can be " @@ -189,106 +182,106 @@ msgid "" "constant." msgstr "" -#: ../../library/ast.rst:168 +#: ../../library/ast.rst:162 msgid "" "Node representing a single formatting field in an f-string. If the string " "contains a single formatting field and nothing else the node can be isolated " "otherwise it appears in :class:`JoinedStr`." msgstr "" -#: ../../library/ast.rst:172 +#: ../../library/ast.rst:166 msgid "" "``value`` is any expression node (such as a literal, a variable, or a " "function call)." msgstr "" -#: ../../library/ast.rst:174 +#: ../../library/ast.rst:168 msgid "``conversion`` is an integer:" msgstr "" -#: ../../library/ast.rst:176 +#: ../../library/ast.rst:170 msgid "-1: no formatting" msgstr "" -#: ../../library/ast.rst:177 +#: ../../library/ast.rst:171 msgid "115: ``!s`` string formatting" msgstr "" -#: ../../library/ast.rst:178 +#: ../../library/ast.rst:172 msgid "114: ``!r`` repr formatting" msgstr "" -#: ../../library/ast.rst:179 +#: ../../library/ast.rst:173 msgid "97: ``!a`` ascii formatting" msgstr "" -#: ../../library/ast.rst:181 +#: ../../library/ast.rst:175 msgid "" "``format_spec`` is a :class:`JoinedStr` node representing the formatting of " "the value, or ``None`` if no format was specified. Both ``conversion`` and " "``format_spec`` can be set at the same time." msgstr "" -#: ../../library/ast.rst:188 +#: ../../library/ast.rst:182 msgid "" "An f-string, comprising a series of :class:`FormattedValue` and :class:" "`Constant` nodes." msgstr "" -#: ../../library/ast.rst:217 +#: ../../library/ast.rst:211 msgid "" "A list or tuple. ``elts`` holds a list of nodes representing the elements. " "``ctx`` is :class:`Store` if the container is an assignment target (i.e. " "``(x,y)=something``), and :class:`Load` otherwise." msgstr "" -#: ../../library/ast.rst:243 +#: ../../library/ast.rst:237 msgid "A set. ``elts`` holds a list of nodes representing the set's elements." msgstr "" -#: ../../library/ast.rst:258 +#: ../../library/ast.rst:252 msgid "" "A dictionary. ``keys`` and ``values`` hold lists of nodes representing the " "keys and the values respectively, in matching order (what would be returned " "when calling :code:`dictionary.keys()` and :code:`dictionary.values()`)." msgstr "" -#: ../../library/ast.rst:262 +#: ../../library/ast.rst:256 msgid "" "When doing dictionary unpacking using dictionary literals the expression to " "be expanded goes in the ``values`` list, with a ``None`` at the " "corresponding position in ``keys``." msgstr "" -#: ../../library/ast.rst:280 +#: ../../library/ast.rst:274 msgid "Variables" msgstr "" -#: ../../library/ast.rst:284 +#: ../../library/ast.rst:278 msgid "" "A variable name. ``id`` holds the name as a string, and ``ctx`` is one of " "the following types." msgstr "" -#: ../../library/ast.rst:292 +#: ../../library/ast.rst:286 msgid "" "Variable references can be used to load the value of a variable, to assign a " "new value to it, or to delete it. Variable references are given a context to " "distinguish these cases." msgstr "" -#: ../../library/ast.rst:325 +#: ../../library/ast.rst:319 msgid "" "A ``*var`` variable reference. ``value`` holds the variable, typically a :" "class:`Name` node. This type must be used when building a :class:`Call` node " "with ``*args``." msgstr "" -#: ../../library/ast.rst:348 +#: ../../library/ast.rst:342 msgid "Expressions" msgstr "" -#: ../../library/ast.rst:352 +#: ../../library/ast.rst:346 msgid "" "When an expression, such as a function call, appears as a statement by " "itself with its return value not used or stored, it is wrapped in this " @@ -297,29 +290,29 @@ msgid "" "`YieldFrom` node." msgstr "" -#: ../../library/ast.rst:371 +#: ../../library/ast.rst:365 msgid "" "A unary operation. ``op`` is the operator, and ``operand`` any expression " "node." msgstr "" -#: ../../library/ast.rst:380 +#: ../../library/ast.rst:374 msgid "" "Unary operator tokens. :class:`Not` is the ``not`` keyword, :class:`Invert` " "is the ``~`` operator." msgstr "" -#: ../../library/ast.rst:394 +#: ../../library/ast.rst:388 msgid "" "A binary operation (like addition or division). ``op`` is the operator, and " "``left`` and ``right`` are any expression nodes." msgstr "" -#: ../../library/ast.rst:421 +#: ../../library/ast.rst:415 msgid "Binary operator tokens." msgstr "" -#: ../../library/ast.rst:426 +#: ../../library/ast.rst:420 msgid "" "A boolean operation, 'or' or 'and'. ``op`` is :class:`Or` or :class:`And`. " "``values`` are the values involved. Consecutive operations with the same " @@ -327,60 +320,60 @@ msgid "" "values." msgstr "" -#: ../../library/ast.rst:431 +#: ../../library/ast.rst:425 msgid "This doesn't include ``not``, which is a :class:`UnaryOp`." msgstr "" -#: ../../library/ast.rst:447 +#: ../../library/ast.rst:441 msgid "Boolean operator tokens." msgstr "" -#: ../../library/ast.rst:452 +#: ../../library/ast.rst:446 msgid "" "A comparison of two or more values. ``left`` is the first value in the " "comparison, ``ops`` the list of operators, and ``comparators`` the list of " "values after the first element in the comparison." msgstr "" -#: ../../library/ast.rst:481 +#: ../../library/ast.rst:475 msgid "Comparison operator tokens." msgstr "" -#: ../../library/ast.rst:486 +#: ../../library/ast.rst:480 msgid "" "A function call. ``func`` is the function, which will often be a :class:" "`Name` or :class:`Attribute` object. Of the arguments:" msgstr "" -#: ../../library/ast.rst:489 +#: ../../library/ast.rst:483 msgid "``args`` holds a list of the arguments passed by position." msgstr "" -#: ../../library/ast.rst:490 +#: ../../library/ast.rst:484 msgid "" "``keywords`` holds a list of :class:`keyword` objects representing arguments " "passed by keyword." msgstr "" -#: ../../library/ast.rst:493 +#: ../../library/ast.rst:487 msgid "" "When creating a ``Call`` node, ``args`` and ``keywords`` are required, but " "they can be empty lists. ``starargs`` and ``kwargs`` are optional." msgstr "" -#: ../../library/ast.rst:517 +#: ../../library/ast.rst:511 msgid "" "A keyword argument to a function call or class definition. ``arg`` is a raw " "string of the parameter name, ``value`` is a node to pass in." msgstr "" -#: ../../library/ast.rst:523 +#: ../../library/ast.rst:517 msgid "" "An expression such as ``a if b else c``. Each field holds a single node, so " "in the following example, all three are :class:`Name` nodes." msgstr "" -#: ../../library/ast.rst:538 +#: ../../library/ast.rst:532 msgid "" "Attribute access, e.g. ``d.keys``. ``value`` is a node, typically a :class:" "`Name`. ``attr`` is a bare string giving the name of the attribute, and " @@ -388,7 +381,7 @@ msgid "" "the attribute is acted on." msgstr "" -#: ../../library/ast.rst:555 +#: ../../library/ast.rst:549 msgid "" "A named expression. This AST node is produced by the assignment expressions " "operator (also known as the walrus operator). As opposed to the :class:" @@ -396,11 +389,11 @@ msgid "" "case both ``target`` and ``value`` must be single nodes." msgstr "" -#: ../../library/ast.rst:570 +#: ../../library/ast.rst:564 msgid "Subscripting" msgstr "" -#: ../../library/ast.rst:574 +#: ../../library/ast.rst:568 msgid "" "A subscript, such as ``l[1]``. ``value`` is the subscripted object (usually " "sequence or mapping). ``slice`` is an index, slice or key. It can be a :" @@ -408,29 +401,29 @@ msgid "" "`Store` or :class:`Del` according to the action performed with the subscript." msgstr "" -#: ../../library/ast.rst:598 +#: ../../library/ast.rst:592 msgid "" "Regular slicing (on the form ``lower:upper`` or ``lower:upper:step``). Can " "occur only inside the *slice* field of :class:`Subscript`, either directly " "or as an element of :class:`Tuple`." msgstr "" -#: ../../library/ast.rst:615 +#: ../../library/ast.rst:609 msgid "Comprehensions" msgstr "" -#: ../../library/ast.rst:622 +#: ../../library/ast.rst:616 msgid "" "List and set comprehensions, generator expressions, and dictionary " "comprehensions. ``elt`` (or ``key`` and ``value``) is a single node " "representing the part that will be evaluated for each item." msgstr "" -#: ../../library/ast.rst:626 +#: ../../library/ast.rst:620 msgid "``generators`` is a list of :class:`comprehension` nodes." msgstr "" -#: ../../library/ast.rst:668 +#: ../../library/ast.rst:662 msgid "" "One ``for`` clause in a comprehension. ``target`` is the reference to use " "for each element - typically a :class:`Name` or :class:`Tuple` node. " @@ -438,36 +431,36 @@ msgid "" "expressions: each ``for`` clause can have multiple ``ifs``." msgstr "" -#: ../../library/ast.rst:673 +#: ../../library/ast.rst:667 msgid "" "``is_async`` indicates a comprehension is asynchronous (using an ``async " "for`` instead of ``for``). The value is an integer (0 or 1)." msgstr "" -#: ../../library/ast.rst:739 +#: ../../library/ast.rst:733 msgid "Statements" msgstr "" -#: ../../library/ast.rst:743 +#: ../../library/ast.rst:737 msgid "" "An assignment. ``targets`` is a list of nodes, and ``value`` is a single " "node." msgstr "" -#: ../../library/ast.rst:745 +#: ../../library/ast.rst:739 msgid "" "Multiple nodes in ``targets`` represents assigning the same value to each. " "Unpacking is represented by putting a :class:`Tuple` or :class:`List` within " "``targets``." msgstr "" -#: ../../library/ast.rst:751 ../../library/ast.rst:1038 -#: ../../library/ast.rst:1211 ../../library/ast.rst:1264 +#: ../../library/ast.rst:745 ../../library/ast.rst:1032 +#: ../../library/ast.rst:1205 ../../library/ast.rst:1258 msgid "" "``type_comment`` is an optional string with the type annotation as a comment." msgstr "" -#: ../../library/ast.rst:781 +#: ../../library/ast.rst:775 msgid "" "An assignment with a type annotation. ``target`` is a single node and can be " "a :class:`Name`, a :class:`Attribute` or a :class:`Subscript`. " @@ -477,7 +470,7 @@ msgid "" "appear in between parenthesis and are hence pure names and not expressions." msgstr "" -#: ../../library/ast.rst:836 +#: ../../library/ast.rst:830 msgid "" "Augmented assignment, such as ``a += 1``. In the following example, " "``target`` is a :class:`Name` node for ``x`` (with the :class:`Store` " @@ -485,50 +478,50 @@ msgid "" "value for 1." msgstr "" -#: ../../library/ast.rst:841 +#: ../../library/ast.rst:835 msgid "" "The ``target`` attribute connot be of class :class:`Tuple` or :class:`List`, " "unlike the targets of :class:`Assign`." msgstr "" -#: ../../library/ast.rst:858 +#: ../../library/ast.rst:852 msgid "" "A ``raise`` statement. ``exc`` is the exception object to be raised, " "normally a :class:`Call` or :class:`Name`, or ``None`` for a standalone " "``raise``. ``cause`` is the optional part for ``y`` in ``raise x from y``." msgstr "" -#: ../../library/ast.rst:875 +#: ../../library/ast.rst:869 msgid "" "An assertion. ``test`` holds the condition, such as a :class:`Compare` node. " "``msg`` holds the failure message." msgstr "" -#: ../../library/ast.rst:891 +#: ../../library/ast.rst:885 msgid "" "Represents a ``del`` statement. ``targets`` is a list of nodes, such as :" "class:`Name`, :class:`Attribute` or :class:`Subscript` nodes." msgstr "" -#: ../../library/ast.rst:909 +#: ../../library/ast.rst:903 msgid "A ``pass`` statement." msgstr "" -#: ../../library/ast.rst:920 +#: ../../library/ast.rst:914 msgid "" "Other statements which are only applicable inside functions or loops are " "described in other sections." msgstr "" -#: ../../library/ast.rst:924 +#: ../../library/ast.rst:918 msgid "Imports" msgstr "" -#: ../../library/ast.rst:928 +#: ../../library/ast.rst:922 msgid "An import statement. ``names`` is a list of :class:`alias` nodes." msgstr "" -#: ../../library/ast.rst:945 +#: ../../library/ast.rst:939 msgid "" "Represents ``from x import y``. ``module`` is a raw string of the 'from' " "name, without any leading dots, or ``None`` for statements such as ``from . " @@ -536,36 +529,36 @@ msgid "" "import (0 means absolute import)." msgstr "" -#: ../../library/ast.rst:967 +#: ../../library/ast.rst:961 msgid "" "Both parameters are raw strings of the names. ``asname`` can be ``None`` if " "the regular name is to be used." msgstr "" -#: ../../library/ast.rst:984 +#: ../../library/ast.rst:978 msgid "Control flow" msgstr "" -#: ../../library/ast.rst:987 +#: ../../library/ast.rst:981 msgid "" "Optional clauses such as ``else`` are stored as an empty list if they're not " "present." msgstr "" -#: ../../library/ast.rst:992 +#: ../../library/ast.rst:986 msgid "" "An ``if`` statement. ``test`` holds a single node, such as a :class:" "`Compare` node. ``body`` and ``orelse`` each hold a list of nodes." msgstr "" -#: ../../library/ast.rst:995 +#: ../../library/ast.rst:989 msgid "" "``elif`` clauses don't have a special representation in the AST, but rather " "appear as extra :class:`If` nodes within the ``orelse`` section of the " "previous one." msgstr "" -#: ../../library/ast.rst:1030 +#: ../../library/ast.rst:1024 msgid "" "A ``for`` loop. ``target`` holds the variable(s) the loop assigns to, as a " "single :class:`Name`, :class:`Tuple` or :class:`List` node. ``iter`` holds " @@ -574,23 +567,23 @@ msgid "" "loop finishes normally, rather than via a ``break`` statement." msgstr "" -#: ../../library/ast.rst:1064 +#: ../../library/ast.rst:1058 msgid "" "A ``while`` loop. ``test`` holds the condition, such as a :class:`Compare` " "node." msgstr "" -#: ../../library/ast.rst:1091 +#: ../../library/ast.rst:1085 msgid "The ``break`` and ``continue`` statements." msgstr "" -#: ../../library/ast.rst:1126 +#: ../../library/ast.rst:1120 msgid "" "``try`` blocks. All attributes are list of nodes to execute, except for " "``handlers``, which is a list of :class:`ExceptHandler` nodes." msgstr "" -#: ../../library/ast.rst:1172 +#: ../../library/ast.rst:1166 msgid "" "A single ``except`` clause. ``type`` is the exception type it will match, " "typically a :class:`Name` node (or ``None`` for a catch-all ``except:`` " @@ -598,14 +591,14 @@ msgid "" "``None`` if the clause doesn't have ``as foo``. ``body`` is a list of nodes." msgstr "" -#: ../../library/ast.rst:1206 +#: ../../library/ast.rst:1200 msgid "" "A ``with`` block. ``items`` is a list of :class:`withitem` nodes " "representing the context managers, and ``body`` is the indented block inside " "the context." msgstr "" -#: ../../library/ast.rst:1216 +#: ../../library/ast.rst:1210 msgid "" "A single context manager in a ``with`` block. ``context_expr`` is the " "context manager, often a :class:`Call` node. ``optional_vars`` is a :class:" @@ -613,183 +606,174 @@ msgid "" "if that isn't used." msgstr "" -#: ../../library/ast.rst:1249 +#: ../../library/ast.rst:1243 msgid "Function and class definitions" msgstr "" -#: ../../library/ast.rst:1253 +#: ../../library/ast.rst:1247 msgid "A function definition." msgstr "" -#: ../../library/ast.rst:1255 +#: ../../library/ast.rst:1249 msgid "``name`` is a raw string of the function name." msgstr "" -#: ../../library/ast.rst:1256 -msgid "``args`` is an :class:`arguments` node." +#: ../../library/ast.rst:1250 +msgid "``args`` is a :class:`arguments` node." msgstr "" -#: ../../library/ast.rst:1257 +#: ../../library/ast.rst:1251 msgid "``body`` is the list of nodes inside the function." msgstr "" -#: ../../library/ast.rst:1258 +#: ../../library/ast.rst:1252 msgid "" "``decorator_list`` is the list of decorators to be applied, stored outermost " "first (i.e. the first in the list will be applied last)." msgstr "" -#: ../../library/ast.rst:1260 +#: ../../library/ast.rst:1254 msgid "``returns`` is the return annotation." msgstr "" -#: ../../library/ast.rst:1269 +#: ../../library/ast.rst:1263 msgid "" "``lambda`` is a minimal function definition that can be used inside an " "expression. Unlike :class:`FunctionDef`, ``body`` holds a single node." msgstr "" -#: ../../library/ast.rst:1293 +#: ../../library/ast.rst:1287 msgid "The arguments for a function." msgstr "" -#: ../../library/ast.rst:1295 +#: ../../library/ast.rst:1289 msgid "" "``posonlyargs``, ``args`` and ``kwonlyargs`` are lists of :class:`arg` nodes." msgstr "" -#: ../../library/ast.rst:1296 +#: ../../library/ast.rst:1290 msgid "" "``vararg`` and ``kwarg`` are single :class:`arg` nodes, referring to the " "``*args, **kwargs`` parameters." msgstr "" -#: ../../library/ast.rst:1298 +#: ../../library/ast.rst:1292 msgid "" "``kw_defaults`` is a list of default values for keyword-only arguments. If " "one is ``None``, the corresponding argument is required." msgstr "" -#: ../../library/ast.rst:1300 +#: ../../library/ast.rst:1294 msgid "" "``defaults`` is a list of default values for arguments that can be passed " "positionally. If there are fewer defaults, they correspond to the last n " "arguments." msgstr "" -#: ../../library/ast.rst:1307 +#: ../../library/ast.rst:1301 msgid "" "A single argument in a list. ``arg`` is a raw string of the argument name, " "``annotation`` is its annotation, such as a :class:`Str` or :class:`Name` " "node." msgstr "" -#: ../../library/ast.rst:1313 +#: ../../library/ast.rst:1307 msgid "" "``type_comment`` is an optional string with the type annotation as a comment" msgstr "" -#: ../../library/ast.rst:1357 +#: ../../library/ast.rst:1351 msgid "A ``return`` statement." msgstr "" -#: ../../library/ast.rst:1372 +#: ../../library/ast.rst:1366 msgid "" "A ``yield`` or ``yield from`` expression. Because these are expressions, " "they must be wrapped in a :class:`Expr` node if the value sent back is not " "used." msgstr "" -#: ../../library/ast.rst:1397 +#: ../../library/ast.rst:1391 msgid "" "``global`` and ``nonlocal`` statements. ``names`` is a list of raw strings." msgstr "" -#: ../../library/ast.rst:1424 +#: ../../library/ast.rst:1418 msgid "A class definition." msgstr "" -#: ../../library/ast.rst:1426 +#: ../../library/ast.rst:1420 msgid "``name`` is a raw string for the class name" msgstr "" -#: ../../library/ast.rst:1427 +#: ../../library/ast.rst:1421 msgid "``bases`` is a list of nodes for explicitly specified base classes." msgstr "" -#: ../../library/ast.rst:1428 +#: ../../library/ast.rst:1422 msgid "" "``keywords`` is a list of :class:`keyword` nodes, principally for " "'metaclass'. Other keywords will be passed to the metaclass, as per " -"`PEP-3115 `_." +"`PEP-3115 `_." msgstr "" -#: ../../library/ast.rst:1431 +#: ../../library/ast.rst:1425 msgid "" "``starargs`` and ``kwargs`` are each a single node, as in a function call. " "starargs will be expanded to join the list of base classes, and kwargs will " "be passed to the metaclass." msgstr "" -#: ../../library/ast.rst:1434 +#: ../../library/ast.rst:1428 msgid "" "``body`` is a list of nodes representing the code within the class " "definition." msgstr "" -#: ../../library/ast.rst:1436 +#: ../../library/ast.rst:1430 msgid "``decorator_list`` is a list of nodes, as in :class:`FunctionDef`." msgstr "" -#: ../../library/ast.rst:1465 +#: ../../library/ast.rst:1459 msgid "Async and await" msgstr "" -#: ../../library/ast.rst:1469 +#: ../../library/ast.rst:1463 msgid "" "An ``async def`` function definition. Has the same fields as :class:" "`FunctionDef`." msgstr "" -#: ../../library/ast.rst:1475 +#: ../../library/ast.rst:1469 msgid "" "An ``await`` expression. ``value`` is what it waits for. Only valid in the " "body of an :class:`AsyncFunctionDef`." msgstr "" -#: ../../library/ast.rst:1508 +#: ../../library/ast.rst:1502 msgid "" "``async for`` loops and ``async with`` context managers. They have the same " "fields as :class:`For` and :class:`With`, respectively. Only valid in the " "body of an :class:`AsyncFunctionDef`." msgstr "" -#: ../../library/ast.rst:1513 -msgid "" -"When a string is parsed by :func:`ast.parse`, operator nodes (subclasses of :" -"class:`ast.operator`, :class:`ast.unaryop`, :class:`ast.cmpop`, :class:`ast." -"boolop` and :class:`ast.expr_context`) on the returned tree will be " -"singletons. Changes to one will be reflected in all other occurrences of the " -"same value (e.g. :class:`ast.Add`)." -msgstr "" - -#: ../../library/ast.rst:1521 +#: ../../library/ast.rst:1508 msgid ":mod:`ast` Helpers" msgstr "" -#: ../../library/ast.rst:1523 +#: ../../library/ast.rst:1510 msgid "" "Apart from the node classes, the :mod:`ast` module defines these utility " "functions and classes for traversing abstract syntax trees:" msgstr "" -#: ../../library/ast.rst:1528 +#: ../../library/ast.rst:1515 msgid "" "Parse the source into an AST node. Equivalent to ``compile(source, " "filename, mode, ast.PyCF_ONLY_AST)``." msgstr "" -#: ../../library/ast.rst:1531 +#: ../../library/ast.rst:1518 msgid "" "If ``type_comments=True`` is given, the parser is modified to check and " "return type comments as specified by :pep:`484` and :pep:`526`. This is " @@ -802,14 +786,14 @@ msgid "" "empty list)." msgstr "" -#: ../../library/ast.rst:1541 +#: ../../library/ast.rst:1528 msgid "" "In addition, if ``mode`` is ``'func_type'``, the input syntax is modified to " "correspond to :pep:`484` \"signature type comments\", e.g. ``(str, int) -> " "List[str]``." msgstr "" -#: ../../library/ast.rst:1545 +#: ../../library/ast.rst:1532 msgid "" "Also, setting ``feature_version`` to a tuple ``(major, minor)`` will attempt " "to parse using that Python version's grammar. Currently ``major`` must equal " @@ -818,37 +802,30 @@ 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:1540 ../../library/ast.rst:1574 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:1544 msgid "Added ``type_comments``, ``mode='func_type'`` and ``feature_version``." msgstr "" -#: ../../library/ast.rst:1563 +#: ../../library/ast.rst:1550 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:1555 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)." +"that generated the :class:`ast.AST` object." msgstr "" -#: ../../library/ast.rst:1573 -msgid "" -"Trying to unparse a highly complex expression would result with :exc:" -"`RecursionError`." -msgstr "" - -#: ../../library/ast.rst:1581 +#: ../../library/ast.rst:1563 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 +833,7 @@ msgid "" "dicts, sets, booleans, and ``None``." msgstr "" -#: ../../library/ast.rst:1586 +#: ../../library/ast.rst:1568 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 +841,15 @@ msgid "" "operators or indexing." msgstr "" -#: ../../library/ast.rst:1596 +#: ../../library/ast.rst:1578 msgid "Now allows bytes and set literals." msgstr "" -#: ../../library/ast.rst:1599 +#: ../../library/ast.rst:1581 msgid "Now supports creating empty sets with ``'set()'``." msgstr "" -#: ../../library/ast.rst:1605 +#: ../../library/ast.rst:1587 msgid "" "Return the docstring of the given *node* (which must be a :class:" "`FunctionDef`, :class:`AsyncFunctionDef`, :class:`ClassDef`, or :class:" @@ -880,24 +857,24 @@ msgid "" "clean up the docstring's indentation with :func:`inspect.cleandoc`." msgstr "" -#: ../../library/ast.rst:1611 +#: ../../library/ast.rst:1593 msgid ":class:`AsyncFunctionDef` is now supported." msgstr "" -#: ../../library/ast.rst:1617 +#: ../../library/ast.rst:1599 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:1603 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:1611 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 +883,77 @@ msgid "" "the values of the parent node. It works recursively starting at *node*." msgstr "" -#: ../../library/ast.rst:1638 +#: ../../library/ast.rst:1620 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:1627 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:1634 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:1640 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:1646 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:1653 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:1657 msgid "" "This class is meant to be subclassed, with the subclass adding visitor " "methods." msgstr "" -#: ../../library/ast.rst:1680 +#: ../../library/ast.rst:1662 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:1668 msgid "This visitor calls :meth:`visit` on all children of the node." msgstr "" -#: ../../library/ast.rst:1688 +#: ../../library/ast.rst:1670 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:1674 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:1680 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 +961,13 @@ msgid "" "method to handle all constant nodes." msgstr "" -#: ../../library/ast.rst:1706 +#: ../../library/ast.rst:1688 msgid "" "A :class:`NodeVisitor` subclass that walks the abstract syntax tree and " "allows modification of nodes." msgstr "" -#: ../../library/ast.rst:1709 +#: ../../library/ast.rst:1691 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 +976,27 @@ msgid "" "may be the original node in which case no replacement takes place." msgstr "" -#: ../../library/ast.rst:1715 +#: ../../library/ast.rst:1697 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:1709 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:1713 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:1717 msgid "" "If :class:`NodeTransformer` introduces new nodes (that weren't part of " "original tree) without giving them location information (such as :attr:" @@ -1027,11 +1004,11 @@ msgid "" "tree to recalculate the location information::" msgstr "" -#: ../../library/ast.rst:1743 +#: ../../library/ast.rst:1725 msgid "Usually you use the transformer like this::" msgstr "" -#: ../../library/ast.rst:1750 +#: ../../library/ast.rst:1732 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 +1019,7 @@ msgid "" "true." msgstr "" -#: ../../library/ast.rst:1758 +#: ../../library/ast.rst:1740 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,112 +1029,54 @@ msgid "" "string is used to indent each level." msgstr "" -#: ../../library/ast.rst:1765 +#: ../../library/ast.rst:1747 msgid "Added the *indent* option." msgstr "" -#: ../../library/ast.rst:1772 -msgid "Compiler Flags" -msgstr "" - -#: ../../library/ast.rst:1774 -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 -msgid "" -"Enables support for top-level ``await``, ``async for``, ``async with`` and " -"async comprehensions." -msgstr "" - -#: ../../library/ast.rst:1786 -msgid "" -"Generates and returns an abstract syntax tree instead of returning a " -"compiled code object." -msgstr "" - -#: ../../library/ast.rst:1791 -msgid "" -"Enables support for :pep:`484` and :pep:`526` style type comments (``# type: " -"``, ``# type: ignore ``)." -msgstr "" - -#: ../../library/ast.rst:1800 +#: ../../library/ast.rst:1754 msgid "Command-Line Usage" msgstr "" -#: ../../library/ast.rst:1804 +#: ../../library/ast.rst:1758 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:1765 msgid "The following options are accepted:" msgstr "" -#: ../../library/ast.rst:1817 +#: ../../library/ast.rst:1771 msgid "Show the help message and exit." msgstr "" -#: ../../library/ast.rst:1822 +#: ../../library/ast.rst:1776 msgid "" "Specify what kind of code must be compiled, like the *mode* argument in :" "func:`parse`." msgstr "" -#: ../../library/ast.rst:1827 +#: ../../library/ast.rst:1781 msgid "Don't parse type comments." msgstr "" -#: ../../library/ast.rst:1831 +#: ../../library/ast.rst:1785 msgid "Include attributes such as line numbers and column offsets." msgstr "" -#: ../../library/ast.rst:1836 +#: ../../library/ast.rst:1790 msgid "Indentation of nodes in AST (number of spaces)." msgstr "" -#: ../../library/ast.rst:1838 +#: ../../library/ast.rst:1792 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:1798 msgid "" "`Green Tree Snakes `_, an external " "documentation resource, has good details on working with Python ASTs." msgstr "" - -#: ../../library/ast.rst:1847 -msgid "" -"`ASTTokens `_ " -"annotates Python ASTs with the positions of tokens and text in the source " -"code that generated them. This is helpful for tools that make source code " -"transformations." -msgstr "" - -#: ../../library/ast.rst:1852 -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 -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 -msgid "" -"`Parso `_ is a Python parser that supports " -"error recovery and round-trip parsing for different Python versions (in " -"multiple Python versions). Parso is also able to list multiple syntax errors " -"in your python file." -msgstr "" diff --git a/library/asyncio-dev.po b/library/asyncio-dev.po index 6c067bb1b6..bf5f7d4788 100644 --- a/library/asyncio-dev.po +++ b/library/asyncio-dev.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.7\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2021-09-07 06:52+0000\n" +"POT-Creation-Date: 2020-06-20 18:08+0800\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-" @@ -127,7 +127,7 @@ msgstr "" #: ../../library/asyncio-dev.rst:76 msgid "" -"To schedule a :term:`callback` from another OS thread, the :meth:`loop." +"To schedule a callback from a different OS thread, the :meth:`loop." "call_soon_threadsafe` method should be used. Example::" msgstr "" @@ -160,83 +160,70 @@ msgid "" "in." msgstr "" -#: ../../library/asyncio-dev.rst:110 -msgid "" -"There is currently no way to schedule coroutines or callbacks directly from " -"a different process (such as one started with :mod:`multiprocessing`). The :" -"ref:`Event Loop Methods ` section lists APIs that can " -"read from pipes and watch file descriptors without blocking the event loop. " -"In addition, asyncio's :ref:`Subprocess ` APIs provide a " -"way to start a process and communicate with it from the event loop. Lastly, " -"the aforementioned :meth:`loop.run_in_executor` method can also be used with " -"a :class:`concurrent.futures.ProcessPoolExecutor` to execute code in a " -"different process." -msgstr "" - -#: ../../library/asyncio-dev.rst:124 +#: ../../library/asyncio-dev.rst:114 msgid "Running Blocking Code" msgstr "" -#: ../../library/asyncio-dev.rst:126 +#: ../../library/asyncio-dev.rst:116 msgid "" "Blocking (CPU-bound) code should not be called directly. For example, if a " "function performs a CPU-intensive calculation for 1 second, all concurrent " "asyncio Tasks and IO operations would be delayed by 1 second." msgstr "" -#: ../../library/asyncio-dev.rst:131 +#: ../../library/asyncio-dev.rst:121 msgid "" "An executor can be used to run a task in a different thread or even in a " "different process to avoid blocking the OS thread with the event loop. See " "the :meth:`loop.run_in_executor` method for more details." msgstr "" -#: ../../library/asyncio-dev.rst:140 +#: ../../library/asyncio-dev.rst:130 msgid "Logging" msgstr "" -#: ../../library/asyncio-dev.rst:142 +#: ../../library/asyncio-dev.rst:132 msgid "" "asyncio uses the :mod:`logging` module and all logging is performed via the " "``\"asyncio\"`` logger." msgstr "" -#: ../../library/asyncio-dev.rst:145 +#: ../../library/asyncio-dev.rst:135 msgid "" "The default log level is :py:data:`logging.INFO`, which can be easily " "adjusted::" msgstr "" -#: ../../library/asyncio-dev.rst:154 +#: ../../library/asyncio-dev.rst:144 msgid "Detect never-awaited coroutines" msgstr "" -#: ../../library/asyncio-dev.rst:156 +#: ../../library/asyncio-dev.rst:146 msgid "" "When a coroutine function is called, but not awaited (e.g. ``coro()`` " "instead of ``await coro()``) or the coroutine is not scheduled with :meth:" "`asyncio.create_task`, asyncio will emit a :exc:`RuntimeWarning`::" msgstr "" -#: ../../library/asyncio-dev.rst:171 ../../library/asyncio-dev.rst:216 +#: ../../library/asyncio-dev.rst:161 ../../library/asyncio-dev.rst:206 msgid "Output::" msgstr "" -#: ../../library/asyncio-dev.rst:176 ../../library/asyncio-dev.rst:232 +#: ../../library/asyncio-dev.rst:166 ../../library/asyncio-dev.rst:222 msgid "Output in debug mode::" msgstr "" -#: ../../library/asyncio-dev.rst:189 +#: ../../library/asyncio-dev.rst:179 msgid "" "The usual fix is to either await the coroutine or call the :meth:`asyncio." "create_task` function::" msgstr "" -#: ../../library/asyncio-dev.rst:197 +#: ../../library/asyncio-dev.rst:187 msgid "Detect never-retrieved exceptions" msgstr "" -#: ../../library/asyncio-dev.rst:199 +#: ../../library/asyncio-dev.rst:189 msgid "" "If a :meth:`Future.set_exception` is called but the Future object is never " "awaited on, the exception would never be propagated to the user code. In " @@ -244,11 +231,11 @@ msgid "" "garbage collected." msgstr "" -#: ../../library/asyncio-dev.rst:204 +#: ../../library/asyncio-dev.rst:194 msgid "Example of an unhandled exception::" msgstr "" -#: ../../library/asyncio-dev.rst:227 +#: ../../library/asyncio-dev.rst:217 msgid "" ":ref:`Enable the debug mode ` to get the traceback where " "the task was created::" diff --git a/library/asyncio-eventloop.po b/library/asyncio-eventloop.po index c1908869ef..a6d849f9b5 100644 --- a/library/asyncio-eventloop.po +++ b/library/asyncio-eventloop.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.7\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2021-09-07 06:52+0000\n" +"POT-Creation-Date: 2020-06-20 18:08+0800\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-" @@ -242,8 +242,8 @@ msgid "" msgstr "" #: ../../library/asyncio-eventloop.rst:166 -#: ../../library/asyncio-eventloop.rst:1078 -#: ../../library/asyncio-eventloop.rst:1460 +#: ../../library/asyncio-eventloop.rst:1074 +#: ../../library/asyncio-eventloop.rst:1456 msgid "Example::" msgstr "" @@ -261,8 +261,8 @@ msgstr "" #: ../../library/asyncio-eventloop.rst:194 msgid "" -"Schedule the *callback* :term:`callback` to be called with *args* arguments " -"at the next iteration of the event loop." +"Schedule a *callback* to be called with *args* arguments at the next " +"iteration of the event loop." msgstr "" #: ../../library/asyncio-eventloop.rst:197 @@ -272,7 +272,7 @@ msgid "" msgstr "" #: ../../library/asyncio-eventloop.rst:200 -#: ../../library/asyncio-eventloop.rst:267 +#: ../../library/asyncio-eventloop.rst:263 msgid "" "An optional keyword-only *context* argument allows specifying a custom :" "class:`contextvars.Context` for the *callback* to run in. The current " @@ -297,153 +297,147 @@ msgstr "" #: ../../library/asyncio-eventloop.rst:214 msgid "" -"Raises :exc:`RuntimeError` if called on a loop that's been closed. This can " -"happen on a secondary thread when the main application is shutting down." -msgstr "" - -#: ../../library/asyncio-eventloop.rst:218 -msgid "" "See the :ref:`concurrency and multithreading ` " "section of the documentation." msgstr "" -#: ../../library/asyncio-eventloop.rst:221 -#: ../../library/asyncio-eventloop.rst:271 -#: ../../library/asyncio-eventloop.rst:291 +#: ../../library/asyncio-eventloop.rst:217 +#: ../../library/asyncio-eventloop.rst:267 +#: ../../library/asyncio-eventloop.rst:287 msgid "" "The *context* keyword-only parameter was added. See :pep:`567` for more " "details." msgstr "" -#: ../../library/asyncio-eventloop.rst:229 +#: ../../library/asyncio-eventloop.rst:225 msgid "" "Most :mod:`asyncio` scheduling functions don't allow passing keyword " "arguments. To do that, use :func:`functools.partial`::" msgstr "" -#: ../../library/asyncio-eventloop.rst:236 +#: ../../library/asyncio-eventloop.rst:232 msgid "" "Using partial objects is usually more convenient than using lambdas, as " "asyncio can render partial objects better in debug and error messages." msgstr "" -#: ../../library/asyncio-eventloop.rst:244 +#: ../../library/asyncio-eventloop.rst:240 msgid "Scheduling delayed callbacks" msgstr "" -#: ../../library/asyncio-eventloop.rst:246 +#: ../../library/asyncio-eventloop.rst:242 msgid "" "Event loop provides mechanisms to schedule callback functions to be called " "at some point in the future. Event loop uses monotonic clocks to track time." msgstr "" -#: ../../library/asyncio-eventloop.rst:253 +#: ../../library/asyncio-eventloop.rst:249 msgid "" "Schedule *callback* to be called after the given *delay* number of seconds " "(can be either an int or a float)." msgstr "" -#: ../../library/asyncio-eventloop.rst:256 -#: ../../library/asyncio-eventloop.rst:288 +#: ../../library/asyncio-eventloop.rst:252 +#: ../../library/asyncio-eventloop.rst:284 msgid "" "An instance of :class:`asyncio.TimerHandle` is returned which can be used to " "cancel the callback." msgstr "" -#: ../../library/asyncio-eventloop.rst:259 +#: ../../library/asyncio-eventloop.rst:255 msgid "" "*callback* will be called exactly once. If two callbacks are scheduled for " "exactly the same time, the order in which they are called is undefined." msgstr "" -#: ../../library/asyncio-eventloop.rst:263 +#: ../../library/asyncio-eventloop.rst:259 msgid "" "The optional positional *args* will be passed to the callback when it is " "called. If you want the callback to be called with keyword arguments use :" "func:`functools.partial`." msgstr "" -#: ../../library/asyncio-eventloop.rst:275 +#: ../../library/asyncio-eventloop.rst:271 msgid "" "In Python 3.7 and earlier with the default event loop implementation, the " "*delay* could not exceed one day. This has been fixed in Python 3.8." msgstr "" -#: ../../library/asyncio-eventloop.rst:282 +#: ../../library/asyncio-eventloop.rst:278 msgid "" "Schedule *callback* to be called at the given absolute timestamp *when* (an " "int or a float), using the same time reference as :meth:`loop.time`." msgstr "" -#: ../../library/asyncio-eventloop.rst:286 +#: ../../library/asyncio-eventloop.rst:282 msgid "This method's behavior is the same as :meth:`call_later`." msgstr "" -#: ../../library/asyncio-eventloop.rst:295 +#: ../../library/asyncio-eventloop.rst:291 msgid "" "In Python 3.7 and earlier with the default event loop implementation, the " "difference between *when* and the current time could not exceed one day. " "This has been fixed in Python 3.8." msgstr "" -#: ../../library/asyncio-eventloop.rst:302 +#: ../../library/asyncio-eventloop.rst:298 msgid "" "Return the current time, as a :class:`float` value, according to the event " "loop's internal monotonic clock." msgstr "" -#: ../../library/asyncio-eventloop.rst:306 +#: ../../library/asyncio-eventloop.rst:302 msgid "" "In Python 3.7 and earlier timeouts (relative *delay* or absolute *when*) " "should not exceed one day. This has been fixed in Python 3.8." msgstr "" -#: ../../library/asyncio-eventloop.rst:312 +#: ../../library/asyncio-eventloop.rst:308 msgid "The :func:`asyncio.sleep` function." msgstr "" -#: ../../library/asyncio-eventloop.rst:316 +#: ../../library/asyncio-eventloop.rst:312 msgid "Creating Futures and Tasks" msgstr "" -#: ../../library/asyncio-eventloop.rst:320 +#: ../../library/asyncio-eventloop.rst:316 msgid "Create an :class:`asyncio.Future` object attached to the event loop." msgstr "" -#: ../../library/asyncio-eventloop.rst:322 +#: ../../library/asyncio-eventloop.rst:318 msgid "" "This is the preferred way to create Futures in asyncio. This lets third-" "party event loops provide alternative implementations of the Future object " "(with better performance or instrumentation)." msgstr "" -#: ../../library/asyncio-eventloop.rst:330 +#: ../../library/asyncio-eventloop.rst:326 msgid "" "Schedule the execution of a :ref:`coroutine`. Return a :class:`Task` object." msgstr "" -#: ../../library/asyncio-eventloop.rst:333 +#: ../../library/asyncio-eventloop.rst:329 msgid "" "Third-party event loops can use their own subclass of :class:`Task` for " "interoperability. In this case, the result type is a subclass of :class:" "`Task`." msgstr "" -#: ../../library/asyncio-eventloop.rst:337 +#: ../../library/asyncio-eventloop.rst:333 msgid "" "If the *name* argument is provided and not ``None``, it is set as the name " "of the task using :meth:`Task.set_name`." msgstr "" -#: ../../library/asyncio-eventloop.rst:340 +#: ../../library/asyncio-eventloop.rst:336 msgid "Added the ``name`` parameter." msgstr "" -#: ../../library/asyncio-eventloop.rst:345 +#: ../../library/asyncio-eventloop.rst:341 msgid "Set a task factory that will be used by :meth:`loop.create_task`." msgstr "" -#: ../../library/asyncio-eventloop.rst:348 +#: ../../library/asyncio-eventloop.rst:344 msgid "" "If *factory* is ``None`` the default task factory will be set. Otherwise, " "*factory* must be a *callable* with the signature matching ``(loop, coro)``, " @@ -452,82 +446,82 @@ msgid "" "compatible object." msgstr "" -#: ../../library/asyncio-eventloop.rst:356 +#: ../../library/asyncio-eventloop.rst:352 msgid "Return a task factory or ``None`` if the default one is in use." msgstr "" -#: ../../library/asyncio-eventloop.rst:360 +#: ../../library/asyncio-eventloop.rst:356 msgid "Opening network connections" msgstr "" -#: ../../library/asyncio-eventloop.rst:369 +#: ../../library/asyncio-eventloop.rst:365 msgid "" "Open a streaming transport connection to a given address specified by *host* " "and *port*." msgstr "" -#: ../../library/asyncio-eventloop.rst:372 +#: ../../library/asyncio-eventloop.rst:368 msgid "" "The socket family can be either :py:data:`~socket.AF_INET` or :py:data:" "`~socket.AF_INET6` depending on *host* (or the *family* argument, if " "provided)." msgstr "" -#: ../../library/asyncio-eventloop.rst:376 +#: ../../library/asyncio-eventloop.rst:372 msgid "The socket type will be :py:data:`~socket.SOCK_STREAM`." msgstr "" -#: ../../library/asyncio-eventloop.rst:378 -#: ../../library/asyncio-eventloop.rst:994 -#: ../../library/asyncio-eventloop.rst:1010 +#: ../../library/asyncio-eventloop.rst:374 +#: ../../library/asyncio-eventloop.rst:990 +#: ../../library/asyncio-eventloop.rst:1006 msgid "" "*protocol_factory* must be a callable returning an :ref:`asyncio protocol " "` implementation." msgstr "" -#: ../../library/asyncio-eventloop.rst:381 +#: ../../library/asyncio-eventloop.rst:377 msgid "" "This method will try to establish the connection in the background. When " "successful, it returns a ``(transport, protocol)`` pair." msgstr "" -#: ../../library/asyncio-eventloop.rst:384 +#: ../../library/asyncio-eventloop.rst:380 msgid "The chronological synopsis of the underlying operation is as follows:" msgstr "" -#: ../../library/asyncio-eventloop.rst:386 +#: ../../library/asyncio-eventloop.rst:382 msgid "" "The connection is established and a :ref:`transport ` is " "created for it." msgstr "" -#: ../../library/asyncio-eventloop.rst:389 +#: ../../library/asyncio-eventloop.rst:385 msgid "" "*protocol_factory* is called without arguments and is expected to return a :" "ref:`protocol ` instance." msgstr "" -#: ../../library/asyncio-eventloop.rst:392 +#: ../../library/asyncio-eventloop.rst:388 msgid "" "The protocol instance is coupled with the transport by calling its :meth:" "`~BaseProtocol.connection_made` method." msgstr "" -#: ../../library/asyncio-eventloop.rst:395 +#: ../../library/asyncio-eventloop.rst:391 msgid "A ``(transport, protocol)`` tuple is returned on success." msgstr "" -#: ../../library/asyncio-eventloop.rst:397 +#: ../../library/asyncio-eventloop.rst:393 msgid "" "The created transport is an implementation-dependent bidirectional stream." msgstr "" -#: ../../library/asyncio-eventloop.rst:400 -#: ../../library/asyncio-eventloop.rst:522 +#: ../../library/asyncio-eventloop.rst:396 +#: ../../library/asyncio-eventloop.rst:518 msgid "Other arguments:" msgstr "" -#: ../../library/asyncio-eventloop.rst:402 +#: ../../library/asyncio-eventloop.rst:398 msgid "" "*ssl*: if given and not false, a SSL/TLS transport is created (by default a " "plain TCP transport is created). If *ssl* is a :class:`ssl.SSLContext` " @@ -536,11 +530,11 @@ msgid "" "is used." msgstr "" -#: ../../library/asyncio-eventloop.rst:408 +#: ../../library/asyncio-eventloop.rst:404 msgid ":ref:`SSL/TLS security considerations `" msgstr "" -#: ../../library/asyncio-eventloop.rst:410 +#: ../../library/asyncio-eventloop.rst:406 msgid "" "*server_hostname* sets or overrides the hostname that the target server's " "certificate will be matched against. Should only be passed if *ssl* is not " @@ -551,7 +545,7 @@ msgid "" "potential man-in-the-middle attacks)." msgstr "" -#: ../../library/asyncio-eventloop.rst:418 +#: ../../library/asyncio-eventloop.rst:414 msgid "" "*family*, *proto*, *flags* are the optional address family, protocol and " "flags to be passed through to getaddrinfo() for *host* resolution. If given, " @@ -559,7 +553,7 @@ msgid "" "constants." msgstr "" -#: ../../library/asyncio-eventloop.rst:423 +#: ../../library/asyncio-eventloop.rst:419 msgid "" "*happy_eyeballs_delay*, if given, enables Happy Eyeballs for this " "connection. It should be a floating-point number representing the amount of " @@ -569,7 +563,7 @@ msgid "" "RFC is ``0.25`` (250 milliseconds)." msgstr "" -#: ../../library/asyncio-eventloop.rst:431 +#: ../../library/asyncio-eventloop.rst:427 msgid "" "*interleave* controls address reordering when a host name resolves to " "multiple IP addresses. If ``0`` or unspecified, no reordering is done, and " @@ -580,7 +574,7 @@ msgid "" "is not specified, and ``1`` if it is." msgstr "" -#: ../../library/asyncio-eventloop.rst:440 +#: ../../library/asyncio-eventloop.rst:436 msgid "" "*sock*, if given, should be an existing, already connected :class:`socket." "socket` object to be used by the transport. If *sock* is given, none of " @@ -588,26 +582,26 @@ msgid "" "*interleave* and *local_addr* should be specified." msgstr "" -#: ../../library/asyncio-eventloop.rst:446 +#: ../../library/asyncio-eventloop.rst:442 msgid "" "*local_addr*, if given, is a ``(local_host, local_port)`` tuple used to bind " -"the socket locally. The *local_host* and *local_port* are looked up using " -"``getaddrinfo()``, similarly to *host* and *port*." +"the socket to locally. The *local_host* and *local_port* are looked up " +"using ``getaddrinfo()``, similarly to *host* and *port*." msgstr "" -#: ../../library/asyncio-eventloop.rst:450 -#: ../../library/asyncio-eventloop.rst:803 +#: ../../library/asyncio-eventloop.rst:446 +#: ../../library/asyncio-eventloop.rst:799 msgid "" "*ssl_handshake_timeout* is (for a TLS connection) the time in seconds to " "wait for the TLS handshake to complete before aborting the connection. " "``60.0`` seconds if ``None`` (default)." msgstr "" -#: ../../library/asyncio-eventloop.rst:456 +#: ../../library/asyncio-eventloop.rst:452 msgid "Added the *happy_eyeballs_delay* and *interleave* parameters." msgstr "" -#: ../../library/asyncio-eventloop.rst:458 +#: ../../library/asyncio-eventloop.rst:454 msgid "" "Happy Eyeballs Algorithm: Success with Dual-Stack Hosts. When a server's " "IPv4 path and protocol are working, but the server's IPv6 path and protocol " @@ -618,50 +612,50 @@ msgid "" "visible delay and provides an algorithm." msgstr "" -#: ../../library/asyncio-eventloop.rst:467 +#: ../../library/asyncio-eventloop.rst:463 msgid "For more information: https://tools.ietf.org/html/rfc6555" msgstr "" -#: ../../library/asyncio-eventloop.rst:471 -#: ../../library/asyncio-eventloop.rst:588 -#: ../../library/asyncio-eventloop.rst:741 +#: ../../library/asyncio-eventloop.rst:467 +#: ../../library/asyncio-eventloop.rst:584 +#: ../../library/asyncio-eventloop.rst:737 msgid "The *ssl_handshake_timeout* parameter." msgstr "" -#: ../../library/asyncio-eventloop.rst:475 -#: ../../library/asyncio-eventloop.rst:671 +#: ../../library/asyncio-eventloop.rst:471 +#: ../../library/asyncio-eventloop.rst:667 msgid "" "The socket option :py:data:`~socket.TCP_NODELAY` is set by default for all " "TCP connections." msgstr "" -#: ../../library/asyncio-eventloop.rst:480 -#: ../../library/asyncio-eventloop.rst:676 +#: ../../library/asyncio-eventloop.rst:476 +#: ../../library/asyncio-eventloop.rst:672 msgid "Added support for SSL/TLS in :class:`ProactorEventLoop`." msgstr "" -#: ../../library/asyncio-eventloop.rst:484 +#: ../../library/asyncio-eventloop.rst:480 msgid "" "The :func:`open_connection` function is a high-level alternative API. It " "returns a pair of (:class:`StreamReader`, :class:`StreamWriter`) that can be " "used directly in async/await code." msgstr "" -#: ../../library/asyncio-eventloop.rst:495 +#: ../../library/asyncio-eventloop.rst:491 msgid "" "The parameter *reuse_address* is no longer supported, as using :py:data:" "`~sockets.SO_REUSEADDR` poses a significant security concern for UDP. " "Explicitly passing ``reuse_address=True`` will raise an exception." msgstr "" -#: ../../library/asyncio-eventloop.rst:499 +#: ../../library/asyncio-eventloop.rst:495 msgid "" "When multiple processes with differing UIDs assign sockets to an identical " "UDP socket address with ``SO_REUSEADDR``, incoming packets can become " "randomly distributed among the sockets." msgstr "" -#: ../../library/asyncio-eventloop.rst:503 +#: ../../library/asyncio-eventloop.rst:499 msgid "" "For supported platforms, *reuse_port* can be used as a replacement for " "similar functionality. With *reuse_port*, :py:data:`~sockets.SO_REUSEPORT` " @@ -669,49 +663,49 @@ msgid "" "from assigning sockets to the same socket address." msgstr "" -#: ../../library/asyncio-eventloop.rst:509 +#: ../../library/asyncio-eventloop.rst:505 msgid "Create a datagram connection." msgstr "" -#: ../../library/asyncio-eventloop.rst:511 +#: ../../library/asyncio-eventloop.rst:507 msgid "" "The socket family can be either :py:data:`~socket.AF_INET`, :py:data:" "`~socket.AF_INET6`, or :py:data:`~socket.AF_UNIX`, depending on *host* (or " "the *family* argument, if provided)." msgstr "" -#: ../../library/asyncio-eventloop.rst:515 +#: ../../library/asyncio-eventloop.rst:511 msgid "The socket type will be :py:data:`~socket.SOCK_DGRAM`." msgstr "" -#: ../../library/asyncio-eventloop.rst:517 -#: ../../library/asyncio-eventloop.rst:613 -#: ../../library/asyncio-eventloop.rst:724 +#: ../../library/asyncio-eventloop.rst:513 +#: ../../library/asyncio-eventloop.rst:609 +#: ../../library/asyncio-eventloop.rst:720 msgid "" "*protocol_factory* must be a callable returning a :ref:`protocol ` implementation." msgstr "" -#: ../../library/asyncio-eventloop.rst:520 -#: ../../library/asyncio-eventloop.rst:574 +#: ../../library/asyncio-eventloop.rst:516 +#: ../../library/asyncio-eventloop.rst:570 msgid "A tuple of ``(transport, protocol)`` is returned on success." msgstr "" -#: ../../library/asyncio-eventloop.rst:524 +#: ../../library/asyncio-eventloop.rst:520 msgid "" "*local_addr*, if given, is a ``(local_host, local_port)`` tuple used to bind " -"the socket locally. The *local_host* and *local_port* are looked up using :" -"meth:`getaddrinfo`." +"the socket to locally. The *local_host* and *local_port* are looked up " +"using :meth:`getaddrinfo`." msgstr "" -#: ../../library/asyncio-eventloop.rst:528 +#: ../../library/asyncio-eventloop.rst:524 msgid "" "*remote_addr*, if given, is a ``(remote_host, remote_port)`` tuple used to " "connect the socket to a remote address. The *remote_host* and *remote_port* " "are looked up using :meth:`getaddrinfo`." msgstr "" -#: ../../library/asyncio-eventloop.rst:532 +#: ../../library/asyncio-eventloop.rst:528 msgid "" "*family*, *proto*, *flags* are the optional address family, protocol and " "flags to be passed through to :meth:`getaddrinfo` for *host* resolution. If " @@ -719,7 +713,7 @@ msgid "" "module constants." msgstr "" -#: ../../library/asyncio-eventloop.rst:537 +#: ../../library/asyncio-eventloop.rst:533 msgid "" "*reuse_port* tells the kernel to allow this endpoint to be bound to the same " "port as other existing endpoints are bound to, so long as they all set this " @@ -728,13 +722,13 @@ msgid "" "this capability is unsupported." msgstr "" -#: ../../library/asyncio-eventloop.rst:543 +#: ../../library/asyncio-eventloop.rst:539 msgid "" "*allow_broadcast* tells the kernel to allow this endpoint to send messages " "to the broadcast address." msgstr "" -#: ../../library/asyncio-eventloop.rst:546 +#: ../../library/asyncio-eventloop.rst:542 msgid "" "*sock* can optionally be specified in order to use a preexisting, already " "connected, :class:`socket.socket` object to be used by the transport. If " @@ -742,155 +736,155 @@ msgid "" "`None`)." msgstr "" -#: ../../library/asyncio-eventloop.rst:551 +#: ../../library/asyncio-eventloop.rst:547 msgid "" "See :ref:`UDP echo client protocol ` and :" "ref:`UDP echo server protocol ` examples." msgstr "" -#: ../../library/asyncio-eventloop.rst:554 +#: ../../library/asyncio-eventloop.rst:550 msgid "" "The *family*, *proto*, *flags*, *reuse_address*, *reuse_port, " "*allow_broadcast*, and *sock* parameters were added." msgstr "" -#: ../../library/asyncio-eventloop.rst:558 +#: ../../library/asyncio-eventloop.rst:554 msgid "" "The *reuse_address* parameter is no longer supported due to security " "concerns." msgstr "" -#: ../../library/asyncio-eventloop.rst:562 +#: ../../library/asyncio-eventloop.rst:558 msgid "Added support for Windows." msgstr "" -#: ../../library/asyncio-eventloop.rst:569 +#: ../../library/asyncio-eventloop.rst:565 msgid "Create a Unix connection." msgstr "" -#: ../../library/asyncio-eventloop.rst:571 +#: ../../library/asyncio-eventloop.rst:567 msgid "" "The socket family will be :py:data:`~socket.AF_UNIX`; socket type will be :" "py:data:`~socket.SOCK_STREAM`." msgstr "" -#: ../../library/asyncio-eventloop.rst:576 +#: ../../library/asyncio-eventloop.rst:572 msgid "" "*path* is the name of a Unix domain socket and is required, unless a *sock* " "parameter is specified. Abstract Unix sockets, :class:`str`, :class:" "`bytes`, and :class:`~pathlib.Path` paths are supported." msgstr "" -#: ../../library/asyncio-eventloop.rst:581 +#: ../../library/asyncio-eventloop.rst:577 msgid "" "See the documentation of the :meth:`loop.create_connection` method for " "information about arguments to this method." msgstr "" -#: ../../library/asyncio-eventloop.rst:585 -#: ../../library/asyncio-eventloop.rst:705 -#: ../../library/asyncio-eventloop.rst:1061 +#: ../../library/asyncio-eventloop.rst:581 +#: ../../library/asyncio-eventloop.rst:701 +#: ../../library/asyncio-eventloop.rst:1057 msgid ":ref:`Availability `: Unix." msgstr "" -#: ../../library/asyncio-eventloop.rst:592 +#: ../../library/asyncio-eventloop.rst:588 msgid "The *path* parameter can now be a :term:`path-like object`." msgstr "" -#: ../../library/asyncio-eventloop.rst:596 +#: ../../library/asyncio-eventloop.rst:592 msgid "Creating network servers" msgstr "" -#: ../../library/asyncio-eventloop.rst:606 +#: ../../library/asyncio-eventloop.rst:602 msgid "" "Create a TCP server (socket type :data:`~socket.SOCK_STREAM`) listening on " "*port* of the *host* address." msgstr "" -#: ../../library/asyncio-eventloop.rst:609 +#: ../../library/asyncio-eventloop.rst:605 msgid "Returns a :class:`Server` object." msgstr "" -#: ../../library/asyncio-eventloop.rst:611 +#: ../../library/asyncio-eventloop.rst:607 msgid "Arguments:" msgstr "" -#: ../../library/asyncio-eventloop.rst:616 +#: ../../library/asyncio-eventloop.rst:612 msgid "" "The *host* parameter can be set to several types which determine where the " "server would be listening:" msgstr "" -#: ../../library/asyncio-eventloop.rst:619 +#: ../../library/asyncio-eventloop.rst:615 msgid "" "If *host* is a string, the TCP server is bound to a single network interface " "specified by *host*." msgstr "" -#: ../../library/asyncio-eventloop.rst:622 +#: ../../library/asyncio-eventloop.rst:618 msgid "" "If *host* is a sequence of strings, the TCP server is bound to all network " "interfaces specified by the sequence." msgstr "" -#: ../../library/asyncio-eventloop.rst:625 +#: ../../library/asyncio-eventloop.rst:621 msgid "" "If *host* is an empty string or ``None``, all interfaces are assumed and a " "list of multiple sockets will be returned (most likely one for IPv4 and " "another one for IPv6)." msgstr "" -#: ../../library/asyncio-eventloop.rst:629 +#: ../../library/asyncio-eventloop.rst:625 msgid "" "*family* can be set to either :data:`socket.AF_INET` or :data:`~socket." "AF_INET6` to force the socket to use IPv4 or IPv6. If not set, the *family* " "will be determined from host name (defaults to :data:`~socket.AF_UNSPEC`)." msgstr "" -#: ../../library/asyncio-eventloop.rst:634 +#: ../../library/asyncio-eventloop.rst:630 msgid "*flags* is a bitmask for :meth:`getaddrinfo`." msgstr "" -#: ../../library/asyncio-eventloop.rst:636 +#: ../../library/asyncio-eventloop.rst:632 msgid "" "*sock* can optionally be specified in order to use a preexisting socket " "object. If specified, *host* and *port* must not be specified." msgstr "" -#: ../../library/asyncio-eventloop.rst:639 +#: ../../library/asyncio-eventloop.rst:635 msgid "" "*backlog* is the maximum number of queued connections passed to :meth:" "`~socket.socket.listen` (defaults to 100)." msgstr "" -#: ../../library/asyncio-eventloop.rst:642 +#: ../../library/asyncio-eventloop.rst:638 msgid "" "*ssl* can be set to an :class:`~ssl.SSLContext` instance to enable TLS over " "the accepted connections." msgstr "" -#: ../../library/asyncio-eventloop.rst:645 +#: ../../library/asyncio-eventloop.rst:641 msgid "" "*reuse_address* tells the kernel to reuse a local socket in ``TIME_WAIT`` " "state, without waiting for its natural timeout to expire. If not specified " "will automatically be set to ``True`` on Unix." msgstr "" -#: ../../library/asyncio-eventloop.rst:650 +#: ../../library/asyncio-eventloop.rst:646 msgid "" "*reuse_port* tells the kernel to allow this endpoint to be bound to the same " "port as other existing endpoints are bound to, so long as they all set this " "flag when being created. This option is not supported on Windows." msgstr "" -#: ../../library/asyncio-eventloop.rst:655 +#: ../../library/asyncio-eventloop.rst:651 msgid "" "*ssl_handshake_timeout* is (for a TLS server) the time in seconds to wait " "for the TLS handshake to complete before aborting the connection. ``60.0`` " "seconds if ``None`` (default)." msgstr "" -#: ../../library/asyncio-eventloop.rst:659 +#: ../../library/asyncio-eventloop.rst:655 msgid "" "*start_serving* set to ``True`` (the default) causes the created server to " "start accepting connections immediately. When set to ``False``, the user " @@ -898,105 +892,105 @@ msgid "" "to make the server to start accepting connections." msgstr "" -#: ../../library/asyncio-eventloop.rst:667 +#: ../../library/asyncio-eventloop.rst:663 msgid "Added *ssl_handshake_timeout* and *start_serving* parameters." msgstr "" -#: ../../library/asyncio-eventloop.rst:680 +#: ../../library/asyncio-eventloop.rst:676 msgid "The *host* parameter can be a sequence of strings." msgstr "" -#: ../../library/asyncio-eventloop.rst:684 +#: ../../library/asyncio-eventloop.rst:680 msgid "" "The :func:`start_server` function is a higher-level alternative API that " "returns a pair of :class:`StreamReader` and :class:`StreamWriter` that can " "be used in an async/await code." msgstr "" -#: ../../library/asyncio-eventloop.rst:693 +#: ../../library/asyncio-eventloop.rst:689 msgid "" "Similar to :meth:`loop.create_server` but works with the :py:data:`~socket." "AF_UNIX` socket family." msgstr "" -#: ../../library/asyncio-eventloop.rst:696 +#: ../../library/asyncio-eventloop.rst:692 msgid "" "*path* is the name of a Unix domain socket, and is required, unless a *sock* " "argument is provided. Abstract Unix sockets, :class:`str`, :class:`bytes`, " "and :class:`~pathlib.Path` paths are supported." msgstr "" -#: ../../library/asyncio-eventloop.rst:701 +#: ../../library/asyncio-eventloop.rst:697 msgid "" "See the documentation of the :meth:`loop.create_server` method for " "information about arguments to this method." msgstr "" -#: ../../library/asyncio-eventloop.rst:708 +#: ../../library/asyncio-eventloop.rst:704 msgid "The *ssl_handshake_timeout* and *start_serving* parameters." msgstr "" -#: ../../library/asyncio-eventloop.rst:712 +#: ../../library/asyncio-eventloop.rst:708 msgid "The *path* parameter can now be a :class:`~pathlib.Path` object." msgstr "" -#: ../../library/asyncio-eventloop.rst:717 +#: ../../library/asyncio-eventloop.rst:713 msgid "Wrap an already accepted connection into a transport/protocol pair." msgstr "" -#: ../../library/asyncio-eventloop.rst:719 +#: ../../library/asyncio-eventloop.rst:715 msgid "" "This method can be used by servers that accept connections outside of " "asyncio but that use asyncio to handle them." msgstr "" -#: ../../library/asyncio-eventloop.rst:722 -#: ../../library/asyncio-eventloop.rst:789 +#: ../../library/asyncio-eventloop.rst:718 +#: ../../library/asyncio-eventloop.rst:785 msgid "Parameters:" msgstr "" -#: ../../library/asyncio-eventloop.rst:727 +#: ../../library/asyncio-eventloop.rst:723 msgid "" "*sock* is a preexisting socket object returned from :meth:`socket.accept " "`." msgstr "" -#: ../../library/asyncio-eventloop.rst:730 +#: ../../library/asyncio-eventloop.rst:726 msgid "" "*ssl* can be set to an :class:`~ssl.SSLContext` to enable SSL over the " "accepted connections." msgstr "" -#: ../../library/asyncio-eventloop.rst:733 +#: ../../library/asyncio-eventloop.rst:729 msgid "" "*ssl_handshake_timeout* is (for an SSL connection) the time in seconds to " "wait for the SSL handshake to complete before aborting the connection. " "``60.0`` seconds if ``None`` (default)." msgstr "" -#: ../../library/asyncio-eventloop.rst:737 +#: ../../library/asyncio-eventloop.rst:733 msgid "Returns a ``(transport, protocol)`` pair." msgstr "" -#: ../../library/asyncio-eventloop.rst:747 +#: ../../library/asyncio-eventloop.rst:743 msgid "Transferring files" msgstr "" -#: ../../library/asyncio-eventloop.rst:752 +#: ../../library/asyncio-eventloop.rst:748 msgid "" "Send a *file* over a *transport*. Return the total number of bytes sent." msgstr "" -#: ../../library/asyncio-eventloop.rst:755 +#: ../../library/asyncio-eventloop.rst:751 msgid "The method uses high-performance :meth:`os.sendfile` if available." msgstr "" -#: ../../library/asyncio-eventloop.rst:757 +#: ../../library/asyncio-eventloop.rst:753 msgid "*file* must be a regular file object opened in binary mode." msgstr "" -#: ../../library/asyncio-eventloop.rst:759 -#: ../../library/asyncio-eventloop.rst:949 +#: ../../library/asyncio-eventloop.rst:755 +#: ../../library/asyncio-eventloop.rst:945 msgid "" "*offset* tells from where to start reading the file. If specified, *count* " "is the total number of bytes to transmit as opposed to sending the file " @@ -1005,98 +999,98 @@ msgid "" "obtain the actual number of bytes sent." msgstr "" -#: ../../library/asyncio-eventloop.rst:766 +#: ../../library/asyncio-eventloop.rst:762 msgid "" "*fallback* set to ``True`` makes asyncio to manually read and send the file " "when the platform does not support the sendfile system call (e.g. Windows or " "SSL socket on Unix)." msgstr "" -#: ../../library/asyncio-eventloop.rst:770 +#: ../../library/asyncio-eventloop.rst:766 msgid "" "Raise :exc:`SendfileNotAvailableError` if the system does not support the " "*sendfile* syscall and *fallback* is ``False``." msgstr "" -#: ../../library/asyncio-eventloop.rst:777 +#: ../../library/asyncio-eventloop.rst:773 msgid "TLS Upgrade" msgstr "" -#: ../../library/asyncio-eventloop.rst:783 +#: ../../library/asyncio-eventloop.rst:779 msgid "Upgrade an existing transport-based connection to TLS." msgstr "" -#: ../../library/asyncio-eventloop.rst:785 +#: ../../library/asyncio-eventloop.rst:781 msgid "" "Return a new transport instance, that the *protocol* must start using " "immediately after the *await*. The *transport* instance passed to the " "*start_tls* method should never be used again." msgstr "" -#: ../../library/asyncio-eventloop.rst:791 +#: ../../library/asyncio-eventloop.rst:787 msgid "" "*transport* and *protocol* instances that methods like :meth:`~loop." "create_server` and :meth:`~loop.create_connection` return." msgstr "" -#: ../../library/asyncio-eventloop.rst:795 +#: ../../library/asyncio-eventloop.rst:791 msgid "*sslcontext*: a configured instance of :class:`~ssl.SSLContext`." msgstr "" -#: ../../library/asyncio-eventloop.rst:797 +#: ../../library/asyncio-eventloop.rst:793 msgid "" "*server_side* pass ``True`` when a server-side connection is being upgraded " "(like the one created by :meth:`~loop.create_server`)." msgstr "" -#: ../../library/asyncio-eventloop.rst:800 +#: ../../library/asyncio-eventloop.rst:796 msgid "" "*server_hostname*: sets or overrides the host name that the target server's " "certificate will be matched against." msgstr "" -#: ../../library/asyncio-eventloop.rst:811 +#: ../../library/asyncio-eventloop.rst:807 msgid "Watching file descriptors" msgstr "" -#: ../../library/asyncio-eventloop.rst:815 +#: ../../library/asyncio-eventloop.rst:811 msgid "" "Start monitoring the *fd* file descriptor for read availability and invoke " "*callback* with the specified arguments once *fd* is available for reading." msgstr "" -#: ../../library/asyncio-eventloop.rst:821 +#: ../../library/asyncio-eventloop.rst:817 msgid "Stop monitoring the *fd* file descriptor for read availability." msgstr "" -#: ../../library/asyncio-eventloop.rst:825 +#: ../../library/asyncio-eventloop.rst:821 msgid "" "Start monitoring the *fd* file descriptor for write availability and invoke " "*callback* with the specified arguments once *fd* is available for writing." msgstr "" -#: ../../library/asyncio-eventloop.rst:829 -#: ../../library/asyncio-eventloop.rst:1048 +#: ../../library/asyncio-eventloop.rst:825 +#: ../../library/asyncio-eventloop.rst:1044 msgid "" "Use :func:`functools.partial` :ref:`to pass keyword arguments ` to *callback*." msgstr "" -#: ../../library/asyncio-eventloop.rst:834 +#: ../../library/asyncio-eventloop.rst:830 msgid "Stop monitoring the *fd* file descriptor for write availability." msgstr "" -#: ../../library/asyncio-eventloop.rst:836 +#: ../../library/asyncio-eventloop.rst:832 msgid "" "See also :ref:`Platform Support ` section for some " "limitations of these methods." msgstr "" -#: ../../library/asyncio-eventloop.rst:841 +#: ../../library/asyncio-eventloop.rst:837 msgid "Working with socket objects directly" msgstr "" -#: ../../library/asyncio-eventloop.rst:843 +#: ../../library/asyncio-eventloop.rst:839 msgid "" "In general, protocol implementations that use transport-based APIs such as :" "meth:`loop.create_connection` and :meth:`loop.create_server` are faster than " @@ -1105,49 +1099,49 @@ msgid "" "socket` objects directly is more convenient." msgstr "" -#: ../../library/asyncio-eventloop.rst:852 +#: ../../library/asyncio-eventloop.rst:848 msgid "" "Receive up to *nbytes* from *sock*. Asynchronous version of :meth:`socket." "recv() `." msgstr "" -#: ../../library/asyncio-eventloop.rst:855 +#: ../../library/asyncio-eventloop.rst:851 msgid "Return the received data as a bytes object." msgstr "" -#: ../../library/asyncio-eventloop.rst:857 -#: ../../library/asyncio-eventloop.rst:871 -#: ../../library/asyncio-eventloop.rst:886 -#: ../../library/asyncio-eventloop.rst:899 -#: ../../library/asyncio-eventloop.rst:925 -#: ../../library/asyncio-eventloop.rst:963 +#: ../../library/asyncio-eventloop.rst:853 +#: ../../library/asyncio-eventloop.rst:867 +#: ../../library/asyncio-eventloop.rst:882 +#: ../../library/asyncio-eventloop.rst:895 +#: ../../library/asyncio-eventloop.rst:921 +#: ../../library/asyncio-eventloop.rst:959 msgid "*sock* must be a non-blocking socket." msgstr "" -#: ../../library/asyncio-eventloop.rst:859 +#: ../../library/asyncio-eventloop.rst:855 msgid "" "Even though this method was always documented as a coroutine method, " "releases before Python 3.7 returned a :class:`Future`. Since Python 3.7 this " "is an ``async def`` method." msgstr "" -#: ../../library/asyncio-eventloop.rst:866 +#: ../../library/asyncio-eventloop.rst:862 msgid "" "Receive data from *sock* into the *buf* buffer. Modeled after the blocking :" "meth:`socket.recv_into() ` method." msgstr "" -#: ../../library/asyncio-eventloop.rst:869 +#: ../../library/asyncio-eventloop.rst:865 msgid "Return the number of bytes written to the buffer." msgstr "" -#: ../../library/asyncio-eventloop.rst:877 +#: ../../library/asyncio-eventloop.rst:873 msgid "" "Send *data* to the *sock* socket. Asynchronous version of :meth:`socket." "sendall() `." msgstr "" -#: ../../library/asyncio-eventloop.rst:880 +#: ../../library/asyncio-eventloop.rst:876 msgid "" "This method continues to send to the socket until either all data in *data* " "has been sent or an error occurs. ``None`` is returned on success. On " @@ -1156,23 +1150,23 @@ msgid "" "the connection." msgstr "" -#: ../../library/asyncio-eventloop.rst:888 +#: ../../library/asyncio-eventloop.rst:884 msgid "" "Even though the method was always documented as a coroutine method, before " "Python 3.7 it returned an :class:`Future`. Since Python 3.7, this is an " "``async def`` method." msgstr "" -#: ../../library/asyncio-eventloop.rst:895 +#: ../../library/asyncio-eventloop.rst:891 msgid "Connect *sock* to a remote socket at *address*." msgstr "" -#: ../../library/asyncio-eventloop.rst:897 +#: ../../library/asyncio-eventloop.rst:893 msgid "" "Asynchronous version of :meth:`socket.connect() `." msgstr "" -#: ../../library/asyncio-eventloop.rst:901 +#: ../../library/asyncio-eventloop.rst:897 msgid "" "``address`` no longer needs to be resolved. ``sock_connect`` will try to " "check if the *address* is already resolved by calling :func:`socket." @@ -1180,19 +1174,19 @@ msgid "" "*address*." msgstr "" -#: ../../library/asyncio-eventloop.rst:910 +#: ../../library/asyncio-eventloop.rst:906 msgid "" ":meth:`loop.create_connection` and :func:`asyncio.open_connection() " "`." msgstr "" -#: ../../library/asyncio-eventloop.rst:916 +#: ../../library/asyncio-eventloop.rst:912 msgid "" "Accept a connection. Modeled after the blocking :meth:`socket.accept() " "` method." msgstr "" -#: ../../library/asyncio-eventloop.rst:919 +#: ../../library/asyncio-eventloop.rst:915 msgid "" "The socket must be bound to an address and listening for connections. The " "return value is a pair ``(conn, address)`` where *conn* is a *new* socket " @@ -1200,64 +1194,64 @@ msgid "" "the address bound to the socket on the other end of the connection." msgstr "" -#: ../../library/asyncio-eventloop.rst:927 +#: ../../library/asyncio-eventloop.rst:923 msgid "" "Even though the method was always documented as a coroutine method, before " "Python 3.7 it returned a :class:`Future`. Since Python 3.7, this is an " "``async def`` method." msgstr "" -#: ../../library/asyncio-eventloop.rst:934 +#: ../../library/asyncio-eventloop.rst:930 msgid ":meth:`loop.create_server` and :func:`start_server`." msgstr "" -#: ../../library/asyncio-eventloop.rst:939 +#: ../../library/asyncio-eventloop.rst:935 msgid "" "Send a file using high-performance :mod:`os.sendfile` if possible. Return " "the total number of bytes sent." msgstr "" -#: ../../library/asyncio-eventloop.rst:942 +#: ../../library/asyncio-eventloop.rst:938 msgid "" "Asynchronous version of :meth:`socket.sendfile() `." msgstr "" -#: ../../library/asyncio-eventloop.rst:944 +#: ../../library/asyncio-eventloop.rst:940 msgid "" "*sock* must be a non-blocking :const:`socket.SOCK_STREAM` :class:`~socket." "socket`." msgstr "" -#: ../../library/asyncio-eventloop.rst:947 +#: ../../library/asyncio-eventloop.rst:943 msgid "*file* must be a regular file object open in binary mode." msgstr "" -#: ../../library/asyncio-eventloop.rst:956 +#: ../../library/asyncio-eventloop.rst:952 msgid "" "*fallback*, when set to ``True``, makes asyncio manually read and send the " "file when the platform does not support the sendfile syscall (e.g. Windows " "or SSL socket on Unix)." msgstr "" -#: ../../library/asyncio-eventloop.rst:960 +#: ../../library/asyncio-eventloop.rst:956 msgid "" "Raise :exc:`SendfileNotAvailableError` if the system does not support " "*sendfile* syscall and *fallback* is ``False``." msgstr "" -#: ../../library/asyncio-eventloop.rst:969 +#: ../../library/asyncio-eventloop.rst:965 msgid "DNS" msgstr "" -#: ../../library/asyncio-eventloop.rst:974 +#: ../../library/asyncio-eventloop.rst:970 msgid "Asynchronous version of :meth:`socket.getaddrinfo`." msgstr "" -#: ../../library/asyncio-eventloop.rst:978 +#: ../../library/asyncio-eventloop.rst:974 msgid "Asynchronous version of :meth:`socket.getnameinfo`." msgstr "" -#: ../../library/asyncio-eventloop.rst:980 +#: ../../library/asyncio-eventloop.rst:976 msgid "" "Both *getaddrinfo* and *getnameinfo* methods were always documented to " "return a coroutine, but prior to Python 3.7 they were, in fact, returning :" @@ -1265,67 +1259,67 @@ msgid "" "coroutines." msgstr "" -#: ../../library/asyncio-eventloop.rst:988 +#: ../../library/asyncio-eventloop.rst:984 msgid "Working with pipes" msgstr "" -#: ../../library/asyncio-eventloop.rst:992 +#: ../../library/asyncio-eventloop.rst:988 msgid "Register the read end of *pipe* in the event loop." msgstr "" -#: ../../library/asyncio-eventloop.rst:997 +#: ../../library/asyncio-eventloop.rst:993 msgid "*pipe* is a :term:`file-like object `." msgstr "" -#: ../../library/asyncio-eventloop.rst:999 +#: ../../library/asyncio-eventloop.rst:995 msgid "" "Return pair ``(transport, protocol)``, where *transport* supports the :class:" "`ReadTransport` interface and *protocol* is an object instantiated by the " "*protocol_factory*." msgstr "" -#: ../../library/asyncio-eventloop.rst:1003 -#: ../../library/asyncio-eventloop.rst:1019 +#: ../../library/asyncio-eventloop.rst:999 +#: ../../library/asyncio-eventloop.rst:1015 msgid "" "With :class:`SelectorEventLoop` event loop, the *pipe* is set to non-" "blocking mode." msgstr "" -#: ../../library/asyncio-eventloop.rst:1008 +#: ../../library/asyncio-eventloop.rst:1004 msgid "Register the write end of *pipe* in the event loop." msgstr "" -#: ../../library/asyncio-eventloop.rst:1013 +#: ../../library/asyncio-eventloop.rst:1009 msgid "*pipe* is :term:`file-like object `." msgstr "" -#: ../../library/asyncio-eventloop.rst:1015 +#: ../../library/asyncio-eventloop.rst:1011 msgid "" "Return pair ``(transport, protocol)``, where *transport* supports :class:" "`WriteTransport` interface and *protocol* is an object instantiated by the " "*protocol_factory*." msgstr "" -#: ../../library/asyncio-eventloop.rst:1024 +#: ../../library/asyncio-eventloop.rst:1020 msgid "" ":class:`SelectorEventLoop` does not support the above methods on Windows. " "Use :class:`ProactorEventLoop` instead for Windows." msgstr "" -#: ../../library/asyncio-eventloop.rst:1029 +#: ../../library/asyncio-eventloop.rst:1025 msgid "" "The :meth:`loop.subprocess_exec` and :meth:`loop.subprocess_shell` methods." msgstr "" -#: ../../library/asyncio-eventloop.rst:1034 +#: ../../library/asyncio-eventloop.rst:1030 msgid "Unix signals" msgstr "" -#: ../../library/asyncio-eventloop.rst:1038 +#: ../../library/asyncio-eventloop.rst:1034 msgid "Set *callback* as the handler for the *signum* signal." msgstr "" -#: ../../library/asyncio-eventloop.rst:1040 +#: ../../library/asyncio-eventloop.rst:1036 msgid "" "The callback will be invoked by *loop*, along with other queued callbacks " "and runnable coroutines of that event loop. Unlike signal handlers " @@ -1333,56 +1327,56 @@ msgid "" "function is allowed to interact with the event loop." msgstr "" -#: ../../library/asyncio-eventloop.rst:1045 +#: ../../library/asyncio-eventloop.rst:1041 msgid "" "Raise :exc:`ValueError` if the signal number is invalid or uncatchable. " "Raise :exc:`RuntimeError` if there is a problem setting up the handler." msgstr "" -#: ../../library/asyncio-eventloop.rst:1051 +#: ../../library/asyncio-eventloop.rst:1047 msgid "" "Like :func:`signal.signal`, this function must be invoked in the main thread." msgstr "" -#: ../../library/asyncio-eventloop.rst:1056 +#: ../../library/asyncio-eventloop.rst:1052 msgid "Remove the handler for the *sig* signal." msgstr "" -#: ../../library/asyncio-eventloop.rst:1058 +#: ../../library/asyncio-eventloop.rst:1054 msgid "" "Return ``True`` if the signal handler was removed, or ``False`` if no " "handler was set for the given signal." msgstr "" -#: ../../library/asyncio-eventloop.rst:1065 +#: ../../library/asyncio-eventloop.rst:1061 msgid "The :mod:`signal` module." msgstr "" -#: ../../library/asyncio-eventloop.rst:1069 +#: ../../library/asyncio-eventloop.rst:1065 msgid "Executing code in thread or process pools" msgstr "" -#: ../../library/asyncio-eventloop.rst:1073 +#: ../../library/asyncio-eventloop.rst:1069 msgid "Arrange for *func* to be called in the specified executor." msgstr "" -#: ../../library/asyncio-eventloop.rst:1075 +#: ../../library/asyncio-eventloop.rst:1071 msgid "" "The *executor* argument should be an :class:`concurrent.futures.Executor` " "instance. The default executor is used if *executor* is ``None``." msgstr "" -#: ../../library/asyncio-eventloop.rst:1119 +#: ../../library/asyncio-eventloop.rst:1115 msgid "This method returns a :class:`asyncio.Future` object." msgstr "" -#: ../../library/asyncio-eventloop.rst:1121 +#: ../../library/asyncio-eventloop.rst:1117 msgid "" "Use :func:`functools.partial` :ref:`to pass keyword arguments ` to *func*." msgstr "" -#: ../../library/asyncio-eventloop.rst:1124 +#: ../../library/asyncio-eventloop.rst:1120 msgid "" ":meth:`loop.run_in_executor` no longer configures the ``max_workers`` of the " "thread pool executor it creates, instead leaving it up to the thread pool " @@ -1390,38 +1384,38 @@ msgid "" "default." msgstr "" -#: ../../library/asyncio-eventloop.rst:1133 +#: ../../library/asyncio-eventloop.rst:1129 msgid "" "Set *executor* as the default executor used by :meth:`run_in_executor`. " "*executor* should be an instance of :class:`~concurrent.futures." "ThreadPoolExecutor`." msgstr "" -#: ../../library/asyncio-eventloop.rst:1137 +#: ../../library/asyncio-eventloop.rst:1133 msgid "" "Using an executor that is not an instance of :class:`~concurrent.futures." "ThreadPoolExecutor` is deprecated and will trigger an error in Python 3.9." msgstr "" -#: ../../library/asyncio-eventloop.rst:1142 +#: ../../library/asyncio-eventloop.rst:1138 msgid "" "*executor* must be an instance of :class:`concurrent.futures." "ThreadPoolExecutor`." msgstr "" -#: ../../library/asyncio-eventloop.rst:1147 +#: ../../library/asyncio-eventloop.rst:1143 msgid "Error Handling API" msgstr "" -#: ../../library/asyncio-eventloop.rst:1149 +#: ../../library/asyncio-eventloop.rst:1145 msgid "Allows customizing how exceptions are handled in the event loop." msgstr "" -#: ../../library/asyncio-eventloop.rst:1153 +#: ../../library/asyncio-eventloop.rst:1149 msgid "Set *handler* as the new event loop exception handler." msgstr "" -#: ../../library/asyncio-eventloop.rst:1155 +#: ../../library/asyncio-eventloop.rst:1151 msgid "" "If *handler* is ``None``, the default exception handler will be set. " "Otherwise, *handler* must be a callable with the signature matching ``(loop, " @@ -1430,146 +1424,146 @@ msgid "" "(see :meth:`call_exception_handler` documentation for details about context)." msgstr "" -#: ../../library/asyncio-eventloop.rst:1165 +#: ../../library/asyncio-eventloop.rst:1161 msgid "" "Return the current exception handler, or ``None`` if no custom exception " "handler was set." msgstr "" -#: ../../library/asyncio-eventloop.rst:1172 +#: ../../library/asyncio-eventloop.rst:1168 msgid "Default exception handler." msgstr "" -#: ../../library/asyncio-eventloop.rst:1174 +#: ../../library/asyncio-eventloop.rst:1170 msgid "" "This is called when an exception occurs and no exception handler is set. " "This can be called by a custom exception handler that wants to defer to the " "default handler behavior." msgstr "" -#: ../../library/asyncio-eventloop.rst:1178 +#: ../../library/asyncio-eventloop.rst:1174 msgid "" "*context* parameter has the same meaning as in :meth:" "`call_exception_handler`." msgstr "" -#: ../../library/asyncio-eventloop.rst:1183 +#: ../../library/asyncio-eventloop.rst:1179 msgid "Call the current event loop exception handler." msgstr "" -#: ../../library/asyncio-eventloop.rst:1185 +#: ../../library/asyncio-eventloop.rst:1181 msgid "" "*context* is a ``dict`` object containing the following keys (new keys may " "be introduced in future Python versions):" msgstr "" -#: ../../library/asyncio-eventloop.rst:1188 +#: ../../library/asyncio-eventloop.rst:1184 msgid "'message': Error message;" msgstr "" -#: ../../library/asyncio-eventloop.rst:1189 +#: ../../library/asyncio-eventloop.rst:1185 msgid "'exception' (optional): Exception object;" msgstr "" -#: ../../library/asyncio-eventloop.rst:1190 +#: ../../library/asyncio-eventloop.rst:1186 msgid "'future' (optional): :class:`asyncio.Future` instance;" msgstr "" -#: ../../library/asyncio-eventloop.rst:1191 +#: ../../library/asyncio-eventloop.rst:1187 msgid "'handle' (optional): :class:`asyncio.Handle` instance;" msgstr "" -#: ../../library/asyncio-eventloop.rst:1192 +#: ../../library/asyncio-eventloop.rst:1188 msgid "'protocol' (optional): :ref:`Protocol ` instance;" msgstr "" -#: ../../library/asyncio-eventloop.rst:1193 +#: ../../library/asyncio-eventloop.rst:1189 msgid "'transport' (optional): :ref:`Transport ` instance;" msgstr "" -#: ../../library/asyncio-eventloop.rst:1194 +#: ../../library/asyncio-eventloop.rst:1190 msgid "'socket' (optional): :class:`socket.socket` instance." msgstr "" -#: ../../library/asyncio-eventloop.rst:1198 +#: ../../library/asyncio-eventloop.rst:1194 msgid "" "This method should not be overloaded in subclassed event loops. For custom " "exception handling, use the :meth:`set_exception_handler()` method." msgstr "" -#: ../../library/asyncio-eventloop.rst:1203 +#: ../../library/asyncio-eventloop.rst:1199 msgid "Enabling debug mode" msgstr "" -#: ../../library/asyncio-eventloop.rst:1207 +#: ../../library/asyncio-eventloop.rst:1203 msgid "Get the debug mode (:class:`bool`) of the event loop." msgstr "" -#: ../../library/asyncio-eventloop.rst:1209 +#: ../../library/asyncio-eventloop.rst:1205 msgid "" "The default value is ``True`` if the environment variable :envvar:" "`PYTHONASYNCIODEBUG` is set to a non-empty string, ``False`` otherwise." msgstr "" -#: ../../library/asyncio-eventloop.rst:1215 +#: ../../library/asyncio-eventloop.rst:1211 msgid "Set the debug mode of the event loop." msgstr "" -#: ../../library/asyncio-eventloop.rst:1219 +#: ../../library/asyncio-eventloop.rst:1215 msgid "" "The new :ref:`Python Development Mode ` can now also be used to " "enable the debug mode." msgstr "" -#: ../../library/asyncio-eventloop.rst:1224 +#: ../../library/asyncio-eventloop.rst:1220 msgid "The :ref:`debug mode of asyncio `." msgstr "" -#: ../../library/asyncio-eventloop.rst:1228 +#: ../../library/asyncio-eventloop.rst:1224 msgid "Running Subprocesses" msgstr "" -#: ../../library/asyncio-eventloop.rst:1230 +#: ../../library/asyncio-eventloop.rst:1226 msgid "" "Methods described in this subsections are low-level. In regular async/await " "code consider using the high-level :func:`asyncio.create_subprocess_shell` " "and :func:`asyncio.create_subprocess_exec` convenience functions instead." msgstr "" -#: ../../library/asyncio-eventloop.rst:1237 +#: ../../library/asyncio-eventloop.rst:1233 msgid "" "The default asyncio event loop on **Windows** does not support subprocesses. " "See :ref:`Subprocess Support on Windows ` for " "details." msgstr "" -#: ../../library/asyncio-eventloop.rst:1245 +#: ../../library/asyncio-eventloop.rst:1241 msgid "" "Create a subprocess from one or more string arguments specified by *args*." msgstr "" -#: ../../library/asyncio-eventloop.rst:1248 +#: ../../library/asyncio-eventloop.rst:1244 msgid "*args* must be a list of strings represented by:" msgstr "" -#: ../../library/asyncio-eventloop.rst:1250 +#: ../../library/asyncio-eventloop.rst:1246 msgid ":class:`str`;" msgstr "" -#: ../../library/asyncio-eventloop.rst:1251 +#: ../../library/asyncio-eventloop.rst:1247 msgid "" "or :class:`bytes`, encoded to the :ref:`filesystem encoding `." msgstr "" -#: ../../library/asyncio-eventloop.rst:1254 +#: ../../library/asyncio-eventloop.rst:1250 msgid "" "The first string specifies the program executable, and the remaining strings " "specify the arguments. Together, string arguments form the ``argv`` of the " "program." msgstr "" -#: ../../library/asyncio-eventloop.rst:1258 +#: ../../library/asyncio-eventloop.rst:1254 msgid "" "This is similar to the standard library :class:`subprocess.Popen` class " "called with ``shell=False`` and the list of strings passed as the first " @@ -1577,136 +1571,136 @@ msgid "" "which is list of strings, *subprocess_exec* takes multiple string arguments." msgstr "" -#: ../../library/asyncio-eventloop.rst:1264 +#: ../../library/asyncio-eventloop.rst:1260 msgid "" "The *protocol_factory* must be a callable returning a subclass of the :class:" "`asyncio.SubprocessProtocol` class." msgstr "" -#: ../../library/asyncio-eventloop.rst:1267 +#: ../../library/asyncio-eventloop.rst:1263 msgid "Other parameters:" msgstr "" -#: ../../library/asyncio-eventloop.rst:1269 +#: ../../library/asyncio-eventloop.rst:1265 msgid "*stdin* can be any of these:" msgstr "" -#: ../../library/asyncio-eventloop.rst:1271 +#: ../../library/asyncio-eventloop.rst:1267 msgid "" "a file-like object representing a pipe to be connected to the subprocess's " "standard input stream using :meth:`~loop.connect_write_pipe`" msgstr "" -#: ../../library/asyncio-eventloop.rst:1274 -#: ../../library/asyncio-eventloop.rst:1286 -#: ../../library/asyncio-eventloop.rst:1298 +#: ../../library/asyncio-eventloop.rst:1270 +#: ../../library/asyncio-eventloop.rst:1282 +#: ../../library/asyncio-eventloop.rst:1294 msgid "" "the :const:`subprocess.PIPE` constant (default) which will create a new pipe " "and connect it," msgstr "" -#: ../../library/asyncio-eventloop.rst:1276 -#: ../../library/asyncio-eventloop.rst:1288 -#: ../../library/asyncio-eventloop.rst:1300 +#: ../../library/asyncio-eventloop.rst:1272 +#: ../../library/asyncio-eventloop.rst:1284 +#: ../../library/asyncio-eventloop.rst:1296 msgid "" "the value ``None`` which will make the subprocess inherit the file " "descriptor from this process" msgstr "" -#: ../../library/asyncio-eventloop.rst:1278 -#: ../../library/asyncio-eventloop.rst:1290 -#: ../../library/asyncio-eventloop.rst:1302 +#: ../../library/asyncio-eventloop.rst:1274 +#: ../../library/asyncio-eventloop.rst:1286 +#: ../../library/asyncio-eventloop.rst:1298 msgid "" "the :const:`subprocess.DEVNULL` constant which indicates that the special :" "data:`os.devnull` file will be used" msgstr "" -#: ../../library/asyncio-eventloop.rst:1281 +#: ../../library/asyncio-eventloop.rst:1277 msgid "*stdout* can be any of these:" msgstr "" -#: ../../library/asyncio-eventloop.rst:1283 +#: ../../library/asyncio-eventloop.rst:1279 msgid "" "a file-like object representing a pipe to be connected to the subprocess's " "standard output stream using :meth:`~loop.connect_write_pipe`" msgstr "" -#: ../../library/asyncio-eventloop.rst:1293 +#: ../../library/asyncio-eventloop.rst:1289 msgid "*stderr* can be any of these:" msgstr "" -#: ../../library/asyncio-eventloop.rst:1295 +#: ../../library/asyncio-eventloop.rst:1291 msgid "" "a file-like object representing a pipe to be connected to the subprocess's " "standard error stream using :meth:`~loop.connect_write_pipe`" msgstr "" -#: ../../library/asyncio-eventloop.rst:1304 +#: ../../library/asyncio-eventloop.rst:1300 msgid "" "the :const:`subprocess.STDOUT` constant which will connect the standard " "error stream to the process' standard output stream" msgstr "" -#: ../../library/asyncio-eventloop.rst:1307 +#: ../../library/asyncio-eventloop.rst:1303 msgid "" "All other keyword arguments are passed to :class:`subprocess.Popen` without " "interpretation, except for *bufsize*, *universal_newlines*, *shell*, *text*, " "*encoding* and *errors*, which should not be specified at all." msgstr "" -#: ../../library/asyncio-eventloop.rst:1312 +#: ../../library/asyncio-eventloop.rst:1308 msgid "" "The ``asyncio`` subprocess API does not support decoding the streams as " "text. :func:`bytes.decode` can be used to convert the bytes returned from " "the stream to text." msgstr "" -#: ../../library/asyncio-eventloop.rst:1316 +#: ../../library/asyncio-eventloop.rst:1312 msgid "" "See the constructor of the :class:`subprocess.Popen` class for documentation " "on other arguments." msgstr "" -#: ../../library/asyncio-eventloop.rst:1319 +#: ../../library/asyncio-eventloop.rst:1315 msgid "" "Returns a pair of ``(transport, protocol)``, where *transport* conforms to " "the :class:`asyncio.SubprocessTransport` base class and *protocol* is an " "object instantiated by the *protocol_factory*." msgstr "" -#: ../../library/asyncio-eventloop.rst:1327 +#: ../../library/asyncio-eventloop.rst:1323 msgid "" "Create a subprocess from *cmd*, which can be a :class:`str` or a :class:" "`bytes` string encoded to the :ref:`filesystem encoding `, using the platform's \"shell\" syntax." msgstr "" -#: ../../library/asyncio-eventloop.rst:1332 +#: ../../library/asyncio-eventloop.rst:1328 msgid "" "This is similar to the standard library :class:`subprocess.Popen` class " "called with ``shell=True``." msgstr "" -#: ../../library/asyncio-eventloop.rst:1335 +#: ../../library/asyncio-eventloop.rst:1331 msgid "" "The *protocol_factory* must be a callable returning a subclass of the :class:" "`SubprocessProtocol` class." msgstr "" -#: ../../library/asyncio-eventloop.rst:1338 +#: ../../library/asyncio-eventloop.rst:1334 msgid "" "See :meth:`~loop.subprocess_exec` for more details about the remaining " "arguments." msgstr "" -#: ../../library/asyncio-eventloop.rst:1341 +#: ../../library/asyncio-eventloop.rst:1337 msgid "" "Returns a pair of ``(transport, protocol)``, where *transport* conforms to " "the :class:`SubprocessTransport` base class and *protocol* is an object " "instantiated by the *protocol_factory*." msgstr "" -#: ../../library/asyncio-eventloop.rst:1346 +#: ../../library/asyncio-eventloop.rst:1342 msgid "" "It is the application's responsibility to ensure that all whitespace and " "special characters are quoted appropriately to avoid `shell injection " @@ -1716,105 +1710,105 @@ msgid "" "used to construct shell commands." msgstr "" -#: ../../library/asyncio-eventloop.rst:1355 +#: ../../library/asyncio-eventloop.rst:1351 msgid "Callback Handles" msgstr "" -#: ../../library/asyncio-eventloop.rst:1359 +#: ../../library/asyncio-eventloop.rst:1355 msgid "" "A callback wrapper object returned by :meth:`loop.call_soon`, :meth:`loop." "call_soon_threadsafe`." msgstr "" -#: ../../library/asyncio-eventloop.rst:1364 +#: ../../library/asyncio-eventloop.rst:1360 msgid "" "Cancel the callback. If the callback has already been canceled or executed, " "this method has no effect." msgstr "" -#: ../../library/asyncio-eventloop.rst:1369 +#: ../../library/asyncio-eventloop.rst:1365 msgid "Return ``True`` if the callback was cancelled." msgstr "" -#: ../../library/asyncio-eventloop.rst:1375 +#: ../../library/asyncio-eventloop.rst:1371 msgid "" "A callback wrapper object returned by :meth:`loop.call_later`, and :meth:" "`loop.call_at`." msgstr "" -#: ../../library/asyncio-eventloop.rst:1378 +#: ../../library/asyncio-eventloop.rst:1374 msgid "This class is a subclass of :class:`Handle`." msgstr "" -#: ../../library/asyncio-eventloop.rst:1382 +#: ../../library/asyncio-eventloop.rst:1378 msgid "Return a scheduled callback time as :class:`float` seconds." msgstr "" -#: ../../library/asyncio-eventloop.rst:1384 +#: ../../library/asyncio-eventloop.rst:1380 msgid "" "The time is an absolute timestamp, using the same time reference as :meth:" "`loop.time`." msgstr "" -#: ../../library/asyncio-eventloop.rst:1391 +#: ../../library/asyncio-eventloop.rst:1387 msgid "Server Objects" msgstr "" -#: ../../library/asyncio-eventloop.rst:1393 +#: ../../library/asyncio-eventloop.rst:1389 msgid "" "Server objects are created by :meth:`loop.create_server`, :meth:`loop." "create_unix_server`, :func:`start_server`, and :func:`start_unix_server` " "functions." msgstr "" -#: ../../library/asyncio-eventloop.rst:1397 +#: ../../library/asyncio-eventloop.rst:1393 msgid "Do not instantiate the class directly." msgstr "" -#: ../../library/asyncio-eventloop.rst:1401 +#: ../../library/asyncio-eventloop.rst:1397 msgid "" "*Server* objects are asynchronous context managers. When used in an ``async " "with`` statement, it's guaranteed that the Server object is closed and not " "accepting new connections when the ``async with`` statement is completed::" msgstr "" -#: ../../library/asyncio-eventloop.rst:1414 +#: ../../library/asyncio-eventloop.rst:1410 msgid "Server object is an asynchronous context manager since Python 3.7." msgstr "" -#: ../../library/asyncio-eventloop.rst:1419 +#: ../../library/asyncio-eventloop.rst:1415 msgid "" "Stop serving: close listening sockets and set the :attr:`sockets` attribute " "to ``None``." msgstr "" -#: ../../library/asyncio-eventloop.rst:1422 +#: ../../library/asyncio-eventloop.rst:1418 msgid "" "The sockets that represent existing incoming client connections are left " "open." msgstr "" -#: ../../library/asyncio-eventloop.rst:1425 +#: ../../library/asyncio-eventloop.rst:1421 msgid "" "The server is closed asynchronously, use the :meth:`wait_closed` coroutine " "to wait until the server is closed." msgstr "" -#: ../../library/asyncio-eventloop.rst:1430 +#: ../../library/asyncio-eventloop.rst:1426 msgid "Return the event loop associated with the server object." msgstr "" -#: ../../library/asyncio-eventloop.rst:1436 +#: ../../library/asyncio-eventloop.rst:1432 msgid "Start accepting connections." msgstr "" -#: ../../library/asyncio-eventloop.rst:1438 +#: ../../library/asyncio-eventloop.rst:1434 msgid "" "This method is idempotent, so it can be called when the server is already " "being serving." msgstr "" -#: ../../library/asyncio-eventloop.rst:1441 +#: ../../library/asyncio-eventloop.rst:1437 msgid "" "The *start_serving* keyword-only parameter to :meth:`loop.create_server` " "and :meth:`asyncio.start_server` allows creating a Server object that is not " @@ -1823,97 +1817,97 @@ msgid "" "accepting connections." msgstr "" -#: ../../library/asyncio-eventloop.rst:1452 +#: ../../library/asyncio-eventloop.rst:1448 msgid "" "Start accepting connections until the coroutine is cancelled. Cancellation " "of ``serve_forever`` task causes the server to be closed." msgstr "" -#: ../../library/asyncio-eventloop.rst:1456 +#: ../../library/asyncio-eventloop.rst:1452 msgid "" "This method can be called if the server is already accepting connections. " "Only one ``serve_forever`` task can exist per one *Server* object." msgstr "" -#: ../../library/asyncio-eventloop.rst:1478 +#: ../../library/asyncio-eventloop.rst:1474 msgid "Return ``True`` if the server is accepting new connections." msgstr "" -#: ../../library/asyncio-eventloop.rst:1484 +#: ../../library/asyncio-eventloop.rst:1480 msgid "Wait until the :meth:`close` method completes." msgstr "" -#: ../../library/asyncio-eventloop.rst:1488 +#: ../../library/asyncio-eventloop.rst:1484 msgid "List of :class:`socket.socket` objects the server is listening on." msgstr "" -#: ../../library/asyncio-eventloop.rst:1490 +#: ../../library/asyncio-eventloop.rst:1486 msgid "" "Prior to Python 3.7 ``Server.sockets`` used to return an internal list of " "server sockets directly. In 3.7 a copy of that list is returned." msgstr "" -#: ../../library/asyncio-eventloop.rst:1499 +#: ../../library/asyncio-eventloop.rst:1495 msgid "Event Loop Implementations" msgstr "" -#: ../../library/asyncio-eventloop.rst:1501 +#: ../../library/asyncio-eventloop.rst:1497 msgid "" "asyncio ships with two different event loop implementations: :class:" "`SelectorEventLoop` and :class:`ProactorEventLoop`." msgstr "" -#: ../../library/asyncio-eventloop.rst:1504 +#: ../../library/asyncio-eventloop.rst:1500 msgid "" "By default asyncio is configured to use :class:`SelectorEventLoop` on Unix " "and :class:`ProactorEventLoop` on Windows." msgstr "" -#: ../../library/asyncio-eventloop.rst:1510 +#: ../../library/asyncio-eventloop.rst:1506 msgid "An event loop based on the :mod:`selectors` module." msgstr "" -#: ../../library/asyncio-eventloop.rst:1512 +#: ../../library/asyncio-eventloop.rst:1508 msgid "" "Uses the most efficient *selector* available for the given platform. It is " "also possible to manually configure the exact selector implementation to be " "used::" msgstr "" -#: ../../library/asyncio-eventloop.rst:1524 +#: ../../library/asyncio-eventloop.rst:1520 msgid ":ref:`Availability `: Unix, Windows." msgstr "" -#: ../../library/asyncio-eventloop.rst:1529 +#: ../../library/asyncio-eventloop.rst:1525 msgid "An event loop for Windows that uses \"I/O Completion Ports\" (IOCP)." msgstr "" -#: ../../library/asyncio-eventloop.rst:1532 +#: ../../library/asyncio-eventloop.rst:1528 msgid ":ref:`Availability `: Windows." msgstr "" -#: ../../library/asyncio-eventloop.rst:1535 +#: ../../library/asyncio-eventloop.rst:1531 msgid "" "`MSDN documentation on I/O Completion Ports `_." msgstr "" -#: ../../library/asyncio-eventloop.rst:1541 +#: ../../library/asyncio-eventloop.rst:1537 msgid "Abstract base class for asyncio-compliant event loops." msgstr "" -#: ../../library/asyncio-eventloop.rst:1543 +#: ../../library/asyncio-eventloop.rst:1539 msgid "" "The :ref:`Event Loop Methods ` section lists all methods " "that an alternative implementation of ``AbstractEventLoop`` should have " "defined." msgstr "" -#: ../../library/asyncio-eventloop.rst:1549 +#: ../../library/asyncio-eventloop.rst:1545 msgid "Examples" msgstr "" -#: ../../library/asyncio-eventloop.rst:1551 +#: ../../library/asyncio-eventloop.rst:1547 msgid "" "Note that all examples in this section **purposefully** show how to use the " "low-level event loop APIs, such as :meth:`loop.run_forever` and :meth:`loop." @@ -1921,70 +1915,70 @@ msgid "" "consider using the high-level functions like :func:`asyncio.run`." msgstr "" -#: ../../library/asyncio-eventloop.rst:1561 +#: ../../library/asyncio-eventloop.rst:1557 msgid "Hello World with call_soon()" msgstr "" -#: ../../library/asyncio-eventloop.rst:1563 +#: ../../library/asyncio-eventloop.rst:1559 msgid "" "An example using the :meth:`loop.call_soon` method to schedule a callback. " "The callback displays ``\"Hello World\"`` and then stops the event loop::" msgstr "" -#: ../../library/asyncio-eventloop.rst:1587 +#: ../../library/asyncio-eventloop.rst:1583 msgid "" "A similar :ref:`Hello World ` example created with a coroutine " "and the :func:`run` function." msgstr "" -#: ../../library/asyncio-eventloop.rst:1594 +#: ../../library/asyncio-eventloop.rst:1590 msgid "Display the current date with call_later()" msgstr "" -#: ../../library/asyncio-eventloop.rst:1596 +#: ../../library/asyncio-eventloop.rst:1592 msgid "" "An example of a callback displaying the current date every second. The " "callback uses the :meth:`loop.call_later` method to reschedule itself after " "5 seconds, and then stops the event loop::" msgstr "" -#: ../../library/asyncio-eventloop.rst:1624 +#: ../../library/asyncio-eventloop.rst:1620 msgid "" "A similar :ref:`current date ` example created with a " "coroutine and the :func:`run` function." msgstr "" -#: ../../library/asyncio-eventloop.rst:1631 +#: ../../library/asyncio-eventloop.rst:1627 msgid "Watch a file descriptor for read events" msgstr "" -#: ../../library/asyncio-eventloop.rst:1633 +#: ../../library/asyncio-eventloop.rst:1629 msgid "" "Wait until a file descriptor received some data using the :meth:`loop." "add_reader` method and then close the event loop::" msgstr "" -#: ../../library/asyncio-eventloop.rst:1671 +#: ../../library/asyncio-eventloop.rst:1667 msgid "" "A similar :ref:`example ` using " "transports, protocols, and the :meth:`loop.create_connection` method." msgstr "" -#: ../../library/asyncio-eventloop.rst:1675 +#: ../../library/asyncio-eventloop.rst:1671 msgid "" "Another similar :ref:`example ` " "using the high-level :func:`asyncio.open_connection` function and streams." msgstr "" -#: ../../library/asyncio-eventloop.rst:1683 +#: ../../library/asyncio-eventloop.rst:1679 msgid "Set signal handlers for SIGINT and SIGTERM" msgstr "" -#: ../../library/asyncio-eventloop.rst:1685 +#: ../../library/asyncio-eventloop.rst:1681 msgid "(This ``signals`` example only works on Unix.)" msgstr "" -#: ../../library/asyncio-eventloop.rst:1687 +#: ../../library/asyncio-eventloop.rst:1683 msgid "" "Register handlers for signals :py:data:`SIGINT` and :py:data:`SIGTERM` using " "the :meth:`loop.add_signal_handler` method::" diff --git a/library/asyncio-policy.po b/library/asyncio-policy.po index ab6269ee24..259123a477 100644 --- a/library/asyncio-policy.po +++ b/library/asyncio-policy.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.7\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2021-09-07 06:52+0000\n" +"POT-Creation-Date: 2020-06-20 18:08+0800\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" @@ -286,7 +286,7 @@ msgstr "" #: ../../library/asyncio-policy.rst:211 msgid "" "There is no noticeable overhead when handling a big number of children " -"(*O(1)* each time a child terminates), but starting a thread per process " +"(*O(1)* each time a child terminates), but stating a thread per process " "requires extra memory." msgstr "" @@ -298,7 +298,7 @@ msgstr "" msgid "" "This implementation registers a :py:data:`SIGCHLD` signal handler on " "instantiation. That can break third-party code that installs a custom " -"handler for :py:data:`SIGCHLD` signal." +"handler for `SIGCHLD`. signal)." msgstr "" #: ../../library/asyncio-policy.rst:224 ../../library/asyncio-policy.rst:242 diff --git a/library/asyncio-protocol.po b/library/asyncio-protocol.po index f4de40629f..3f182072e3 100644 --- a/library/asyncio-protocol.po +++ b/library/asyncio-protocol.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.7\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2021-09-07 06:52+0000\n" +"POT-Creation-Date: 2020-06-20 18:08+0800\n" "PO-Revision-Date: 2018-05-23 14:39+0000\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -900,7 +900,7 @@ msgstr "" #: ../../library/asyncio-protocol.rst:686 msgid "" -"Subprocess Protocol instances should be constructed by protocol factories " +"Datagram Protocol instances should be constructed by protocol factories " "passed to the :meth:`loop.subprocess_exec` and :meth:`loop.subprocess_shell` " "methods." msgstr "" @@ -1022,7 +1022,7 @@ msgid "" msgstr "" #: ../../library/asyncio-protocol.rst:996 -msgid "The subprocess is created by the :meth:`loop.subprocess_exec` method::" +msgid "The subprocess is created by th :meth:`loop.subprocess_exec` method::" msgstr "" #: ../../library/asyncio-protocol.rst:1042 diff --git a/library/asyncio-subprocess.po b/library/asyncio-subprocess.po index b3eea90e4e..d686b3f455 100644 --- a/library/asyncio-subprocess.po +++ b/library/asyncio-subprocess.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.7\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2021-09-07 06:52+0000\n" +"POT-Creation-Date: 2020-06-20 18:08+0800\n" "PO-Revision-Date: 2018-05-23 14:39+0000\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -111,12 +111,13 @@ msgstr "" #: ../../library/asyncio-subprocess.rst:113 msgid "" -"Subprocesses are available for Windows if a :class:`ProactorEventLoop` is " -"used. See :ref:`Subprocess Support on Windows ` " -"for details." +"The default asyncio event loop implementation on **Windows** does not " +"support subprocesses. Subprocesses are available for Windows if a :class:" +"`ProactorEventLoop` is used. See :ref:`Subprocess Support on Windows " +"` for details." msgstr "" -#: ../../library/asyncio-subprocess.rst:119 +#: ../../library/asyncio-subprocess.rst:121 msgid "" "asyncio also has the following *low-level* APIs to work with subprocesses: :" "meth:`loop.subprocess_exec`, :meth:`loop.subprocess_shell`, :meth:`loop." @@ -125,22 +126,22 @@ msgid "" "Protocols `." msgstr "" -#: ../../library/asyncio-subprocess.rst:127 +#: ../../library/asyncio-subprocess.rst:129 msgid "Constants" msgstr "" -#: ../../library/asyncio-subprocess.rst:131 +#: ../../library/asyncio-subprocess.rst:133 msgid "Can be passed to the *stdin*, *stdout* or *stderr* parameters." msgstr "" -#: ../../library/asyncio-subprocess.rst:133 +#: ../../library/asyncio-subprocess.rst:135 msgid "" "If *PIPE* is passed to *stdin* argument, the :attr:`Process.stdin ` attribute will point to a :class:`StreamWriter` " "instance." msgstr "" -#: ../../library/asyncio-subprocess.rst:137 +#: ../../library/asyncio-subprocess.rst:139 msgid "" "If *PIPE* is passed to *stdout* or *stderr* arguments, the :attr:`Process." "stdout ` and :attr:`Process.stderr " @@ -148,24 +149,24 @@ msgid "" "`StreamReader` instances." msgstr "" -#: ../../library/asyncio-subprocess.rst:144 +#: ../../library/asyncio-subprocess.rst:146 msgid "" "Special value that can be used as the *stderr* argument and indicates that " "standard error should be redirected into standard output." msgstr "" -#: ../../library/asyncio-subprocess.rst:149 +#: ../../library/asyncio-subprocess.rst:151 msgid "" "Special value that can be used as the *stdin*, *stdout* or *stderr* argument " "to process creation functions. It indicates that the special file :data:`os." "devnull` will be used for the corresponding subprocess stream." msgstr "" -#: ../../library/asyncio-subprocess.rst:155 +#: ../../library/asyncio-subprocess.rst:157 msgid "Interacting with Subprocesses" msgstr "" -#: ../../library/asyncio-subprocess.rst:157 +#: ../../library/asyncio-subprocess.rst:159 msgid "" "Both :func:`create_subprocess_exec` and :func:`create_subprocess_shell` " "functions return instances of the *Process* class. *Process* is a high-" @@ -173,61 +174,61 @@ msgid "" "their completion." msgstr "" -#: ../../library/asyncio-subprocess.rst:164 +#: ../../library/asyncio-subprocess.rst:166 msgid "" "An object that wraps OS processes created by the :func:" "`create_subprocess_exec` and :func:`create_subprocess_shell` functions." msgstr "" -#: ../../library/asyncio-subprocess.rst:168 +#: ../../library/asyncio-subprocess.rst:170 msgid "" "This class is designed to have a similar API to the :class:`subprocess." "Popen` class, but there are some notable differences:" msgstr "" -#: ../../library/asyncio-subprocess.rst:172 +#: ../../library/asyncio-subprocess.rst:174 msgid "" "unlike Popen, Process instances do not have an equivalent to the :meth:" "`~subprocess.Popen.poll` method;" msgstr "" -#: ../../library/asyncio-subprocess.rst:175 +#: ../../library/asyncio-subprocess.rst:177 msgid "" "the :meth:`~asyncio.subprocess.Process.communicate` and :meth:`~asyncio." "subprocess.Process.wait` methods don't have a *timeout* parameter: use the :" "func:`wait_for` function;" msgstr "" -#: ../../library/asyncio-subprocess.rst:179 +#: ../../library/asyncio-subprocess.rst:181 msgid "" "the :meth:`Process.wait() ` method is " "asynchronous, whereas :meth:`subprocess.Popen.wait` method is implemented as " "a blocking busy loop;" msgstr "" -#: ../../library/asyncio-subprocess.rst:183 +#: ../../library/asyncio-subprocess.rst:185 msgid "the *universal_newlines* parameter is not supported." msgstr "" -#: ../../library/asyncio-subprocess.rst:185 +#: ../../library/asyncio-subprocess.rst:187 msgid "This class is :ref:`not thread safe `." msgstr "" -#: ../../library/asyncio-subprocess.rst:187 +#: ../../library/asyncio-subprocess.rst:189 msgid "" "See also the :ref:`Subprocess and Threads ` " "section." msgstr "" -#: ../../library/asyncio-subprocess.rst:192 +#: ../../library/asyncio-subprocess.rst:194 msgid "Wait for the child process to terminate." msgstr "" -#: ../../library/asyncio-subprocess.rst:194 +#: ../../library/asyncio-subprocess.rst:196 msgid "Set and return the :attr:`returncode` attribute." msgstr "" -#: ../../library/asyncio-subprocess.rst:198 +#: ../../library/asyncio-subprocess.rst:200 msgid "" "This method can deadlock when using ``stdout=PIPE`` or ``stderr=PIPE`` and " "the child process generates so much output that it blocks waiting for the OS " @@ -235,33 +236,33 @@ msgid "" "using pipes to avoid this condition." msgstr "" -#: ../../library/asyncio-subprocess.rst:206 +#: ../../library/asyncio-subprocess.rst:208 msgid "Interact with process:" msgstr "" -#: ../../library/asyncio-subprocess.rst:208 +#: ../../library/asyncio-subprocess.rst:210 msgid "send data to *stdin* (if *input* is not ``None``);" msgstr "" -#: ../../library/asyncio-subprocess.rst:209 +#: ../../library/asyncio-subprocess.rst:211 msgid "read data from *stdout* and *stderr*, until EOF is reached;" msgstr "" -#: ../../library/asyncio-subprocess.rst:210 +#: ../../library/asyncio-subprocess.rst:212 msgid "wait for process to terminate." msgstr "" -#: ../../library/asyncio-subprocess.rst:212 +#: ../../library/asyncio-subprocess.rst:214 msgid "" "The optional *input* argument is the data (:class:`bytes` object) that will " "be sent to the child process." msgstr "" -#: ../../library/asyncio-subprocess.rst:215 +#: ../../library/asyncio-subprocess.rst:217 msgid "Return a tuple ``(stdout_data, stderr_data)``." msgstr "" -#: ../../library/asyncio-subprocess.rst:217 +#: ../../library/asyncio-subprocess.rst:219 msgid "" "If either :exc:`BrokenPipeError` or :exc:`ConnectionResetError` exception is " "raised when writing *input* into *stdin*, the exception is ignored. This " @@ -269,7 +270,7 @@ msgid "" "*stdin*." msgstr "" -#: ../../library/asyncio-subprocess.rst:222 +#: ../../library/asyncio-subprocess.rst:224 msgid "" "If it is desired to send data to the process' *stdin*, the process needs to " "be created with ``stdin=PIPE``. Similarly, to get anything other than " @@ -277,71 +278,71 @@ msgid "" "``stdout=PIPE`` and/or ``stderr=PIPE`` arguments." msgstr "" -#: ../../library/asyncio-subprocess.rst:228 +#: ../../library/asyncio-subprocess.rst:230 msgid "" "Note, that the data read is buffered in memory, so do not use this method if " "the data size is large or unlimited." msgstr "" -#: ../../library/asyncio-subprocess.rst:233 +#: ../../library/asyncio-subprocess.rst:235 msgid "Sends the signal *signal* to the child process." msgstr "" -#: ../../library/asyncio-subprocess.rst:237 +#: ../../library/asyncio-subprocess.rst:239 msgid "" "On Windows, :py:data:`SIGTERM` is an alias for :meth:`terminate`. " "``CTRL_C_EVENT`` and ``CTRL_BREAK_EVENT`` can be sent to processes started " "with a *creationflags* parameter which includes ``CREATE_NEW_PROCESS_GROUP``." msgstr "" -#: ../../library/asyncio-subprocess.rst:244 +#: ../../library/asyncio-subprocess.rst:246 msgid "Stop the child process." msgstr "" -#: ../../library/asyncio-subprocess.rst:246 +#: ../../library/asyncio-subprocess.rst:248 msgid "" "On POSIX systems this method sends :py:data:`signal.SIGTERM` to the child " "process." msgstr "" -#: ../../library/asyncio-subprocess.rst:249 +#: ../../library/asyncio-subprocess.rst:251 msgid "" "On Windows the Win32 API function :c:func:`TerminateProcess` is called to " "stop the child process." msgstr "" -#: ../../library/asyncio-subprocess.rst:254 -msgid "Kill the child process." +#: ../../library/asyncio-subprocess.rst:256 +msgid "Kill the child." msgstr "" -#: ../../library/asyncio-subprocess.rst:256 +#: ../../library/asyncio-subprocess.rst:258 msgid "" "On POSIX systems this method sends :py:data:`SIGKILL` to the child process." msgstr "" -#: ../../library/asyncio-subprocess.rst:259 +#: ../../library/asyncio-subprocess.rst:261 msgid "On Windows this method is an alias for :meth:`terminate`." msgstr "" -#: ../../library/asyncio-subprocess.rst:263 +#: ../../library/asyncio-subprocess.rst:265 msgid "" "Standard input stream (:class:`StreamWriter`) or ``None`` if the process was " "created with ``stdin=None``." msgstr "" -#: ../../library/asyncio-subprocess.rst:268 +#: ../../library/asyncio-subprocess.rst:270 msgid "" "Standard output stream (:class:`StreamReader`) or ``None`` if the process " "was created with ``stdout=None``." msgstr "" -#: ../../library/asyncio-subprocess.rst:273 +#: ../../library/asyncio-subprocess.rst:275 msgid "" "Standard error stream (:class:`StreamReader`) or ``None`` if the process was " "created with ``stderr=None``." msgstr "" -#: ../../library/asyncio-subprocess.rst:278 +#: ../../library/asyncio-subprocess.rst:280 msgid "" "Use the :meth:`communicate` method rather than :attr:`process.stdin.write() " "`, :attr:`await process.stdout.read() ` or :attr:`await " @@ -349,94 +350,94 @@ msgid "" "reading or writing and blocking the child process." msgstr "" -#: ../../library/asyncio-subprocess.rst:287 +#: ../../library/asyncio-subprocess.rst:289 msgid "Process identification number (PID)." msgstr "" -#: ../../library/asyncio-subprocess.rst:289 +#: ../../library/asyncio-subprocess.rst:291 msgid "" "Note that for processes created by the :func:`create_subprocess_shell` " "function, this attribute is the PID of the spawned shell." msgstr "" -#: ../../library/asyncio-subprocess.rst:294 +#: ../../library/asyncio-subprocess.rst:296 msgid "Return code of the process when it exits." msgstr "" -#: ../../library/asyncio-subprocess.rst:296 +#: ../../library/asyncio-subprocess.rst:298 msgid "A ``None`` value indicates that the process has not terminated yet." msgstr "" -#: ../../library/asyncio-subprocess.rst:298 +#: ../../library/asyncio-subprocess.rst:300 msgid "" "A negative value ``-N`` indicates that the child was terminated by signal " "``N`` (POSIX only)." msgstr "" -#: ../../library/asyncio-subprocess.rst:305 +#: ../../library/asyncio-subprocess.rst:307 #, fuzzy msgid "Subprocess and Threads" msgstr "子程序" -#: ../../library/asyncio-subprocess.rst:307 +#: ../../library/asyncio-subprocess.rst:309 msgid "" "Standard asyncio event loop supports running subprocesses from different " "threads by default." msgstr "" -#: ../../library/asyncio-subprocess.rst:310 +#: ../../library/asyncio-subprocess.rst:312 msgid "" "On Windows subprocesses are provided by :class:`ProactorEventLoop` only " "(default), :class:`SelectorEventLoop` has no subprocess support." msgstr "" -#: ../../library/asyncio-subprocess.rst:313 +#: ../../library/asyncio-subprocess.rst:315 msgid "" "On UNIX *child watchers* are used for subprocess finish waiting, see :ref:" "`asyncio-watchers` for more info." msgstr "" -#: ../../library/asyncio-subprocess.rst:319 +#: ../../library/asyncio-subprocess.rst:321 msgid "" "UNIX switched to use :class:`ThreadedChildWatcher` for spawning subprocesses " "from different threads without any limitation." msgstr "" -#: ../../library/asyncio-subprocess.rst:322 +#: ../../library/asyncio-subprocess.rst:324 msgid "" "Spawning a subprocess with *inactive* current child watcher raises :exc:" "`RuntimeError`." msgstr "" -#: ../../library/asyncio-subprocess.rst:325 +#: ../../library/asyncio-subprocess.rst:327 msgid "" "Note that alternative event loop implementations might have own limitations; " "please refer to their documentation." msgstr "" -#: ../../library/asyncio-subprocess.rst:330 +#: ../../library/asyncio-subprocess.rst:332 msgid "" "The :ref:`Concurrency and multithreading in asyncio ` section." msgstr "" -#: ../../library/asyncio-subprocess.rst:335 +#: ../../library/asyncio-subprocess.rst:337 msgid "Examples" msgstr "" -#: ../../library/asyncio-subprocess.rst:337 +#: ../../library/asyncio-subprocess.rst:339 msgid "" "An example using the :class:`~asyncio.subprocess.Process` class to control a " "subprocess and the :class:`StreamReader` class to read from its standard " "output." msgstr "" -#: ../../library/asyncio-subprocess.rst:343 +#: ../../library/asyncio-subprocess.rst:345 msgid "" "The subprocess is created by the :func:`create_subprocess_exec` function::" msgstr "" -#: ../../library/asyncio-subprocess.rst:370 +#: ../../library/asyncio-subprocess.rst:372 msgid "" "See also the :ref:`same example ` written " "using low-level APIs." diff --git a/library/asyncio-sync.po b/library/asyncio-sync.po index 30ac7b3988..ab2bca38fe 100644 --- a/library/asyncio-sync.po +++ b/library/asyncio-sync.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.7\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2021-09-07 06:52+0000\n" +"POT-Creation-Date: 2020-06-20 18:08+0800\n" "PO-Revision-Date: 2018-05-23 14:39+0000\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -153,9 +153,9 @@ msgstr "" #: ../../library/asyncio-sync.rst:106 msgid "" "An Event object manages an internal flag that can be set to *true* with the :" -"meth:`~Event.set` method and reset to *false* with the :meth:`clear` " -"method. The :meth:`~Event.wait` method blocks until the flag is set to " -"*true*. The flag is set to *false* initially." +"meth:`set` method and reset to *false* with the :meth:`clear` method. The :" +"meth:`wait` method blocks until the flag is set to *true*. The flag is set " +"to *false* initially." msgstr "" #: ../../library/asyncio-sync.rst:117 @@ -169,7 +169,7 @@ msgstr "" #: ../../library/asyncio-sync.rst:144 msgid "" "If the event is set, return ``True`` immediately. Otherwise block until " -"another task calls :meth:`~Event.set`." +"another task calls :meth:`set`." msgstr "" #: ../../library/asyncio-sync.rst:149 @@ -186,8 +186,8 @@ msgstr "" #: ../../library/asyncio-sync.rst:158 msgid "" -"Tasks awaiting on :meth:`~Event.wait` will now block until the :meth:`~Event." -"set` method is called again." +"Tasks awaiting on :meth:`wait` will now block until the :meth:`set` method " +"is called again." msgstr "" #: ../../library/asyncio-sync.rst:163 diff --git a/library/asyncio-task.po b/library/asyncio-task.po index 0e1ad3b763..af18566207 100644 --- a/library/asyncio-task.po +++ b/library/asyncio-task.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.7\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2021-09-07 06:52+0000\n" +"POT-Creation-Date: 2020-06-20 18:08+0800\n" "PO-Revision-Date: 2018-05-23 14:39+0000\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -213,8 +213,8 @@ msgid "" "ideally only be called once." msgstr "" -#: ../../library/asyncio-task.rst:230 ../../library/asyncio-task.rst:360 -#: ../../library/asyncio-task.rst:481 ../../library/asyncio-task.rst:613 +#: ../../library/asyncio-task.rst:230 ../../library/asyncio-task.rst:356 +#: ../../library/asyncio-task.rst:466 ../../library/asyncio-task.rst:598 msgid "Example::" msgstr "" @@ -256,7 +256,7 @@ msgid "" "low-level :func:`asyncio.ensure_future` function can be used instead::" msgstr "" -#: ../../library/asyncio-task.rst:279 ../../library/asyncio-task.rst:795 +#: ../../library/asyncio-task.rst:279 ../../library/asyncio-task.rst:780 msgid "Added the ``name`` parameter." msgstr "" @@ -279,49 +279,42 @@ msgid "" "``sleep()`` always suspends the current task, allowing other tasks to run." msgstr "" -#: ../../library/asyncio-task.rst:296 -msgid "" -"Setting the delay to 0 provides an optimized path to allow other tasks to " -"run. This can be used by long-running functions to avoid blocking the event " -"loop for the full duration of the function call." -msgstr "" - -#: ../../library/asyncio-task.rst:302 ../../library/asyncio-task.rst:357 -#: ../../library/asyncio-task.rst:447 ../../library/asyncio-task.rst:478 -#: ../../library/asyncio-task.rst:565 ../../library/asyncio-task.rst:612 -#: ../../library/asyncio-task.rst:800 +#: ../../library/asyncio-task.rst:298 ../../library/asyncio-task.rst:353 +#: ../../library/asyncio-task.rst:432 ../../library/asyncio-task.rst:463 +#: ../../library/asyncio-task.rst:550 ../../library/asyncio-task.rst:597 +#: ../../library/asyncio-task.rst:785 msgid "The *loop* parameter." msgstr "" -#: ../../library/asyncio-task.rst:305 +#: ../../library/asyncio-task.rst:301 msgid "" "Example of coroutine displaying the current date every second for 5 seconds::" msgstr "" -#: ../../library/asyncio-task.rst:324 +#: ../../library/asyncio-task.rst:320 msgid "Running Tasks Concurrently" msgstr "" -#: ../../library/asyncio-task.rst:328 +#: ../../library/asyncio-task.rst:324 msgid "" "Run :ref:`awaitable objects ` in the *aws* sequence " "*concurrently*." msgstr "" -#: ../../library/asyncio-task.rst:331 +#: ../../library/asyncio-task.rst:327 msgid "" "If any awaitable in *aws* is a coroutine, it is automatically scheduled as a " "Task." msgstr "" -#: ../../library/asyncio-task.rst:334 +#: ../../library/asyncio-task.rst:330 msgid "" "If all awaitables are completed successfully, the result is an aggregate " "list of returned values. The order of result values corresponds to the " "order of awaitables in *aws*." msgstr "" -#: ../../library/asyncio-task.rst:338 +#: ../../library/asyncio-task.rst:334 msgid "" "If *return_exceptions* is ``False`` (default), the first raised exception is " "immediately propagated to the task that awaits on ``gather()``. Other " @@ -329,19 +322,19 @@ msgid "" "run." msgstr "" -#: ../../library/asyncio-task.rst:343 +#: ../../library/asyncio-task.rst:339 msgid "" "If *return_exceptions* is ``True``, exceptions are treated the same as " "successful results, and aggregated in the result list." msgstr "" -#: ../../library/asyncio-task.rst:346 +#: ../../library/asyncio-task.rst:342 msgid "" "If ``gather()`` is *cancelled*, all submitted awaitables (that have not " "completed yet) are also *cancelled*." msgstr "" -#: ../../library/asyncio-task.rst:349 +#: ../../library/asyncio-task.rst:345 msgid "" "If any Task or Future from the *aws* sequence is *cancelled*, it is treated " "as if it raised :exc:`CancelledError` -- the ``gather()`` call is **not** " @@ -349,44 +342,35 @@ msgid "" "submitted Task/Future to cause other Tasks/Futures to be cancelled." msgstr "" -#: ../../library/asyncio-task.rst:398 -msgid "" -"If *return_exceptions* is False, cancelling gather() after it has been " -"marked done won't cancel any submitted awaitables. For instance, gather can " -"be marked done after propagating an exception to the caller, therefore, " -"calling ``gather.cancel()`` after catching an exception (raised by one of " -"the awaitables) from gather won't cancel any other awaitables." -msgstr "" - -#: ../../library/asyncio-task.rst:405 +#: ../../library/asyncio-task.rst:390 msgid "" "If the *gather* itself is cancelled, the cancellation is propagated " "regardless of *return_exceptions*." msgstr "" -#: ../../library/asyncio-task.rst:411 +#: ../../library/asyncio-task.rst:396 msgid "Shielding From Cancellation" msgstr "" -#: ../../library/asyncio-task.rst:415 +#: ../../library/asyncio-task.rst:400 msgid "" "Protect an :ref:`awaitable object ` from being :meth:" "`cancelled `." msgstr "" -#: ../../library/asyncio-task.rst:418 ../../library/asyncio-task.rst:458 +#: ../../library/asyncio-task.rst:403 ../../library/asyncio-task.rst:443 msgid "If *aw* is a coroutine it is automatically scheduled as a Task." msgstr "" -#: ../../library/asyncio-task.rst:420 +#: ../../library/asyncio-task.rst:405 msgid "The statement::" msgstr "" -#: ../../library/asyncio-task.rst:424 +#: ../../library/asyncio-task.rst:409 msgid "is equivalent to::" msgstr "" -#: ../../library/asyncio-task.rst:428 +#: ../../library/asyncio-task.rst:413 msgid "" "*except* that if the coroutine containing it is cancelled, the Task running " "in ``something()`` is not cancelled. From the point of view of " @@ -395,211 +379,211 @@ msgid "" "`CancelledError`." msgstr "" -#: ../../library/asyncio-task.rst:434 +#: ../../library/asyncio-task.rst:419 msgid "" "If ``something()`` is cancelled by other means (i.e. from within itself) " "that would also cancel ``shield()``." msgstr "" -#: ../../library/asyncio-task.rst:437 +#: ../../library/asyncio-task.rst:422 msgid "" "If it is desired to completely ignore cancellation (not recommended) the " "``shield()`` function should be combined with a try/except clause, as " "follows::" msgstr "" -#: ../../library/asyncio-task.rst:451 +#: ../../library/asyncio-task.rst:436 msgid "Timeouts" msgstr "" -#: ../../library/asyncio-task.rst:455 +#: ../../library/asyncio-task.rst:440 msgid "" "Wait for the *aw* :ref:`awaitable ` to complete with a " "timeout." msgstr "" -#: ../../library/asyncio-task.rst:460 +#: ../../library/asyncio-task.rst:445 msgid "" "*timeout* can either be ``None`` or a float or int number of seconds to wait " "for. If *timeout* is ``None``, block until the future completes." msgstr "" -#: ../../library/asyncio-task.rst:464 +#: ../../library/asyncio-task.rst:449 msgid "" "If a timeout occurs, it cancels the task and raises :exc:`asyncio." "TimeoutError`." msgstr "" -#: ../../library/asyncio-task.rst:467 +#: ../../library/asyncio-task.rst:452 msgid "" "To avoid the task :meth:`cancellation `, wrap it in :func:" "`shield`." msgstr "" -#: ../../library/asyncio-task.rst:470 +#: ../../library/asyncio-task.rst:455 msgid "" "The function will wait until the future is actually cancelled, so the total " "wait time may exceed the *timeout*. If an exception happens during " "cancellation, it is propagated." msgstr "" -#: ../../library/asyncio-task.rst:474 +#: ../../library/asyncio-task.rst:459 msgid "If the wait is cancelled, the future *aw* is also cancelled." msgstr "" -#: ../../library/asyncio-task.rst:501 +#: ../../library/asyncio-task.rst:486 msgid "" "When *aw* is cancelled due to a timeout, ``wait_for`` waits for *aw* to be " "cancelled. Previously, it raised :exc:`asyncio.TimeoutError` immediately." msgstr "" -#: ../../library/asyncio-task.rst:508 +#: ../../library/asyncio-task.rst:493 msgid "Waiting Primitives" msgstr "" -#: ../../library/asyncio-task.rst:513 +#: ../../library/asyncio-task.rst:498 msgid "" -"Run :ref:`awaitable objects ` in the *aws* iterable " +"Run :ref:`awaitable objects ` in the *aws* set " "concurrently and block until the condition specified by *return_when*." msgstr "" -#: ../../library/asyncio-task.rst:517 -msgid "The *aws* iterable must not be empty." +#: ../../library/asyncio-task.rst:502 +msgid "The *aws* set must not be empty." msgstr "" -#: ../../library/asyncio-task.rst:519 +#: ../../library/asyncio-task.rst:504 msgid "Returns two sets of Tasks/Futures: ``(done, pending)``." msgstr "" -#: ../../library/asyncio-task.rst:521 +#: ../../library/asyncio-task.rst:506 msgid "Usage::" msgstr "" -#: ../../library/asyncio-task.rst:525 +#: ../../library/asyncio-task.rst:510 msgid "" "*timeout* (a float or int), if specified, can be used to control the maximum " "number of seconds to wait before returning." msgstr "" -#: ../../library/asyncio-task.rst:528 +#: ../../library/asyncio-task.rst:513 msgid "" "Note that this function does not raise :exc:`asyncio.TimeoutError`. Futures " "or Tasks that aren't done when the timeout occurs are simply returned in the " "second set." msgstr "" -#: ../../library/asyncio-task.rst:532 +#: ../../library/asyncio-task.rst:517 msgid "" "*return_when* indicates when this function should return. It must be one of " "the following constants:" msgstr "" -#: ../../library/asyncio-task.rst:538 +#: ../../library/asyncio-task.rst:523 msgid "Constant" msgstr "" -#: ../../library/asyncio-task.rst:538 +#: ../../library/asyncio-task.rst:523 msgid "Description" msgstr "描述" -#: ../../library/asyncio-task.rst:540 +#: ../../library/asyncio-task.rst:525 msgid ":const:`FIRST_COMPLETED`" msgstr "" -#: ../../library/asyncio-task.rst:540 +#: ../../library/asyncio-task.rst:525 msgid "The function will return when any future finishes or is cancelled." msgstr "" -#: ../../library/asyncio-task.rst:543 +#: ../../library/asyncio-task.rst:528 msgid ":const:`FIRST_EXCEPTION`" msgstr "" -#: ../../library/asyncio-task.rst:543 +#: ../../library/asyncio-task.rst:528 msgid "" "The function will return when any future finishes by raising an exception. " "If no future raises an exception then it is equivalent to :const:" "`ALL_COMPLETED`." msgstr "" -#: ../../library/asyncio-task.rst:549 +#: ../../library/asyncio-task.rst:534 msgid ":const:`ALL_COMPLETED`" msgstr "" -#: ../../library/asyncio-task.rst:549 +#: ../../library/asyncio-task.rst:534 msgid "The function will return when all futures finish or are cancelled." msgstr "" -#: ../../library/asyncio-task.rst:553 +#: ../../library/asyncio-task.rst:538 msgid "" "Unlike :func:`~asyncio.wait_for`, ``wait()`` does not cancel the futures " "when a timeout occurs." msgstr "" -#: ../../library/asyncio-task.rst:558 +#: ../../library/asyncio-task.rst:543 msgid "" "If any awaitable in *aws* is a coroutine, it is automatically scheduled as a " "Task. Passing coroutines objects to ``wait()`` directly is deprecated as it " "leads to :ref:`confusing behavior `." msgstr "" -#: ../../library/asyncio-task.rst:570 +#: ../../library/asyncio-task.rst:555 msgid "" "``wait()`` schedules coroutines as Tasks automatically and later returns " "those implicitly created Task objects in ``(done, pending)`` sets. " "Therefore the following code won't work as expected::" msgstr "" -#: ../../library/asyncio-task.rst:583 +#: ../../library/asyncio-task.rst:568 msgid "Here is how the above snippet can be fixed::" msgstr "" -#: ../../library/asyncio-task.rst:596 +#: ../../library/asyncio-task.rst:581 msgid "Passing coroutine objects to ``wait()`` directly is deprecated." msgstr "" -#: ../../library/asyncio-task.rst:602 +#: ../../library/asyncio-task.rst:587 msgid "" -"Run :ref:`awaitable objects ` in the *aws* iterable " +"Run :ref:`awaitable objects ` in the *aws* set " "concurrently. Return an iterator of coroutines. Each coroutine returned can " -"be awaited to get the earliest next result from the iterable of the " -"remaining awaitables." +"be awaited to get the earliest next result from the set of the remaining " +"awaitables." msgstr "" -#: ../../library/asyncio-task.rst:607 +#: ../../library/asyncio-task.rst:592 msgid "" "Raises :exc:`asyncio.TimeoutError` if the timeout occurs before all Futures " "are done." msgstr "" -#: ../../library/asyncio-task.rst:621 +#: ../../library/asyncio-task.rst:606 msgid "Running in Threads" msgstr "" -#: ../../library/asyncio-task.rst:625 +#: ../../library/asyncio-task.rst:610 msgid "Asynchronously run function *func* in a separate thread." msgstr "" -#: ../../library/asyncio-task.rst:627 +#: ../../library/asyncio-task.rst:612 msgid "" "Any \\*args and \\*\\*kwargs supplied for this function are directly passed " -"to *func*. Also, the current :class:`contextvars.Context` is propagated, " +"to *func*. Also, the current :class:`contextvars.Context` is propogated, " "allowing context variables from the event loop thread to be accessed in the " "separate thread." msgstr "" -#: ../../library/asyncio-task.rst:632 +#: ../../library/asyncio-task.rst:617 msgid "" "Return a coroutine that can be awaited to get the eventual result of *func*." msgstr "" -#: ../../library/asyncio-task.rst:634 +#: ../../library/asyncio-task.rst:619 msgid "" "This coroutine function is primarily intended to be used for executing IO-" "bound functions/methods that would otherwise block the event loop if they " "were ran in the main thread. For example::" msgstr "" -#: ../../library/asyncio-task.rst:664 +#: ../../library/asyncio-task.rst:649 msgid "" "Directly calling `blocking_io()` in any coroutine would block the event loop " "for its duration, resulting in an additional 1 second of run time. Instead, " @@ -607,7 +591,7 @@ msgid "" "blocking the event loop." msgstr "" -#: ../../library/asyncio-task.rst:671 +#: ../../library/asyncio-task.rst:656 msgid "" "Due to the :term:`GIL`, `asyncio.to_thread()` can typically only be used to " "make IO-bound functions non-blocking. However, for extension modules that " @@ -615,81 +599,81 @@ msgid "" "`asyncio.to_thread()` can also be used for CPU-bound functions." msgstr "" -#: ../../library/asyncio-task.rst:680 +#: ../../library/asyncio-task.rst:665 msgid "Scheduling From Other Threads" msgstr "" -#: ../../library/asyncio-task.rst:684 +#: ../../library/asyncio-task.rst:669 msgid "Submit a coroutine to the given event loop. Thread-safe." msgstr "" -#: ../../library/asyncio-task.rst:686 +#: ../../library/asyncio-task.rst:671 msgid "" "Return a :class:`concurrent.futures.Future` to wait for the result from " "another OS thread." msgstr "" -#: ../../library/asyncio-task.rst:689 +#: ../../library/asyncio-task.rst:674 msgid "" "This function is meant to be called from a different OS thread than the one " "where the event loop is running. Example::" msgstr "" -#: ../../library/asyncio-task.rst:701 +#: ../../library/asyncio-task.rst:686 msgid "" "If an exception is raised in the coroutine, the returned Future will be " "notified. It can also be used to cancel the task in the event loop::" msgstr "" -#: ../../library/asyncio-task.rst:715 +#: ../../library/asyncio-task.rst:700 msgid "" "See the :ref:`concurrency and multithreading ` " "section of the documentation." msgstr "" -#: ../../library/asyncio-task.rst:718 +#: ../../library/asyncio-task.rst:703 msgid "" "Unlike other asyncio functions this function requires the *loop* argument to " "be passed explicitly." msgstr "" -#: ../../library/asyncio-task.rst:725 +#: ../../library/asyncio-task.rst:710 msgid "Introspection" msgstr "" -#: ../../library/asyncio-task.rst:730 +#: ../../library/asyncio-task.rst:715 msgid "" "Return the currently running :class:`Task` instance, or ``None`` if no task " "is running." msgstr "" -#: ../../library/asyncio-task.rst:733 +#: ../../library/asyncio-task.rst:718 msgid "" "If *loop* is ``None`` :func:`get_running_loop` is used to get the current " "loop." msgstr "" -#: ../../library/asyncio-task.rst:741 +#: ../../library/asyncio-task.rst:726 msgid "Return a set of not yet finished :class:`Task` objects run by the loop." msgstr "" -#: ../../library/asyncio-task.rst:744 +#: ../../library/asyncio-task.rst:729 msgid "" "If *loop* is ``None``, :func:`get_running_loop` is used for getting current " "loop." msgstr "" -#: ../../library/asyncio-task.rst:751 +#: ../../library/asyncio-task.rst:736 msgid "Task Object" msgstr "" -#: ../../library/asyncio-task.rst:755 +#: ../../library/asyncio-task.rst:740 msgid "" "A :class:`Future-like ` object that runs a Python :ref:`coroutine " "`. Not thread-safe." msgstr "" -#: ../../library/asyncio-task.rst:758 +#: ../../library/asyncio-task.rst:743 msgid "" "Tasks are used to run coroutines in event loops. If a coroutine awaits on a " "Future, the Task suspends the execution of the coroutine and waits for the " @@ -697,21 +681,21 @@ msgid "" "wrapped coroutine resumes." msgstr "" -#: ../../library/asyncio-task.rst:764 +#: ../../library/asyncio-task.rst:749 msgid "" "Event loops use cooperative scheduling: an event loop runs one Task at a " "time. While a Task awaits for the completion of a Future, the event loop " "runs other Tasks, callbacks, or performs IO operations." msgstr "" -#: ../../library/asyncio-task.rst:769 +#: ../../library/asyncio-task.rst:754 msgid "" "Use the high-level :func:`asyncio.create_task` function to create Tasks, or " "the low-level :meth:`loop.create_task` or :func:`ensure_future` functions. " "Manual instantiation of Tasks is discouraged." msgstr "" -#: ../../library/asyncio-task.rst:774 +#: ../../library/asyncio-task.rst:759 msgid "" "To cancel a running Task use the :meth:`cancel` method. Calling it will " "cause the Task to throw a :exc:`CancelledError` exception into the wrapped " @@ -719,41 +703,41 @@ msgid "" "cancellation, the Future object will be cancelled." msgstr "" -#: ../../library/asyncio-task.rst:779 +#: ../../library/asyncio-task.rst:764 msgid "" ":meth:`cancelled` can be used to check if the Task was cancelled. The method " "returns ``True`` if the wrapped coroutine did not suppress the :exc:" "`CancelledError` exception and was actually cancelled." msgstr "" -#: ../../library/asyncio-task.rst:784 +#: ../../library/asyncio-task.rst:769 msgid "" ":class:`asyncio.Task` inherits from :class:`Future` all of its APIs except :" "meth:`Future.set_result` and :meth:`Future.set_exception`." msgstr "" -#: ../../library/asyncio-task.rst:788 +#: ../../library/asyncio-task.rst:773 msgid "" "Tasks support the :mod:`contextvars` module. When a Task is created it " "copies the current context and later runs its coroutine in the copied " "context." msgstr "" -#: ../../library/asyncio-task.rst:792 +#: ../../library/asyncio-task.rst:777 msgid "Added support for the :mod:`contextvars` module." msgstr "" -#: ../../library/asyncio-task.rst:803 +#: ../../library/asyncio-task.rst:788 msgid "Request the Task to be cancelled." msgstr "" -#: ../../library/asyncio-task.rst:805 +#: ../../library/asyncio-task.rst:790 msgid "" "This arranges for a :exc:`CancelledError` exception to be thrown into the " "wrapped coroutine on the next cycle of the event loop." msgstr "" -#: ../../library/asyncio-task.rst:808 +#: ../../library/asyncio-task.rst:793 msgid "" "The coroutine then has a chance to clean up or even deny the request by " "suppressing the exception with a :keyword:`try` ... ... ``except " @@ -763,103 +747,103 @@ msgid "" "is actively discouraged." msgstr "" -#: ../../library/asyncio-task.rst:816 +#: ../../library/asyncio-task.rst:801 msgid "Added the ``msg`` parameter." msgstr "" -#: ../../library/asyncio-task.rst:821 +#: ../../library/asyncio-task.rst:806 msgid "" "The following example illustrates how coroutines can intercept the " "cancellation request::" msgstr "" -#: ../../library/asyncio-task.rst:860 +#: ../../library/asyncio-task.rst:845 msgid "Return ``True`` if the Task is *cancelled*." msgstr "" -#: ../../library/asyncio-task.rst:862 +#: ../../library/asyncio-task.rst:847 msgid "" "The Task is *cancelled* when the cancellation was requested with :meth:" "`cancel` and the wrapped coroutine propagated the :exc:`CancelledError` " "exception thrown into it." msgstr "" -#: ../../library/asyncio-task.rst:868 +#: ../../library/asyncio-task.rst:853 msgid "Return ``True`` if the Task is *done*." msgstr "" -#: ../../library/asyncio-task.rst:870 +#: ../../library/asyncio-task.rst:855 msgid "" "A Task is *done* when the wrapped coroutine either returned a value, raised " "an exception, or the Task was cancelled." msgstr "" -#: ../../library/asyncio-task.rst:875 +#: ../../library/asyncio-task.rst:860 msgid "Return the result of the Task." msgstr "" -#: ../../library/asyncio-task.rst:877 +#: ../../library/asyncio-task.rst:862 msgid "" "If the Task is *done*, the result of the wrapped coroutine is returned (or " "if the coroutine raised an exception, that exception is re-raised.)" msgstr "" -#: ../../library/asyncio-task.rst:881 ../../library/asyncio-task.rst:895 +#: ../../library/asyncio-task.rst:866 ../../library/asyncio-task.rst:880 msgid "" "If the Task has been *cancelled*, this method raises a :exc:`CancelledError` " "exception." msgstr "" -#: ../../library/asyncio-task.rst:884 +#: ../../library/asyncio-task.rst:869 msgid "" "If the Task's result isn't yet available, this method raises a :exc:" "`InvalidStateError` exception." msgstr "" -#: ../../library/asyncio-task.rst:889 +#: ../../library/asyncio-task.rst:874 msgid "Return the exception of the Task." msgstr "" -#: ../../library/asyncio-task.rst:891 +#: ../../library/asyncio-task.rst:876 msgid "" "If the wrapped coroutine raised an exception that exception is returned. If " "the wrapped coroutine returned normally this method returns ``None``." msgstr "" -#: ../../library/asyncio-task.rst:898 +#: ../../library/asyncio-task.rst:883 msgid "" "If the Task isn't *done* yet, this method raises an :exc:`InvalidStateError` " "exception." msgstr "" -#: ../../library/asyncio-task.rst:903 +#: ../../library/asyncio-task.rst:888 msgid "Add a callback to be run when the Task is *done*." msgstr "" -#: ../../library/asyncio-task.rst:905 ../../library/asyncio-task.rst:914 +#: ../../library/asyncio-task.rst:890 ../../library/asyncio-task.rst:899 msgid "This method should only be used in low-level callback-based code." msgstr "" -#: ../../library/asyncio-task.rst:907 +#: ../../library/asyncio-task.rst:892 msgid "" "See the documentation of :meth:`Future.add_done_callback` for more details." msgstr "" -#: ../../library/asyncio-task.rst:912 +#: ../../library/asyncio-task.rst:897 msgid "Remove *callback* from the callbacks list." msgstr "" -#: ../../library/asyncio-task.rst:916 +#: ../../library/asyncio-task.rst:901 msgid "" "See the documentation of :meth:`Future.remove_done_callback` for more " "details." msgstr "" -#: ../../library/asyncio-task.rst:921 +#: ../../library/asyncio-task.rst:906 msgid "Return the list of stack frames for this Task." msgstr "" -#: ../../library/asyncio-task.rst:923 +#: ../../library/asyncio-task.rst:908 msgid "" "If the wrapped coroutine is not done, this returns the stack where it is " "suspended. If the coroutine has completed successfully or was cancelled, " @@ -867,15 +851,15 @@ msgid "" "this returns the list of traceback frames." msgstr "" -#: ../../library/asyncio-task.rst:929 +#: ../../library/asyncio-task.rst:914 msgid "The frames are always ordered from oldest to newest." msgstr "" -#: ../../library/asyncio-task.rst:931 +#: ../../library/asyncio-task.rst:916 msgid "Only one stack frame is returned for a suspended coroutine." msgstr "" -#: ../../library/asyncio-task.rst:933 +#: ../../library/asyncio-task.rst:918 msgid "" "The optional *limit* argument sets the maximum number of frames to return; " "by default all available frames are returned. The ordering of the returned " @@ -884,111 +868,144 @@ msgid "" "are returned. (This matches the behavior of the traceback module.)" msgstr "" -#: ../../library/asyncio-task.rst:942 +#: ../../library/asyncio-task.rst:927 msgid "Print the stack or traceback for this Task." msgstr "" -#: ../../library/asyncio-task.rst:944 +#: ../../library/asyncio-task.rst:929 msgid "" "This produces output similar to that of the traceback module for the frames " "retrieved by :meth:`get_stack`." msgstr "" -#: ../../library/asyncio-task.rst:947 +#: ../../library/asyncio-task.rst:932 msgid "The *limit* argument is passed to :meth:`get_stack` directly." msgstr "" -#: ../../library/asyncio-task.rst:949 +#: ../../library/asyncio-task.rst:934 msgid "" "The *file* argument is an I/O stream to which the output is written; by " "default output is written to :data:`sys.stderr`." msgstr "" -#: ../../library/asyncio-task.rst:954 +#: ../../library/asyncio-task.rst:939 msgid "Return the coroutine object wrapped by the :class:`Task`." msgstr "" -#: ../../library/asyncio-task.rst:960 +#: ../../library/asyncio-task.rst:945 msgid "Return the name of the Task." msgstr "" -#: ../../library/asyncio-task.rst:962 +#: ../../library/asyncio-task.rst:947 msgid "" "If no name has been explicitly assigned to the Task, the default asyncio " "Task implementation generates a default name during instantiation." msgstr "" -#: ../../library/asyncio-task.rst:970 +#: ../../library/asyncio-task.rst:955 msgid "Set the name of the Task." msgstr "" -#: ../../library/asyncio-task.rst:972 +#: ../../library/asyncio-task.rst:957 msgid "" "The *value* argument can be any object, which is then converted to a string." msgstr "" -#: ../../library/asyncio-task.rst:975 +#: ../../library/asyncio-task.rst:960 msgid "" "In the default Task implementation, the name will be visible in the :func:" "`repr` output of a task object." msgstr "" -#: ../../library/asyncio-task.rst:984 +#: ../../library/asyncio-task.rst:967 +msgid "Return a set of all tasks for an event loop." +msgstr "" + +#: ../../library/asyncio-task.rst:969 +msgid "" +"By default all tasks for the current event loop are returned. If *loop* is " +"``None``, the :func:`get_event_loop` function is used to get the current " +"loop." +msgstr "" + +#: ../../library/asyncio-task.rst:975 +msgid "" +"Do not call this as a task method. Use the :func:`asyncio.all_tasks` " +"function instead." +msgstr "" + +#: ../../library/asyncio-task.rst:980 +msgid "Return the currently running task or ``None``." +msgstr "" + +#: ../../library/asyncio-task.rst:982 +msgid "" +"If *loop* is ``None``, the :func:`get_event_loop` function is used to get " +"the current loop." +msgstr "" + +#: ../../library/asyncio-task.rst:987 +msgid "" +"Do not call this as a task method. Use the :func:`asyncio.current_task` " +"function instead." +msgstr "" + +#: ../../library/asyncio-task.rst:994 msgid "Generator-based Coroutines" msgstr "" -#: ../../library/asyncio-task.rst:988 +#: ../../library/asyncio-task.rst:998 msgid "" "Support for generator-based coroutines is **deprecated** and is scheduled " "for removal in Python 3.10." msgstr "" -#: ../../library/asyncio-task.rst:991 +#: ../../library/asyncio-task.rst:1001 msgid "" "Generator-based coroutines predate async/await syntax. They are Python " "generators that use ``yield from`` expressions to await on Futures and other " "coroutines." msgstr "" -#: ../../library/asyncio-task.rst:995 +#: ../../library/asyncio-task.rst:1005 msgid "" "Generator-based coroutines should be decorated with :func:`@asyncio." "coroutine `, although this is not enforced." msgstr "" -#: ../../library/asyncio-task.rst:1002 +#: ../../library/asyncio-task.rst:1012 msgid "Decorator to mark generator-based coroutines." msgstr "" -#: ../../library/asyncio-task.rst:1004 +#: ../../library/asyncio-task.rst:1014 msgid "" "This decorator enables legacy generator-based coroutines to be compatible " "with async/await code::" msgstr "" -#: ../../library/asyncio-task.rst:1014 +#: ../../library/asyncio-task.rst:1024 msgid "This decorator should not be used for :keyword:`async def` coroutines." msgstr "" -#: ../../library/asyncio-task.rst:1019 +#: ../../library/asyncio-task.rst:1029 msgid "Use :keyword:`async def` instead." msgstr "" -#: ../../library/asyncio-task.rst:1023 +#: ../../library/asyncio-task.rst:1033 msgid "Return ``True`` if *obj* is a :ref:`coroutine object `." msgstr "" -#: ../../library/asyncio-task.rst:1025 +#: ../../library/asyncio-task.rst:1035 msgid "" "This method is different from :func:`inspect.iscoroutine` because it returns " "``True`` for generator-based coroutines." msgstr "" -#: ../../library/asyncio-task.rst:1030 +#: ../../library/asyncio-task.rst:1040 msgid "Return ``True`` if *func* is a :ref:`coroutine function `." msgstr "" -#: ../../library/asyncio-task.rst:1033 +#: ../../library/asyncio-task.rst:1043 msgid "" "This method is different from :func:`inspect.iscoroutinefunction` because it " "returns ``True`` for generator-based coroutine functions decorated with :" diff --git a/library/atexit.po b/library/atexit.po index 7f8a2d2be4..44cf15fa6d 100644 --- a/library/atexit.po +++ b/library/atexit.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.7\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2021-09-07 06:52+0000\n" +"POT-Creation-Date: 2018-06-26 18:54+0800\n" "PO-Revision-Date: 2016-01-31 07:13+0000\n" "Last-Translator: Liang-Bo Wang \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -66,7 +66,7 @@ msgstr "" msgid "" "If an exception is raised during execution of the exit handlers, a traceback " "is printed (unless :exc:`SystemExit` is raised) and the exception " -"information is saved. After all exit handlers have had a chance to run, the " +"information is saved. After all exit handlers have had a chance to run the " "last exception to be raised is re-raised." msgstr "" @@ -78,29 +78,27 @@ msgstr "" #: ../../library/atexit.rst:51 msgid "" -"Remove *func* from the list of functions to be run at interpreter shutdown. :" -"func:`unregister` silently does nothing if *func* was not previously " -"registered. If *func* has been registered more than once, every occurrence " -"of that function in the :mod:`atexit` call stack will be removed. Equality " -"comparisons (``==``) are used internally during unregistration, so function " -"references do not need to have matching identities." +"Remove *func* from the list of functions to be run at interpreter shutdown. " +"After calling :func:`unregister`, *func* is guaranteed not to be called when " +"the interpreter shuts down, even if it was registered more than once. :func:" +"`unregister` silently does nothing if *func* was not previously registered." msgstr "" -#: ../../library/atexit.rst:62 +#: ../../library/atexit.rst:61 msgid "Module :mod:`readline`" msgstr "" -#: ../../library/atexit.rst:62 +#: ../../library/atexit.rst:61 msgid "" "Useful example of :mod:`atexit` to read and write :mod:`readline` history " "files." msgstr "" -#: ../../library/atexit.rst:69 +#: ../../library/atexit.rst:68 msgid ":mod:`atexit` Example" msgstr "" -#: ../../library/atexit.rst:71 +#: ../../library/atexit.rst:70 msgid "" "The following simple example demonstrates how a module can initialize a " "counter from a file when it is imported and save the counter's updated value " @@ -108,16 +106,16 @@ msgid "" "making an explicit call into this module at termination. ::" msgstr "" -#: ../../library/atexit.rst:94 +#: ../../library/atexit.rst:92 msgid "" "Positional and keyword arguments may also be passed to :func:`register` to " "be passed along to the registered function when it is called::" msgstr "" -#: ../../library/atexit.rst:106 +#: ../../library/atexit.rst:104 msgid "Usage as a :term:`decorator`::" msgstr "" -#: ../../library/atexit.rst:114 +#: ../../library/atexit.rst:112 msgid "This only works with functions that can be called without arguments." msgstr "" diff --git a/library/audit_events.po b/library/audit_events.po index 6574f6390d..3c22cfe881 100644 --- a/library/audit_events.po +++ b/library/audit_events.po @@ -8,11 +8,10 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.9\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2021-09-07 06:52+0000\n" +"POT-Creation-Date: 2020-06-20 18:08+0800\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" -"Language: \n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" @@ -25,7 +24,7 @@ msgstr "" msgid "" "This table contains all events raised by :func:`sys.audit` or :c:func:" "`PySys_Audit` calls throughout the CPython runtime and the standard " -"library. These calls were added in 3.8.0 or later (see :pep:`578`)." +"library. These calls were added in 3.8.0 or later." msgstr "" #: ../../library/audit_events.rst:12 @@ -40,79 +39,3 @@ msgid "" "represent events raised by other implementations. See your runtime specific " "documentation for actual events raised." msgstr "" - -#: ../../library/audit_events.rst:23 -msgid "" -"The following events are raised internally and do not correspond to any " -"public API of CPython:" -msgstr "" - -#: ../../library/audit_events.rst:27 -msgid "Audit event" -msgstr "" - -#: ../../library/audit_events.rst:27 -msgid "Arguments" -msgstr "" - -#: ../../library/audit_events.rst:29 -msgid "_winapi.CreateFile" -msgstr "" - -#: ../../library/audit_events.rst:29 -msgid "" -"``file_name``, ``desired_access``, ``share_mode``, ``creation_disposition``, " -"``flags_and_attributes``" -msgstr "" - -#: ../../library/audit_events.rst:33 -msgid "_winapi.CreateJunction" -msgstr "" - -#: ../../library/audit_events.rst:33 -msgid "``src_path``, ``dst_path``" -msgstr "" - -#: ../../library/audit_events.rst:35 -msgid "_winapi.CreateNamedPipe" -msgstr "" - -#: ../../library/audit_events.rst:35 -msgid "``name``, ``open_mode``, ``pipe_mode``" -msgstr "" - -#: ../../library/audit_events.rst:37 -msgid "_winapi.CreatePipe" -msgstr "" - -#: ../../library/audit_events.rst:39 -msgid "_winapi.CreateProcess" -msgstr "" - -#: ../../library/audit_events.rst:39 -msgid "``application_name``, ``command_line``, ``current_directory``" -msgstr "" - -#: ../../library/audit_events.rst:42 -msgid "_winapi.OpenProcess" -msgstr "" - -#: ../../library/audit_events.rst:42 -msgid "``process_id``, ``desired_access``" -msgstr "" - -#: ../../library/audit_events.rst:44 -msgid "_winapi.TerminateProcess" -msgstr "" - -#: ../../library/audit_events.rst:44 -msgid "``handle``, ``exit_code``" -msgstr "" - -#: ../../library/audit_events.rst:46 -msgid "ctypes.PyObj_FromPtr" -msgstr "" - -#: ../../library/audit_events.rst:46 -msgid "``obj``" -msgstr "" diff --git a/library/bz2.po b/library/bz2.po index cd1a0dd66c..a44ada4c1d 100644 --- a/library/bz2.po +++ b/library/bz2.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.7\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2021-09-07 06:52+0000\n" +"POT-Creation-Date: 2020-06-20 18:08+0800\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-" @@ -369,17 +369,17 @@ msgid "" "compression:" msgstr "" -#: ../../library/bz2.rst:284 +#: ../../library/bz2.rst:287 msgid "Using :class:`BZ2Compressor` for incremental compression:" msgstr "" -#: ../../library/bz2.rst:302 +#: ../../library/bz2.rst:306 msgid "" "The example above uses a very \"nonrandom\" stream of data (a stream of `b\"z" "\"` chunks). Random data tends to compress poorly, while ordered, " "repetitive data usually yields a high compression ratio." msgstr "" -#: ../../library/bz2.rst:306 +#: ../../library/bz2.rst:310 msgid "Writing and reading a bzip2-compressed file in binary mode:" msgstr "" diff --git a/library/calendar.po b/library/calendar.po index 0d42b40794..d7fcb8d4eb 100644 --- a/library/calendar.po +++ b/library/calendar.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.7\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2021-09-07 06:52+0000\n" +"POT-Creation-Date: 2018-06-26 18:54+0800\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-" @@ -357,7 +357,7 @@ msgstr "" #: ../../library/calendar.rst:351 msgid "" "Returns a matrix representing a month's calendar. Each row represents a " -"week; days outside of the month are represented by zeros. Each week begins " +"week; days outside of the month a represented by zeros. Each week begins " "with Monday unless set by :func:`setfirstweekday`." msgstr "" diff --git a/library/cgi.po b/library/cgi.po index f7f6e29194..919ea97d5b 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-07 06:52+0000\n" +"POT-Creation-Date: 2020-06-20 18:08+0800\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-" @@ -328,8 +328,8 @@ msgstr "" #: ../../library/cgi.rst:282 msgid "" "Parse a query in the environment or from a file (the file defaults to ``sys." -"stdin``). The *keep_blank_values*, *strict_parsing* and *separator* " -"parameters are passed to :func:`urllib.parse.parse_qs` unchanged." +"stdin``). The *keep_blank_values* and *strict_parsing* parameters are " +"passed to :func:`urllib.parse.parse_qs` unchanged." msgstr "" #: ../../library/cgi.rst:289 @@ -360,72 +360,68 @@ msgid "" "value is now a list of strings, not bytes." msgstr "" -#: ../../library/cgi.rst:306 -msgid "Added the *separator* parameter." -msgstr "" - -#: ../../library/cgi.rst:312 +#: ../../library/cgi.rst:309 msgid "" "Parse a MIME header (such as :mailheader:`Content-Type`) into a main value " "and a dictionary of parameters." msgstr "" -#: ../../library/cgi.rst:318 +#: ../../library/cgi.rst:315 msgid "" "Robust test CGI script, usable as main program. Writes minimal HTTP headers " -"and formats all information provided to the script in HTML format." +"and formats all information provided to the script in HTML form." msgstr "" -#: ../../library/cgi.rst:324 +#: ../../library/cgi.rst:321 msgid "Format the shell environment in HTML." msgstr "" -#: ../../library/cgi.rst:329 +#: ../../library/cgi.rst:326 msgid "Format a form in HTML." msgstr "" -#: ../../library/cgi.rst:334 +#: ../../library/cgi.rst:331 msgid "Format the current directory in HTML." msgstr "" -#: ../../library/cgi.rst:339 +#: ../../library/cgi.rst:336 msgid "Print a list of useful (used by CGI) environment variables in HTML." msgstr "" -#: ../../library/cgi.rst:345 +#: ../../library/cgi.rst:342 msgid "Caring about security" msgstr "" -#: ../../library/cgi.rst:349 +#: ../../library/cgi.rst:346 msgid "" -"There's one important rule: if you invoke an external program (via :func:`os." -"system`, :func:`os.popen` or other functions with similar functionality), " -"make very sure you don't pass arbitrary strings received from the client to " -"the shell. This is a well-known security hole whereby clever hackers " -"anywhere on the Web can exploit a gullible CGI script to invoke arbitrary " -"shell commands. Even parts of the URL or field names cannot be trusted, " -"since the request doesn't have to come from your form!" +"There's one important rule: if you invoke an external program (via the :func:" +"`os.system` or :func:`os.popen` functions. or others with similar " +"functionality), make very sure you don't pass arbitrary strings received " +"from the client to the shell. This is a well-known security hole whereby " +"clever hackers anywhere on the Web can exploit a gullible CGI script to " +"invoke arbitrary shell commands. Even parts of the URL or field names " +"cannot be trusted, since the request doesn't have to come from your form!" msgstr "" -#: ../../library/cgi.rst:357 +#: ../../library/cgi.rst:354 msgid "" "To be on the safe side, if you must pass a string gotten from a form to a " "shell command, you should make sure the string contains only alphanumeric " "characters, dashes, underscores, and periods." msgstr "" -#: ../../library/cgi.rst:363 +#: ../../library/cgi.rst:360 msgid "Installing your CGI script on a Unix system" msgstr "" -#: ../../library/cgi.rst:365 +#: ../../library/cgi.rst:362 msgid "" "Read the documentation for your HTTP server and check with your local system " "administrator to find the directory where CGI scripts should be installed; " "usually this is in a directory :file:`cgi-bin` in the server tree." msgstr "" -#: ../../library/cgi.rst:369 +#: ../../library/cgi.rst:366 msgid "" "Make sure that your script is readable and executable by \"others\"; the " "Unix file mode should be ``0o755`` octal (use ``chmod 0755 filename``). " @@ -433,12 +429,12 @@ msgid "" "column 1 followed by the pathname of the Python interpreter, for instance::" msgstr "" -#: ../../library/cgi.rst:376 +#: ../../library/cgi.rst:373 msgid "" "Make sure the Python interpreter exists and is executable by \"others\"." msgstr "" -#: ../../library/cgi.rst:378 +#: ../../library/cgi.rst:375 msgid "" "Make sure that any files your script needs to read or write are readable or " "writable, respectively, by \"others\" --- their mode should be ``0o644`` for " @@ -453,28 +449,28 @@ msgid "" "anything interesting." msgstr "" -#: ../../library/cgi.rst:389 +#: ../../library/cgi.rst:386 msgid "" "If you need to load modules from a directory which is not on Python's " "default module search path, you can change the path in your script, before " "importing other modules. For example::" msgstr "" -#: ../../library/cgi.rst:397 +#: ../../library/cgi.rst:394 msgid "(This way, the directory inserted last will be searched first!)" msgstr "" -#: ../../library/cgi.rst:399 +#: ../../library/cgi.rst:396 msgid "" "Instructions for non-Unix systems will vary; check your HTTP server's " "documentation (it will usually have a section on CGI scripts)." msgstr "" -#: ../../library/cgi.rst:404 +#: ../../library/cgi.rst:401 msgid "Testing your CGI script" msgstr "" -#: ../../library/cgi.rst:406 +#: ../../library/cgi.rst:403 msgid "" "Unfortunately, a CGI script will generally not run when you try it from the " "command line, and a script that works perfectly from the command line may " @@ -484,30 +480,30 @@ msgid "" "will most likely send a cryptic error to the client." msgstr "" -#: ../../library/cgi.rst:413 +#: ../../library/cgi.rst:410 msgid "" "Assuming your script has no syntax errors, yet it does not work, you have no " "choice but to read the next section." msgstr "" -#: ../../library/cgi.rst:418 +#: ../../library/cgi.rst:415 msgid "Debugging CGI scripts" msgstr "" -#: ../../library/cgi.rst:422 +#: ../../library/cgi.rst:419 msgid "" "First of all, check for trivial installation errors --- reading the section " "above on installing your CGI script carefully can save you a lot of time. " "If you wonder whether you have understood the installation procedure " "correctly, try installing a copy of this module file (:file:`cgi.py`) as a " "CGI script. When invoked as a script, the file will dump its environment " -"and the contents of the form in HTML format. Give it the right mode etc., " -"and send it a request. If it's installed in the standard :file:`cgi-bin` " +"and the contents of the form in HTML form. Give it the right mode etc, and " +"send it a request. If it's installed in the standard :file:`cgi-bin` " "directory, it should be possible to send it a request by entering a URL into " "your browser of the form:" msgstr "" -#: ../../library/cgi.rst:435 +#: ../../library/cgi.rst:432 msgid "" "If this gives an error of type 404, the server cannot find the script -- " "perhaps you need to install it in a different directory. If it gives " @@ -519,19 +515,19 @@ msgid "" "same procedure for your own script, you should now be able to debug it." msgstr "" -#: ../../library/cgi.rst:444 +#: ../../library/cgi.rst:441 msgid "" "The next step could be to call the :mod:`cgi` module's :func:`test` function " "from your script: replace its main code with the single statement ::" msgstr "" -#: ../../library/cgi.rst:449 +#: ../../library/cgi.rst:446 msgid "" "This should produce the same results as those gotten from installing the :" "file:`cgi.py` file itself." msgstr "" -#: ../../library/cgi.rst:452 +#: ../../library/cgi.rst:449 msgid "" "When an ordinary Python script raises an unhandled exception (for whatever " "reason: of a typo in a module name, a file that can't be opened, etc.), the " @@ -541,28 +537,28 @@ msgid "" "or be discarded altogether." msgstr "" -#: ../../library/cgi.rst:459 +#: ../../library/cgi.rst:456 msgid "" "Fortunately, once you have managed to get your script to execute *some* " "code, you can easily send tracebacks to the Web browser using the :mod:" "`cgitb` module. If you haven't done so already, just add the lines::" msgstr "" -#: ../../library/cgi.rst:466 +#: ../../library/cgi.rst:463 msgid "" "to the top of your script. Then try running it again; when a problem " "occurs, you should see a detailed report that will likely make apparent the " "cause of the crash." msgstr "" -#: ../../library/cgi.rst:470 +#: ../../library/cgi.rst:467 msgid "" "If you suspect that there may be a problem in importing the :mod:`cgitb` " "module, you can use an even more robust approach (which only uses built-in " "modules)::" msgstr "" -#: ../../library/cgi.rst:479 +#: ../../library/cgi.rst:476 msgid "" "This relies on the Python interpreter to print the traceback. The content " "type of the output is set to plain text, which disables all HTML " @@ -572,47 +568,47 @@ msgid "" "interpretation is going on, the traceback will be readable." msgstr "" -#: ../../library/cgi.rst:488 +#: ../../library/cgi.rst:485 msgid "Common problems and solutions" msgstr "" -#: ../../library/cgi.rst:490 +#: ../../library/cgi.rst:487 msgid "" "Most HTTP servers buffer the output from CGI scripts until the script is " "completed. This means that it is not possible to display a progress report " "on the client's display while the script is running." msgstr "" -#: ../../library/cgi.rst:494 +#: ../../library/cgi.rst:491 msgid "Check the installation instructions above." msgstr "" -#: ../../library/cgi.rst:496 +#: ../../library/cgi.rst:493 msgid "" "Check the HTTP server's log files. (``tail -f logfile`` in a separate " "window may be useful!)" msgstr "" -#: ../../library/cgi.rst:499 +#: ../../library/cgi.rst:496 msgid "" "Always check a script for syntax errors first, by doing something like " "``python script.py``." msgstr "" -#: ../../library/cgi.rst:502 +#: ../../library/cgi.rst:499 msgid "" "If your script does not have any syntax errors, try adding ``import cgitb; " "cgitb.enable()`` to the top of the script." msgstr "" -#: ../../library/cgi.rst:505 +#: ../../library/cgi.rst:502 msgid "" "When invoking external programs, make sure they can be found. Usually, this " "means using absolute path names --- :envvar:`PATH` is usually not set to a " "very useful value in a CGI script." msgstr "" -#: ../../library/cgi.rst:509 +#: ../../library/cgi.rst:506 msgid "" "When reading or writing external files, make sure they can be read or " "written by the userid under which your CGI script will be running: this is " @@ -620,17 +616,17 @@ msgid "" "explicitly specified userid for a web server's ``suexec`` feature." msgstr "" -#: ../../library/cgi.rst:514 +#: ../../library/cgi.rst:511 msgid "" "Don't try to give a CGI script a set-uid mode. This doesn't work on most " "systems, and is a security liability as well." msgstr "" -#: ../../library/cgi.rst:518 +#: ../../library/cgi.rst:515 msgid "Footnotes" msgstr "註解" -#: ../../library/cgi.rst:519 +#: ../../library/cgi.rst:516 msgid "" "Note that some recent versions of the HTML specification do state what order " "the field values should be supplied in, but knowing whether a request was " diff --git a/library/codecs.po b/library/codecs.po index 2a4f52d3fb..695563c694 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-07 06:52+0000\n" +"POT-Creation-Date: 2020-06-20 18:08+0800\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-" @@ -188,23 +188,18 @@ msgstr "" #: ../../library/codecs.rst:161 msgid "" "Register a codec search function. Search functions are expected to take one " -"argument, being the encoding name in all lower case letters with hyphens and " -"spaces converted to underscores, and return a :class:`CodecInfo` object. In " -"case a search function cannot find a given encoding, it should return " -"``None``." +"argument, being the encoding name in all lower case letters, and return a :" +"class:`CodecInfo` object. In case a search function cannot find a given " +"encoding, it should return ``None``." msgstr "" -#: ../../library/codecs.rst:167 -msgid "Hyphens and spaces are converted to underscore." -msgstr "" - -#: ../../library/codecs.rst:172 +#: ../../library/codecs.rst:168 msgid "" "Search function registration is not currently reversible, which may cause " "problems in some cases, such as unit testing or module reloading." msgstr "" -#: ../../library/codecs.rst:176 +#: ../../library/codecs.rst:172 msgid "" "While the builtin :func:`open` and the associated :mod:`io` module are the " "recommended approach for working with encoded text files, this module " @@ -212,14 +207,14 @@ msgid "" "wider range of codecs when working with binary files:" msgstr "" -#: ../../library/codecs.rst:183 +#: ../../library/codecs.rst:179 msgid "" "Open an encoded file using the given *mode* and return an instance of :class:" "`StreamReaderWriter`, providing transparent encoding/decoding. The default " "file mode is ``'r'``, meaning to open the file in read mode." msgstr "" -#: ../../library/codecs.rst:189 +#: ../../library/codecs.rst:185 msgid "" "Underlying encoded files are always opened in binary mode. No automatic " "conversion of ``'\\n'`` is done on reading and writing. The *mode* argument " @@ -227,34 +222,34 @@ msgid "" "``'b'`` is automatically added." msgstr "" -#: ../../library/codecs.rst:194 +#: ../../library/codecs.rst:190 msgid "" "*encoding* specifies the encoding which is to be used for the file. Any " "encoding that encodes to and decodes from bytes is allowed, and the data " "types supported by the file methods depend on the codec used." msgstr "" -#: ../../library/codecs.rst:198 +#: ../../library/codecs.rst:194 msgid "" "*errors* may be given to define the error handling. It defaults to " "``'strict'`` which causes a :exc:`ValueError` to be raised in case an " "encoding error occurs." msgstr "" -#: ../../library/codecs.rst:201 +#: ../../library/codecs.rst:197 msgid "" "*buffering* has the same meaning as for the built-in :func:`open` function. " "It defaults to -1 which means that the default buffer size will be used." msgstr "" -#: ../../library/codecs.rst:207 +#: ../../library/codecs.rst:203 msgid "" "Return a :class:`StreamRecoder` instance, a wrapped version of *file* which " "provides transparent transcoding. The original file is closed when the " "wrapped version is closed." msgstr "" -#: ../../library/codecs.rst:211 +#: ../../library/codecs.rst:207 msgid "" "Data written to the wrapped file is decoded according to the given " "*data_encoding* and then written to the original file as bytes using " @@ -262,18 +257,18 @@ msgid "" "*file_encoding*, and the result is encoded using *data_encoding*." msgstr "" -#: ../../library/codecs.rst:217 +#: ../../library/codecs.rst:213 msgid "If *file_encoding* is not given, it defaults to *data_encoding*." msgstr "" -#: ../../library/codecs.rst:219 +#: ../../library/codecs.rst:215 msgid "" "*errors* may be given to define the error handling. It defaults to " "``'strict'``, which causes :exc:`ValueError` to be raised in case an " "encoding error occurs." msgstr "" -#: ../../library/codecs.rst:226 +#: ../../library/codecs.rst:222 msgid "" "Uses an incremental encoder to iteratively encode the input provided by " "*iterator*. This function is a :term:`generator`. The *errors* argument (as " @@ -281,14 +276,14 @@ msgid "" "encoder." msgstr "" -#: ../../library/codecs.rst:231 +#: ../../library/codecs.rst:227 msgid "" "This function requires that the codec accept text :class:`str` objects to " "encode. Therefore it does not support bytes-to-bytes encoders such as " "``base64_codec``." msgstr "" -#: ../../library/codecs.rst:238 +#: ../../library/codecs.rst:234 msgid "" "Uses an incremental decoder to iteratively decode the input provided by " "*iterator*. This function is a :term:`generator`. The *errors* argument (as " @@ -296,7 +291,7 @@ msgid "" "decoder." msgstr "" -#: ../../library/codecs.rst:243 +#: ../../library/codecs.rst:239 msgid "" "This function requires that the codec accept :class:`bytes` objects to " "decode. Therefore it does not support text-to-text encoders such as " @@ -304,13 +299,13 @@ msgid "" "`iterencode`." msgstr "" -#: ../../library/codecs.rst:249 +#: ../../library/codecs.rst:245 msgid "" "The module also provides the following constants which are useful for " "reading and writing to platform dependent files:" msgstr "" -#: ../../library/codecs.rst:264 +#: ../../library/codecs.rst:260 msgid "" "These constants define various byte sequences, being Unicode byte order " "marks (BOMs) for several encodings. They are used in UTF-16 and UTF-32 data " @@ -322,18 +317,18 @@ msgid "" "represent the BOM in UTF-8 and UTF-32 encodings." msgstr "" -#: ../../library/codecs.rst:278 +#: ../../library/codecs.rst:274 msgid "Codec Base Classes" msgstr "" -#: ../../library/codecs.rst:280 +#: ../../library/codecs.rst:276 msgid "" "The :mod:`codecs` module defines a set of base classes which define the " "interfaces for working with codec objects, and can also be used as the basis " "for custom codec implementations." msgstr "" -#: ../../library/codecs.rst:284 +#: ../../library/codecs.rst:280 msgid "" "Each codec has to define four interfaces to make it usable as codec in " "Python: stateless encoder, stateless decoder, stream reader and stream " @@ -342,11 +337,11 @@ msgid "" "how the codec will handle encoding and decoding errors." msgstr "" -#: ../../library/codecs.rst:295 +#: ../../library/codecs.rst:291 msgid "Error Handlers" msgstr "" -#: ../../library/codecs.rst:297 +#: ../../library/codecs.rst:293 msgid "" "To simplify and standardize error handling, codecs may implement different " "error handling schemes by accepting the *errors* string argument. The " @@ -354,89 +349,89 @@ msgid "" "codecs:" msgstr "" -#: ../../library/codecs.rst:305 ../../library/codecs.rst:328 -#: ../../library/codecs.rst:361 +#: ../../library/codecs.rst:301 ../../library/codecs.rst:324 +#: ../../library/codecs.rst:357 msgid "Value" msgstr "" -#: ../../library/codecs.rst:305 ../../library/codecs.rst:328 -#: ../../library/codecs.rst:361 ../../library/codecs.rst:1273 -#: ../../library/codecs.rst:1340 ../../library/codecs.rst:1395 +#: ../../library/codecs.rst:301 ../../library/codecs.rst:324 +#: ../../library/codecs.rst:357 ../../library/codecs.rst:1269 +#: ../../library/codecs.rst:1336 ../../library/codecs.rst:1391 msgid "Meaning" msgstr "" -#: ../../library/codecs.rst:307 +#: ../../library/codecs.rst:303 msgid "``'strict'``" msgstr "" -#: ../../library/codecs.rst:307 +#: ../../library/codecs.rst:303 msgid "" "Raise :exc:`UnicodeError` (or a subclass); this is the default. Implemented " "in :func:`strict_errors`." msgstr "" -#: ../../library/codecs.rst:311 +#: ../../library/codecs.rst:307 msgid "``'ignore'``" msgstr "" -#: ../../library/codecs.rst:311 +#: ../../library/codecs.rst:307 msgid "" "Ignore the malformed data and continue without further notice. Implemented " "in :func:`ignore_errors`." msgstr "" -#: ../../library/codecs.rst:316 +#: ../../library/codecs.rst:312 msgid "" "The following error handlers are only applicable to :term:`text encodings " "`:" msgstr "" -#: ../../library/codecs.rst:330 +#: ../../library/codecs.rst:326 msgid "``'replace'``" msgstr "" -#: ../../library/codecs.rst:330 +#: ../../library/codecs.rst:326 msgid "" "Replace with a suitable replacement marker; Python will use the official ``U" "+FFFD`` REPLACEMENT CHARACTER for the built-in codecs on decoding, and '?' " "on encoding. Implemented in :func:`replace_errors`." msgstr "" -#: ../../library/codecs.rst:337 +#: ../../library/codecs.rst:333 msgid "``'xmlcharrefreplace'``" msgstr "" -#: ../../library/codecs.rst:337 +#: ../../library/codecs.rst:333 msgid "" "Replace with the appropriate XML character reference (only for encoding). " "Implemented in :func:`xmlcharrefreplace_errors`." msgstr "" -#: ../../library/codecs.rst:341 +#: ../../library/codecs.rst:337 msgid "``'backslashreplace'``" msgstr "" -#: ../../library/codecs.rst:341 +#: ../../library/codecs.rst:337 msgid "" "Replace with backslashed escape sequences. Implemented in :func:" "`backslashreplace_errors`." msgstr "" -#: ../../library/codecs.rst:345 +#: ../../library/codecs.rst:341 msgid "``'namereplace'``" msgstr "" -#: ../../library/codecs.rst:345 +#: ../../library/codecs.rst:341 msgid "" "Replace with ``\\N{...}`` escape sequences (only for encoding). Implemented " "in :func:`namereplace_errors`." msgstr "" -#: ../../library/codecs.rst:349 +#: ../../library/codecs.rst:345 msgid "``'surrogateescape'``" msgstr "" -#: ../../library/codecs.rst:349 +#: ../../library/codecs.rst:345 msgid "" "On decoding, replace byte with individual surrogate code ranging from ``U" "+DC80`` to ``U+DCFF``. This code will then be turned back into the same byte " @@ -444,63 +439,63 @@ msgid "" "(See :pep:`383` for more.)" msgstr "" -#: ../../library/codecs.rst:358 +#: ../../library/codecs.rst:354 msgid "" "In addition, the following error handler is specific to the given codecs:" msgstr "" -#: ../../library/codecs.rst:361 +#: ../../library/codecs.rst:357 msgid "Codecs" msgstr "" -#: ../../library/codecs.rst:363 +#: ../../library/codecs.rst:359 msgid "``'surrogatepass'``" msgstr "" -#: ../../library/codecs.rst:363 +#: ../../library/codecs.rst:359 msgid "utf-8, utf-16, utf-32, utf-16-be, utf-16-le, utf-32-be, utf-32-le" msgstr "" -#: ../../library/codecs.rst:363 +#: ../../library/codecs.rst:359 msgid "" "Allow encoding and decoding of surrogate codes. These codecs normally treat " "the presence of surrogates as an error." msgstr "" -#: ../../library/codecs.rst:368 +#: ../../library/codecs.rst:364 msgid "The ``'surrogateescape'`` and ``'surrogatepass'`` error handlers." msgstr "" -#: ../../library/codecs.rst:371 +#: ../../library/codecs.rst:367 msgid "" "The ``'surrogatepass'`` error handlers now works with utf-16\\* and " "utf-32\\* codecs." msgstr "" -#: ../../library/codecs.rst:374 +#: ../../library/codecs.rst:370 msgid "The ``'namereplace'`` error handler." msgstr "" -#: ../../library/codecs.rst:377 +#: ../../library/codecs.rst:373 msgid "" "The ``'backslashreplace'`` error handlers now works with decoding and " "translating." msgstr "" -#: ../../library/codecs.rst:381 +#: ../../library/codecs.rst:377 msgid "" "The set of allowed values can be extended by registering a new named error " "handler:" msgstr "" -#: ../../library/codecs.rst:386 +#: ../../library/codecs.rst:382 msgid "" "Register the error handling function *error_handler* under the name *name*. " "The *error_handler* argument will be called during encoding and decoding in " "case of an error, when *name* is specified as the errors parameter." msgstr "" -#: ../../library/codecs.rst:390 +#: ../../library/codecs.rst:386 msgid "" "For encoding, *error_handler* will be called with a :exc:" "`UnicodeEncodeError` instance, which contains information about the location " @@ -515,40 +510,40 @@ msgid "" "position is out of bound an :exc:`IndexError` will be raised." msgstr "" -#: ../../library/codecs.rst:402 +#: ../../library/codecs.rst:398 msgid "" "Decoding and translating works similarly, except :exc:`UnicodeDecodeError` " "or :exc:`UnicodeTranslateError` will be passed to the handler and that the " "replacement from the error handler will be put into the output directly." msgstr "" -#: ../../library/codecs.rst:407 +#: ../../library/codecs.rst:403 msgid "" "Previously registered error handlers (including the standard error handlers) " "can be looked up by name:" msgstr "" -#: ../../library/codecs.rst:412 +#: ../../library/codecs.rst:408 msgid "Return the error handler previously registered under the name *name*." msgstr "" -#: ../../library/codecs.rst:414 +#: ../../library/codecs.rst:410 msgid "Raises a :exc:`LookupError` in case the handler cannot be found." msgstr "" -#: ../../library/codecs.rst:416 +#: ../../library/codecs.rst:412 msgid "" "The following standard error handlers are also made available as module " "level functions:" msgstr "" -#: ../../library/codecs.rst:421 +#: ../../library/codecs.rst:417 msgid "" "Implements the ``'strict'`` error handling: each encoding or decoding error " "raises a :exc:`UnicodeError`." msgstr "" -#: ../../library/codecs.rst:427 +#: ../../library/codecs.rst:423 msgid "" "Implements the ``'replace'`` error handling (for :term:`text encodings ` only): substitutes ``'?'`` for encoding errors (to be encoded by " @@ -556,44 +551,44 @@ msgid "" "decoding errors." msgstr "" -#: ../../library/codecs.rst:435 +#: ../../library/codecs.rst:431 msgid "" "Implements the ``'ignore'`` error handling: malformed data is ignored and " "encoding or decoding is continued without further notice." msgstr "" -#: ../../library/codecs.rst:441 +#: ../../library/codecs.rst:437 msgid "" "Implements the ``'xmlcharrefreplace'`` error handling (for encoding with :" "term:`text encodings ` only): the unencodable character is " "replaced by an appropriate XML character reference." msgstr "" -#: ../../library/codecs.rst:448 +#: ../../library/codecs.rst:444 msgid "" "Implements the ``'backslashreplace'`` error handling (for :term:`text " "encodings ` only): malformed data is replaced by a " "backslashed escape sequence." msgstr "" -#: ../../library/codecs.rst:454 +#: ../../library/codecs.rst:450 msgid "" "Implements the ``'namereplace'`` error handling (for encoding with :term:" "`text encodings ` only): the unencodable character is " "replaced by a ``\\N{...}`` escape sequence." msgstr "" -#: ../../library/codecs.rst:464 +#: ../../library/codecs.rst:460 msgid "Stateless Encoding and Decoding" msgstr "" -#: ../../library/codecs.rst:466 +#: ../../library/codecs.rst:462 msgid "" "The base :class:`Codec` class defines these methods which also define the " "function interfaces of the stateless encoder and decoder:" msgstr "" -#: ../../library/codecs.rst:472 +#: ../../library/codecs.rst:468 msgid "" "Encodes the object *input* and returns a tuple (output object, length " "consumed). For instance, :term:`text encoding` converts a string object to a " @@ -601,26 +596,26 @@ msgid "" "``iso-8859-1``)." msgstr "" -#: ../../library/codecs.rst:477 ../../library/codecs.rst:499 +#: ../../library/codecs.rst:473 ../../library/codecs.rst:495 msgid "" "The *errors* argument defines the error handling to apply. It defaults to " "``'strict'`` handling." msgstr "" -#: ../../library/codecs.rst:480 +#: ../../library/codecs.rst:476 msgid "" "The method may not store state in the :class:`Codec` instance. Use :class:" "`StreamWriter` for codecs which have to keep state in order to make encoding " "efficient." msgstr "" -#: ../../library/codecs.rst:484 +#: ../../library/codecs.rst:480 msgid "" "The encoder must be able to handle zero length input and return an empty " "object of the output object type in this situation." msgstr "" -#: ../../library/codecs.rst:490 +#: ../../library/codecs.rst:486 msgid "" "Decodes the object *input* and returns a tuple (output object, length " "consumed). For instance, for a :term:`text encoding`, decoding converts a " @@ -628,31 +623,31 @@ msgid "" "object." msgstr "" -#: ../../library/codecs.rst:495 +#: ../../library/codecs.rst:491 msgid "" "For text encodings and bytes-to-bytes codecs, *input* must be a bytes object " "or one which provides the read-only buffer interface -- for example, buffer " "objects and memory mapped files." msgstr "" -#: ../../library/codecs.rst:502 +#: ../../library/codecs.rst:498 msgid "" "The method may not store state in the :class:`Codec` instance. Use :class:" "`StreamReader` for codecs which have to keep state in order to make decoding " "efficient." msgstr "" -#: ../../library/codecs.rst:506 +#: ../../library/codecs.rst:502 msgid "" "The decoder must be able to handle zero length input and return an empty " "object of the output object type in this situation." msgstr "" -#: ../../library/codecs.rst:511 +#: ../../library/codecs.rst:507 msgid "Incremental Encoding and Decoding" msgstr "" -#: ../../library/codecs.rst:513 +#: ../../library/codecs.rst:509 msgid "" "The :class:`IncrementalEncoder` and :class:`IncrementalDecoder` classes " "provide the basic interface for incremental encoding and decoding. Encoding/" @@ -663,7 +658,7 @@ msgid "" "during method calls." msgstr "" -#: ../../library/codecs.rst:521 +#: ../../library/codecs.rst:517 msgid "" "The joined output of calls to the :meth:`~IncrementalEncoder.encode`/:meth:" "`~IncrementalDecoder.decode` method is the same as if all the single inputs " @@ -671,36 +666,36 @@ msgid "" "encoder/decoder." msgstr "" -#: ../../library/codecs.rst:530 +#: ../../library/codecs.rst:526 msgid "IncrementalEncoder Objects" msgstr "" -#: ../../library/codecs.rst:532 +#: ../../library/codecs.rst:528 msgid "" "The :class:`IncrementalEncoder` class is used for encoding an input in " "multiple steps. It defines the following methods which every incremental " "encoder must define in order to be compatible with the Python codec registry." msgstr "" -#: ../../library/codecs.rst:539 +#: ../../library/codecs.rst:535 msgid "Constructor for an :class:`IncrementalEncoder` instance." msgstr "" -#: ../../library/codecs.rst:541 +#: ../../library/codecs.rst:537 msgid "" "All incremental encoders must provide this constructor interface. They are " "free to add additional keyword arguments, but only the ones defined here are " "used by the Python codec registry." msgstr "" -#: ../../library/codecs.rst:545 +#: ../../library/codecs.rst:541 msgid "" "The :class:`IncrementalEncoder` may implement different error handling " "schemes by providing the *errors* keyword argument. See :ref:`error-" "handlers` for possible values." msgstr "" -#: ../../library/codecs.rst:549 +#: ../../library/codecs.rst:545 msgid "" "The *errors* argument will be assigned to an attribute of the same name. " "Assigning to this attribute makes it possible to switch between different " @@ -708,21 +703,21 @@ msgid "" "`IncrementalEncoder` object." msgstr "" -#: ../../library/codecs.rst:557 +#: ../../library/codecs.rst:553 msgid "" "Encodes *object* (taking the current state of the encoder into account) and " "returns the resulting encoded object. If this is the last call to :meth:" "`encode` *final* must be true (the default is false)." msgstr "" -#: ../../library/codecs.rst:564 +#: ../../library/codecs.rst:560 msgid "" "Reset the encoder to the initial state. The output is discarded: call ``." "encode(object, final=True)``, passing an empty byte or text string if " "necessary, to reset the encoder and to get the output." msgstr "" -#: ../../library/codecs.rst:571 +#: ../../library/codecs.rst:567 msgid "" "Return the current state of the encoder which must be an integer. The " "implementation should make sure that ``0`` is the most common state. (States " @@ -731,42 +726,42 @@ msgid "" "into an integer.)" msgstr "" -#: ../../library/codecs.rst:580 +#: ../../library/codecs.rst:576 msgid "" "Set the state of the encoder to *state*. *state* must be an encoder state " "returned by :meth:`getstate`." msgstr "" -#: ../../library/codecs.rst:587 +#: ../../library/codecs.rst:583 msgid "IncrementalDecoder Objects" msgstr "" -#: ../../library/codecs.rst:589 +#: ../../library/codecs.rst:585 msgid "" "The :class:`IncrementalDecoder` class is used for decoding an input in " "multiple steps. It defines the following methods which every incremental " "decoder must define in order to be compatible with the Python codec registry." msgstr "" -#: ../../library/codecs.rst:596 +#: ../../library/codecs.rst:592 msgid "Constructor for an :class:`IncrementalDecoder` instance." msgstr "" -#: ../../library/codecs.rst:598 +#: ../../library/codecs.rst:594 msgid "" "All incremental decoders must provide this constructor interface. They are " "free to add additional keyword arguments, but only the ones defined here are " "used by the Python codec registry." msgstr "" -#: ../../library/codecs.rst:602 +#: ../../library/codecs.rst:598 msgid "" "The :class:`IncrementalDecoder` may implement different error handling " "schemes by providing the *errors* keyword argument. See :ref:`error-" "handlers` for possible values." msgstr "" -#: ../../library/codecs.rst:606 +#: ../../library/codecs.rst:602 msgid "" "The *errors* argument will be assigned to an attribute of the same name. " "Assigning to this attribute makes it possible to switch between different " @@ -774,7 +769,7 @@ msgid "" "`IncrementalDecoder` object." msgstr "" -#: ../../library/codecs.rst:614 +#: ../../library/codecs.rst:610 msgid "" "Decodes *object* (taking the current state of the decoder into account) and " "returns the resulting decoded object. If this is the last call to :meth:" @@ -785,11 +780,11 @@ msgid "" "(which might raise an exception)." msgstr "" -#: ../../library/codecs.rst:625 +#: ../../library/codecs.rst:621 msgid "Reset the decoder to the initial state." msgstr "" -#: ../../library/codecs.rst:630 +#: ../../library/codecs.rst:626 msgid "" "Return the current state of the decoder. This must be a tuple with two " "items, the first must be the buffer containing the still undecoded input. " @@ -804,59 +799,59 @@ msgid "" "bytes of the resulting string into an integer.)" msgstr "" -#: ../../library/codecs.rst:645 +#: ../../library/codecs.rst:641 msgid "" "Set the state of the decoder to *state*. *state* must be a decoder state " "returned by :meth:`getstate`." msgstr "" -#: ../../library/codecs.rst:650 +#: ../../library/codecs.rst:646 msgid "Stream Encoding and Decoding" msgstr "" -#: ../../library/codecs.rst:653 +#: ../../library/codecs.rst:649 msgid "" "The :class:`StreamWriter` and :class:`StreamReader` classes provide generic " "working interfaces which can be used to implement new encoding submodules " "very easily. See :mod:`encodings.utf_8` for an example of how this is done." msgstr "" -#: ../../library/codecs.rst:661 +#: ../../library/codecs.rst:657 msgid "StreamWriter Objects" msgstr "" -#: ../../library/codecs.rst:663 +#: ../../library/codecs.rst:659 msgid "" "The :class:`StreamWriter` class is a subclass of :class:`Codec` and defines " "the following methods which every stream writer must define in order to be " "compatible with the Python codec registry." msgstr "" -#: ../../library/codecs.rst:670 +#: ../../library/codecs.rst:666 msgid "Constructor for a :class:`StreamWriter` instance." msgstr "" -#: ../../library/codecs.rst:672 +#: ../../library/codecs.rst:668 msgid "" "All stream writers must provide this constructor interface. They are free to " "add additional keyword arguments, but only the ones defined here are used by " "the Python codec registry." msgstr "" -#: ../../library/codecs.rst:676 +#: ../../library/codecs.rst:672 msgid "" "The *stream* argument must be a file-like object open for writing text or " "binary data, as appropriate for the specific codec." msgstr "" -#: ../../library/codecs.rst:679 +#: ../../library/codecs.rst:675 msgid "" "The :class:`StreamWriter` may implement different error handling schemes by " "providing the *errors* keyword argument. See :ref:`error-handlers` for the " "standard error handlers the underlying stream codec may support." msgstr "" -#: ../../library/codecs.rst:683 +#: ../../library/codecs.rst:679 msgid "" "The *errors* argument will be assigned to an attribute of the same name. " "Assigning to this attribute makes it possible to switch between different " @@ -864,70 +859,70 @@ msgid "" "object." msgstr "" -#: ../../library/codecs.rst:689 +#: ../../library/codecs.rst:685 msgid "Writes the object's contents encoded to the stream." msgstr "" -#: ../../library/codecs.rst:694 +#: ../../library/codecs.rst:690 msgid "" "Writes the concatenated list of strings to the stream (possibly by reusing " "the :meth:`write` method). The standard bytes-to-bytes codecs do not support " "this method." msgstr "" -#: ../../library/codecs.rst:701 ../../library/codecs.rst:796 -msgid "Resets the codec buffers used for keeping internal state." +#: ../../library/codecs.rst:697 +msgid "Flushes and resets the codec buffers used for keeping state." msgstr "" -#: ../../library/codecs.rst:703 +#: ../../library/codecs.rst:699 msgid "" "Calling this method should ensure that the data on the output is put into a " "clean state that allows appending of new fresh data without having to rescan " "the whole stream to recover state." msgstr "" -#: ../../library/codecs.rst:708 +#: ../../library/codecs.rst:704 msgid "" "In addition to the above methods, the :class:`StreamWriter` must also " "inherit all other methods and attributes from the underlying stream." msgstr "" -#: ../../library/codecs.rst:715 +#: ../../library/codecs.rst:711 msgid "StreamReader Objects" msgstr "" -#: ../../library/codecs.rst:717 +#: ../../library/codecs.rst:713 msgid "" "The :class:`StreamReader` class is a subclass of :class:`Codec` and defines " "the following methods which every stream reader must define in order to be " "compatible with the Python codec registry." msgstr "" -#: ../../library/codecs.rst:724 +#: ../../library/codecs.rst:720 msgid "Constructor for a :class:`StreamReader` instance." msgstr "" -#: ../../library/codecs.rst:726 +#: ../../library/codecs.rst:722 msgid "" "All stream readers must provide this constructor interface. They are free to " "add additional keyword arguments, but only the ones defined here are used by " "the Python codec registry." msgstr "" -#: ../../library/codecs.rst:730 +#: ../../library/codecs.rst:726 msgid "" "The *stream* argument must be a file-like object open for reading text or " "binary data, as appropriate for the specific codec." msgstr "" -#: ../../library/codecs.rst:733 +#: ../../library/codecs.rst:729 msgid "" "The :class:`StreamReader` may implement different error handling schemes by " "providing the *errors* keyword argument. See :ref:`error-handlers` for the " "standard error handlers the underlying stream codec may support." msgstr "" -#: ../../library/codecs.rst:737 +#: ../../library/codecs.rst:733 msgid "" "The *errors* argument will be assigned to an attribute of the same name. " "Assigning to this attribute makes it possible to switch between different " @@ -935,24 +930,24 @@ msgid "" "object." msgstr "" -#: ../../library/codecs.rst:741 +#: ../../library/codecs.rst:737 msgid "" "The set of allowed values for the *errors* argument can be extended with :" "func:`register_error`." msgstr "" -#: ../../library/codecs.rst:747 +#: ../../library/codecs.rst:743 msgid "Decodes data from the stream and returns the resulting object." msgstr "" -#: ../../library/codecs.rst:749 +#: ../../library/codecs.rst:745 msgid "" "The *chars* argument indicates the number of decoded code points or bytes to " "return. The :func:`read` method will never return more data than requested, " "but it might return less, if there is not enough available." msgstr "" -#: ../../library/codecs.rst:754 +#: ../../library/codecs.rst:750 msgid "" "The *size* argument indicates the approximate maximum number of encoded " "bytes or code points to read for decoding. The decoder can modify this " @@ -961,13 +956,13 @@ msgid "" "huge files in one step." msgstr "" -#: ../../library/codecs.rst:761 +#: ../../library/codecs.rst:757 msgid "" "The *firstline* flag indicates that it would be sufficient to only return " "the first line, if there are decoding errors on later lines." msgstr "" -#: ../../library/codecs.rst:765 +#: ../../library/codecs.rst:761 msgid "" "The method should use a greedy read strategy meaning that it should read as " "much data as is allowed within the definition of the encoding and the given " @@ -975,68 +970,72 @@ msgid "" "the stream, these should be read too." msgstr "" -#: ../../library/codecs.rst:773 +#: ../../library/codecs.rst:769 msgid "Read one line from the input stream and return the decoded data." msgstr "" -#: ../../library/codecs.rst:775 +#: ../../library/codecs.rst:771 msgid "" "*size*, if given, is passed as size argument to the stream's :meth:`read` " "method." msgstr "" -#: ../../library/codecs.rst:778 +#: ../../library/codecs.rst:774 msgid "" "If *keepends* is false line-endings will be stripped from the lines returned." msgstr "" -#: ../../library/codecs.rst:784 +#: ../../library/codecs.rst:780 msgid "" "Read all lines available on the input stream and return them as a list of " "lines." msgstr "" -#: ../../library/codecs.rst:787 +#: ../../library/codecs.rst:783 msgid "" "Line-endings are implemented using the codec's :meth:`decode` method and are " "included in the list entries if *keepends* is true." msgstr "" -#: ../../library/codecs.rst:790 +#: ../../library/codecs.rst:786 msgid "" "*sizehint*, if given, is passed as the *size* argument to the stream's :meth:" "`read` method." msgstr "" -#: ../../library/codecs.rst:798 +#: ../../library/codecs.rst:792 +msgid "Resets the codec buffers used for keeping state." +msgstr "" + +#: ../../library/codecs.rst:794 msgid "" "Note that no stream repositioning should take place. This method is " "primarily intended to be able to recover from decoding errors." msgstr "" -#: ../../library/codecs.rst:802 +#: ../../library/codecs.rst:798 msgid "" "In addition to the above methods, the :class:`StreamReader` must also " "inherit all other methods and attributes from the underlying stream." msgstr "" -#: ../../library/codecs.rst:808 +#: ../../library/codecs.rst:804 msgid "StreamReaderWriter Objects" msgstr "" -#: ../../library/codecs.rst:810 +#: ../../library/codecs.rst:806 msgid "" "The :class:`StreamReaderWriter` is a convenience class that allows wrapping " "streams which work in both read and write modes." msgstr "" -#: ../../library/codecs.rst:813 ../../library/codecs.rst:837 +#: ../../library/codecs.rst:809 ../../library/codecs.rst:833 msgid "" "The design is such that one can use the factory functions returned by the :" "func:`lookup` function to construct the instance." msgstr "" -#: ../../library/codecs.rst:819 +#: ../../library/codecs.rst:815 msgid "" "Creates a :class:`StreamReaderWriter` instance. *stream* must be a file-like " "object. *Reader* and *Writer* must be factory functions or classes providing " @@ -1045,24 +1044,24 @@ msgid "" "writers." msgstr "" -#: ../../library/codecs.rst:824 +#: ../../library/codecs.rst:820 msgid "" ":class:`StreamReaderWriter` instances define the combined interfaces of :" "class:`StreamReader` and :class:`StreamWriter` classes. They inherit all " "other methods and attributes from the underlying stream." msgstr "" -#: ../../library/codecs.rst:832 +#: ../../library/codecs.rst:828 msgid "StreamRecoder Objects" msgstr "" -#: ../../library/codecs.rst:834 +#: ../../library/codecs.rst:830 msgid "" "The :class:`StreamRecoder` translates data from one encoding to another, " "which is sometimes useful when dealing with different encoding environments." msgstr "" -#: ../../library/codecs.rst:843 +#: ../../library/codecs.rst:839 msgid "" "Creates a :class:`StreamRecoder` instance which implements a two-way " "conversion: *encode* and *decode* work on the frontend — the data visible to " @@ -1070,17 +1069,17 @@ msgid "" "work on the backend — the data in *stream*." msgstr "" -#: ../../library/codecs.rst:848 +#: ../../library/codecs.rst:844 msgid "" "You can use these objects to do transparent transcodings, e.g., from Latin-1 " "to UTF-8 and back." msgstr "" -#: ../../library/codecs.rst:851 +#: ../../library/codecs.rst:847 msgid "The *stream* argument must be a file-like object." msgstr "" -#: ../../library/codecs.rst:853 +#: ../../library/codecs.rst:849 msgid "" "The *encode* and *decode* arguments must adhere to the :class:`Codec` " "interface. *Reader* and *Writer* must be factory functions or classes " @@ -1088,24 +1087,24 @@ msgid "" "interface respectively." msgstr "" -#: ../../library/codecs.rst:858 +#: ../../library/codecs.rst:854 msgid "" "Error handling is done in the same way as defined for the stream readers and " "writers." msgstr "" -#: ../../library/codecs.rst:862 +#: ../../library/codecs.rst:858 msgid "" ":class:`StreamRecoder` instances define the combined interfaces of :class:" "`StreamReader` and :class:`StreamWriter` classes. They inherit all other " "methods and attributes from the underlying stream." msgstr "" -#: ../../library/codecs.rst:870 +#: ../../library/codecs.rst:866 msgid "Encodings and Unicode" msgstr "" -#: ../../library/codecs.rst:872 +#: ../../library/codecs.rst:868 msgid "" "Strings are stored internally as sequences of code points in range ``0x0``--" "``0x10FFFF``. (See :pep:`393` for more details about the implementation.) " @@ -1117,7 +1116,7 @@ msgid "" "collectivity referred to as :term:`text encodings `." msgstr "" -#: ../../library/codecs.rst:882 +#: ../../library/codecs.rst:878 msgid "" "The simplest text encoding (called ``'latin-1'`` or ``'iso-8859-1'``) maps " "the code points 0--255 to the bytes ``0x0``--``0xff``, which means that a " @@ -1128,7 +1127,7 @@ msgid "" "position 3: ordinal not in range(256)``." msgstr "" -#: ../../library/codecs.rst:890 +#: ../../library/codecs.rst:886 msgid "" "There's another group of encodings (the so called charmap encodings) that " "choose a different subset of all Unicode code points and how these code " @@ -1138,7 +1137,7 @@ msgid "" "that shows you which character is mapped to which byte value." msgstr "" -#: ../../library/codecs.rst:897 +#: ../../library/codecs.rst:893 msgid "" "All of these encodings can only encode 256 of the 1114112 code points " "defined in Unicode. A simple and straightforward way that can store each " @@ -1168,7 +1167,7 @@ msgid "" "normal character that will be decoded like any other." msgstr "" -#: ../../library/codecs.rst:923 +#: ../../library/codecs.rst:919 msgid "" "There's another encoding that is able to encoding the full range of Unicode " "characters: UTF-8. UTF-8 is an 8-bit encoding, which means there are no " @@ -1179,59 +1178,59 @@ msgid "" "which when concatenated give the Unicode character):" msgstr "" -#: ../../library/codecs.rst:932 +#: ../../library/codecs.rst:928 msgid "Range" msgstr "" -#: ../../library/codecs.rst:932 +#: ../../library/codecs.rst:928 msgid "Encoding" msgstr "" -#: ../../library/codecs.rst:934 +#: ../../library/codecs.rst:930 msgid "``U-00000000`` ... ``U-0000007F``" msgstr "" -#: ../../library/codecs.rst:934 +#: ../../library/codecs.rst:930 msgid "0xxxxxxx" msgstr "" -#: ../../library/codecs.rst:936 +#: ../../library/codecs.rst:932 msgid "``U-00000080`` ... ``U-000007FF``" msgstr "" -#: ../../library/codecs.rst:936 +#: ../../library/codecs.rst:932 msgid "110xxxxx 10xxxxxx" msgstr "" -#: ../../library/codecs.rst:938 +#: ../../library/codecs.rst:934 msgid "``U-00000800`` ... ``U-0000FFFF``" msgstr "" -#: ../../library/codecs.rst:938 +#: ../../library/codecs.rst:934 msgid "1110xxxx 10xxxxxx 10xxxxxx" msgstr "" -#: ../../library/codecs.rst:940 +#: ../../library/codecs.rst:936 msgid "``U-00010000`` ... ``U-0010FFFF``" msgstr "" -#: ../../library/codecs.rst:940 +#: ../../library/codecs.rst:936 msgid "11110xxx 10xxxxxx 10xxxxxx 10xxxxxx" msgstr "" -#: ../../library/codecs.rst:943 +#: ../../library/codecs.rst:939 msgid "" "The least significant bit of the Unicode character is the rightmost x bit." msgstr "" -#: ../../library/codecs.rst:945 +#: ../../library/codecs.rst:941 msgid "" "As UTF-8 is an 8-bit encoding no BOM is required and any ``U+FEFF`` " "character in the decoded string (even if it's the first character) is " "treated as a ``ZERO WIDTH NO-BREAK SPACE``." msgstr "" -#: ../../library/codecs.rst:949 +#: ../../library/codecs.rst:945 msgid "" "Without external information it's impossible to reliably determine which " "encoding was used for encoding a string. Each charmap encoding can decode " @@ -1258,7 +1257,7 @@ msgstr "" msgid "INVERTED QUESTION MARK" msgstr "" -#: ../../library/codecs.rst:965 +#: ../../library/codecs.rst:961 msgid "" "in iso-8859-1), this increases the probability that a ``utf-8-sig`` encoding " "can be correctly guessed from the byte sequence. So here the BOM is not used " @@ -1270,11 +1269,11 @@ msgid "" "the use of the BOM is discouraged and should generally be avoided." msgstr "" -#: ../../library/codecs.rst:978 +#: ../../library/codecs.rst:974 msgid "Standard Encodings" msgstr "" -#: ../../library/codecs.rst:980 +#: ../../library/codecs.rst:976 msgid "" "Python comes with a number of codecs built-in, either implemented as C " "functions or with dictionaries as mapping tables. The following table lists " @@ -1286,7 +1285,7 @@ msgid "" "alias for the ``'utf_8'`` codec." msgstr "" -#: ../../library/codecs.rst:990 +#: ../../library/codecs.rst:986 msgid "" "Some common encodings can bypass the codecs lookup machinery to improve " "performance. These optimization opportunities are only recognized by CPython " @@ -1296,11 +1295,11 @@ msgid "" "Using alternative aliases for these encodings may result in slower execution." msgstr "" -#: ../../library/codecs.rst:998 +#: ../../library/codecs.rst:994 msgid "Optimization opportunity recognized for us-ascii." msgstr "" -#: ../../library/codecs.rst:1001 +#: ../../library/codecs.rst:997 msgid "" "Many of the character sets support the same languages. They vary in " "individual characters (e.g. whether the EURO SIGN is supported or not), and " @@ -1308,949 +1307,949 @@ msgid "" "languages in particular, the following variants typically exist:" msgstr "" -#: ../../library/codecs.rst:1006 +#: ../../library/codecs.rst:1002 msgid "an ISO 8859 codeset" msgstr "" -#: ../../library/codecs.rst:1008 +#: ../../library/codecs.rst:1004 msgid "" "a Microsoft Windows code page, which is typically derived from an 8859 " "codeset, but replaces control characters with additional graphic characters" msgstr "" -#: ../../library/codecs.rst:1011 +#: ../../library/codecs.rst:1007 msgid "an IBM EBCDIC code page" msgstr "" -#: ../../library/codecs.rst:1013 +#: ../../library/codecs.rst:1009 msgid "an IBM PC code page, which is ASCII compatible" msgstr "" -#: ../../library/codecs.rst:1018 ../../library/codecs.rst:1273 -#: ../../library/codecs.rst:1340 ../../library/codecs.rst:1395 +#: ../../library/codecs.rst:1014 ../../library/codecs.rst:1269 +#: ../../library/codecs.rst:1336 ../../library/codecs.rst:1391 msgid "Codec" msgstr "" -#: ../../library/codecs.rst:1018 ../../library/codecs.rst:1273 -#: ../../library/codecs.rst:1340 ../../library/codecs.rst:1395 +#: ../../library/codecs.rst:1014 ../../library/codecs.rst:1269 +#: ../../library/codecs.rst:1336 ../../library/codecs.rst:1391 msgid "Aliases" msgstr "" -#: ../../library/codecs.rst:1018 +#: ../../library/codecs.rst:1014 msgid "Languages" msgstr "" -#: ../../library/codecs.rst:1020 +#: ../../library/codecs.rst:1016 msgid "ascii" msgstr "" -#: ../../library/codecs.rst:1020 +#: ../../library/codecs.rst:1016 msgid "646, us-ascii" msgstr "" -#: ../../library/codecs.rst:1020 ../../library/codecs.rst:1026 -#: ../../library/codecs.rst:1034 +#: ../../library/codecs.rst:1016 ../../library/codecs.rst:1022 +#: ../../library/codecs.rst:1030 msgid "English" msgstr "" -#: ../../library/codecs.rst:1022 +#: ../../library/codecs.rst:1018 msgid "big5" msgstr "" -#: ../../library/codecs.rst:1022 +#: ../../library/codecs.rst:1018 msgid "big5-tw, csbig5" msgstr "" -#: ../../library/codecs.rst:1022 ../../library/codecs.rst:1024 -#: ../../library/codecs.rst:1082 +#: ../../library/codecs.rst:1018 ../../library/codecs.rst:1020 +#: ../../library/codecs.rst:1078 msgid "Traditional Chinese" msgstr "" -#: ../../library/codecs.rst:1024 +#: ../../library/codecs.rst:1020 msgid "big5hkscs" msgstr "" -#: ../../library/codecs.rst:1024 +#: ../../library/codecs.rst:1020 msgid "big5-hkscs, hkscs" msgstr "" -#: ../../library/codecs.rst:1026 +#: ../../library/codecs.rst:1022 msgid "cp037" msgstr "" -#: ../../library/codecs.rst:1026 +#: ../../library/codecs.rst:1022 msgid "IBM037, IBM039" msgstr "" -#: ../../library/codecs.rst:1028 +#: ../../library/codecs.rst:1024 msgid "cp273" msgstr "" -#: ../../library/codecs.rst:1028 +#: ../../library/codecs.rst:1024 msgid "273, IBM273, csIBM273" msgstr "" -#: ../../library/codecs.rst:1028 +#: ../../library/codecs.rst:1024 msgid "German" msgstr "" -#: ../../library/codecs.rst:1032 +#: ../../library/codecs.rst:1028 msgid "cp424" msgstr "" -#: ../../library/codecs.rst:1032 +#: ../../library/codecs.rst:1028 msgid "EBCDIC-CP-HE, IBM424" msgstr "" -#: ../../library/codecs.rst:1032 ../../library/codecs.rst:1052 -#: ../../library/codecs.rst:1062 ../../library/codecs.rst:1105 -#: ../../library/codecs.rst:1168 +#: ../../library/codecs.rst:1028 ../../library/codecs.rst:1048 +#: ../../library/codecs.rst:1058 ../../library/codecs.rst:1101 +#: ../../library/codecs.rst:1164 msgid "Hebrew" msgstr "" -#: ../../library/codecs.rst:1034 +#: ../../library/codecs.rst:1030 msgid "cp437" msgstr "" -#: ../../library/codecs.rst:1034 +#: ../../library/codecs.rst:1030 msgid "437, IBM437" msgstr "" -#: ../../library/codecs.rst:1036 +#: ../../library/codecs.rst:1032 msgid "cp500" msgstr "" -#: ../../library/codecs.rst:1036 +#: ../../library/codecs.rst:1032 msgid "EBCDIC-CP-BE, EBCDIC-CP-CH, IBM500" msgstr "" -#: ../../library/codecs.rst:1036 ../../library/codecs.rst:1045 -#: ../../library/codecs.rst:1056 ../../library/codecs.rst:1092 -#: ../../library/codecs.rst:1099 ../../library/codecs.rst:1152 -#: ../../library/codecs.rst:1180 ../../library/codecs.rst:1208 +#: ../../library/codecs.rst:1032 ../../library/codecs.rst:1041 +#: ../../library/codecs.rst:1052 ../../library/codecs.rst:1088 +#: ../../library/codecs.rst:1095 ../../library/codecs.rst:1148 +#: ../../library/codecs.rst:1176 ../../library/codecs.rst:1204 msgid "Western Europe" msgstr "" -#: ../../library/codecs.rst:1039 +#: ../../library/codecs.rst:1035 msgid "cp720" msgstr "" -#: ../../library/codecs.rst:1039 ../../library/codecs.rst:1066 -#: ../../library/codecs.rst:1107 ../../library/codecs.rst:1164 +#: ../../library/codecs.rst:1035 ../../library/codecs.rst:1062 +#: ../../library/codecs.rst:1103 ../../library/codecs.rst:1160 msgid "Arabic" msgstr "" -#: ../../library/codecs.rst:1041 +#: ../../library/codecs.rst:1037 msgid "cp737" msgstr "" -#: ../../library/codecs.rst:1041 ../../library/codecs.rst:1072 -#: ../../library/codecs.rst:1076 ../../library/codecs.rst:1101 -#: ../../library/codecs.rst:1166 ../../library/codecs.rst:1201 +#: ../../library/codecs.rst:1037 ../../library/codecs.rst:1068 +#: ../../library/codecs.rst:1072 ../../library/codecs.rst:1097 +#: ../../library/codecs.rst:1162 ../../library/codecs.rst:1197 msgid "Greek" msgstr "" -#: ../../library/codecs.rst:1043 +#: ../../library/codecs.rst:1039 msgid "cp775" msgstr "" -#: ../../library/codecs.rst:1043 +#: ../../library/codecs.rst:1039 msgid "IBM775" msgstr "" -#: ../../library/codecs.rst:1043 ../../library/codecs.rst:1109 -#: ../../library/codecs.rst:1159 ../../library/codecs.rst:1176 +#: ../../library/codecs.rst:1039 ../../library/codecs.rst:1105 +#: ../../library/codecs.rst:1155 ../../library/codecs.rst:1172 msgid "Baltic languages" msgstr "" -#: ../../library/codecs.rst:1045 +#: ../../library/codecs.rst:1041 msgid "cp850" msgstr "" -#: ../../library/codecs.rst:1045 +#: ../../library/codecs.rst:1041 msgid "850, IBM850" msgstr "" -#: ../../library/codecs.rst:1047 +#: ../../library/codecs.rst:1043 msgid "cp852" msgstr "" -#: ../../library/codecs.rst:1047 +#: ../../library/codecs.rst:1043 msgid "852, IBM852" msgstr "" -#: ../../library/codecs.rst:1047 ../../library/codecs.rst:1094 -#: ../../library/codecs.rst:1155 ../../library/codecs.rst:1205 +#: ../../library/codecs.rst:1043 ../../library/codecs.rst:1090 +#: ../../library/codecs.rst:1151 ../../library/codecs.rst:1201 msgid "Central and Eastern Europe" msgstr "" -#: ../../library/codecs.rst:1049 +#: ../../library/codecs.rst:1045 msgid "cp855" msgstr "" -#: ../../library/codecs.rst:1049 +#: ../../library/codecs.rst:1045 msgid "855, IBM855" msgstr "" -#: ../../library/codecs.rst:1049 ../../library/codecs.rst:1096 -#: ../../library/codecs.rst:1161 ../../library/codecs.rst:1198 +#: ../../library/codecs.rst:1045 ../../library/codecs.rst:1092 +#: ../../library/codecs.rst:1157 ../../library/codecs.rst:1194 msgid "Bulgarian, Byelorussian, Macedonian, Russian, Serbian" msgstr "" -#: ../../library/codecs.rst:1052 +#: ../../library/codecs.rst:1048 msgid "cp856" msgstr "" -#: ../../library/codecs.rst:1054 +#: ../../library/codecs.rst:1050 msgid "cp857" msgstr "" -#: ../../library/codecs.rst:1054 +#: ../../library/codecs.rst:1050 msgid "857, IBM857" msgstr "" -#: ../../library/codecs.rst:1054 ../../library/codecs.rst:1086 -#: ../../library/codecs.rst:1103 ../../library/codecs.rst:1170 -#: ../../library/codecs.rst:1210 +#: ../../library/codecs.rst:1050 ../../library/codecs.rst:1082 +#: ../../library/codecs.rst:1099 ../../library/codecs.rst:1166 +#: ../../library/codecs.rst:1206 msgid "Turkish" msgstr "" -#: ../../library/codecs.rst:1056 +#: ../../library/codecs.rst:1052 msgid "cp858" msgstr "" -#: ../../library/codecs.rst:1056 +#: ../../library/codecs.rst:1052 msgid "858, IBM858" msgstr "" -#: ../../library/codecs.rst:1058 +#: ../../library/codecs.rst:1054 msgid "cp860" msgstr "" -#: ../../library/codecs.rst:1058 +#: ../../library/codecs.rst:1054 msgid "860, IBM860" msgstr "" -#: ../../library/codecs.rst:1058 +#: ../../library/codecs.rst:1054 msgid "Portuguese" msgstr "" -#: ../../library/codecs.rst:1060 +#: ../../library/codecs.rst:1056 msgid "cp861" msgstr "" -#: ../../library/codecs.rst:1060 +#: ../../library/codecs.rst:1056 msgid "861, CP-IS, IBM861" msgstr "" -#: ../../library/codecs.rst:1060 ../../library/codecs.rst:1203 +#: ../../library/codecs.rst:1056 ../../library/codecs.rst:1199 msgid "Icelandic" msgstr "" -#: ../../library/codecs.rst:1062 +#: ../../library/codecs.rst:1058 msgid "cp862" msgstr "" -#: ../../library/codecs.rst:1062 +#: ../../library/codecs.rst:1058 msgid "862, IBM862" msgstr "" -#: ../../library/codecs.rst:1064 +#: ../../library/codecs.rst:1060 msgid "cp863" msgstr "" -#: ../../library/codecs.rst:1064 +#: ../../library/codecs.rst:1060 msgid "863, IBM863" msgstr "" -#: ../../library/codecs.rst:1064 +#: ../../library/codecs.rst:1060 msgid "Canadian" msgstr "" -#: ../../library/codecs.rst:1066 +#: ../../library/codecs.rst:1062 msgid "cp864" msgstr "" -#: ../../library/codecs.rst:1066 +#: ../../library/codecs.rst:1062 msgid "IBM864" msgstr "" -#: ../../library/codecs.rst:1068 +#: ../../library/codecs.rst:1064 msgid "cp865" msgstr "" -#: ../../library/codecs.rst:1068 +#: ../../library/codecs.rst:1064 msgid "865, IBM865" msgstr "" -#: ../../library/codecs.rst:1068 +#: ../../library/codecs.rst:1064 msgid "Danish, Norwegian" msgstr "" -#: ../../library/codecs.rst:1070 +#: ../../library/codecs.rst:1066 msgid "cp866" msgstr "" -#: ../../library/codecs.rst:1070 +#: ../../library/codecs.rst:1066 msgid "866, IBM866" msgstr "" -#: ../../library/codecs.rst:1070 ../../library/codecs.rst:1186 +#: ../../library/codecs.rst:1066 ../../library/codecs.rst:1182 msgid "Russian" msgstr "" -#: ../../library/codecs.rst:1072 +#: ../../library/codecs.rst:1068 msgid "cp869" msgstr "" -#: ../../library/codecs.rst:1072 +#: ../../library/codecs.rst:1068 msgid "869, CP-GR, IBM869" msgstr "" -#: ../../library/codecs.rst:1074 +#: ../../library/codecs.rst:1070 msgid "cp874" msgstr "" -#: ../../library/codecs.rst:1074 +#: ../../library/codecs.rst:1070 msgid "Thai" msgstr "" -#: ../../library/codecs.rst:1076 +#: ../../library/codecs.rst:1072 msgid "cp875" msgstr "" -#: ../../library/codecs.rst:1078 +#: ../../library/codecs.rst:1074 msgid "cp932" msgstr "" -#: ../../library/codecs.rst:1078 +#: ../../library/codecs.rst:1074 msgid "932, ms932, mskanji, ms-kanji" msgstr "" -#: ../../library/codecs.rst:1078 ../../library/codecs.rst:1113 -#: ../../library/codecs.rst:1115 ../../library/codecs.rst:1117 -#: ../../library/codecs.rst:1134 ../../library/codecs.rst:1137 -#: ../../library/codecs.rst:1142 ../../library/codecs.rst:1145 -#: ../../library/codecs.rst:1147 ../../library/codecs.rst:1215 -#: ../../library/codecs.rst:1218 ../../library/codecs.rst:1221 +#: ../../library/codecs.rst:1074 ../../library/codecs.rst:1109 +#: ../../library/codecs.rst:1111 ../../library/codecs.rst:1113 +#: ../../library/codecs.rst:1130 ../../library/codecs.rst:1133 +#: ../../library/codecs.rst:1138 ../../library/codecs.rst:1141 +#: ../../library/codecs.rst:1143 ../../library/codecs.rst:1211 +#: ../../library/codecs.rst:1214 ../../library/codecs.rst:1217 msgid "Japanese" msgstr "" -#: ../../library/codecs.rst:1080 +#: ../../library/codecs.rst:1076 msgid "cp949" msgstr "" -#: ../../library/codecs.rst:1080 +#: ../../library/codecs.rst:1076 msgid "949, ms949, uhc" msgstr "" -#: ../../library/codecs.rst:1080 ../../library/codecs.rst:1119 -#: ../../library/codecs.rst:1149 ../../library/codecs.rst:1184 +#: ../../library/codecs.rst:1076 ../../library/codecs.rst:1115 +#: ../../library/codecs.rst:1145 ../../library/codecs.rst:1180 msgid "Korean" msgstr "" -#: ../../library/codecs.rst:1082 +#: ../../library/codecs.rst:1078 msgid "cp950" msgstr "" -#: ../../library/codecs.rst:1082 +#: ../../library/codecs.rst:1078 msgid "950, ms950" msgstr "" -#: ../../library/codecs.rst:1084 +#: ../../library/codecs.rst:1080 msgid "cp1006" msgstr "" -#: ../../library/codecs.rst:1084 +#: ../../library/codecs.rst:1080 msgid "Urdu" msgstr "" -#: ../../library/codecs.rst:1086 +#: ../../library/codecs.rst:1082 msgid "cp1026" msgstr "" -#: ../../library/codecs.rst:1086 +#: ../../library/codecs.rst:1082 msgid "ibm1026" msgstr "" -#: ../../library/codecs.rst:1088 +#: ../../library/codecs.rst:1084 msgid "cp1125" msgstr "" -#: ../../library/codecs.rst:1088 +#: ../../library/codecs.rst:1084 msgid "1125, ibm1125, cp866u, ruscii" msgstr "" -#: ../../library/codecs.rst:1088 ../../library/codecs.rst:1192 +#: ../../library/codecs.rst:1084 ../../library/codecs.rst:1188 msgid "Ukrainian" msgstr "" -#: ../../library/codecs.rst:1092 +#: ../../library/codecs.rst:1088 msgid "cp1140" msgstr "" -#: ../../library/codecs.rst:1092 +#: ../../library/codecs.rst:1088 msgid "ibm1140" msgstr "" -#: ../../library/codecs.rst:1094 +#: ../../library/codecs.rst:1090 msgid "cp1250" msgstr "" -#: ../../library/codecs.rst:1094 +#: ../../library/codecs.rst:1090 msgid "windows-1250" msgstr "" -#: ../../library/codecs.rst:1096 +#: ../../library/codecs.rst:1092 msgid "cp1251" msgstr "" -#: ../../library/codecs.rst:1096 +#: ../../library/codecs.rst:1092 msgid "windows-1251" msgstr "" -#: ../../library/codecs.rst:1099 +#: ../../library/codecs.rst:1095 msgid "cp1252" msgstr "" -#: ../../library/codecs.rst:1099 +#: ../../library/codecs.rst:1095 msgid "windows-1252" msgstr "" -#: ../../library/codecs.rst:1101 +#: ../../library/codecs.rst:1097 msgid "cp1253" msgstr "" -#: ../../library/codecs.rst:1101 +#: ../../library/codecs.rst:1097 msgid "windows-1253" msgstr "" -#: ../../library/codecs.rst:1103 +#: ../../library/codecs.rst:1099 msgid "cp1254" msgstr "" -#: ../../library/codecs.rst:1103 +#: ../../library/codecs.rst:1099 msgid "windows-1254" msgstr "" -#: ../../library/codecs.rst:1105 +#: ../../library/codecs.rst:1101 msgid "cp1255" msgstr "" -#: ../../library/codecs.rst:1105 +#: ../../library/codecs.rst:1101 msgid "windows-1255" msgstr "" -#: ../../library/codecs.rst:1107 +#: ../../library/codecs.rst:1103 msgid "cp1256" msgstr "" -#: ../../library/codecs.rst:1107 +#: ../../library/codecs.rst:1103 msgid "windows-1256" msgstr "" -#: ../../library/codecs.rst:1109 +#: ../../library/codecs.rst:1105 msgid "cp1257" msgstr "" -#: ../../library/codecs.rst:1109 +#: ../../library/codecs.rst:1105 msgid "windows-1257" msgstr "" -#: ../../library/codecs.rst:1111 +#: ../../library/codecs.rst:1107 msgid "cp1258" msgstr "" -#: ../../library/codecs.rst:1111 +#: ../../library/codecs.rst:1107 msgid "windows-1258" msgstr "" -#: ../../library/codecs.rst:1111 +#: ../../library/codecs.rst:1107 msgid "Vietnamese" msgstr "" -#: ../../library/codecs.rst:1113 +#: ../../library/codecs.rst:1109 msgid "euc_jp" msgstr "" -#: ../../library/codecs.rst:1113 +#: ../../library/codecs.rst:1109 msgid "eucjp, ujis, u-jis" msgstr "" -#: ../../library/codecs.rst:1115 +#: ../../library/codecs.rst:1111 msgid "euc_jis_2004" msgstr "" -#: ../../library/codecs.rst:1115 +#: ../../library/codecs.rst:1111 msgid "jisx0213, eucjis2004" msgstr "" -#: ../../library/codecs.rst:1117 +#: ../../library/codecs.rst:1113 msgid "euc_jisx0213" msgstr "" -#: ../../library/codecs.rst:1117 +#: ../../library/codecs.rst:1113 msgid "eucjisx0213" msgstr "" -#: ../../library/codecs.rst:1119 +#: ../../library/codecs.rst:1115 msgid "euc_kr" msgstr "" -#: ../../library/codecs.rst:1119 +#: ../../library/codecs.rst:1115 msgid "euckr, korean, ksc5601, ks_c-5601, ks_c-5601-1987, ksx1001, ks_x-1001" msgstr "" -#: ../../library/codecs.rst:1123 +#: ../../library/codecs.rst:1119 msgid "gb2312" msgstr "" -#: ../../library/codecs.rst:1123 +#: ../../library/codecs.rst:1119 msgid "" "chinese, csiso58gb231280, euc-cn, euccn, eucgb2312-cn, gb2312-1980, " "gb2312-80, iso-ir-58" msgstr "" -#: ../../library/codecs.rst:1123 ../../library/codecs.rst:1132 +#: ../../library/codecs.rst:1119 ../../library/codecs.rst:1128 msgid "Simplified Chinese" msgstr "" -#: ../../library/codecs.rst:1128 +#: ../../library/codecs.rst:1124 msgid "gbk" msgstr "" -#: ../../library/codecs.rst:1128 +#: ../../library/codecs.rst:1124 msgid "936, cp936, ms936" msgstr "" -#: ../../library/codecs.rst:1128 ../../library/codecs.rst:1130 +#: ../../library/codecs.rst:1124 ../../library/codecs.rst:1126 msgid "Unified Chinese" msgstr "" -#: ../../library/codecs.rst:1130 +#: ../../library/codecs.rst:1126 msgid "gb18030" msgstr "" -#: ../../library/codecs.rst:1130 +#: ../../library/codecs.rst:1126 msgid "gb18030-2000" msgstr "" -#: ../../library/codecs.rst:1132 +#: ../../library/codecs.rst:1128 msgid "hz" msgstr "" -#: ../../library/codecs.rst:1132 +#: ../../library/codecs.rst:1128 msgid "hzgb, hz-gb, hz-gb-2312" msgstr "" -#: ../../library/codecs.rst:1134 +#: ../../library/codecs.rst:1130 msgid "iso2022_jp" msgstr "" -#: ../../library/codecs.rst:1134 +#: ../../library/codecs.rst:1130 msgid "csiso2022jp, iso2022jp, iso-2022-jp" msgstr "" -#: ../../library/codecs.rst:1137 +#: ../../library/codecs.rst:1133 msgid "iso2022_jp_1" msgstr "" -#: ../../library/codecs.rst:1137 +#: ../../library/codecs.rst:1133 msgid "iso2022jp-1, iso-2022-jp-1" msgstr "" -#: ../../library/codecs.rst:1139 +#: ../../library/codecs.rst:1135 msgid "iso2022_jp_2" msgstr "" -#: ../../library/codecs.rst:1139 +#: ../../library/codecs.rst:1135 msgid "iso2022jp-2, iso-2022-jp-2" msgstr "" -#: ../../library/codecs.rst:1139 +#: ../../library/codecs.rst:1135 msgid "Japanese, Korean, Simplified Chinese, Western Europe, Greek" msgstr "" -#: ../../library/codecs.rst:1142 +#: ../../library/codecs.rst:1138 msgid "iso2022_jp_2004" msgstr "" -#: ../../library/codecs.rst:1142 +#: ../../library/codecs.rst:1138 msgid "iso2022jp-2004, iso-2022-jp-2004" msgstr "" -#: ../../library/codecs.rst:1145 +#: ../../library/codecs.rst:1141 msgid "iso2022_jp_3" msgstr "" -#: ../../library/codecs.rst:1145 +#: ../../library/codecs.rst:1141 msgid "iso2022jp-3, iso-2022-jp-3" msgstr "" -#: ../../library/codecs.rst:1147 +#: ../../library/codecs.rst:1143 msgid "iso2022_jp_ext" msgstr "" -#: ../../library/codecs.rst:1147 +#: ../../library/codecs.rst:1143 msgid "iso2022jp-ext, iso-2022-jp-ext" msgstr "" -#: ../../library/codecs.rst:1149 +#: ../../library/codecs.rst:1145 msgid "iso2022_kr" msgstr "" -#: ../../library/codecs.rst:1149 +#: ../../library/codecs.rst:1145 msgid "csiso2022kr, iso2022kr, iso-2022-kr" msgstr "" -#: ../../library/codecs.rst:1152 +#: ../../library/codecs.rst:1148 msgid "latin_1" msgstr "" -#: ../../library/codecs.rst:1152 +#: ../../library/codecs.rst:1148 msgid "iso-8859-1, iso8859-1, 8859, cp819, latin, latin1, L1" msgstr "" -#: ../../library/codecs.rst:1155 +#: ../../library/codecs.rst:1151 msgid "iso8859_2" msgstr "" -#: ../../library/codecs.rst:1155 +#: ../../library/codecs.rst:1151 msgid "iso-8859-2, latin2, L2" msgstr "" -#: ../../library/codecs.rst:1157 +#: ../../library/codecs.rst:1153 msgid "iso8859_3" msgstr "" -#: ../../library/codecs.rst:1157 +#: ../../library/codecs.rst:1153 msgid "iso-8859-3, latin3, L3" msgstr "" -#: ../../library/codecs.rst:1157 +#: ../../library/codecs.rst:1153 msgid "Esperanto, Maltese" msgstr "" -#: ../../library/codecs.rst:1159 +#: ../../library/codecs.rst:1155 msgid "iso8859_4" msgstr "" -#: ../../library/codecs.rst:1159 +#: ../../library/codecs.rst:1155 msgid "iso-8859-4, latin4, L4" msgstr "" -#: ../../library/codecs.rst:1161 +#: ../../library/codecs.rst:1157 msgid "iso8859_5" msgstr "" -#: ../../library/codecs.rst:1161 +#: ../../library/codecs.rst:1157 msgid "iso-8859-5, cyrillic" msgstr "" -#: ../../library/codecs.rst:1164 +#: ../../library/codecs.rst:1160 msgid "iso8859_6" msgstr "" -#: ../../library/codecs.rst:1164 +#: ../../library/codecs.rst:1160 msgid "iso-8859-6, arabic" msgstr "" -#: ../../library/codecs.rst:1166 +#: ../../library/codecs.rst:1162 msgid "iso8859_7" msgstr "" -#: ../../library/codecs.rst:1166 +#: ../../library/codecs.rst:1162 msgid "iso-8859-7, greek, greek8" msgstr "" -#: ../../library/codecs.rst:1168 +#: ../../library/codecs.rst:1164 msgid "iso8859_8" msgstr "" -#: ../../library/codecs.rst:1168 +#: ../../library/codecs.rst:1164 msgid "iso-8859-8, hebrew" msgstr "" -#: ../../library/codecs.rst:1170 +#: ../../library/codecs.rst:1166 msgid "iso8859_9" msgstr "" -#: ../../library/codecs.rst:1170 +#: ../../library/codecs.rst:1166 msgid "iso-8859-9, latin5, L5" msgstr "" -#: ../../library/codecs.rst:1172 +#: ../../library/codecs.rst:1168 msgid "iso8859_10" msgstr "" -#: ../../library/codecs.rst:1172 +#: ../../library/codecs.rst:1168 msgid "iso-8859-10, latin6, L6" msgstr "" -#: ../../library/codecs.rst:1172 +#: ../../library/codecs.rst:1168 msgid "Nordic languages" msgstr "" -#: ../../library/codecs.rst:1174 +#: ../../library/codecs.rst:1170 msgid "iso8859_11" msgstr "" -#: ../../library/codecs.rst:1174 +#: ../../library/codecs.rst:1170 msgid "iso-8859-11, thai" msgstr "" -#: ../../library/codecs.rst:1174 +#: ../../library/codecs.rst:1170 msgid "Thai languages" msgstr "" -#: ../../library/codecs.rst:1176 +#: ../../library/codecs.rst:1172 msgid "iso8859_13" msgstr "" -#: ../../library/codecs.rst:1176 +#: ../../library/codecs.rst:1172 msgid "iso-8859-13, latin7, L7" msgstr "" -#: ../../library/codecs.rst:1178 +#: ../../library/codecs.rst:1174 msgid "iso8859_14" msgstr "" -#: ../../library/codecs.rst:1178 +#: ../../library/codecs.rst:1174 msgid "iso-8859-14, latin8, L8" msgstr "" -#: ../../library/codecs.rst:1178 +#: ../../library/codecs.rst:1174 msgid "Celtic languages" msgstr "" -#: ../../library/codecs.rst:1180 +#: ../../library/codecs.rst:1176 msgid "iso8859_15" msgstr "" -#: ../../library/codecs.rst:1180 +#: ../../library/codecs.rst:1176 msgid "iso-8859-15, latin9, L9" msgstr "" -#: ../../library/codecs.rst:1182 +#: ../../library/codecs.rst:1178 msgid "iso8859_16" msgstr "" -#: ../../library/codecs.rst:1182 +#: ../../library/codecs.rst:1178 msgid "iso-8859-16, latin10, L10" msgstr "" -#: ../../library/codecs.rst:1182 +#: ../../library/codecs.rst:1178 msgid "South-Eastern Europe" msgstr "" -#: ../../library/codecs.rst:1184 +#: ../../library/codecs.rst:1180 msgid "johab" msgstr "" -#: ../../library/codecs.rst:1184 +#: ../../library/codecs.rst:1180 msgid "cp1361, ms1361" msgstr "" -#: ../../library/codecs.rst:1186 +#: ../../library/codecs.rst:1182 msgid "koi8_r" msgstr "" -#: ../../library/codecs.rst:1188 +#: ../../library/codecs.rst:1184 msgid "koi8_t" msgstr "" -#: ../../library/codecs.rst:1188 +#: ../../library/codecs.rst:1184 msgid "Tajik" msgstr "" -#: ../../library/codecs.rst:1192 +#: ../../library/codecs.rst:1188 msgid "koi8_u" msgstr "" -#: ../../library/codecs.rst:1194 +#: ../../library/codecs.rst:1190 msgid "kz1048" msgstr "" -#: ../../library/codecs.rst:1194 +#: ../../library/codecs.rst:1190 msgid "kz_1048, strk1048_2002, rk1048" msgstr "" -#: ../../library/codecs.rst:1194 ../../library/codecs.rst:1212 +#: ../../library/codecs.rst:1190 ../../library/codecs.rst:1208 msgid "Kazakh" msgstr "" -#: ../../library/codecs.rst:1198 +#: ../../library/codecs.rst:1194 msgid "mac_cyrillic" msgstr "" -#: ../../library/codecs.rst:1198 +#: ../../library/codecs.rst:1194 msgid "maccyrillic" msgstr "" -#: ../../library/codecs.rst:1201 +#: ../../library/codecs.rst:1197 msgid "mac_greek" msgstr "" -#: ../../library/codecs.rst:1201 +#: ../../library/codecs.rst:1197 msgid "macgreek" msgstr "" -#: ../../library/codecs.rst:1203 +#: ../../library/codecs.rst:1199 msgid "mac_iceland" msgstr "" -#: ../../library/codecs.rst:1203 +#: ../../library/codecs.rst:1199 msgid "maciceland" msgstr "" -#: ../../library/codecs.rst:1205 +#: ../../library/codecs.rst:1201 msgid "mac_latin2" msgstr "" -#: ../../library/codecs.rst:1205 +#: ../../library/codecs.rst:1201 msgid "maclatin2, maccentraleurope, mac_centeuro" msgstr "" -#: ../../library/codecs.rst:1208 +#: ../../library/codecs.rst:1204 msgid "mac_roman" msgstr "" -#: ../../library/codecs.rst:1208 +#: ../../library/codecs.rst:1204 msgid "macroman, macintosh" msgstr "" -#: ../../library/codecs.rst:1210 +#: ../../library/codecs.rst:1206 msgid "mac_turkish" msgstr "" -#: ../../library/codecs.rst:1210 +#: ../../library/codecs.rst:1206 msgid "macturkish" msgstr "" -#: ../../library/codecs.rst:1212 +#: ../../library/codecs.rst:1208 msgid "ptcp154" msgstr "" -#: ../../library/codecs.rst:1212 +#: ../../library/codecs.rst:1208 msgid "csptcp154, pt154, cp154, cyrillic-asian" msgstr "" -#: ../../library/codecs.rst:1215 +#: ../../library/codecs.rst:1211 msgid "shift_jis" msgstr "" -#: ../../library/codecs.rst:1215 +#: ../../library/codecs.rst:1211 msgid "csshiftjis, shiftjis, sjis, s_jis" msgstr "" -#: ../../library/codecs.rst:1218 +#: ../../library/codecs.rst:1214 msgid "shift_jis_2004" msgstr "" -#: ../../library/codecs.rst:1218 +#: ../../library/codecs.rst:1214 msgid "shiftjis2004, sjis_2004, sjis2004" msgstr "" -#: ../../library/codecs.rst:1221 +#: ../../library/codecs.rst:1217 msgid "shift_jisx0213" msgstr "" -#: ../../library/codecs.rst:1221 +#: ../../library/codecs.rst:1217 msgid "shiftjisx0213, sjisx0213, s_jisx0213" msgstr "" -#: ../../library/codecs.rst:1224 +#: ../../library/codecs.rst:1220 msgid "utf_32" msgstr "" -#: ../../library/codecs.rst:1224 +#: ../../library/codecs.rst:1220 msgid "U32, utf32" msgstr "" +#: ../../library/codecs.rst:1220 ../../library/codecs.rst:1222 #: ../../library/codecs.rst:1224 ../../library/codecs.rst:1226 #: ../../library/codecs.rst:1228 ../../library/codecs.rst:1230 #: ../../library/codecs.rst:1232 ../../library/codecs.rst:1234 -#: ../../library/codecs.rst:1236 ../../library/codecs.rst:1238 -#: ../../library/codecs.rst:1240 +#: ../../library/codecs.rst:1236 msgid "all languages" msgstr "" -#: ../../library/codecs.rst:1226 +#: ../../library/codecs.rst:1222 msgid "utf_32_be" msgstr "" -#: ../../library/codecs.rst:1226 +#: ../../library/codecs.rst:1222 msgid "UTF-32BE" msgstr "" -#: ../../library/codecs.rst:1228 +#: ../../library/codecs.rst:1224 msgid "utf_32_le" msgstr "" -#: ../../library/codecs.rst:1228 +#: ../../library/codecs.rst:1224 msgid "UTF-32LE" msgstr "" -#: ../../library/codecs.rst:1230 +#: ../../library/codecs.rst:1226 msgid "utf_16" msgstr "" -#: ../../library/codecs.rst:1230 +#: ../../library/codecs.rst:1226 msgid "U16, utf16" msgstr "" -#: ../../library/codecs.rst:1232 +#: ../../library/codecs.rst:1228 msgid "utf_16_be" msgstr "" -#: ../../library/codecs.rst:1232 +#: ../../library/codecs.rst:1228 msgid "UTF-16BE" msgstr "" -#: ../../library/codecs.rst:1234 +#: ../../library/codecs.rst:1230 msgid "utf_16_le" msgstr "" -#: ../../library/codecs.rst:1234 +#: ../../library/codecs.rst:1230 msgid "UTF-16LE" msgstr "" -#: ../../library/codecs.rst:1236 +#: ../../library/codecs.rst:1232 msgid "utf_7" msgstr "" -#: ../../library/codecs.rst:1236 +#: ../../library/codecs.rst:1232 msgid "U7, unicode-1-1-utf-7" msgstr "" -#: ../../library/codecs.rst:1238 +#: ../../library/codecs.rst:1234 msgid "utf_8" msgstr "" -#: ../../library/codecs.rst:1238 +#: ../../library/codecs.rst:1234 msgid "U8, UTF, utf8, cp65001" msgstr "" -#: ../../library/codecs.rst:1240 +#: ../../library/codecs.rst:1236 msgid "utf_8_sig" msgstr "" -#: ../../library/codecs.rst:1243 +#: ../../library/codecs.rst:1239 msgid "" "The utf-16\\* and utf-32\\* encoders no longer allow surrogate code points " "(``U+D800``--``U+DFFF``) to be encoded. The utf-32\\* decoders no longer " "decode byte sequences that correspond to surrogate code points." msgstr "" -#: ../../library/codecs.rst:1249 +#: ../../library/codecs.rst:1245 msgid "``cp65001`` is now an alias to ``utf_8``." msgstr "" -#: ../../library/codecs.rst:1254 +#: ../../library/codecs.rst:1250 msgid "Python Specific Encodings" msgstr "" -#: ../../library/codecs.rst:1256 +#: ../../library/codecs.rst:1252 msgid "" "A number of predefined codecs are specific to Python, so their codec names " "have no meaning outside Python. These are listed in the tables below based " @@ -2260,272 +2259,272 @@ msgid "" "asymmetric codecs, the stated meaning describes the encoding direction." msgstr "" -#: ../../library/codecs.rst:1264 +#: ../../library/codecs.rst:1260 msgid "Text Encodings" msgstr "" -#: ../../library/codecs.rst:1266 +#: ../../library/codecs.rst:1262 msgid "" "The following codecs provide :class:`str` to :class:`bytes` encoding and :" "term:`bytes-like object` to :class:`str` decoding, similar to the Unicode " "text encodings." msgstr "" -#: ../../library/codecs.rst:1275 +#: ../../library/codecs.rst:1271 msgid "idna" msgstr "" -#: ../../library/codecs.rst:1275 +#: ../../library/codecs.rst:1271 msgid "" "Implement :rfc:`3490`, see also :mod:`encodings.idna`. Only " "``errors='strict'`` is supported." msgstr "" -#: ../../library/codecs.rst:1281 +#: ../../library/codecs.rst:1277 msgid "mbcs" msgstr "" -#: ../../library/codecs.rst:1281 +#: ../../library/codecs.rst:1277 msgid "ansi, dbcs" msgstr "" -#: ../../library/codecs.rst:1281 +#: ../../library/codecs.rst:1277 msgid "" "Windows only: Encode the operand according to the ANSI codepage (CP_ACP)." msgstr "" -#: ../../library/codecs.rst:1285 +#: ../../library/codecs.rst:1281 msgid "oem" msgstr "" -#: ../../library/codecs.rst:1285 +#: ../../library/codecs.rst:1281 msgid "" "Windows only: Encode the operand according to the OEM codepage (CP_OEMCP)." msgstr "" -#: ../../library/codecs.rst:1291 +#: ../../library/codecs.rst:1287 msgid "palmos" msgstr "" -#: ../../library/codecs.rst:1291 +#: ../../library/codecs.rst:1287 msgid "Encoding of PalmOS 3.5." msgstr "" -#: ../../library/codecs.rst:1293 +#: ../../library/codecs.rst:1289 msgid "punycode" msgstr "" -#: ../../library/codecs.rst:1293 +#: ../../library/codecs.rst:1289 msgid "Implement :rfc:`3492`. Stateful codecs are not supported." msgstr "" -#: ../../library/codecs.rst:1297 +#: ../../library/codecs.rst:1293 msgid "raw_unicode_escape" msgstr "" -#: ../../library/codecs.rst:1297 +#: ../../library/codecs.rst:1293 msgid "" "Latin-1 encoding with ``\\uXXXX`` and ``\\UXXXXXXXX`` for other code points. " "Existing backslashes are not escaped in any way. It is used in the Python " "pickle protocol." msgstr "" -#: ../../library/codecs.rst:1306 +#: ../../library/codecs.rst:1302 msgid "undefined" msgstr "" -#: ../../library/codecs.rst:1306 +#: ../../library/codecs.rst:1302 msgid "" "Raise an exception for all conversions, even empty strings. The error " "handler is ignored." msgstr "" -#: ../../library/codecs.rst:1311 +#: ../../library/codecs.rst:1307 msgid "unicode_escape" msgstr "" -#: ../../library/codecs.rst:1311 +#: ../../library/codecs.rst:1307 msgid "" "Encoding suitable as the contents of a Unicode literal in ASCII-encoded " "Python source code, except that quotes are not escaped. Decode from Latin-1 " "source code. Beware that Python source code actually uses UTF-8 by default." msgstr "" -#: ../../library/codecs.rst:1323 +#: ../../library/codecs.rst:1319 msgid "\"unicode_internal\" codec is removed." msgstr "" -#: ../../library/codecs.rst:1330 +#: ../../library/codecs.rst:1326 msgid "Binary Transforms" msgstr "" -#: ../../library/codecs.rst:1332 +#: ../../library/codecs.rst:1328 msgid "" "The following codecs provide binary transforms: :term:`bytes-like object` " "to :class:`bytes` mappings. They are not supported by :meth:`bytes.decode` " "(which only produces :class:`str` output)." msgstr "" -#: ../../library/codecs.rst:1340 +#: ../../library/codecs.rst:1336 msgid "Encoder / decoder" msgstr "" -#: ../../library/codecs.rst:1342 +#: ../../library/codecs.rst:1338 msgid "base64_codec [#b64]_" msgstr "" -#: ../../library/codecs.rst:1342 +#: ../../library/codecs.rst:1338 msgid "base64, base_64" msgstr "" -#: ../../library/codecs.rst:1342 +#: ../../library/codecs.rst:1338 msgid "" "Convert the operand to multiline MIME base64 (the result always includes a " "trailing ``'\\n'``)." msgstr "" -#: ../../library/codecs.rst:1347 +#: ../../library/codecs.rst:1343 msgid "" "accepts any :term:`bytes-like object` as input for encoding and decoding" msgstr "" -#: ../../library/codecs.rst:1342 +#: ../../library/codecs.rst:1338 msgid ":meth:`base64.encodebytes` / :meth:`base64.decodebytes`" msgstr "" -#: ../../library/codecs.rst:1353 +#: ../../library/codecs.rst:1349 msgid "bz2_codec" msgstr "" -#: ../../library/codecs.rst:1353 +#: ../../library/codecs.rst:1349 msgid "bz2" msgstr "" -#: ../../library/codecs.rst:1353 +#: ../../library/codecs.rst:1349 msgid "Compress the operand using bz2." msgstr "" -#: ../../library/codecs.rst:1353 +#: ../../library/codecs.rst:1349 msgid ":meth:`bz2.compress` / :meth:`bz2.decompress`" msgstr "" -#: ../../library/codecs.rst:1356 +#: ../../library/codecs.rst:1352 msgid "hex_codec" msgstr "" -#: ../../library/codecs.rst:1356 +#: ../../library/codecs.rst:1352 msgid "hex" msgstr "" -#: ../../library/codecs.rst:1356 +#: ../../library/codecs.rst:1352 msgid "" "Convert the operand to hexadecimal representation, with two digits per byte." msgstr "" -#: ../../library/codecs.rst:1356 +#: ../../library/codecs.rst:1352 msgid ":meth:`binascii.b2a_hex` / :meth:`binascii.a2b_hex`" msgstr "" -#: ../../library/codecs.rst:1361 +#: ../../library/codecs.rst:1357 msgid "quopri_codec" msgstr "" -#: ../../library/codecs.rst:1361 +#: ../../library/codecs.rst:1357 msgid "quopri, quotedprintable, quoted_printable" msgstr "" -#: ../../library/codecs.rst:1361 +#: ../../library/codecs.rst:1357 msgid "Convert the operand to MIME quoted printable." msgstr "" -#: ../../library/codecs.rst:1361 +#: ../../library/codecs.rst:1357 msgid ":meth:`quopri.encode` with ``quotetabs=True`` / :meth:`quopri.decode`" msgstr "" -#: ../../library/codecs.rst:1365 +#: ../../library/codecs.rst:1361 msgid "uu_codec" msgstr "" -#: ../../library/codecs.rst:1365 +#: ../../library/codecs.rst:1361 msgid "uu" msgstr "" -#: ../../library/codecs.rst:1365 +#: ../../library/codecs.rst:1361 msgid "Convert the operand using uuencode." msgstr "" -#: ../../library/codecs.rst:1365 +#: ../../library/codecs.rst:1361 msgid ":meth:`uu.encode` / :meth:`uu.decode`" msgstr "" -#: ../../library/codecs.rst:1368 +#: ../../library/codecs.rst:1364 msgid "zlib_codec" msgstr "" -#: ../../library/codecs.rst:1368 +#: ../../library/codecs.rst:1364 msgid "zip, zlib" msgstr "" -#: ../../library/codecs.rst:1368 +#: ../../library/codecs.rst:1364 msgid "Compress the operand using gzip." msgstr "" -#: ../../library/codecs.rst:1368 +#: ../../library/codecs.rst:1364 msgid ":meth:`zlib.compress` / :meth:`zlib.decompress`" msgstr "" -#: ../../library/codecs.rst:1372 +#: ../../library/codecs.rst:1368 msgid "" "In addition to :term:`bytes-like objects `, " "``'base64_codec'`` also accepts ASCII-only instances of :class:`str` for " "decoding" msgstr "" -#: ../../library/codecs.rst:1376 +#: ../../library/codecs.rst:1372 msgid "Restoration of the binary transforms." msgstr "" -#: ../../library/codecs.rst:1379 +#: ../../library/codecs.rst:1375 msgid "Restoration of the aliases for the binary transforms." msgstr "" -#: ../../library/codecs.rst:1386 +#: ../../library/codecs.rst:1382 msgid "Text Transforms" msgstr "" -#: ../../library/codecs.rst:1388 +#: ../../library/codecs.rst:1384 msgid "" "The following codec provides a text transform: a :class:`str` to :class:" "`str` mapping. It is not supported by :meth:`str.encode` (which only " "produces :class:`bytes` output)." msgstr "" -#: ../../library/codecs.rst:1397 +#: ../../library/codecs.rst:1393 msgid "rot_13" msgstr "" -#: ../../library/codecs.rst:1397 +#: ../../library/codecs.rst:1393 msgid "rot13" msgstr "" -#: ../../library/codecs.rst:1397 +#: ../../library/codecs.rst:1393 msgid "Return the Caesar-cypher encryption of the operand." msgstr "" -#: ../../library/codecs.rst:1402 +#: ../../library/codecs.rst:1398 msgid "Restoration of the ``rot_13`` text transform." msgstr "" -#: ../../library/codecs.rst:1405 +#: ../../library/codecs.rst:1401 msgid "Restoration of the ``rot13`` alias." msgstr "" -#: ../../library/codecs.rst:1410 +#: ../../library/codecs.rst:1406 msgid "" ":mod:`encodings.idna` --- Internationalized Domain Names in Applications" msgstr "" -#: ../../library/codecs.rst:1416 +#: ../../library/codecs.rst:1412 msgid "" "This module implements :rfc:`3490` (Internationalized Domain Names in " "Applications) and :rfc:`3492` (Nameprep: A Stringprep Profile for " @@ -2533,13 +2532,7 @@ msgid "" "encoding and :mod:`stringprep`." msgstr "" -#: ../../library/codecs.rst:1421 -msgid "" -"If you need the IDNA 2008 standard from :rfc:`5891` and :rfc:`5895`, use the " -"third-party `idna module _`." -msgstr "" - -#: ../../library/codecs.rst:1424 +#: ../../library/codecs.rst:1417 msgid "" "These RFCs together define a protocol to support non-ASCII characters in " "domain names. A domain name containing non-ASCII characters (such as ``www." @@ -2553,7 +2546,7 @@ msgid "" "presenting them to the user." msgstr "" -#: ../../library/codecs.rst:1435 +#: ../../library/codecs.rst:1428 msgid "" "Python supports this conversion in several ways: the ``idna`` codec " "performs conversion between Unicode and ACE, separating an input string into " @@ -2570,14 +2563,14 @@ msgid "" "sends that field at all)." msgstr "" -#: ../../library/codecs.rst:1448 +#: ../../library/codecs.rst:1441 msgid "" "When receiving host names from the wire (such as in reverse name lookup), no " "automatic conversion to Unicode is performed: applications wishing to " "present such host names to the user should decode them to Unicode." msgstr "" -#: ../../library/codecs.rst:1452 +#: ../../library/codecs.rst:1445 msgid "" "The module :mod:`encodings.idna` also implements the nameprep procedure, " "which performs certain normalizations on host names, to achieve case-" @@ -2585,49 +2578,49 @@ msgid "" "characters. The nameprep functions can be used directly if desired." msgstr "" -#: ../../library/codecs.rst:1460 +#: ../../library/codecs.rst:1453 msgid "" "Return the nameprepped version of *label*. The implementation currently " "assumes query strings, so ``AllowUnassigned`` is true." msgstr "" -#: ../../library/codecs.rst:1466 +#: ../../library/codecs.rst:1459 msgid "" "Convert a label to ASCII, as specified in :rfc:`3490`. ``UseSTD3ASCIIRules`` " "is assumed to be false." msgstr "" -#: ../../library/codecs.rst:1472 +#: ../../library/codecs.rst:1465 msgid "Convert a label to Unicode, as specified in :rfc:`3490`." msgstr "" -#: ../../library/codecs.rst:1476 +#: ../../library/codecs.rst:1469 msgid ":mod:`encodings.mbcs` --- Windows ANSI codepage" msgstr "" -#: ../../library/codecs.rst:1481 +#: ../../library/codecs.rst:1474 msgid "This module implements the ANSI codepage (CP_ACP)." msgstr "" -#: ../../library/codecs.rst:1484 +#: ../../library/codecs.rst:1477 msgid ":ref:`Availability `: Windows only." msgstr "" -#: ../../library/codecs.rst:1485 +#: ../../library/codecs.rst:1478 msgid "Support any error handler." msgstr "" -#: ../../library/codecs.rst:1488 +#: ../../library/codecs.rst:1481 msgid "" "Before 3.2, the *errors* argument was ignored; ``'replace'`` was always used " "to encode, and ``'ignore'`` to decode." msgstr "" -#: ../../library/codecs.rst:1494 +#: ../../library/codecs.rst:1487 msgid ":mod:`encodings.utf_8_sig` --- UTF-8 codec with BOM signature" msgstr "" -#: ../../library/codecs.rst:1500 +#: ../../library/codecs.rst:1493 msgid "" "This module implements a variant of the UTF-8 codec. On encoding, a UTF-8 " "encoded BOM will be prepended to the UTF-8 encoded bytes. For the stateful " diff --git a/library/collections.abc.po b/library/collections.abc.po index 01e07158cd..6dcc6b6c22 100644 --- a/library/collections.abc.po +++ b/library/collections.abc.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.7\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2021-09-07 06:52+0000\n" +"POT-Creation-Date: 2018-06-26 18:54+0800\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-" @@ -312,27 +312,17 @@ msgstr "" msgid "``aclose``, ``__aiter__``, ``__anext__``" msgstr "" -#: ../../library/collections.abc.rst:102 -msgid "ABC for classes that provide the :meth:`__contains__` method." -msgstr "" - -#: ../../library/collections.abc.rst:106 -msgid "ABC for classes that provide the :meth:`__hash__` method." +#: ../../library/collections.abc.rst:105 +msgid "" +"ABCs for classes that provide respectively the methods :meth:" +"`__contains__`, :meth:`__hash__`, :meth:`__len__`, and :meth:`__call__`." msgstr "" #: ../../library/collections.abc.rst:110 -msgid "ABC for classes that provide the :meth:`__len__` method." -msgstr "" - -#: ../../library/collections.abc.rst:114 -msgid "ABC for classes that provide the :meth:`__call__` method." -msgstr "" - -#: ../../library/collections.abc.rst:118 msgid "ABC for classes that provide the :meth:`__iter__` method." msgstr "" -#: ../../library/collections.abc.rst:120 +#: ../../library/collections.abc.rst:112 msgid "" "Checking ``isinstance(obj, Iterable)`` detects classes that are registered " "as :class:`Iterable` or that have an :meth:`__iter__` method, but it does " @@ -341,22 +331,22 @@ msgid "" "call ``iter(obj)``." msgstr "" -#: ../../library/collections.abc.rst:128 +#: ../../library/collections.abc.rst:120 msgid "ABC for sized iterable container classes." msgstr "" -#: ../../library/collections.abc.rst:134 +#: ../../library/collections.abc.rst:126 msgid "" "ABC for classes that provide the :meth:`~iterator.__iter__` and :meth:" "`~iterator.__next__` methods. See also the definition of :term:`iterator`." msgstr "" -#: ../../library/collections.abc.rst:140 +#: ../../library/collections.abc.rst:132 msgid "" "ABC for iterable classes that also provide the :meth:`__reversed__` method." msgstr "" -#: ../../library/collections.abc.rst:147 +#: ../../library/collections.abc.rst:139 msgid "" "ABC for generator classes that implement the protocol defined in :pep:`342` " "that extends iterators with the :meth:`~generator.send`, :meth:`~generator." @@ -364,11 +354,11 @@ msgid "" "term:`generator`." msgstr "" -#: ../../library/collections.abc.rst:158 +#: ../../library/collections.abc.rst:150 msgid "ABCs for read-only and mutable :term:`sequences `." msgstr "" -#: ../../library/collections.abc.rst:160 +#: ../../library/collections.abc.rst:152 msgid "" "Implementation note: Some of the mixin methods, such as :meth:`__iter__`, :" "meth:`__reversed__` and :meth:`index`, make repeated calls to the " @@ -379,37 +369,37 @@ msgid "" "likely need to be overridden." msgstr "" -#: ../../library/collections.abc.rst:169 +#: ../../library/collections.abc.rst:161 msgid "The index() method added support for *stop* and *start* arguments." msgstr "" -#: ../../library/collections.abc.rst:176 +#: ../../library/collections.abc.rst:168 msgid "ABCs for read-only and mutable sets." msgstr "" -#: ../../library/collections.abc.rst:181 +#: ../../library/collections.abc.rst:173 msgid "ABCs for read-only and mutable :term:`mappings `." msgstr "" -#: ../../library/collections.abc.rst:188 +#: ../../library/collections.abc.rst:180 msgid "" "ABCs for mapping, items, keys, and values :term:`views `." msgstr "" -#: ../../library/collections.abc.rst:192 +#: ../../library/collections.abc.rst:184 msgid "" "ABC for :term:`awaitable` objects, which can be used in :keyword:`await` " "expressions. Custom implementations must provide the :meth:`__await__` " "method." msgstr "" -#: ../../library/collections.abc.rst:196 +#: ../../library/collections.abc.rst:188 msgid "" -":term:`Coroutine ` objects and instances of the :class:" -"`~collections.abc.Coroutine` ABC are all instances of this ABC." +":term:`Coroutine` objects and instances of the :class:`~collections.abc." +"Coroutine` ABC are all instances of this ABC." msgstr "" -#: ../../library/collections.abc.rst:200 +#: ../../library/collections.abc.rst:192 msgid "" "In CPython, generator-based coroutines (generators decorated with :func:" "`types.coroutine` or :func:`asyncio.coroutine`) are *awaitables*, even " @@ -418,7 +408,7 @@ msgid "" "`inspect.isawaitable` to detect them." msgstr "" -#: ../../library/collections.abc.rst:210 +#: ../../library/collections.abc.rst:202 msgid "" "ABC for coroutine compatible classes. These implement the following " "methods, defined in :ref:`coroutine-objects`: :meth:`~coroutine.send`, :meth:" @@ -428,7 +418,7 @@ msgid "" "`coroutine`." msgstr "" -#: ../../library/collections.abc.rst:218 +#: ../../library/collections.abc.rst:210 msgid "" "In CPython, generator-based coroutines (generators decorated with :func:" "`types.coroutine` or :func:`asyncio.coroutine`) are *awaitables*, even " @@ -437,31 +427,31 @@ msgid "" "`inspect.isawaitable` to detect them." msgstr "" -#: ../../library/collections.abc.rst:228 +#: ../../library/collections.abc.rst:220 msgid "" "ABC for classes that provide ``__aiter__`` method. See also the definition " "of :term:`asynchronous iterable`." msgstr "" -#: ../../library/collections.abc.rst:235 +#: ../../library/collections.abc.rst:227 msgid "" "ABC for classes that provide ``__aiter__`` and ``__anext__`` methods. See " "also the definition of :term:`asynchronous iterator`." msgstr "" -#: ../../library/collections.abc.rst:242 +#: ../../library/collections.abc.rst:234 msgid "" "ABC for asynchronous generator classes that implement the protocol defined " "in :pep:`525` and :pep:`492`." msgstr "" -#: ../../library/collections.abc.rst:248 +#: ../../library/collections.abc.rst:240 msgid "" "These ABCs allow us to ask classes or instances if they provide particular " "functionality, for example::" msgstr "" -#: ../../library/collections.abc.rst:255 +#: ../../library/collections.abc.rst:247 msgid "" "Several of the ABCs are also useful as mixins that make it easier to develop " "classes supporting container APIs. For example, to write a class supporting " @@ -471,11 +461,11 @@ msgid "" "`__and__` and :meth:`isdisjoint`::" msgstr "" -#: ../../library/collections.abc.rst:284 +#: ../../library/collections.abc.rst:276 msgid "Notes on using :class:`Set` and :class:`MutableSet` as a mixin:" msgstr "" -#: ../../library/collections.abc.rst:287 +#: ../../library/collections.abc.rst:279 msgid "" "Since some set operations create new sets, the default mixin methods need a " "way to create new instances from an iterable. The class constructor is " @@ -484,18 +474,17 @@ msgid "" "`_from_iterable` which calls ``cls(iterable)`` to produce a new set. If the :" "class:`Set` mixin is being used in a class with a different constructor " "signature, you will need to override :meth:`_from_iterable` with a " -"classmethod or regular method that can construct new instances from an " -"iterable argument." +"classmethod that can construct new instances from an iterable argument." msgstr "" -#: ../../library/collections.abc.rst:298 +#: ../../library/collections.abc.rst:290 msgid "" "To override the comparisons (presumably for speed, as the semantics are " "fixed), redefine :meth:`__le__` and :meth:`__ge__`, then the other " "operations will automatically follow suit." msgstr "" -#: ../../library/collections.abc.rst:303 +#: ../../library/collections.abc.rst:295 msgid "" "The :class:`Set` mixin provides a :meth:`_hash` method to compute a hash " "value for the set; however, :meth:`__hash__` is not defined because not all " @@ -504,12 +493,12 @@ msgid "" "Set._hash``." msgstr "" -#: ../../library/collections.abc.rst:311 +#: ../../library/collections.abc.rst:303 msgid "" "`OrderedSet recipe `_ for an " "example built on :class:`MutableSet`." msgstr "" -#: ../../library/collections.abc.rst:314 +#: ../../library/collections.abc.rst:306 msgid "For more about ABCs, see the :mod:`abc` module and :pep:`3119`." msgstr "" diff --git a/library/collections.po b/library/collections.po index a824c27405..1bcddd095b 100644 --- a/library/collections.po +++ b/library/collections.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.7\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2021-09-07 06:52+0000\n" +"POT-Creation-Date: 2020-06-20 18:08+0800\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-" @@ -225,7 +225,7 @@ msgstr "" #: ../../library/collections.rst:130 msgid "" -"Django's `Context class `_ for templating is a read-only chain of mappings. It " "also features pushing and popping of contexts similar to the :meth:" "`~collections.ChainMap.new_child` method and the :attr:`~collections." @@ -694,7 +694,7 @@ msgstr "" #: ../../library/collections.rst:690 msgid "" -"Return a new dictionary-like object. :class:`defaultdict` is a subclass of " +"Returns a new dictionary-like object. :class:`defaultdict` is a subclass of " "the built-in :class:`dict` class. It overrides one method and adds one " "writable instance variable. The remaining functionality is the same as for " "the :class:`dict` class and is not documented here." @@ -759,7 +759,7 @@ msgid "" "absent." msgstr "" -#: ../../library/collections.rst:735 ../../library/collections.rst:1132 +#: ../../library/collections.rst:735 ../../library/collections.rst:1129 msgid "" "Added merge (``|``) and update (``|=``) operators, specified in :pep:`584`." msgstr "" @@ -882,63 +882,57 @@ msgid "" msgstr "" #: ../../library/collections.rst:852 -msgid "" -"To support pickling, the named tuple class should be assigned to a variable " -"that matches *typename*." -msgstr "" - -#: ../../library/collections.rst:855 msgid "Added support for *rename*." msgstr "" -#: ../../library/collections.rst:858 +#: ../../library/collections.rst:855 msgid "" "The *verbose* and *rename* parameters became :ref:`keyword-only arguments " "`." msgstr "" -#: ../../library/collections.rst:862 +#: ../../library/collections.rst:859 msgid "Added the *module* parameter." msgstr "" -#: ../../library/collections.rst:865 +#: ../../library/collections.rst:862 msgid "Removed the *verbose* parameter and the :attr:`_source` attribute." msgstr "" -#: ../../library/collections.rst:868 +#: ../../library/collections.rst:865 msgid "" "Added the *defaults* parameter and the :attr:`_field_defaults` attribute." msgstr "" -#: ../../library/collections.rst:888 +#: ../../library/collections.rst:885 msgid "" "Named tuples are especially useful for assigning field names to result " "tuples returned by the :mod:`csv` or :mod:`sqlite3` modules::" msgstr "" -#: ../../library/collections.rst:904 +#: ../../library/collections.rst:901 msgid "" "In addition to the methods inherited from tuples, named tuples support three " "additional methods and two attributes. To prevent conflicts with field " "names, the method and attribute names start with an underscore." msgstr "" -#: ../../library/collections.rst:910 +#: ../../library/collections.rst:907 msgid "" "Class method that makes a new instance from an existing sequence or iterable." msgstr "" -#: ../../library/collections.rst:920 +#: ../../library/collections.rst:917 msgid "" "Return a new :class:`dict` which maps field names to their corresponding " "values:" msgstr "" -#: ../../library/collections.rst:929 +#: ../../library/collections.rst:926 msgid "Returns an :class:`OrderedDict` instead of a regular :class:`dict`." msgstr "" -#: ../../library/collections.rst:932 +#: ../../library/collections.rst:929 msgid "" "Returns a regular :class:`dict` instead of an :class:`OrderedDict`. As of " "Python 3.7, regular dicts are guaranteed to be ordered. If the extra " @@ -946,89 +940,89 @@ msgid "" "to cast the result to the desired type: ``OrderedDict(nt._asdict())``." msgstr "" -#: ../../library/collections.rst:941 +#: ../../library/collections.rst:938 msgid "" "Return a new instance of the named tuple replacing specified fields with new " "values::" msgstr "" -#: ../../library/collections.rst:953 +#: ../../library/collections.rst:950 msgid "" "Tuple of strings listing the field names. Useful for introspection and for " "creating new named tuple types from existing named tuples." msgstr "" -#: ../../library/collections.rst:968 +#: ../../library/collections.rst:965 msgid "Dictionary mapping field names to default values." msgstr "" -#: ../../library/collections.rst:978 +#: ../../library/collections.rst:975 msgid "" "To retrieve a field whose name is stored in a string, use the :func:" "`getattr` function:" msgstr "" -#: ../../library/collections.rst:984 +#: ../../library/collections.rst:981 msgid "" "To convert a dictionary to a named tuple, use the double-star-operator (as " "described in :ref:`tut-unpacking-arguments`):" msgstr "" -#: ../../library/collections.rst:991 +#: ../../library/collections.rst:988 msgid "" "Since a named tuple is a regular Python class, it is easy to add or change " "functionality with a subclass. Here is how to add a calculated field and a " "fixed-width print format:" msgstr "" -#: ../../library/collections.rst:1010 +#: ../../library/collections.rst:1007 msgid "" "The subclass shown above sets ``__slots__`` to an empty tuple. This helps " "keep memory requirements low by preventing the creation of instance " "dictionaries." msgstr "" -#: ../../library/collections.rst:1013 +#: ../../library/collections.rst:1010 msgid "" "Subclassing is not useful for adding new, stored fields. Instead, simply " "create a new named tuple type from the :attr:`~somenamedtuple._fields` " "attribute:" msgstr "" -#: ../../library/collections.rst:1018 +#: ../../library/collections.rst:1015 msgid "" "Docstrings can be customized by making direct assignments to the ``__doc__`` " "fields:" msgstr "" -#: ../../library/collections.rst:1027 +#: ../../library/collections.rst:1024 msgid "Property docstrings became writeable." msgstr "" -#: ../../library/collections.rst:1032 +#: ../../library/collections.rst:1029 msgid "" "See :class:`typing.NamedTuple` for a way to add type hints for named " "tuples. It also provides an elegant notation using the :keyword:`class` " "keyword::" msgstr "" -#: ../../library/collections.rst:1041 +#: ../../library/collections.rst:1038 msgid "" "See :meth:`types.SimpleNamespace` for a mutable namespace based on an " "underlying dictionary instead of a tuple." msgstr "" -#: ../../library/collections.rst:1044 +#: ../../library/collections.rst:1041 msgid "" "The :mod:`dataclasses` module provides a decorator and functions for " "automatically adding generated special methods to user-defined classes." msgstr "" -#: ../../library/collections.rst:1049 +#: ../../library/collections.rst:1046 msgid ":class:`OrderedDict` objects" msgstr "" -#: ../../library/collections.rst:1051 +#: ../../library/collections.rst:1048 msgid "" "Ordered dictionaries are just like regular dictionaries but have some extra " "capabilities relating to ordering operations. They have become less " @@ -1036,24 +1030,24 @@ msgid "" "remember insertion order (this new behavior became guaranteed in Python 3.7)." msgstr "" -#: ../../library/collections.rst:1057 +#: ../../library/collections.rst:1054 msgid "Some differences from :class:`dict` still remain:" msgstr "" -#: ../../library/collections.rst:1059 +#: ../../library/collections.rst:1056 msgid "" "The regular :class:`dict` was designed to be very good at mapping " "operations. Tracking insertion order was secondary." msgstr "" -#: ../../library/collections.rst:1062 +#: ../../library/collections.rst:1059 msgid "" "The :class:`OrderedDict` was designed to be good at reordering operations. " "Space efficiency, iteration speed, and the performance of update operations " "were secondary." msgstr "" -#: ../../library/collections.rst:1066 +#: ../../library/collections.rst:1063 msgid "" "Algorithmically, :class:`OrderedDict` can handle frequent reordering " "operations better than :class:`dict`. This makes it suitable for tracking " @@ -1061,34 +1055,34 @@ msgid "" "@krishankantsinghal/my-first-blog-on-medium-583159139237>`_)." msgstr "" -#: ../../library/collections.rst:1071 +#: ../../library/collections.rst:1068 msgid "" "The equality operation for :class:`OrderedDict` checks for matching order." msgstr "" -#: ../../library/collections.rst:1073 +#: ../../library/collections.rst:1070 msgid "" "The :meth:`popitem` method of :class:`OrderedDict` has a different " "signature. It accepts an optional argument to specify which item is popped." msgstr "" -#: ../../library/collections.rst:1076 +#: ../../library/collections.rst:1073 msgid "" ":class:`OrderedDict` has a :meth:`move_to_end` method to efficiently " "reposition an element to an endpoint." msgstr "" -#: ../../library/collections.rst:1079 +#: ../../library/collections.rst:1076 msgid "Until Python 3.8, :class:`dict` lacked a :meth:`__reversed__` method." msgstr "" -#: ../../library/collections.rst:1084 +#: ../../library/collections.rst:1081 msgid "" "Return an instance of a :class:`dict` subclass that has methods specialized " "for rearranging dictionary order." msgstr "" -#: ../../library/collections.rst:1091 +#: ../../library/collections.rst:1088 msgid "" "The :meth:`popitem` method for ordered dictionaries returns and removes a " "(key, value) pair. The pairs are returned in :abbr:`LIFO (last-in, first-" @@ -1096,20 +1090,20 @@ msgid "" "false." msgstr "" -#: ../../library/collections.rst:1098 +#: ../../library/collections.rst:1095 msgid "" "Move an existing *key* to either end of an ordered dictionary. The item is " "moved to the right end if *last* is true (the default) or to the beginning " "if *last* is false. Raises :exc:`KeyError` if the *key* does not exist::" msgstr "" -#: ../../library/collections.rst:1113 +#: ../../library/collections.rst:1110 msgid "" "In addition to the usual mapping methods, ordered dictionaries also support " "reverse iteration using :func:`reversed`." msgstr "" -#: ../../library/collections.rst:1116 +#: ../../library/collections.rst:1113 msgid "" "Equality tests between :class:`OrderedDict` objects are order-sensitive and " "are implemented as ``list(od1.items())==list(od2.items())``. Equality tests " @@ -1119,23 +1113,23 @@ msgid "" "dictionary is used." msgstr "" -#: ../../library/collections.rst:1123 +#: ../../library/collections.rst:1120 msgid "" "The items, keys, and values :term:`views ` of :class:" "`OrderedDict` now support reverse iteration using :func:`reversed`." msgstr "" -#: ../../library/collections.rst:1127 +#: ../../library/collections.rst:1124 msgid "" "With the acceptance of :pep:`468`, order is retained for keyword arguments " "passed to the :class:`OrderedDict` constructor and its :meth:`update` method." msgstr "" -#: ../../library/collections.rst:1137 +#: ../../library/collections.rst:1134 msgid ":class:`OrderedDict` Examples and Recipes" msgstr "" -#: ../../library/collections.rst:1139 +#: ../../library/collections.rst:1136 msgid "" "It is straightforward to create an ordered dictionary variant that remembers " "the order the keys were *last* inserted. If a new entry overwrites an " @@ -1143,17 +1137,17 @@ msgid "" "end::" msgstr "" -#: ../../library/collections.rst:1151 +#: ../../library/collections.rst:1148 msgid "" "An :class:`OrderedDict` would also be useful for implementing variants of :" -"func:`functools.lru_cache`:" +"func:`functools.lru_cache`::" msgstr "" -#: ../../library/collections.rst:1192 +#: ../../library/collections.rst:1173 msgid ":class:`UserDict` objects" msgstr "" -#: ../../library/collections.rst:1194 +#: ../../library/collections.rst:1175 msgid "" "The class, :class:`UserDict` acts as a wrapper around dictionary objects. " "The need for this class has been partially supplanted by the ability to " @@ -1161,31 +1155,31 @@ msgid "" "work with because the underlying dictionary is accessible as an attribute." msgstr "" -#: ../../library/collections.rst:1202 +#: ../../library/collections.rst:1183 msgid "" "Class that simulates a dictionary. The instance's contents are kept in a " "regular dictionary, which is accessible via the :attr:`data` attribute of :" "class:`UserDict` instances. If *initialdata* is provided, :attr:`data` is " "initialized with its contents; note that a reference to *initialdata* will " -"not be kept, allowing it to be used for other purposes." +"not be kept, allowing it be used for other purposes." msgstr "" -#: ../../library/collections.rst:1208 +#: ../../library/collections.rst:1189 msgid "" "In addition to supporting the methods and operations of mappings, :class:" "`UserDict` instances provide the following attribute:" msgstr "" -#: ../../library/collections.rst:1213 +#: ../../library/collections.rst:1194 msgid "" "A real dictionary used to store the contents of the :class:`UserDict` class." msgstr "" -#: ../../library/collections.rst:1219 +#: ../../library/collections.rst:1200 msgid ":class:`UserList` objects" msgstr "" -#: ../../library/collections.rst:1221 +#: ../../library/collections.rst:1202 msgid "" "This class acts as a wrapper around list objects. It is a useful base class " "for your own list-like classes which can inherit from them and override " @@ -1193,14 +1187,14 @@ msgid "" "lists." msgstr "" -#: ../../library/collections.rst:1226 +#: ../../library/collections.rst:1207 msgid "" "The need for this class has been partially supplanted by the ability to " "subclass directly from :class:`list`; however, this class can be easier to " "work with because the underlying list is accessible as an attribute." msgstr "" -#: ../../library/collections.rst:1232 +#: ../../library/collections.rst:1213 msgid "" "Class that simulates a list. The instance's contents are kept in a regular " "list, which is accessible via the :attr:`data` attribute of :class:" @@ -1209,19 +1203,19 @@ msgid "" "for example a real Python list or a :class:`UserList` object." msgstr "" -#: ../../library/collections.rst:1238 +#: ../../library/collections.rst:1219 msgid "" "In addition to supporting the methods and operations of mutable sequences, :" "class:`UserList` instances provide the following attribute:" msgstr "" -#: ../../library/collections.rst:1243 +#: ../../library/collections.rst:1224 msgid "" "A real :class:`list` object used to store the contents of the :class:" "`UserList` class." msgstr "" -#: ../../library/collections.rst:1246 +#: ../../library/collections.rst:1227 msgid "" "**Subclassing requirements:** Subclasses of :class:`UserList` are expected " "to offer a constructor which can be called with either no arguments or one " @@ -1231,7 +1225,7 @@ msgid "" "object used as a data source." msgstr "" -#: ../../library/collections.rst:1253 +#: ../../library/collections.rst:1234 msgid "" "If a derived class does not wish to comply with this requirement, all of the " "special methods supported by this class will need to be overridden; please " @@ -1239,11 +1233,11 @@ msgid "" "provided in that case." msgstr "" -#: ../../library/collections.rst:1259 +#: ../../library/collections.rst:1240 msgid ":class:`UserString` objects" msgstr "" -#: ../../library/collections.rst:1261 +#: ../../library/collections.rst:1242 msgid "" "The class, :class:`UserString` acts as a wrapper around string objects. The " "need for this class has been partially supplanted by the ability to subclass " @@ -1251,7 +1245,7 @@ msgid "" "because the underlying string is accessible as an attribute." msgstr "" -#: ../../library/collections.rst:1269 +#: ../../library/collections.rst:1250 msgid "" "Class that simulates a string object. The instance's content is kept in a " "regular string object, which is accessible via the :attr:`data` attribute " @@ -1260,19 +1254,19 @@ msgid "" "converted into a string using the built-in :func:`str` function." msgstr "" -#: ../../library/collections.rst:1276 +#: ../../library/collections.rst:1257 msgid "" "In addition to supporting the methods and operations of strings, :class:" "`UserString` instances provide the following attribute:" msgstr "" -#: ../../library/collections.rst:1281 +#: ../../library/collections.rst:1262 msgid "" "A real :class:`str` object used to store the contents of the :class:" "`UserString` class." msgstr "" -#: ../../library/collections.rst:1284 +#: ../../library/collections.rst:1265 msgid "" "New methods ``__getnewargs__``, ``__rmod__``, ``casefold``, ``format_map``, " "``isprintable``, and ``maketrans``." diff --git a/library/compileall.po b/library/compileall.po index 09a63cfafb..b196d6308d 100644 --- a/library/compileall.po +++ b/library/compileall.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.7\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2021-09-07 06:52+0000\n" +"POT-Creation-Date: 2020-06-20 18:08+0800\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-" @@ -219,20 +219,19 @@ msgstr "" #: ../../library/compileall.rst:169 msgid "" -"If *rx* is given, its ``search`` method is called on the complete path to " -"each file considered for compilation, and if it returns a true value, the " -"file is skipped. This can be used to exclude files matching a regular " -"expression, given as a :ref:`re.Pattern ` object." +"If *rx* is given, its search method is called on the complete path to each " +"file considered for compilation, and if it returns a true value, the file is " +"skipped." msgstr "" -#: ../../library/compileall.rst:174 ../../library/compileall.rst:251 +#: ../../library/compileall.rst:173 ../../library/compileall.rst:249 msgid "" "If *quiet* is ``False`` or ``0`` (the default), the filenames and other " "information are printed to standard out. Set to ``1``, only errors are " "printed. Set to ``2``, all output is suppressed." msgstr "" -#: ../../library/compileall.rst:178 ../../library/compileall.rst:255 +#: ../../library/compileall.rst:177 ../../library/compileall.rst:253 msgid "" "If *legacy* is true, byte-code files are written to their legacy locations " "and names, which may overwrite byte-code files created by another version of " @@ -241,7 +240,7 @@ msgid "" "coexist." msgstr "" -#: ../../library/compileall.rst:184 ../../library/compileall.rst:261 +#: ../../library/compileall.rst:183 ../../library/compileall.rst:259 msgid "" "*optimize* specifies the optimization level for the compiler. It is passed " "to the built-in :func:`compile` function. Accepts also a sequence of " @@ -249,7 +248,7 @@ msgid "" "file in one call." msgstr "" -#: ../../library/compileall.rst:188 +#: ../../library/compileall.rst:187 msgid "" "The argument *workers* specifies how many workers are used to compile files " "in parallel. The default is to not use multiple workers. If the platform " @@ -259,79 +258,79 @@ msgid "" "`ValueError` will be raised." msgstr "" -#: ../../library/compileall.rst:195 ../../library/compileall.rst:265 +#: ../../library/compileall.rst:194 ../../library/compileall.rst:263 msgid "" "*invalidation_mode* should be a member of the :class:`py_compile." "PycInvalidationMode` enum and controls how the generated pycs are " "invalidated at runtime." msgstr "" -#: ../../library/compileall.rst:199 ../../library/compileall.rst:269 +#: ../../library/compileall.rst:198 ../../library/compileall.rst:267 msgid "" "The *stripdir*, *prependdir* and *limit_sl_dest* arguments correspond to the " "``-s``, ``-p`` and ``-e`` options described above. They may be specified as " "``str``, ``bytes`` or :py:class:`os.PathLike`." msgstr "" -#: ../../library/compileall.rst:203 ../../library/compileall.rst:273 +#: ../../library/compileall.rst:202 ../../library/compileall.rst:271 msgid "" "If *hardlink_dupes* is true and two ``.pyc`` files with different " "optimization level have the same content, use hard links to consolidate " "duplicate files." msgstr "" -#: ../../library/compileall.rst:206 ../../library/compileall.rst:304 +#: ../../library/compileall.rst:205 ../../library/compileall.rst:302 msgid "Added the *legacy* and *optimize* parameter." msgstr "" -#: ../../library/compileall.rst:209 +#: ../../library/compileall.rst:208 msgid "Added the *workers* parameter." msgstr "" -#: ../../library/compileall.rst:212 ../../library/compileall.rst:278 -#: ../../library/compileall.rst:307 +#: ../../library/compileall.rst:211 ../../library/compileall.rst:276 +#: ../../library/compileall.rst:305 msgid "*quiet* parameter was changed to a multilevel value." msgstr "" -#: ../../library/compileall.rst:215 ../../library/compileall.rst:281 -#: ../../library/compileall.rst:310 +#: ../../library/compileall.rst:214 ../../library/compileall.rst:279 +#: ../../library/compileall.rst:308 msgid "" "The *legacy* parameter only writes out ``.pyc`` files, not ``.pyo`` files no " "matter what the value of *optimize* is." msgstr "" -#: ../../library/compileall.rst:219 +#: ../../library/compileall.rst:218 msgid "Accepts a :term:`path-like object`." msgstr "" -#: ../../library/compileall.rst:222 ../../library/compileall.rst:285 -#: ../../library/compileall.rst:314 +#: ../../library/compileall.rst:221 ../../library/compileall.rst:283 +#: ../../library/compileall.rst:312 msgid "The *invalidation_mode* parameter was added." msgstr "" -#: ../../library/compileall.rst:225 ../../library/compileall.rst:288 -#: ../../library/compileall.rst:317 +#: ../../library/compileall.rst:224 ../../library/compileall.rst:286 +#: ../../library/compileall.rst:315 msgid "The *invalidation_mode* parameter's default value is updated to None." msgstr "" -#: ../../library/compileall.rst:228 +#: ../../library/compileall.rst:227 msgid "Setting *workers* to 0 now chooses the optimal number of cores." msgstr "" -#: ../../library/compileall.rst:231 +#: ../../library/compileall.rst:230 msgid "" "Added *stripdir*, *prependdir*, *limit_sl_dest* and *hardlink_dupes* " "arguments. Default value of *maxlevels* was changed from ``10`` to ``sys." "getrecursionlimit()``" msgstr "" -#: ../../library/compileall.rst:237 +#: ../../library/compileall.rst:236 msgid "" "Compile the file with path *fullname*. Return a true value if the file " "compiled successfully, and a false value otherwise." msgstr "" -#: ../../library/compileall.rst:240 +#: ../../library/compileall.rst:239 msgid "" "If *ddir* is given, it is prepended to the path to the file being compiled " "for use in compilation time tracebacks, and is also compiled in to the byte-" @@ -340,29 +339,27 @@ msgid "" "executed." msgstr "" -#: ../../library/compileall.rst:246 +#: ../../library/compileall.rst:245 msgid "" -"If *rx* is given, its ``search`` method is passed the full path name to the " -"file being compiled, and if it returns a true value, the file is not " -"compiled and ``True`` is returned. This can be used to exclude files " -"matching a regular expression, given as a :ref:`re.Pattern ` " -"object." +"If *rx* is given, its search method is passed the full path name to the file " +"being compiled, and if it returns a true value, the file is not compiled and " +"``True`` is returned." msgstr "" -#: ../../library/compileall.rst:291 +#: ../../library/compileall.rst:289 msgid "" "Added *stripdir*, *prependdir*, *limit_sl_dest* and *hardlink_dupes* " "arguments." msgstr "" -#: ../../library/compileall.rst:296 +#: ../../library/compileall.rst:294 msgid "" "Byte-compile all the :file:`.py` files found along ``sys.path``. Return a " "true value if all the files compiled successfully, and a false value " "otherwise." msgstr "" -#: ../../library/compileall.rst:299 +#: ../../library/compileall.rst:297 msgid "" "If *skip_curdir* is true (the default), the current directory is not " "included in the search. All other parameters are passed to the :func:" @@ -370,16 +367,16 @@ msgid "" "``maxlevels`` defaults to ``0``." msgstr "" -#: ../../library/compileall.rst:320 +#: ../../library/compileall.rst:318 msgid "" "To force a recompile of all the :file:`.py` files in the :file:`Lib/` " "subdirectory and all its subdirectories::" msgstr "" -#: ../../library/compileall.rst:337 +#: ../../library/compileall.rst:335 msgid "Module :mod:`py_compile`" msgstr "" -#: ../../library/compileall.rst:338 +#: ../../library/compileall.rst:336 msgid "Byte-compile a single source file." msgstr "" diff --git a/library/concurrency.po b/library/concurrency.po index 6c340115d8..f30773a24e 100644 --- a/library/concurrency.po +++ b/library/concurrency.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.7\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2021-09-07 06:52+0000\n" +"POT-Creation-Date: 2020-06-20 18:08+0800\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-" @@ -31,6 +31,6 @@ msgid "" "an overview:" msgstr "" -#: ../../library/concurrency.rst:27 +#: ../../library/concurrency.rst:26 msgid "The following are support modules for some of the above services:" msgstr "" diff --git a/library/concurrent.futures.po b/library/concurrent.futures.po index 98bf8780e6..e7d373eb72 100644 --- a/library/concurrent.futures.po +++ b/library/concurrent.futures.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.7\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2021-09-07 06:52+0000\n" +"POT-Creation-Date: 2020-06-20 18:08+0800\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-" @@ -198,7 +198,7 @@ msgid "" msgstr "" #: ../../library/concurrent.futures.rst:171 -#: ../../library/concurrent.futures.rst:265 +#: ../../library/concurrent.futures.rst:264 msgid "Added the *initializer* and *initargs* arguments." msgstr "" @@ -229,48 +229,47 @@ msgid "" "The :class:`ProcessPoolExecutor` class is an :class:`Executor` subclass that " "uses a pool of processes to execute calls asynchronously. :class:" "`ProcessPoolExecutor` uses the :mod:`multiprocessing` module, which allows " -"it to side-step the :term:`Global Interpreter Lock ` but also means that only picklable objects can be executed and " -"returned." +"it to side-step the :term:`Global Interpreter Lock` but also means that only " +"picklable objects can be executed and returned." msgstr "" -#: ../../library/concurrent.futures.rst:228 +#: ../../library/concurrent.futures.rst:227 msgid "" "The ``__main__`` module must be importable by worker subprocesses. This " "means that :class:`ProcessPoolExecutor` will not work in the interactive " "interpreter." msgstr "" -#: ../../library/concurrent.futures.rst:231 +#: ../../library/concurrent.futures.rst:230 msgid "" "Calling :class:`Executor` or :class:`Future` methods from a callable " "submitted to a :class:`ProcessPoolExecutor` will result in deadlock." msgstr "" -#: ../../library/concurrent.futures.rst:236 +#: ../../library/concurrent.futures.rst:235 msgid "" "An :class:`Executor` subclass that executes calls asynchronously using a " "pool of at most *max_workers* processes. If *max_workers* is ``None`` or " "not given, it will default to the number of processors on the machine. If " -"*max_workers* is less than or equal to ``0``, then a :exc:`ValueError` will " -"be raised. On Windows, *max_workers* must be less than or equal to ``61``. " -"If it is not then :exc:`ValueError` will be raised. If *max_workers* is " -"``None``, then the default chosen will be at most ``61``, even if more " -"processors are available. *mp_context* can be a multiprocessing context or " -"None. It will be used to launch the workers. If *mp_context* is ``None`` or " -"not given, the default multiprocessing context is used." +"*max_workers* is lower or equal to ``0``, then a :exc:`ValueError` will be " +"raised. On Windows, *max_workers* must be equal or lower than ``61``. If it " +"is not then :exc:`ValueError` will be raised. If *max_workers* is ``None``, " +"then the default chosen will be at most ``61``, even if more processors are " +"available. *mp_context* can be a multiprocessing context or None. It will be " +"used to launch the workers. If *mp_context* is ``None`` or not given, the " +"default multiprocessing context is used." msgstr "" -#: ../../library/concurrent.futures.rst:249 +#: ../../library/concurrent.futures.rst:248 msgid "" "*initializer* is an optional callable that is called at the start of each " "worker process; *initargs* is a tuple of arguments passed to the " "initializer. Should *initializer* raise an exception, all currently pending " "jobs will raise a :exc:`~concurrent.futures.process.BrokenProcessPool`, as " -"well as any attempt to submit more jobs to the pool." +"well any attempt to submit more jobs to the pool." msgstr "" -#: ../../library/concurrent.futures.rst:255 +#: ../../library/concurrent.futures.rst:254 msgid "" "When one of the worker processes terminates abruptly, a :exc:" "`BrokenProcessPool` error is now raised. Previously, behaviour was " @@ -278,34 +277,34 @@ msgid "" "or deadlock." msgstr "" -#: ../../library/concurrent.futures.rst:261 +#: ../../library/concurrent.futures.rst:260 msgid "" "The *mp_context* argument was added to allow users to control the " "start_method for worker processes created by the pool." msgstr "" -#: ../../library/concurrent.futures.rst:271 +#: ../../library/concurrent.futures.rst:270 msgid "ProcessPoolExecutor Example" msgstr "" -#: ../../library/concurrent.futures.rst:309 +#: ../../library/concurrent.futures.rst:308 msgid "Future Objects" msgstr "" -#: ../../library/concurrent.futures.rst:311 +#: ../../library/concurrent.futures.rst:310 msgid "" "The :class:`Future` class encapsulates the asynchronous execution of a " "callable. :class:`Future` instances are created by :meth:`Executor.submit`." msgstr "" -#: ../../library/concurrent.futures.rst:316 +#: ../../library/concurrent.futures.rst:315 msgid "" "Encapsulates the asynchronous execution of a callable. :class:`Future` " "instances are created by :meth:`Executor.submit` and should not be created " "directly except for testing." msgstr "" -#: ../../library/concurrent.futures.rst:322 +#: ../../library/concurrent.futures.rst:321 msgid "" "Attempt to cancel the call. If the call is currently being executed or " "finished running and cannot be cancelled then the method will return " @@ -313,22 +312,22 @@ msgid "" "``True``." msgstr "" -#: ../../library/concurrent.futures.rst:329 +#: ../../library/concurrent.futures.rst:328 msgid "Return ``True`` if the call was successfully cancelled." msgstr "" -#: ../../library/concurrent.futures.rst:333 +#: ../../library/concurrent.futures.rst:332 msgid "" "Return ``True`` if the call is currently being executed and cannot be " "cancelled." msgstr "" -#: ../../library/concurrent.futures.rst:338 +#: ../../library/concurrent.futures.rst:337 msgid "" "Return ``True`` if the call was successfully cancelled or finished running." msgstr "" -#: ../../library/concurrent.futures.rst:343 +#: ../../library/concurrent.futures.rst:342 msgid "" "Return the value returned by the call. If the call hasn't yet completed then " "this method will wait up to *timeout* seconds. If the call hasn't completed " @@ -337,19 +336,18 @@ msgid "" "``None``, there is no limit to the wait time." msgstr "" -#: ../../library/concurrent.futures.rst:350 -#: ../../library/concurrent.futures.rst:364 +#: ../../library/concurrent.futures.rst:349 +#: ../../library/concurrent.futures.rst:363 msgid "" "If the future is cancelled before completing then :exc:`.CancelledError` " "will be raised." msgstr "" -#: ../../library/concurrent.futures.rst:353 -msgid "" -"If the call raised an exception, this method will raise the same exception." +#: ../../library/concurrent.futures.rst:352 +msgid "If the call raised, this method will raise the same exception." msgstr "" -#: ../../library/concurrent.futures.rst:357 +#: ../../library/concurrent.futures.rst:356 msgid "" "Return the exception raised by the call. If the call hasn't yet completed " "then this method will wait up to *timeout* seconds. If the call hasn't " @@ -358,18 +356,18 @@ msgid "" "*timeout* is not specified or ``None``, there is no limit to the wait time." msgstr "" -#: ../../library/concurrent.futures.rst:367 +#: ../../library/concurrent.futures.rst:366 msgid "If the call completed without raising, ``None`` is returned." msgstr "" -#: ../../library/concurrent.futures.rst:371 +#: ../../library/concurrent.futures.rst:370 msgid "" "Attaches the callable *fn* to the future. *fn* will be called, with the " "future as its only argument, when the future is cancelled or finishes " "running." msgstr "" -#: ../../library/concurrent.futures.rst:375 +#: ../../library/concurrent.futures.rst:374 msgid "" "Added callables are called in the order that they were added and are always " "called in a thread belonging to the process that added them. If the " @@ -378,26 +376,26 @@ msgid "" "behavior is undefined." msgstr "" -#: ../../library/concurrent.futures.rst:381 +#: ../../library/concurrent.futures.rst:380 msgid "" "If the future has already completed or been cancelled, *fn* will be called " "immediately." msgstr "" -#: ../../library/concurrent.futures.rst:384 +#: ../../library/concurrent.futures.rst:383 msgid "" "The following :class:`Future` methods are meant for use in unit tests and :" "class:`Executor` implementations." msgstr "" -#: ../../library/concurrent.futures.rst:389 +#: ../../library/concurrent.futures.rst:388 msgid "" "This method should only be called by :class:`Executor` implementations " "before executing the work associated with the :class:`Future` and by unit " "tests." msgstr "" -#: ../../library/concurrent.futures.rst:393 +#: ../../library/concurrent.futures.rst:392 msgid "" "If the method returns ``False`` then the :class:`Future` was cancelled, i." "e. :meth:`Future.cancel` was called and returned `True`. Any threads " @@ -405,49 +403,49 @@ msgid "" "or :func:`wait`) will be woken up." msgstr "" -#: ../../library/concurrent.futures.rst:398 +#: ../../library/concurrent.futures.rst:397 msgid "" "If the method returns ``True`` then the :class:`Future` was not cancelled " "and has been put in the running state, i.e. calls to :meth:`Future.running` " "will return `True`." msgstr "" -#: ../../library/concurrent.futures.rst:402 +#: ../../library/concurrent.futures.rst:401 msgid "" "This method can only be called once and cannot be called after :meth:`Future." "set_result` or :meth:`Future.set_exception` have been called." msgstr "" -#: ../../library/concurrent.futures.rst:408 +#: ../../library/concurrent.futures.rst:407 msgid "" "Sets the result of the work associated with the :class:`Future` to *result*." msgstr "" -#: ../../library/concurrent.futures.rst:411 -#: ../../library/concurrent.futures.rst:424 +#: ../../library/concurrent.futures.rst:410 +#: ../../library/concurrent.futures.rst:423 msgid "" "This method should only be used by :class:`Executor` implementations and " "unit tests." msgstr "" -#: ../../library/concurrent.futures.rst:414 -#: ../../library/concurrent.futures.rst:427 +#: ../../library/concurrent.futures.rst:413 +#: ../../library/concurrent.futures.rst:426 msgid "" "This method raises :exc:`concurrent.futures.InvalidStateError` if the :class:" "`Future` is already done." msgstr "" -#: ../../library/concurrent.futures.rst:421 +#: ../../library/concurrent.futures.rst:420 msgid "" "Sets the result of the work associated with the :class:`Future` to the :" "class:`Exception` *exception*." msgstr "" -#: ../../library/concurrent.futures.rst:433 +#: ../../library/concurrent.futures.rst:432 msgid "Module Functions" msgstr "" -#: ../../library/concurrent.futures.rst:437 +#: ../../library/concurrent.futures.rst:436 msgid "" "Wait for the :class:`Future` instances (possibly created by different :class:" "`Executor` instances) given by *fs* to complete. Returns a named 2-tuple of " @@ -457,55 +455,55 @@ msgid "" "running futures)." msgstr "" -#: ../../library/concurrent.futures.rst:444 +#: ../../library/concurrent.futures.rst:443 msgid "" "*timeout* can be used to control the maximum number of seconds to wait " "before returning. *timeout* can be an int or float. If *timeout* is not " "specified or ``None``, there is no limit to the wait time." msgstr "" -#: ../../library/concurrent.futures.rst:448 +#: ../../library/concurrent.futures.rst:447 msgid "" "*return_when* indicates when this function should return. It must be one of " "the following constants:" msgstr "" -#: ../../library/concurrent.futures.rst:454 +#: ../../library/concurrent.futures.rst:453 msgid "Constant" msgstr "" -#: ../../library/concurrent.futures.rst:454 +#: ../../library/concurrent.futures.rst:453 msgid "Description" msgstr "描述" -#: ../../library/concurrent.futures.rst:456 +#: ../../library/concurrent.futures.rst:455 msgid ":const:`FIRST_COMPLETED`" msgstr "" -#: ../../library/concurrent.futures.rst:456 +#: ../../library/concurrent.futures.rst:455 msgid "The function will return when any future finishes or is cancelled." msgstr "" -#: ../../library/concurrent.futures.rst:459 +#: ../../library/concurrent.futures.rst:458 msgid ":const:`FIRST_EXCEPTION`" msgstr "" -#: ../../library/concurrent.futures.rst:459 +#: ../../library/concurrent.futures.rst:458 msgid "" "The function will return when any future finishes by raising an exception. " "If no future raises an exception then it is equivalent to :const:" "`ALL_COMPLETED`." msgstr "" -#: ../../library/concurrent.futures.rst:465 +#: ../../library/concurrent.futures.rst:464 msgid ":const:`ALL_COMPLETED`" msgstr "" -#: ../../library/concurrent.futures.rst:465 +#: ../../library/concurrent.futures.rst:464 msgid "The function will return when all futures finish or are cancelled." msgstr "" -#: ../../library/concurrent.futures.rst:471 +#: ../../library/concurrent.futures.rst:470 msgid "" "Returns an iterator over the :class:`Future` instances (possibly created by " "different :class:`Executor` instances) given by *fs* that yields futures as " @@ -519,49 +517,49 @@ msgid "" "wait time." msgstr "" -#: ../../library/concurrent.futures.rst:485 +#: ../../library/concurrent.futures.rst:484 msgid ":pep:`3148` -- futures - execute computations asynchronously" msgstr "" -#: ../../library/concurrent.futures.rst:485 +#: ../../library/concurrent.futures.rst:484 msgid "" "The proposal which described this feature for inclusion in the Python " "standard library." msgstr "" -#: ../../library/concurrent.futures.rst:490 +#: ../../library/concurrent.futures.rst:489 msgid "Exception classes" msgstr "" -#: ../../library/concurrent.futures.rst:496 +#: ../../library/concurrent.futures.rst:495 msgid "Raised when a future is cancelled." msgstr "" -#: ../../library/concurrent.futures.rst:500 +#: ../../library/concurrent.futures.rst:499 msgid "Raised when a future operation exceeds the given timeout." msgstr "" -#: ../../library/concurrent.futures.rst:504 +#: ../../library/concurrent.futures.rst:503 msgid "" "Derived from :exc:`RuntimeError`, this exception class is raised when an " "executor is broken for some reason, and cannot be used to submit or execute " "new tasks." msgstr "" -#: ../../library/concurrent.futures.rst:512 +#: ../../library/concurrent.futures.rst:511 msgid "" "Raised when an operation is performed on a future that is not allowed in the " "current state." msgstr "" -#: ../../library/concurrent.futures.rst:521 +#: ../../library/concurrent.futures.rst:520 msgid "" "Derived from :exc:`~concurrent.futures.BrokenExecutor`, this exception class " "is raised when one of the workers of a :class:`ThreadPoolExecutor` has " "failed initializing." msgstr "" -#: ../../library/concurrent.futures.rst:531 +#: ../../library/concurrent.futures.rst:530 msgid "" "Derived from :exc:`~concurrent.futures.BrokenExecutor` (formerly :exc:" "`RuntimeError`), this exception class is raised when one of the workers of " diff --git a/library/configparser.po b/library/configparser.po index f79b003cb7..ee91d3553c 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-07 06:52+0000\n" +"POT-Creation-Date: 2020-06-20 18:08+0800\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-" @@ -60,15 +60,15 @@ msgid "" "used for this purpose." msgstr "" -#: ../../library/configparser.rst:56 +#: ../../library/configparser.rst:51 msgid "Quick Start" msgstr "" -#: ../../library/configparser.rst:58 +#: ../../library/configparser.rst:53 msgid "Let's take a very basic configuration file that looks like this:" msgstr "" -#: ../../library/configparser.rst:75 +#: ../../library/configparser.rst:70 msgid "" "The structure of INI files is described `in the following section " "<#supported-ini-file-structure>`_. Essentially, the file consists of " @@ -77,20 +77,20 @@ msgid "" "configuration file programmatically." msgstr "" -#: ../../library/configparser.rst:99 +#: ../../library/configparser.rst:94 msgid "" "As you can see, we can treat a config parser much like a dictionary. There " "are differences, `outlined later <#mapping-protocol-access>`_, but the " "behavior is very close to what you would expect from a dictionary." msgstr "" -#: ../../library/configparser.rst:103 +#: ../../library/configparser.rst:98 msgid "" "Now that we have created and saved a configuration file, let's read it back " "and explore the data it holds." msgstr "" -#: ../../library/configparser.rst:138 +#: ../../library/configparser.rst:133 msgid "" "As we can see above, the API is pretty straightforward. The only bit of " "magic involves the ``DEFAULT`` section which provides default values for all " @@ -98,18 +98,18 @@ msgid "" "and stored in lowercase [1]_." msgstr "" -#: ../../library/configparser.rst:145 +#: ../../library/configparser.rst:140 msgid "Supported Datatypes" msgstr "" -#: ../../library/configparser.rst:147 +#: ../../library/configparser.rst:142 msgid "" "Config parsers do not guess datatypes of values in configuration files, " "always storing them internally as strings. This means that if you need " "other datatypes, you should convert on your own:" msgstr "" -#: ../../library/configparser.rst:158 +#: ../../library/configparser.rst:153 msgid "" "Since this task is so common, config parsers provide a range of handy getter " "methods to handle integers, floats and booleans. The last one is the most " @@ -120,7 +120,7 @@ msgid "" "``'true'``/``'false'`` and ``'1'``/``'0'`` [1]_. For example:" msgstr "" -#: ../../library/configparser.rst:175 +#: ../../library/configparser.rst:170 msgid "" "Apart from :meth:`~ConfigParser.getboolean`, config parsers also provide " "equivalent :meth:`~ConfigParser.getint` and :meth:`~ConfigParser.getfloat` " @@ -128,17 +128,17 @@ msgid "" "ones. [1]_" msgstr "" -#: ../../library/configparser.rst:181 +#: ../../library/configparser.rst:176 msgid "Fallback Values" msgstr "" -#: ../../library/configparser.rst:183 +#: ../../library/configparser.rst:178 msgid "" "As with a dictionary, you can use a section's :meth:`get` method to provide " "fallback values:" msgstr "" -#: ../../library/configparser.rst:196 +#: ../../library/configparser.rst:191 msgid "" "Please note that default values have precedence over fallback values. For " "instance, in our example the ``'CompressionLevel'`` key was specified only " @@ -147,7 +147,7 @@ msgid "" "specify a fallback:" msgstr "" -#: ../../library/configparser.rst:207 +#: ../../library/configparser.rst:202 msgid "" "One more thing to be aware of is that the parser-level :meth:`get` method " "provides a custom, more complex interface, maintained for backwards " @@ -155,18 +155,18 @@ msgid "" "the ``fallback`` keyword-only argument:" msgstr "" -#: ../../library/configparser.rst:218 +#: ../../library/configparser.rst:213 msgid "" "The same ``fallback`` argument can be used with the :meth:`~ConfigParser." "getint`, :meth:`~ConfigParser.getfloat` and :meth:`~ConfigParser.getboolean` " "methods, for example:" msgstr "" -#: ../../library/configparser.rst:234 +#: ../../library/configparser.rst:229 msgid "Supported INI File Structure" msgstr "" -#: ../../library/configparser.rst:236 +#: ../../library/configparser.rst:231 msgid "" "A configuration file consists of sections, each led by a ``[section]`` " "header, followed by key/value entries separated by a specific string (``=`` " @@ -178,29 +178,29 @@ msgid "" "mode, blank lines may be treated as parts of multiline values or ignored." msgstr "" -#: ../../library/configparser.rst:245 +#: ../../library/configparser.rst:240 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:244 ../../library/configparser.rst:307 msgid "For example:" msgstr "" -#: ../../library/configparser.rst:297 +#: ../../library/configparser.rst:292 msgid "Interpolation of values" msgstr "" -#: ../../library/configparser.rst:299 +#: ../../library/configparser.rst:294 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:302 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 +208,7 @@ msgid "" "can be provided on initialization." msgstr "" -#: ../../library/configparser.rst:324 +#: ../../library/configparser.rst:319 msgid "" "In the example above, :class:`ConfigParser` with *interpolation* set to " "``BasicInterpolation()`` would resolve ``%(home_dir)s`` to the value of " @@ -218,14 +218,14 @@ msgid "" "specific order in the configuration file." msgstr "" -#: ../../library/configparser.rst:331 +#: ../../library/configparser.rst:326 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:334 msgid "" "An alternative handler for interpolation which implements a more advanced " "syntax, used for instance in ``zc.buildout``. Extended interpolation is " @@ -235,21 +235,21 @@ msgid "" "possibly the default values from the special section)." msgstr "" -#: ../../library/configparser.rst:346 +#: ../../library/configparser.rst:341 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:354 msgid "Values from other sections can be fetched as well:" msgstr "" -#: ../../library/configparser.rst:381 +#: ../../library/configparser.rst:376 msgid "Mapping Protocol Access" msgstr "" -#: ../../library/configparser.rst:385 +#: ../../library/configparser.rst:380 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 +257,7 @@ msgid "" "``parser['section']['option']`` notation." msgstr "" -#: ../../library/configparser.rst:390 +#: ../../library/configparser.rst:385 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 +266,7 @@ msgid "" "original parser." msgstr "" -#: ../../library/configparser.rst:396 +#: ../../library/configparser.rst:391 msgid "" ":mod:`configparser` objects behave as close to actual dictionaries as " "possible. The mapping interface is complete and adheres to the :class:" @@ -274,7 +274,7 @@ msgid "" "that should be taken into account:" msgstr "" -#: ../../library/configparser.rst:401 +#: ../../library/configparser.rst:396 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 +283,7 @@ msgid "" "expressions return ``True``::" msgstr "" -#: ../../library/configparser.rst:409 +#: ../../library/configparser.rst:404 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 +293,30 @@ msgid "" "default value causes a :exc:`KeyError`." msgstr "" -#: ../../library/configparser.rst:416 +#: ../../library/configparser.rst:411 msgid "``DEFAULTSECT`` cannot be removed from the parser:" msgstr "" -#: ../../library/configparser.rst:418 +#: ../../library/configparser.rst:413 msgid "trying to delete it raises :exc:`ValueError`," msgstr "" -#: ../../library/configparser.rst:420 +#: ../../library/configparser.rst:415 msgid "``parser.clear()`` leaves it intact," msgstr "" -#: ../../library/configparser.rst:422 +#: ../../library/configparser.rst:417 msgid "``parser.popitem()`` never returns it." msgstr "" -#: ../../library/configparser.rst:424 +#: ../../library/configparser.rst:419 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:423 msgid "" "``parser.items()`` is compatible with the mapping protocol (returns a list " "of *section_name*, *section_proxy* pairs including the DEFAULTSECT). " @@ -326,18 +326,18 @@ msgid "" "(unless ``raw=True`` is provided)." msgstr "" -#: ../../library/configparser.rst:435 +#: ../../library/configparser.rst:430 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:436 msgid "Customizing Parser Behaviour" msgstr "" -#: ../../library/configparser.rst:443 +#: ../../library/configparser.rst:438 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 +346,17 @@ msgid "" "customize some of the features." msgstr "" -#: ../../library/configparser.rst:449 +#: ../../library/configparser.rst:444 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:447 msgid "*defaults*, default value: ``None``" msgstr "" -#: ../../library/configparser.rst:454 +#: ../../library/configparser.rst:449 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 +364,17 @@ msgid "" "the documented default." msgstr "" -#: ../../library/configparser.rst:459 +#: ../../library/configparser.rst:454 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:457 msgid "*dict_type*, default value: :class:`dict`" msgstr "" -#: ../../library/configparser.rst:464 +#: ../../library/configparser.rst:459 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 +382,24 @@ msgid "" "goes for options within sections." msgstr "" -#: ../../library/configparser.rst:469 +#: ../../library/configparser.rst:464 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:467 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:489 msgid "*allow_no_value*, default value: ``False``" msgstr "" -#: ../../library/configparser.rst:496 +#: ../../library/configparser.rst:491 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 +407,32 @@ msgid "" "such values should be accepted:" msgstr "" -#: ../../library/configparser.rst:531 +#: ../../library/configparser.rst:526 msgid "*delimiters*, default value: ``('=', ':')``" msgstr "" -#: ../../library/configparser.rst:533 +#: ../../library/configparser.rst:528 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:532 msgid "" "See also the *space_around_delimiters* argument to :meth:`ConfigParser." "write`." msgstr "" -#: ../../library/configparser.rst:540 +#: ../../library/configparser.rst:535 msgid "*comment_prefixes*, default value: ``('#', ';')``" msgstr "" -#: ../../library/configparser.rst:542 +#: ../../library/configparser.rst:537 msgid "*inline_comment_prefixes*, default value: ``None``" msgstr "" -#: ../../library/configparser.rst:544 +#: ../../library/configparser.rst:539 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 +442,13 @@ msgid "" "used as prefixes for whole line comments." msgstr "" -#: ../../library/configparser.rst:551 +#: ../../library/configparser.rst:546 msgid "" "In previous versions of :mod:`configparser` behaviour matched " "``comment_prefixes=('#',';')`` and ``inline_comment_prefixes=(';',)``." msgstr "" -#: ../../library/configparser.rst:555 +#: ../../library/configparser.rst:550 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 +458,11 @@ msgid "" "values is to interpolate the prefix, for example::" msgstr "" -#: ../../library/configparser.rst:601 +#: ../../library/configparser.rst:596 msgid "*strict*, default value: ``True``" msgstr "" -#: ../../library/configparser.rst:603 +#: ../../library/configparser.rst:598 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 +470,17 @@ msgid "" "parsers in new applications." msgstr "" -#: ../../library/configparser.rst:608 +#: ../../library/configparser.rst:603 msgid "" "In previous versions of :mod:`configparser` behaviour matched " "``strict=False``." msgstr "" -#: ../../library/configparser.rst:612 +#: ../../library/configparser.rst:607 msgid "*empty_lines_in_values*, default value: ``True``" msgstr "" -#: ../../library/configparser.rst:614 +#: ../../library/configparser.rst:609 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 +490,7 @@ msgid "" "lose track of the file structure. Take for instance:" msgstr "" -#: ../../library/configparser.rst:629 +#: ../../library/configparser.rst:624 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 +499,13 @@ msgid "" "would produce two keys, ``key`` and ``this``." msgstr "" -#: ../../library/configparser.rst:635 +#: ../../library/configparser.rst:630 msgid "" "*default_section*, default value: ``configparser.DEFAULTSECT`` (that is: ``" "\"DEFAULT\"``)" msgstr "" -#: ../../library/configparser.rst:638 +#: ../../library/configparser.rst:633 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 +519,11 @@ msgid "" "files from one format to another)." msgstr "" -#: ../../library/configparser.rst:649 +#: ../../library/configparser.rst:644 msgid "*interpolation*, default value: ``configparser.BasicInterpolation``" msgstr "" -#: ../../library/configparser.rst:651 +#: ../../library/configparser.rst:646 msgid "" "Interpolation behaviour may be customized by providing a custom handler " "through the *interpolation* argument. ``None`` can be used to turn off " @@ -533,11 +533,11 @@ msgid "" "`RawConfigParser` has a default value of ``None``." msgstr "" -#: ../../library/configparser.rst:658 +#: ../../library/configparser.rst:653 msgid "*converters*, default value: not set" msgstr "" -#: ../../library/configparser.rst:660 +#: ../../library/configparser.rst:655 msgid "" "Config parsers provide option value getters that perform type conversion. " "By default :meth:`~ConfigParser.getint`, :meth:`~ConfigParser.getfloat`, " @@ -551,7 +551,7 @@ msgid "" "``parser_instance['section'].getdecimal('key', 0)``." msgstr "" -#: ../../library/configparser.rst:671 +#: ../../library/configparser.rst:666 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 +559,14 @@ msgid "" "the dict-compatible form (see the ``getdecimal()`` example above)." msgstr "" -#: ../../library/configparser.rst:676 +#: ../../library/configparser.rst:671 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:677 msgid "" "By default when using :meth:`~ConfigParser.getboolean`, config parsers " "consider the following values ``True``: ``'1'``, ``'yes'``, ``'true'``, " @@ -575,13 +575,13 @@ msgid "" "strings and their Boolean outcomes. For example:" msgstr "" -#: ../../library/configparser.rst:700 +#: ../../library/configparser.rst:695 msgid "" "Other typical Boolean pairs include ``accept``/``reject`` or ``enabled``/" "``disabled``." msgstr "" -#: ../../library/configparser.rst:706 +#: ../../library/configparser.rst:700 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 +589,14 @@ msgid "" "method if that's unsuitable. For example:" msgstr "" -#: ../../library/configparser.rst:736 +#: ../../library/configparser.rst:730 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:737 msgid "" "A compiled regular expression used to parse section headers. The default " "matches ``[section]`` to the name ``\"section\"``. Whitespace is considered " @@ -605,18 +605,18 @@ msgid "" "example:" msgstr "" -#: ../../library/configparser.rst:771 +#: ../../library/configparser.rst:765 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:771 msgid "Legacy API Examples" msgstr "" -#: ../../library/configparser.rst:779 +#: ../../library/configparser.rst:773 msgid "" "Mainly because of backwards compatibility concerns, :mod:`configparser` " "provides also a legacy API with explicit ``get``/``set`` methods. While " @@ -625,29 +625,29 @@ msgid "" "advanced, low-level and downright counterintuitive." msgstr "" -#: ../../library/configparser.rst:785 +#: ../../library/configparser.rst:779 msgid "An example of writing to a configuration file::" msgstr "" -#: ../../library/configparser.rst:808 +#: ../../library/configparser.rst:802 msgid "An example of reading the configuration file again::" msgstr "" -#: ../../library/configparser.rst:826 +#: ../../library/configparser.rst:820 msgid "To get interpolation, use :class:`ConfigParser`::" msgstr "" -#: ../../library/configparser.rst:859 +#: ../../library/configparser.rst:853 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:871 msgid "ConfigParser Objects" msgstr "" -#: ../../library/configparser.rst:881 +#: ../../library/configparser.rst:875 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 +655,7 @@ msgid "" "the options within a section, and for the default values." msgstr "" -#: ../../library/configparser.rst:886 +#: ../../library/configparser.rst:880 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 +664,7 @@ msgid "" "as the set of substrings that prefix comments in non-empty lines." msgstr "" -#: ../../library/configparser.rst:892 +#: ../../library/configparser.rst:886 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 +677,7 @@ msgid "" "without the trailing delimiter." msgstr "" -#: ../../library/configparser.rst:902 +#: ../../library/configparser.rst:896 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 +685,7 @@ msgid "" "on runtime using the ``default_section`` instance attribute." msgstr "" -#: ../../library/configparser.rst:907 +#: ../../library/configparser.rst:901 msgid "" "Interpolation behaviour may be customized by providing a custom handler " "through the *interpolation* argument. ``None`` can be used to turn off " @@ -694,7 +694,7 @@ msgid "" "`dedicated documentation section <#interpolation-of-values>`_." msgstr "" -#: ../../library/configparser.rst:913 +#: ../../library/configparser.rst:907 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 +703,7 @@ msgid "" "%(BAR)s`` are equivalent." msgstr "" -#: ../../library/configparser.rst:919 +#: ../../library/configparser.rst:913 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 +712,44 @@ msgid "" "object and section proxies." msgstr "" -#: ../../library/configparser.rst:925 +#: ../../library/configparser.rst:919 msgid "The default *dict_type* is :class:`collections.OrderedDict`." msgstr "" -#: ../../library/configparser.rst:928 +#: ../../library/configparser.rst:922 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:927 msgid "The *converters* argument was added." msgstr "" -#: ../../library/configparser.rst:936 +#: ../../library/configparser.rst:930 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:935 ../../library/configparser.rst:1213 msgid "" "The default *dict_type* is :class:`dict`, since it now preserves insertion " "order." msgstr "" -#: ../../library/configparser.rst:947 +#: ../../library/configparser.rst:941 msgid "Return a dictionary containing the instance-wide defaults." msgstr "" -#: ../../library/configparser.rst:952 +#: ../../library/configparser.rst:946 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:952 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 +757,34 @@ msgid "" "the section must be a string; if not, :exc:`TypeError` is raised." msgstr "" -#: ../../library/configparser.rst:963 +#: ../../library/configparser.rst:957 msgid "Non-string section names raise :exc:`TypeError`." msgstr "" -#: ../../library/configparser.rst:969 +#: ../../library/configparser.rst:963 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:969 msgid "Return a list of options available in the specified *section*." msgstr "" -#: ../../library/configparser.rst:980 +#: ../../library/configparser.rst:974 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:981 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:984 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 +795,7 @@ msgid "" "be read." msgstr "" -#: ../../library/configparser.rst:999 +#: ../../library/configparser.rst:993 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 +803,49 @@ msgid "" "`read_file` before calling :meth:`read` for any optional files::" msgstr "" -#: ../../library/configparser.rst:1012 +#: ../../library/configparser.rst:1006 msgid "" "The *encoding* parameter. Previously, all files were read using the default " "encoding for :func:`open`." msgstr "" -#: ../../library/configparser.rst:1016 +#: ../../library/configparser.rst:1010 msgid "The *filenames* parameter accepts a :term:`path-like object`." msgstr "" -#: ../../library/configparser.rst:1019 +#: ../../library/configparser.rst:1013 msgid "The *filenames* parameter accepts a :class:`bytes` object." msgstr "" -#: ../../library/configparser.rst:1025 +#: ../../library/configparser.rst:1019 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:1022 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:1026 msgid "Replaces :meth:`readfp`." msgstr "" -#: ../../library/configparser.rst:1037 +#: ../../library/configparser.rst:1031 msgid "Parse configuration data from a string." msgstr "" -#: ../../library/configparser.rst:1039 +#: ../../library/configparser.rst:1033 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:1042 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 +854,17 @@ msgid "" "automatically converted to strings." msgstr "" -#: ../../library/configparser.rst:1054 +#: ../../library/configparser.rst:1048 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:1051 msgid "This method can be used to copy state between parsers." msgstr "" -#: ../../library/configparser.rst:1064 +#: ../../library/configparser.rst:1058 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 +873,35 @@ msgid "" "provided as a *fallback* value." msgstr "" -#: ../../library/configparser.rst:1070 +#: ../../library/configparser.rst:1064 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:1068 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:1076 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:1083 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:1090 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 +913,34 @@ msgid "" "*fallback*." msgstr "" -#: ../../library/configparser.rst:1109 +#: ../../library/configparser.rst:1103 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:1106 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:1110 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:1118 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:1125 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 +949,20 @@ msgid "" "surrounded by spaces." msgstr "" -#: ../../library/configparser.rst:1139 -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:1134 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:1142 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:1148 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 +971,7 @@ msgid "" "of this name on instances to affect this behavior." msgstr "" -#: ../../library/configparser.rst:1167 +#: ../../library/configparser.rst:1154 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 +979,46 @@ msgid "" "sensitive::" msgstr "" -#: ../../library/configparser.rst:1175 +#: ../../library/configparser.rst:1162 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:1168 msgid "Use :meth:`read_file` instead." msgstr "" -#: ../../library/configparser.rst:1184 +#: ../../library/configparser.rst:1171 msgid "" ":meth:`readfp` now iterates on *fp* instead of calling ``fp.readline()``." msgstr "" -#: ../../library/configparser.rst:1187 +#: ../../library/configparser.rst:1174 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:1184 msgid "" "Instead of ``parser.readfp(fp)`` use ``parser." "read_file(readline_generator(fp))``." msgstr "" -#: ../../library/configparser.rst:1203 +#: ../../library/configparser.rst:1190 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:1198 msgid "RawConfigParser Objects" msgstr "" -#: ../../library/configparser.rst:1221 +#: ../../library/configparser.rst:1208 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 +1026,27 @@ msgid "" "``defaults=`` keyword argument handling." msgstr "" -#: ../../library/configparser.rst:1231 +#: ../../library/configparser.rst:1218 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:1225 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:1229 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:1235 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 +1056,7 @@ msgid "" "string values." msgstr "" -#: ../../library/configparser.rst:1255 +#: ../../library/configparser.rst:1242 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 +1064,32 @@ msgid "" "not allow such assignments to take place." msgstr "" -#: ../../library/configparser.rst:1262 +#: ../../library/configparser.rst:1249 msgid "Exceptions" msgstr "" -#: ../../library/configparser.rst:1266 +#: ../../library/configparser.rst:1253 msgid "Base class for all other :mod:`configparser` exceptions." msgstr "" -#: ../../library/configparser.rst:1271 +#: ../../library/configparser.rst:1258 msgid "Exception raised when a specified section is not found." msgstr "" -#: ../../library/configparser.rst:1276 +#: ../../library/configparser.rst:1263 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:1267 msgid "" "Optional ``source`` and ``lineno`` attributes and arguments to :meth:" "`__init__` were added." msgstr "" -#: ../../library/configparser.rst:1287 +#: ../../library/configparser.rst:1274 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 +1097,58 @@ msgid "" "representing the same case-insensitive configuration key." msgstr "" -#: ../../library/configparser.rst:1295 +#: ../../library/configparser.rst:1282 msgid "" "Exception raised when a specified option is not found in the specified " "section." msgstr "" -#: ../../library/configparser.rst:1301 +#: ../../library/configparser.rst:1288 msgid "" "Base class for exceptions raised when problems occur performing string " "interpolation." msgstr "" -#: ../../library/configparser.rst:1307 +#: ../../library/configparser.rst:1294 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:1301 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:1307 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:1313 msgid "" "Exception raised when attempting to parse a file which has no section " "headers." msgstr "" -#: ../../library/configparser.rst:1332 +#: ../../library/configparser.rst:1319 msgid "Exception raised when errors occur attempting to parse a file." msgstr "" -#: ../../library/configparser.rst:1334 +#: ../../library/configparser.rst:1321 msgid "" "The ``filename`` attribute and :meth:`__init__` argument were renamed to " "``source`` for consistency." msgstr "" -#: ../../library/configparser.rst:1340 +#: ../../library/configparser.rst:1327 msgid "Footnotes" msgstr "註解" -#: ../../library/configparser.rst:1341 +#: ../../library/configparser.rst:1328 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/contextlib.po b/library/contextlib.po index be55e3ae09..1e1438081a 100644 --- a/library/contextlib.po +++ b/library/contextlib.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.7\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2021-09-07 06:52+0000\n" +"POT-Creation-Date: 2020-06-20 18:08+0800\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-" @@ -168,12 +168,11 @@ msgstr "" #: ../../library/contextlib.rst:193 msgid "" "Return a context manager that suppresses any of the specified exceptions if " -"they occur in the body of a :keyword:`!with` statement and then resumes " -"execution with the first statement following the end of the :keyword:`!with` " -"statement." +"they occur in the body of a with statement and then resumes execution with " +"the first statement following the end of the with statement." msgstr "" -#: ../../library/contextlib.rst:198 +#: ../../library/contextlib.rst:197 msgid "" "As with any other mechanism that completely suppresses exceptions, this " "context manager should be used only to cover very specific errors where " @@ -181,51 +180,49 @@ msgid "" "do." msgstr "" -#: ../../library/contextlib.rst:203 +#: ../../library/contextlib.rst:202 msgid "For example::" msgstr "" -#: ../../library/contextlib.rst:213 +#: ../../library/contextlib.rst:212 msgid "This code is equivalent to::" msgstr "" -#: ../../library/contextlib.rst:225 ../../library/contextlib.rst:265 -#: ../../library/contextlib.rst:275 +#: ../../library/contextlib.rst:224 ../../library/contextlib.rst:263 +#: ../../library/contextlib.rst:273 msgid "This context manager is :ref:`reentrant `." msgstr "" -#: ../../library/contextlib.rst:232 +#: ../../library/contextlib.rst:231 msgid "" "Context manager for temporarily redirecting :data:`sys.stdout` to another " "file or file-like object." msgstr "" -#: ../../library/contextlib.rst:235 +#: ../../library/contextlib.rst:234 msgid "" "This tool adds flexibility to existing functions or classes whose output is " "hardwired to stdout." msgstr "" -#: ../../library/contextlib.rst:238 +#: ../../library/contextlib.rst:237 msgid "" "For example, the output of :func:`help` normally is sent to *sys.stdout*. " "You can capture that output in a string by redirecting the output to an :" -"class:`io.StringIO` object. The replacement stream is returned from the " -"``__enter__`` method and so is available as the target of the :keyword:" -"`with` statement::" +"class:`io.StringIO` object::" msgstr "" -#: ../../library/contextlib.rst:248 +#: ../../library/contextlib.rst:246 msgid "" "To send the output of :func:`help` to a file on disk, redirect the output to " "a regular file::" msgstr "" -#: ../../library/contextlib.rst:255 +#: ../../library/contextlib.rst:253 msgid "To send the output of :func:`help` to *sys.stderr*::" msgstr "" -#: ../../library/contextlib.rst:260 +#: ../../library/contextlib.rst:258 msgid "" "Note that the global side effect on :data:`sys.stdout` means that this " "context manager is not suitable for use in library code and most threaded " @@ -233,56 +230,56 @@ msgid "" "it is still a useful approach for many utility scripts." msgstr "" -#: ../../library/contextlib.rst:272 +#: ../../library/contextlib.rst:270 msgid "" "Similar to :func:`~contextlib.redirect_stdout` but redirecting :data:`sys." "stderr` to another file or file-like object." msgstr "" -#: ../../library/contextlib.rst:282 +#: ../../library/contextlib.rst:280 msgid "" "A base class that enables a context manager to also be used as a decorator." msgstr "" -#: ../../library/contextlib.rst:284 +#: ../../library/contextlib.rst:282 msgid "" "Context managers inheriting from ``ContextDecorator`` have to implement " "``__enter__`` and ``__exit__`` as normal. ``__exit__`` retains its optional " "exception handling even when used as a decorator." msgstr "" -#: ../../library/contextlib.rst:288 +#: ../../library/contextlib.rst:286 msgid "" "``ContextDecorator`` is used by :func:`contextmanager`, so you get this " "functionality automatically." msgstr "" -#: ../../library/contextlib.rst:291 +#: ../../library/contextlib.rst:289 msgid "Example of ``ContextDecorator``::" msgstr "" -#: ../../library/contextlib.rst:320 +#: ../../library/contextlib.rst:318 msgid "" "This change is just syntactic sugar for any construct of the following form::" msgstr "" -#: ../../library/contextlib.rst:326 +#: ../../library/contextlib.rst:324 msgid "``ContextDecorator`` lets you instead write::" msgstr "" -#: ../../library/contextlib.rst:332 +#: ../../library/contextlib.rst:330 msgid "" "It makes it clear that the ``cm`` applies to the whole function, rather than " "just a piece of it (and saving an indentation level is nice, too)." msgstr "" -#: ../../library/contextlib.rst:335 +#: ../../library/contextlib.rst:333 msgid "" "Existing context managers that already have a base class can be extended by " "using ``ContextDecorator`` as a mixin class::" msgstr "" -#: ../../library/contextlib.rst:348 +#: ../../library/contextlib.rst:346 msgid "" "As the decorated function must be able to be called multiple times, the " "underlying context manager must support use in multiple :keyword:`with` " @@ -290,20 +287,20 @@ msgid "" "explicit :keyword:`!with` statement inside the function should be used." msgstr "" -#: ../../library/contextlib.rst:358 +#: ../../library/contextlib.rst:356 msgid "" "A context manager that is designed to make it easy to programmatically " "combine other context managers and cleanup functions, especially those that " "are optional or otherwise driven by input data." msgstr "" -#: ../../library/contextlib.rst:362 +#: ../../library/contextlib.rst:360 msgid "" "For example, a set of files may easily be handled in a single with statement " "as follows::" msgstr "" -#: ../../library/contextlib.rst:371 +#: ../../library/contextlib.rst:369 msgid "" "Each instance maintains a stack of registered callbacks that are called in " "reverse order when the instance is closed (either explicitly or implicitly " @@ -311,14 +308,14 @@ msgid "" "invoked implicitly when the context stack instance is garbage collected." msgstr "" -#: ../../library/contextlib.rst:376 +#: ../../library/contextlib.rst:374 msgid "" "This stack model is used so that context managers that acquire their " "resources in their ``__init__`` method (such as file objects) can be handled " "correctly." msgstr "" -#: ../../library/contextlib.rst:380 +#: ../../library/contextlib.rst:378 msgid "" "Since registered callbacks are invoked in the reverse order of registration, " "this ends up behaving as if multiple nested :keyword:`with` statements had " @@ -328,7 +325,7 @@ msgid "" "updated state." msgstr "" -#: ../../library/contextlib.rst:387 +#: ../../library/contextlib.rst:385 msgid "" "This is a relatively low level API that takes care of the details of " "correctly unwinding the stack of exit callbacks. It provides a suitable " @@ -336,68 +333,68 @@ msgid "" "in application specific ways." msgstr "" -#: ../../library/contextlib.rst:396 +#: ../../library/contextlib.rst:394 msgid "" "Enters a new context manager and adds its :meth:`__exit__` method to the " "callback stack. The return value is the result of the context manager's own :" "meth:`__enter__` method." msgstr "" -#: ../../library/contextlib.rst:400 +#: ../../library/contextlib.rst:398 msgid "" "These context managers may suppress exceptions just as they normally would " "if used directly as part of a :keyword:`with` statement." msgstr "" -#: ../../library/contextlib.rst:405 +#: ../../library/contextlib.rst:403 msgid "Adds a context manager's :meth:`__exit__` method to the callback stack." msgstr "" -#: ../../library/contextlib.rst:407 +#: ../../library/contextlib.rst:405 msgid "" "As ``__enter__`` is *not* invoked, this method can be used to cover part of " "an :meth:`__enter__` implementation with a context manager's own :meth:" "`__exit__` method." msgstr "" -#: ../../library/contextlib.rst:411 +#: ../../library/contextlib.rst:409 msgid "" "If passed an object that is not a context manager, this method assumes it is " "a callback with the same signature as a context manager's :meth:`__exit__` " "method and adds it directly to the callback stack." msgstr "" -#: ../../library/contextlib.rst:415 +#: ../../library/contextlib.rst:413 msgid "" "By returning true values, these callbacks can suppress exceptions the same " "way context manager :meth:`__exit__` methods can." msgstr "" -#: ../../library/contextlib.rst:418 +#: ../../library/contextlib.rst:416 msgid "" "The passed in object is returned from the function, allowing this method to " "be used as a function decorator." msgstr "" -#: ../../library/contextlib.rst:423 +#: ../../library/contextlib.rst:421 msgid "" "Accepts an arbitrary callback function and arguments and adds it to the " "callback stack." msgstr "" -#: ../../library/contextlib.rst:426 +#: ../../library/contextlib.rst:424 msgid "" "Unlike the other methods, callbacks added this way cannot suppress " "exceptions (as they are never passed the exception details)." msgstr "" -#: ../../library/contextlib.rst:429 +#: ../../library/contextlib.rst:427 msgid "" "The passed in callback is returned from the function, allowing this method " "to be used as a function decorator." msgstr "" -#: ../../library/contextlib.rst:434 +#: ../../library/contextlib.rst:432 msgid "" "Transfers the callback stack to a fresh :class:`ExitStack` instance and " "returns it. No callbacks are invoked by this operation - instead, they will " @@ -405,70 +402,70 @@ msgid "" "at the end of a :keyword:`with` statement)." msgstr "" -#: ../../library/contextlib.rst:439 +#: ../../library/contextlib.rst:437 msgid "" "For example, a group of files can be opened as an \"all or nothing\" " "operation as follows::" msgstr "" -#: ../../library/contextlib.rst:453 +#: ../../library/contextlib.rst:451 msgid "" "Immediately unwinds the callback stack, invoking callbacks in the reverse " "order of registration. For any context managers and exit callbacks " "registered, the arguments passed in will indicate that no exception occurred." msgstr "" -#: ../../library/contextlib.rst:460 +#: ../../library/contextlib.rst:458 msgid "" "An :ref:`asynchronous context manager `, similar to :" "class:`ExitStack`, that supports combining both synchronous and asynchronous " "context managers, as well as having coroutines for cleanup logic." msgstr "" -#: ../../library/contextlib.rst:465 +#: ../../library/contextlib.rst:463 msgid "" "The :meth:`close` method is not implemented, :meth:`aclose` must be used " "instead." msgstr "" -#: ../../library/contextlib.rst:470 +#: ../../library/contextlib.rst:468 msgid "" "Similar to :meth:`enter_context` but expects an asynchronous context manager." msgstr "" -#: ../../library/contextlib.rst:475 +#: ../../library/contextlib.rst:473 msgid "" "Similar to :meth:`push` but expects either an asynchronous context manager " "or a coroutine function." msgstr "" -#: ../../library/contextlib.rst:480 +#: ../../library/contextlib.rst:478 msgid "Similar to :meth:`callback` but expects a coroutine function." msgstr "" -#: ../../library/contextlib.rst:484 +#: ../../library/contextlib.rst:482 msgid "Similar to :meth:`close` but properly handles awaitables." msgstr "" -#: ../../library/contextlib.rst:486 +#: ../../library/contextlib.rst:484 msgid "Continuing the example for :func:`asynccontextmanager`::" msgstr "" -#: ../../library/contextlib.rst:498 +#: ../../library/contextlib.rst:496 msgid "Examples and Recipes" msgstr "" -#: ../../library/contextlib.rst:500 +#: ../../library/contextlib.rst:498 msgid "" "This section describes some examples and recipes for making effective use of " "the tools provided by :mod:`contextlib`." msgstr "" -#: ../../library/contextlib.rst:505 +#: ../../library/contextlib.rst:503 msgid "Supporting a variable number of context managers" msgstr "" -#: ../../library/contextlib.rst:507 +#: ../../library/contextlib.rst:505 msgid "" "The primary use case for :class:`ExitStack` is the one given in the class " "documentation: supporting a variable number of context managers and other " @@ -478,18 +475,18 @@ msgid "" "of the context managers being optional::" msgstr "" -#: ../../library/contextlib.rst:522 +#: ../../library/contextlib.rst:520 msgid "" "As shown, :class:`ExitStack` also makes it quite easy to use :keyword:`with` " "statements to manage arbitrary resources that don't natively support the " "context management protocol." msgstr "" -#: ../../library/contextlib.rst:528 +#: ../../library/contextlib.rst:526 msgid "Catching exceptions from ``__enter__`` methods" msgstr "" -#: ../../library/contextlib.rst:530 +#: ../../library/contextlib.rst:528 msgid "" "It is occasionally desirable to catch exceptions from an ``__enter__`` " "method implementation, *without* inadvertently catching exceptions from the :" @@ -498,7 +495,7 @@ msgid "" "be separated slightly in order to allow this::" msgstr "" -#: ../../library/contextlib.rst:545 +#: ../../library/contextlib.rst:543 msgid "" "Actually needing to do this is likely to indicate that the underlying API " "should be providing a direct resource management interface for use with :" @@ -509,29 +506,29 @@ msgid "" "`with` statement." msgstr "" -#: ../../library/contextlib.rst:555 +#: ../../library/contextlib.rst:553 msgid "Cleaning up in an ``__enter__`` implementation" msgstr "" -#: ../../library/contextlib.rst:557 +#: ../../library/contextlib.rst:555 msgid "" "As noted in the documentation of :meth:`ExitStack.push`, this method can be " "useful in cleaning up an already allocated resource if later steps in the :" "meth:`__enter__` implementation fail." msgstr "" -#: ../../library/contextlib.rst:561 +#: ../../library/contextlib.rst:559 msgid "" "Here's an example of doing this for a context manager that accepts resource " "acquisition and release functions, along with an optional validation " "function, and maps them to the context management protocol::" msgstr "" -#: ../../library/contextlib.rst:601 +#: ../../library/contextlib.rst:599 msgid "Replacing any use of ``try-finally`` and flag variables" msgstr "" -#: ../../library/contextlib.rst:603 +#: ../../library/contextlib.rst:601 msgid "" "A pattern you will sometimes see is a ``try-finally`` statement with a flag " "variable to indicate whether or not the body of the ``finally`` clause " @@ -539,57 +536,57 @@ msgid "" "by using an ``except`` clause instead), it looks something like this::" msgstr "" -#: ../../library/contextlib.rst:617 +#: ../../library/contextlib.rst:615 msgid "" "As with any ``try`` statement based code, this can cause problems for " "development and review, because the setup code and the cleanup code can end " "up being separated by arbitrarily long sections of code." msgstr "" -#: ../../library/contextlib.rst:621 +#: ../../library/contextlib.rst:619 msgid "" ":class:`ExitStack` makes it possible to instead register a callback for " "execution at the end of a ``with`` statement, and then later decide to skip " "executing that callback::" msgstr "" -#: ../../library/contextlib.rst:633 +#: ../../library/contextlib.rst:631 msgid "" "This allows the intended cleanup up behaviour to be made explicit up front, " "rather than requiring a separate flag variable." msgstr "" -#: ../../library/contextlib.rst:636 +#: ../../library/contextlib.rst:634 msgid "" "If a particular application uses this pattern a lot, it can be simplified " "even further by means of a small helper class::" msgstr "" -#: ../../library/contextlib.rst:654 +#: ../../library/contextlib.rst:652 msgid "" "If the resource cleanup isn't already neatly bundled into a standalone " "function, then it is still possible to use the decorator form of :meth:" "`ExitStack.callback` to declare the resource cleanup in advance::" msgstr "" -#: ../../library/contextlib.rst:669 +#: ../../library/contextlib.rst:667 msgid "" "Due to the way the decorator protocol works, a callback function declared " "this way cannot take any parameters. Instead, any resources to be released " "must be accessed as closure variables." msgstr "" -#: ../../library/contextlib.rst:675 +#: ../../library/contextlib.rst:673 msgid "Using a context manager as a function decorator" msgstr "" -#: ../../library/contextlib.rst:677 +#: ../../library/contextlib.rst:675 msgid "" ":class:`ContextDecorator` makes it possible to use a context manager in both " "an ordinary ``with`` statement and also as a function decorator." msgstr "" -#: ../../library/contextlib.rst:680 +#: ../../library/contextlib.rst:678 msgid "" "For example, it is sometimes useful to wrap functions or groups of " "statements with a logger that can track the time of entry and time of exit. " @@ -598,15 +595,15 @@ msgid "" "in a single definition::" msgstr "" -#: ../../library/contextlib.rst:701 +#: ../../library/contextlib.rst:699 msgid "Instances of this class can be used as both a context manager::" msgstr "" -#: ../../library/contextlib.rst:707 +#: ../../library/contextlib.rst:705 msgid "And also as a function decorator::" msgstr "" -#: ../../library/contextlib.rst:714 +#: ../../library/contextlib.rst:712 msgid "" "Note that there is one additional limitation when using context managers as " "function decorators: there's no way to access the return value of :meth:" @@ -614,21 +611,21 @@ msgid "" "explicit ``with`` statement." msgstr "" -#: ../../library/contextlib.rst:722 +#: ../../library/contextlib.rst:720 msgid ":pep:`343` - The \"with\" statement" msgstr "" -#: ../../library/contextlib.rst:722 +#: ../../library/contextlib.rst:720 msgid "" "The specification, background, and examples for the Python :keyword:`with` " "statement." msgstr "" -#: ../../library/contextlib.rst:728 +#: ../../library/contextlib.rst:726 msgid "Single use, reusable and reentrant context managers" msgstr "" -#: ../../library/contextlib.rst:730 +#: ../../library/contextlib.rst:728 msgid "" "Most context managers are written in a way that means they can only be used " "effectively in a :keyword:`with` statement once. These single use context " @@ -636,32 +633,32 @@ msgid "" "them a second time will trigger an exception or otherwise not work correctly." msgstr "" -#: ../../library/contextlib.rst:736 +#: ../../library/contextlib.rst:734 msgid "" "This common limitation means that it is generally advisable to create " "context managers directly in the header of the :keyword:`with` statement " "where they are used (as shown in all of the usage examples above)." msgstr "" -#: ../../library/contextlib.rst:740 +#: ../../library/contextlib.rst:738 msgid "" "Files are an example of effectively single use context managers, since the " "first :keyword:`with` statement will close the file, preventing any further " "IO operations using that file object." msgstr "" -#: ../../library/contextlib.rst:744 +#: ../../library/contextlib.rst:742 msgid "" "Context managers created using :func:`contextmanager` are also single use " "context managers, and will complain about the underlying generator failing " "to yield if an attempt is made to use them a second time::" msgstr "" -#: ../../library/contextlib.rst:772 +#: ../../library/contextlib.rst:770 msgid "Reentrant context managers" msgstr "" -#: ../../library/contextlib.rst:774 +#: ../../library/contextlib.rst:772 msgid "" "More sophisticated context managers may be \"reentrant\". These context " "managers can not only be used in multiple :keyword:`with` statements, but " @@ -669,21 +666,21 @@ msgid "" "the same context manager." msgstr "" -#: ../../library/contextlib.rst:779 +#: ../../library/contextlib.rst:777 msgid "" ":class:`threading.RLock` is an example of a reentrant context manager, as " "are :func:`suppress` and :func:`redirect_stdout`. Here's a very simple " "example of reentrant use::" msgstr "" -#: ../../library/contextlib.rst:798 +#: ../../library/contextlib.rst:796 msgid "" "Real world examples of reentrancy are more likely to involve multiple " "functions calling each other and hence be far more complicated than this " "example." msgstr "" -#: ../../library/contextlib.rst:802 +#: ../../library/contextlib.rst:800 msgid "" "Note also that being reentrant is *not* the same thing as being thread " "safe. :func:`redirect_stdout`, for example, is definitely not thread safe, " @@ -691,11 +688,11 @@ msgid "" "stdout` to a different stream." msgstr "" -#: ../../library/contextlib.rst:811 +#: ../../library/contextlib.rst:809 msgid "Reusable context managers" msgstr "" -#: ../../library/contextlib.rst:813 +#: ../../library/contextlib.rst:811 msgid "" "Distinct from both single use and reentrant context managers are \"reusable" "\" context managers (or, to be completely explicit, \"reusable, but not " @@ -705,21 +702,21 @@ msgid "" "instance has already been used in a containing with statement." msgstr "" -#: ../../library/contextlib.rst:820 +#: ../../library/contextlib.rst:818 msgid "" ":class:`threading.Lock` is an example of a reusable, but not reentrant, " "context manager (for a reentrant lock, it is necessary to use :class:" "`threading.RLock` instead)." msgstr "" -#: ../../library/contextlib.rst:824 +#: ../../library/contextlib.rst:822 msgid "" "Another example of a reusable, but not reentrant, context manager is :class:" "`ExitStack`, as it invokes *all* currently registered callbacks when leaving " "any with statement, regardless of where those callbacks were added::" msgstr "" -#: ../../library/contextlib.rst:855 +#: ../../library/contextlib.rst:853 msgid "" "As the output from the example shows, reusing a single stack object across " "multiple with statements works correctly, but attempting to nest them will " @@ -727,7 +724,7 @@ msgid "" "which is unlikely to be desirable behaviour." msgstr "" -#: ../../library/contextlib.rst:860 +#: ../../library/contextlib.rst:858 msgid "" "Using separate :class:`ExitStack` instances instead of reusing a single " "instance avoids that problem::" diff --git a/library/csv.po b/library/csv.po index 85d177b089..760589f44e 100644 --- a/library/csv.po +++ b/library/csv.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.7\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2021-09-07 06:52+0000\n" +"POT-Creation-Date: 2020-06-20 18:08+0800\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-" @@ -113,9 +113,9 @@ msgid "" "`Dialect` class or one of the strings returned by the :func:`list_dialects` " "function. The other optional *fmtparams* keyword arguments can be given to " "override individual formatting parameters in the current dialect. For full " -"details about dialects and formatting parameters, see the :ref:`csv-fmt-" -"params` section. To make it as easy as possible to interface with modules " -"which implement the DB API, the value :const:`None` is written as the empty " +"details about the dialect and formatting parameters, see section :ref:`csv-" +"fmt-params`. To make it as easy as possible to interface with modules which " +"implement the DB API, the value :const:`None` is written as the empty " "string. While this isn't a reversible transformation, it makes it easier to " "dump SQL NULL data values to CSV files without preprocessing the data " "returned from a ``cursor.fetch*`` call. All other non-string data are " @@ -127,7 +127,7 @@ msgid "" "Associate *dialect* with *name*. *name* must be a string. The dialect can " "be specified either by passing a sub-class of :class:`Dialect`, or by " "*fmtparams* keyword arguments, or both, with keyword arguments overriding " -"parameters of the dialect. For full details about dialects and formatting " +"parameters of the dialect. For full details about the dialect and formatting " "parameters, see section :ref:`csv-fmt-params`." msgstr "" @@ -220,89 +220,80 @@ msgstr "" #: ../../library/csv.rst:228 msgid "" -"The :class:`Dialect` class is a container class whose attributes contain " -"information for how to handle doublequotes, whitespace, delimiters, etc. Due " -"to the lack of a strict CSV specification, different applications produce " -"subtly different CSV data. :class:`Dialect` instances define how :class:" -"`reader` and :class:`writer` instances behave." +"The :class:`Dialect` class is a container class relied on primarily for its " +"attributes, which are used to define the parameters for a specific :class:" +"`reader` or :class:`writer` instance." msgstr "" -#: ../../library/csv.rst:234 -msgid "" -"All available :class:`Dialect` names are returned by :func:`list_dialects`, " -"and they can be registered with specific :class:`reader` and :class:`writer` " -"classes through their initializer (``__init__``) functions like this::" -msgstr "" - -#: ../../library/csv.rst:247 +#: ../../library/csv.rst:235 msgid "" "The :class:`excel` class defines the usual properties of an Excel-generated " "CSV file. It is registered with the dialect name ``'excel'``." msgstr "" -#: ../../library/csv.rst:253 +#: ../../library/csv.rst:241 msgid "" "The :class:`excel_tab` class defines the usual properties of an Excel-" "generated TAB-delimited file. It is registered with the dialect name " "``'excel-tab'``." msgstr "" -#: ../../library/csv.rst:259 +#: ../../library/csv.rst:247 msgid "" "The :class:`unix_dialect` class defines the usual properties of a CSV file " "generated on UNIX systems, i.e. using ``'\\n'`` as line terminator and " "quoting all fields. It is registered with the dialect name ``'unix'``." msgstr "" -#: ../../library/csv.rst:268 +#: ../../library/csv.rst:256 msgid "The :class:`Sniffer` class is used to deduce the format of a CSV file." msgstr "" -#: ../../library/csv.rst:270 +#: ../../library/csv.rst:258 msgid "The :class:`Sniffer` class provides two methods:" msgstr "" -#: ../../library/csv.rst:274 +#: ../../library/csv.rst:262 msgid "" "Analyze the given *sample* and return a :class:`Dialect` subclass reflecting " "the parameters found. If the optional *delimiters* parameter is given, it " "is interpreted as a string containing possible valid delimiter characters." msgstr "" -#: ../../library/csv.rst:282 +#: ../../library/csv.rst:270 msgid "" "Analyze the sample text (presumed to be in CSV format) and return :const:" "`True` if the first row appears to be a series of column headers." msgstr "" -#: ../../library/csv.rst:285 +#: ../../library/csv.rst:273 msgid "An example for :class:`Sniffer` use::" msgstr "" -#: ../../library/csv.rst:294 +#: ../../library/csv.rst:282 msgid "The :mod:`csv` module defines the following constants:" msgstr "" -#: ../../library/csv.rst:298 +#: ../../library/csv.rst:286 msgid "Instructs :class:`writer` objects to quote all fields." msgstr "" -#: ../../library/csv.rst:303 +#: ../../library/csv.rst:291 msgid "" "Instructs :class:`writer` objects to only quote those fields which contain " "special characters such as *delimiter*, *quotechar* or any of the characters " "in *lineterminator*." msgstr "" -#: ../../library/csv.rst:310 +#: ../../library/csv.rst:298 msgid "Instructs :class:`writer` objects to quote all non-numeric fields." msgstr "" -#: ../../library/csv.rst:312 +#: ../../library/csv.rst:300 msgid "Instructs the reader to convert all non-quoted fields to type *float*." msgstr "" -#: ../../library/csv.rst:317 +#: ../../library/csv.rst:305 msgid "" "Instructs :class:`writer` objects to never quote fields. When the current " "*delimiter* occurs in output data it is preceded by the current *escapechar* " @@ -310,25 +301,25 @@ msgid "" "if any characters that require escaping are encountered." msgstr "" -#: ../../library/csv.rst:322 +#: ../../library/csv.rst:310 msgid "" "Instructs :class:`reader` to perform no special processing of quote " "characters." msgstr "" -#: ../../library/csv.rst:324 +#: ../../library/csv.rst:312 msgid "The :mod:`csv` module defines the following exception:" msgstr "" -#: ../../library/csv.rst:329 +#: ../../library/csv.rst:317 msgid "Raised by any of the functions when an error is detected." msgstr "" -#: ../../library/csv.rst:334 +#: ../../library/csv.rst:322 msgid "Dialects and Formatting Parameters" msgstr "" -#: ../../library/csv.rst:336 +#: ../../library/csv.rst:324 msgid "" "To make it easier to specify the format of input and output records, " "specific formatting parameters are grouped together into dialects. A " @@ -341,16 +332,16 @@ msgid "" "attributes defined below for the :class:`Dialect` class." msgstr "" -#: ../../library/csv.rst:346 +#: ../../library/csv.rst:334 msgid "Dialects support the following attributes:" msgstr "" -#: ../../library/csv.rst:351 +#: ../../library/csv.rst:339 msgid "" "A one-character string used to separate fields. It defaults to ``','``." msgstr "" -#: ../../library/csv.rst:356 +#: ../../library/csv.rst:344 msgid "" "Controls how instances of *quotechar* appearing inside a field should " "themselves be quoted. When :const:`True`, the character is doubled. When :" @@ -358,13 +349,13 @@ msgid "" "defaults to :const:`True`." msgstr "" -#: ../../library/csv.rst:361 +#: ../../library/csv.rst:349 msgid "" "On output, if *doublequote* is :const:`False` and no *escapechar* is set, :" "exc:`Error` is raised if a *quotechar* is found in a field." msgstr "" -#: ../../library/csv.rst:367 +#: ../../library/csv.rst:355 msgid "" "A one-character string used by the writer to escape the *delimiter* if " "*quoting* is set to :const:`QUOTE_NONE` and the *quotechar* if *doublequote* " @@ -373,92 +364,92 @@ msgid "" "escaping." msgstr "" -#: ../../library/csv.rst:375 +#: ../../library/csv.rst:363 msgid "" "The string used to terminate lines produced by the :class:`writer`. It " "defaults to ``'\\r\\n'``." msgstr "" -#: ../../library/csv.rst:380 +#: ../../library/csv.rst:368 msgid "" "The :class:`reader` is hard-coded to recognise either ``'\\r'`` or ``'\\n'`` " "as end-of-line, and ignores *lineterminator*. This behavior may change in " "the future." msgstr "" -#: ../../library/csv.rst:387 +#: ../../library/csv.rst:375 msgid "" "A one-character string used to quote fields containing special characters, " "such as the *delimiter* or *quotechar*, or which contain new-line " "characters. It defaults to ``'\"'``." msgstr "" -#: ../../library/csv.rst:394 +#: ../../library/csv.rst:382 msgid "" "Controls when quotes should be generated by the writer and recognised by the " "reader. It can take on any of the :const:`QUOTE_\\*` constants (see " "section :ref:`csv-contents`) and defaults to :const:`QUOTE_MINIMAL`." msgstr "" -#: ../../library/csv.rst:401 +#: ../../library/csv.rst:389 msgid "" "When :const:`True`, whitespace immediately following the *delimiter* is " "ignored. The default is :const:`False`." msgstr "" -#: ../../library/csv.rst:407 +#: ../../library/csv.rst:395 msgid "" "When ``True``, raise exception :exc:`Error` on bad CSV input. The default is " "``False``." msgstr "" -#: ../../library/csv.rst:411 +#: ../../library/csv.rst:399 msgid "Reader Objects" msgstr "" -#: ../../library/csv.rst:413 +#: ../../library/csv.rst:401 msgid "" "Reader objects (:class:`DictReader` instances and objects returned by the :" "func:`reader` function) have the following public methods:" msgstr "" -#: ../../library/csv.rst:418 +#: ../../library/csv.rst:406 msgid "" "Return the next row of the reader's iterable object as a list (if the object " "was returned from :func:`reader`) or a dict (if it is a :class:`DictReader` " -"instance), parsed according to the current :class:`Dialect`. Usually you " -"should call this as ``next(reader)``." +"instance), parsed according to the current dialect. Usually you should call " +"this as ``next(reader)``." msgstr "" -#: ../../library/csv.rst:424 +#: ../../library/csv.rst:412 msgid "Reader objects have the following public attributes:" msgstr "" -#: ../../library/csv.rst:428 +#: ../../library/csv.rst:416 msgid "A read-only description of the dialect in use by the parser." msgstr "" -#: ../../library/csv.rst:433 +#: ../../library/csv.rst:421 msgid "" "The number of lines read from the source iterator. This is not the same as " "the number of records returned, as records can span multiple lines." msgstr "" -#: ../../library/csv.rst:437 +#: ../../library/csv.rst:425 msgid "DictReader objects have the following public attribute:" msgstr "" -#: ../../library/csv.rst:441 +#: ../../library/csv.rst:429 msgid "" "If not passed as a parameter when creating the object, this attribute is " "initialized upon first access or when the first record is read from the file." msgstr "" -#: ../../library/csv.rst:448 +#: ../../library/csv.rst:436 msgid "Writer Objects" msgstr "" -#: ../../library/csv.rst:450 +#: ../../library/csv.rst:438 msgid "" ":class:`Writer` objects (:class:`DictWriter` instances and objects returned " "by the :func:`writer` function) have the following public methods. A *row* " @@ -470,66 +461,66 @@ msgid "" "complex numbers at all)." msgstr "" -#: ../../library/csv.rst:461 +#: ../../library/csv.rst:449 msgid "" "Write the *row* parameter to the writer's file object, formatted according " -"to the current :class:`Dialect`. Return the return value of the call to the " -"*write* method of the underlying file object." +"to the current dialect. Return the return value of the call to the *write* " +"method of the underlying file object." msgstr "" -#: ../../library/csv.rst:465 +#: ../../library/csv.rst:453 msgid "Added support of arbitrary iterables." msgstr "" -#: ../../library/csv.rst:470 +#: ../../library/csv.rst:458 msgid "" "Write all elements in *rows* (an iterable of *row* objects as described " "above) to the writer's file object, formatted according to the current " "dialect." msgstr "" -#: ../../library/csv.rst:474 +#: ../../library/csv.rst:462 msgid "Writer objects have the following public attribute:" msgstr "" -#: ../../library/csv.rst:479 +#: ../../library/csv.rst:467 msgid "A read-only description of the dialect in use by the writer." msgstr "" -#: ../../library/csv.rst:482 +#: ../../library/csv.rst:470 msgid "DictWriter objects have the following public method:" msgstr "" -#: ../../library/csv.rst:487 +#: ../../library/csv.rst:475 msgid "" "Write a row with the field names (as specified in the constructor) to the " "writer's file object, formatted according to the current dialect. Return the " "return value of the :meth:`csvwriter.writerow` call used internally." msgstr "" -#: ../../library/csv.rst:492 +#: ../../library/csv.rst:480 msgid "" ":meth:`writeheader` now also returns the value returned by the :meth:" "`csvwriter.writerow` method it uses internally." msgstr "" -#: ../../library/csv.rst:500 +#: ../../library/csv.rst:488 msgid "Examples" msgstr "" -#: ../../library/csv.rst:502 +#: ../../library/csv.rst:490 msgid "The simplest example of reading a CSV file::" msgstr "" -#: ../../library/csv.rst:510 +#: ../../library/csv.rst:498 msgid "Reading a file with an alternate format::" msgstr "" -#: ../../library/csv.rst:518 +#: ../../library/csv.rst:506 msgid "The corresponding simplest possible writing example is::" msgstr "" -#: ../../library/csv.rst:525 +#: ../../library/csv.rst:513 msgid "" "Since :func:`open` is used to open a CSV file for reading, the file will by " "default be decoded into unicode using the system default encoding (see :func:" @@ -537,33 +528,33 @@ msgid "" "encoding, use the ``encoding`` argument of open::" msgstr "" -#: ../../library/csv.rst:536 +#: ../../library/csv.rst:524 msgid "" "The same applies to writing in something other than the system default " "encoding: specify the encoding argument when opening the output file." msgstr "" -#: ../../library/csv.rst:539 +#: ../../library/csv.rst:527 msgid "Registering a new dialect::" msgstr "" -#: ../../library/csv.rst:546 +#: ../../library/csv.rst:534 msgid "" "A slightly more advanced use of the reader --- catching and reporting " "errors::" msgstr "" -#: ../../library/csv.rst:558 +#: ../../library/csv.rst:546 msgid "" "And while the module doesn't directly support parsing strings, it can easily " "be done::" msgstr "" -#: ../../library/csv.rst:567 +#: ../../library/csv.rst:555 msgid "Footnotes" msgstr "註解" -#: ../../library/csv.rst:568 +#: ../../library/csv.rst:556 msgid "" "If ``newline=''`` is not specified, newlines embedded inside quoted fields " "will not be interpreted correctly, and on platforms that use ``\\r\\n`` " diff --git a/library/ctypes.po b/library/ctypes.po index d91ec8130d..736621cc21 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-07 06:52+0000\n" +"POT-Creation-Date: 2020-06-20 18:08+0800\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-" @@ -205,7 +205,7 @@ msgid "" "learn more about :mod:`ctypes` data types." msgstr "" -#: ../../library/ctypes.rst:211 ../../library/ctypes.rst:2143 +#: ../../library/ctypes.rst:211 ../../library/ctypes.rst:2128 msgid "Fundamental data types" msgstr "" @@ -1185,7 +1185,7 @@ msgid "" "If no library can be found, returns ``None``." msgstr "" -#: ../../library/ctypes.rst:1270 ../../library/ctypes.rst:1918 +#: ../../library/ctypes.rst:1270 ../../library/ctypes.rst:1903 msgid "The exact functionality is system dependent." msgstr "" @@ -1245,25 +1245,7 @@ msgid "" "return :c:type:`int`." msgstr "" -#: ../../library/ctypes.rst:1329 -msgid "" -"On Windows creating a :class:`CDLL` instance may fail even if the DLL name " -"exists. When a dependent DLL of the loaded DLL is not found, a :exc:" -"`OSError` error is raised with the message *\"[WinError 126] The specified " -"module could not be found\".* This error message does not contain the name " -"of the missing DLL because the Windows API does not return this information " -"making this error hard to diagnose. To resolve this error and determine " -"which DLL is not found, you need to find the list of dependent DLLs and " -"determine which one is not found using Windows debugging and tracing tools." -msgstr "" - -#: ../../library/ctypes.rst:1341 -msgid "" -"`Microsoft DUMPBIN tool `_ -- A tool to find DLL dependents." -msgstr "" - -#: ../../library/ctypes.rst:1347 +#: ../../library/ctypes.rst:1332 msgid "" "Windows only: Instances of this class represent loaded shared libraries, " "functions in these libraries use the ``stdcall`` calling convention, and are " @@ -1273,31 +1255,31 @@ msgid "" "value signals a failure, an :class:`OSError` is automatically raised." msgstr "" -#: ../../library/ctypes.rst:1354 +#: ../../library/ctypes.rst:1339 msgid ":exc:`WindowsError` used to be raised." msgstr "" -#: ../../library/ctypes.rst:1360 +#: ../../library/ctypes.rst:1345 msgid "" "Windows only: Instances of this class represent loaded shared libraries, " "functions in these libraries use the ``stdcall`` calling convention, and are " "assumed to return :c:type:`int` by default." msgstr "" -#: ../../library/ctypes.rst:1364 +#: ../../library/ctypes.rst:1349 msgid "" "On Windows CE only the standard calling convention is used, for convenience " "the :class:`WinDLL` and :class:`OleDLL` use the standard calling convention " "on this platform." msgstr "" -#: ../../library/ctypes.rst:1368 +#: ../../library/ctypes.rst:1353 msgid "" "The Python :term:`global interpreter lock` is released before calling any " "function exported by these libraries, and reacquired afterwards." msgstr "" -#: ../../library/ctypes.rst:1374 +#: ../../library/ctypes.rst:1359 msgid "" "Instances of this class behave like :class:`CDLL` instances, except that the " "Python GIL is *not* released during the function call, and after the " @@ -1305,11 +1287,11 @@ msgid "" "set, a Python exception is raised." msgstr "" -#: ../../library/ctypes.rst:1379 +#: ../../library/ctypes.rst:1364 msgid "Thus, this is only useful to call Python C api functions directly." msgstr "" -#: ../../library/ctypes.rst:1381 +#: ../../library/ctypes.rst:1366 msgid "" "All these classes can be instantiated by calling them with at least one " "argument, the pathname of the shared library. If you have an existing " @@ -1319,7 +1301,7 @@ msgid "" "to get a handle to it." msgstr "" -#: ../../library/ctypes.rst:1388 +#: ../../library/ctypes.rst:1373 msgid "" "The *mode* parameter can be used to specify how the library is loaded. For " "details, consult the :manpage:`dlopen(3)` manpage. On Windows, *mode* is " @@ -1327,7 +1309,7 @@ msgid "" "configurable." msgstr "" -#: ../../library/ctypes.rst:1393 +#: ../../library/ctypes.rst:1378 msgid "" "The *use_errno* parameter, when set to true, enables a ctypes mechanism that " "allows accessing the system :data:`errno` error number in a safe way. :mod:" @@ -1337,14 +1319,14 @@ msgid "" "private copy, the same happens immediately after the function call." msgstr "" -#: ../../library/ctypes.rst:1400 +#: ../../library/ctypes.rst:1385 msgid "" "The function :func:`ctypes.get_errno` returns the value of the ctypes " "private copy, and the function :func:`ctypes.set_errno` changes the ctypes " "private copy to a new value and returns the former value." msgstr "" -#: ../../library/ctypes.rst:1404 +#: ../../library/ctypes.rst:1389 msgid "" "The *use_last_error* parameter, when set to true, enables the same mechanism " "for the Windows error code which is managed by the :func:`GetLastError` and :" @@ -1353,7 +1335,7 @@ msgid "" "private copy of the windows error code." msgstr "" -#: ../../library/ctypes.rst:1410 +#: ../../library/ctypes.rst:1395 msgid "" "The *winmode* parameter is used on Windows to specify how the library is " "loaded (since *mode* is ignored). It takes any value that is valid for the " @@ -1363,29 +1345,29 @@ msgid "" "ensure the correct library and dependencies are loaded." msgstr "" -#: ../../library/ctypes.rst:1417 +#: ../../library/ctypes.rst:1402 msgid "Added *winmode* parameter." msgstr "" -#: ../../library/ctypes.rst:1424 +#: ../../library/ctypes.rst:1409 msgid "" "Flag to use as *mode* parameter. On platforms where this flag is not " "available, it is defined as the integer zero." msgstr "" -#: ../../library/ctypes.rst:1431 +#: ../../library/ctypes.rst:1416 msgid "" "Flag to use as *mode* parameter. On platforms where this is not available, " "it is the same as *RTLD_GLOBAL*." msgstr "" -#: ../../library/ctypes.rst:1438 +#: ../../library/ctypes.rst:1423 msgid "" "The default mode which is used to load shared libraries. On OSX 10.3, this " "is *RTLD_GLOBAL*, otherwise it is the same as *RTLD_LOCAL*." msgstr "" -#: ../../library/ctypes.rst:1441 +#: ../../library/ctypes.rst:1426 msgid "" "Instances of these classes have no public methods. Functions exported by " "the shared library can be accessed as attributes or by index. Please note " @@ -1394,21 +1376,21 @@ msgid "" "other hand, accessing it through an index returns a new object each time::" msgstr "" -#: ../../library/ctypes.rst:1454 +#: ../../library/ctypes.rst:1439 msgid "" "The following public attributes are available, their name starts with an " "underscore to not clash with exported function names:" msgstr "" -#: ../../library/ctypes.rst:1460 +#: ../../library/ctypes.rst:1445 msgid "The system handle used to access the library." msgstr "" -#: ../../library/ctypes.rst:1465 +#: ../../library/ctypes.rst:1450 msgid "The name of the library passed in the constructor." msgstr "" -#: ../../library/ctypes.rst:1467 +#: ../../library/ctypes.rst:1452 msgid "" "Shared libraries can also be loaded by using one of the prefabricated " "objects, which are instances of the :class:`LibraryLoader` class, either by " @@ -1416,52 +1398,52 @@ msgid "" "attribute of the loader instance." msgstr "" -#: ../../library/ctypes.rst:1475 +#: ../../library/ctypes.rst:1460 msgid "" "Class which loads shared libraries. *dlltype* should be one of the :class:" "`CDLL`, :class:`PyDLL`, :class:`WinDLL`, or :class:`OleDLL` types." msgstr "" -#: ../../library/ctypes.rst:1478 +#: ../../library/ctypes.rst:1463 msgid "" ":meth:`__getattr__` has special behavior: It allows loading a shared library " "by accessing it as attribute of a library loader instance. The result is " "cached, so repeated attribute accesses return the same library each time." msgstr "" -#: ../../library/ctypes.rst:1484 +#: ../../library/ctypes.rst:1469 msgid "" "Load a shared library into the process and return it. This method always " "returns a new instance of the library." msgstr "" -#: ../../library/ctypes.rst:1488 +#: ../../library/ctypes.rst:1473 msgid "These prefabricated library loaders are available:" msgstr "" -#: ../../library/ctypes.rst:1493 +#: ../../library/ctypes.rst:1478 msgid "Creates :class:`CDLL` instances." msgstr "" -#: ../../library/ctypes.rst:1499 +#: ../../library/ctypes.rst:1484 msgid "Windows only: Creates :class:`WinDLL` instances." msgstr "" -#: ../../library/ctypes.rst:1505 +#: ../../library/ctypes.rst:1490 msgid "Windows only: Creates :class:`OleDLL` instances." msgstr "" -#: ../../library/ctypes.rst:1511 +#: ../../library/ctypes.rst:1496 msgid "Creates :class:`PyDLL` instances." msgstr "" -#: ../../library/ctypes.rst:1514 +#: ../../library/ctypes.rst:1499 msgid "" "For accessing the C Python api directly, a ready-to-use Python shared " "library object is available:" msgstr "" -#: ../../library/ctypes.rst:1520 +#: ../../library/ctypes.rst:1505 msgid "" "An instance of :class:`PyDLL` that exposes Python C API functions as " "attributes. Note that all these functions are assumed to return C :c:type:" @@ -1469,50 +1451,50 @@ msgid "" "correct :attr:`restype` attribute to use these functions." msgstr "" -#: ../../library/ctypes.rst:1525 +#: ../../library/ctypes.rst:None msgid "" "Raises an :ref:`auditing event ` ``ctypes.dlopen`` with argument " "``name``." msgstr "" -#: ../../library/ctypes.rst:1527 +#: ../../library/ctypes.rst:1512 msgid "" "Loading a library through any of these objects raises an :ref:`auditing " "event ` ``ctypes.dlopen`` with string argument ``name``, the name " "used to load the library." msgstr "" -#: ../../library/ctypes.rst:1531 +#: ../../library/ctypes.rst:None msgid "" "Raises an :ref:`auditing event ` ``ctypes.dlsym`` with arguments " "``library``, ``name``." msgstr "" -#: ../../library/ctypes.rst:1533 +#: ../../library/ctypes.rst:1518 msgid "" "Accessing a function on a loaded library raises an auditing event ``ctypes." "dlsym`` with arguments ``library`` (the library object) and ``name`` (the " "symbol's name as a string or integer)." msgstr "" -#: ../../library/ctypes.rst:1537 +#: ../../library/ctypes.rst:None msgid "" "Raises an :ref:`auditing event ` ``ctypes.dlsym/handle`` with " "arguments ``handle``, ``name``." msgstr "" -#: ../../library/ctypes.rst:1539 +#: ../../library/ctypes.rst:1524 msgid "" "In cases when only the library handle is available rather than the object, " "accessing a function raises an auditing event ``ctypes.dlsym/handle`` with " "arguments ``handle`` (the raw library handle) and ``name``." msgstr "" -#: ../../library/ctypes.rst:1546 +#: ../../library/ctypes.rst:1531 msgid "Foreign functions" msgstr "" -#: ../../library/ctypes.rst:1548 +#: ../../library/ctypes.rst:1533 msgid "" "As explained in the previous section, foreign functions can be accessed as " "attributes of loaded shared libraries. The function objects created in this " @@ -1521,29 +1503,29 @@ msgid "" "library loader. They are instances of a private class:" msgstr "" -#: ../../library/ctypes.rst:1557 +#: ../../library/ctypes.rst:1542 msgid "Base class for C callable foreign functions." msgstr "" -#: ../../library/ctypes.rst:1559 +#: ../../library/ctypes.rst:1544 msgid "" "Instances of foreign functions are also C compatible data types; they " "represent C function pointers." msgstr "" -#: ../../library/ctypes.rst:1562 +#: ../../library/ctypes.rst:1547 msgid "" "This behavior can be customized by assigning to special attributes of the " "foreign function object." msgstr "" -#: ../../library/ctypes.rst:1567 +#: ../../library/ctypes.rst:1552 msgid "" "Assign a ctypes type to specify the result type of the foreign function. Use " "``None`` for :c:type:`void`, a function not returning anything." msgstr "" -#: ../../library/ctypes.rst:1570 +#: ../../library/ctypes.rst:1555 msgid "" "It is possible to assign a callable Python object that is not a ctypes type, " "in this case the function is assumed to return a C :c:type:`int`, and the " @@ -1553,7 +1535,7 @@ msgid "" "callable to the :attr:`errcheck` attribute." msgstr "" -#: ../../library/ctypes.rst:1579 +#: ../../library/ctypes.rst:1564 msgid "" "Assign a tuple of ctypes types to specify the argument types that the " "function accepts. Functions using the ``stdcall`` calling convention can " @@ -1562,7 +1544,7 @@ msgid "" "unspecified arguments as well." msgstr "" -#: ../../library/ctypes.rst:1585 +#: ../../library/ctypes.rst:1570 msgid "" "When a foreign function is called, each actual argument is passed to the :" "meth:`from_param` class method of the items in the :attr:`argtypes` tuple, " @@ -1572,7 +1554,7 @@ msgid "" "object using ctypes conversion rules." msgstr "" -#: ../../library/ctypes.rst:1592 +#: ../../library/ctypes.rst:1577 msgid "" "New: It is now possible to put items in argtypes which are not ctypes types, " "but each item must have a :meth:`from_param` method which returns a value " @@ -1580,50 +1562,50 @@ msgid "" "adapters that can adapt custom objects as function parameters." msgstr "" -#: ../../library/ctypes.rst:1599 +#: ../../library/ctypes.rst:1584 msgid "" "Assign a Python function or another callable to this attribute. The callable " "will be called with three or more arguments:" msgstr "" -#: ../../library/ctypes.rst:1606 +#: ../../library/ctypes.rst:1591 msgid "" "*result* is what the foreign function returns, as specified by the :attr:" "`restype` attribute." msgstr "" -#: ../../library/ctypes.rst:1609 +#: ../../library/ctypes.rst:1594 msgid "" "*func* is the foreign function object itself, this allows reusing the same " "callable object to check or post process the results of several functions." msgstr "" -#: ../../library/ctypes.rst:1613 +#: ../../library/ctypes.rst:1598 msgid "" "*arguments* is a tuple containing the parameters originally passed to the " "function call, this allows specializing the behavior on the arguments used." msgstr "" -#: ../../library/ctypes.rst:1617 +#: ../../library/ctypes.rst:1602 msgid "" "The object that this function returns will be returned from the foreign " "function call, but it can also check the result value and raise an exception " "if the foreign function call failed." msgstr "" -#: ../../library/ctypes.rst:1624 +#: ../../library/ctypes.rst:1609 msgid "" "This exception is raised when a foreign function call cannot convert one of " "the passed arguments." msgstr "" -#: ../../library/ctypes.rst:1628 +#: ../../library/ctypes.rst:None msgid "" "Raises an :ref:`auditing event ` ``ctypes.seh_exception`` with " "argument ``code``." msgstr "" -#: ../../library/ctypes.rst:1630 +#: ../../library/ctypes.rst:1615 msgid "" "On Windows, when a foreign function call raises a system exception (for " "example, due to an access violation), it will be captured and replaced with " @@ -1632,24 +1614,24 @@ msgid "" "hook to replace the exception with its own." msgstr "" -#: ../../library/ctypes.rst:1636 +#: ../../library/ctypes.rst:None msgid "" "Raises an :ref:`auditing event ` ``ctypes.call_function`` with " "arguments ``func_pointer``, ``arguments``." msgstr "" -#: ../../library/ctypes.rst:1638 +#: ../../library/ctypes.rst:1623 msgid "" "Some ways to invoke foreign function calls may raise an auditing event " "``ctypes.call_function`` with arguments ``function pointer`` and " "``arguments``." msgstr "" -#: ../../library/ctypes.rst:1644 +#: ../../library/ctypes.rst:1629 msgid "Function prototypes" msgstr "" -#: ../../library/ctypes.rst:1646 +#: ../../library/ctypes.rst:1631 msgid "" "Foreign functions can also be created by instantiating function prototypes. " "Function prototypes are similar to function prototypes in C; they describe a " @@ -1660,7 +1642,7 @@ msgid "" "``@wrapper`` syntax. See :ref:`ctypes-callback-functions` for examples." msgstr "" -#: ../../library/ctypes.rst:1657 +#: ../../library/ctypes.rst:1642 msgid "" "The returned function prototype creates functions that use the standard C " "calling convention. The function will release the GIL during the call. If " @@ -1669,7 +1651,7 @@ msgid "" "after the call; *use_last_error* does the same for the Windows error code." msgstr "" -#: ../../library/ctypes.rst:1667 +#: ../../library/ctypes.rst:1652 msgid "" "Windows only: The returned function prototype creates functions that use the " "``stdcall`` calling convention, except on Windows CE where :func:" @@ -1678,30 +1660,30 @@ msgid "" "meaning as above." msgstr "" -#: ../../library/ctypes.rst:1676 +#: ../../library/ctypes.rst:1661 msgid "" "The returned function prototype creates functions that use the Python " "calling convention. The function will *not* release the GIL during the call." msgstr "" -#: ../../library/ctypes.rst:1679 +#: ../../library/ctypes.rst:1664 msgid "" "Function prototypes created by these factory functions can be instantiated " "in different ways, depending on the type and number of the parameters in the " "call:" msgstr "" -#: ../../library/ctypes.rst:1687 +#: ../../library/ctypes.rst:1672 msgid "" "Returns a foreign function at the specified address which must be an integer." msgstr "" -#: ../../library/ctypes.rst:1694 +#: ../../library/ctypes.rst:1679 msgid "" "Create a C callable function (a callback function) from a Python *callable*." msgstr "" -#: ../../library/ctypes.rst:1701 +#: ../../library/ctypes.rst:1686 msgid "" "Returns a foreign function exported by a shared library. *func_spec* must be " "a 2-tuple ``(name_or_ordinal, library)``. The first item is the name of the " @@ -1709,7 +1691,7 @@ msgid "" "small integer. The second item is the shared library instance." msgstr "" -#: ../../library/ctypes.rst:1711 +#: ../../library/ctypes.rst:1696 msgid "" "Returns a foreign function that will call a COM method. *vtbl_index* is the " "index into the virtual function table, a small non-negative integer. *name* " @@ -1717,85 +1699,85 @@ msgid "" "identifier which is used in extended error reporting." msgstr "" -#: ../../library/ctypes.rst:1716 +#: ../../library/ctypes.rst:1701 msgid "" "COM methods use a special calling convention: They require a pointer to the " "COM interface as first argument, in addition to those parameters that are " "specified in the :attr:`argtypes` tuple." msgstr "" -#: ../../library/ctypes.rst:1720 +#: ../../library/ctypes.rst:1705 msgid "" "The optional *paramflags* parameter creates foreign function wrappers with " "much more functionality than the features described above." msgstr "" -#: ../../library/ctypes.rst:1723 +#: ../../library/ctypes.rst:1708 msgid "*paramflags* must be a tuple of the same length as :attr:`argtypes`." msgstr "" -#: ../../library/ctypes.rst:1725 +#: ../../library/ctypes.rst:1710 msgid "" "Each item in this tuple contains further information about a parameter, it " "must be a tuple containing one, two, or three items." msgstr "" -#: ../../library/ctypes.rst:1728 +#: ../../library/ctypes.rst:1713 msgid "" "The first item is an integer containing a combination of direction flags for " "the parameter:" msgstr "" -#: ../../library/ctypes.rst:1732 +#: ../../library/ctypes.rst:1717 msgid "1" msgstr "1" -#: ../../library/ctypes.rst:1732 +#: ../../library/ctypes.rst:1717 msgid "Specifies an input parameter to the function." msgstr "" -#: ../../library/ctypes.rst:1735 +#: ../../library/ctypes.rst:1720 msgid "2" msgstr "2" -#: ../../library/ctypes.rst:1735 +#: ../../library/ctypes.rst:1720 msgid "Output parameter. The foreign function fills in a value." msgstr "" -#: ../../library/ctypes.rst:1738 +#: ../../library/ctypes.rst:1723 msgid "4" msgstr "4" -#: ../../library/ctypes.rst:1738 +#: ../../library/ctypes.rst:1723 msgid "Input parameter which defaults to the integer zero." msgstr "" -#: ../../library/ctypes.rst:1740 +#: ../../library/ctypes.rst:1725 msgid "" "The optional second item is the parameter name as string. If this is " "specified, the foreign function can be called with named parameters." msgstr "" -#: ../../library/ctypes.rst:1743 +#: ../../library/ctypes.rst:1728 msgid "The optional third item is the default value for this parameter." msgstr "" -#: ../../library/ctypes.rst:1745 +#: ../../library/ctypes.rst:1730 msgid "" "This example demonstrates how to wrap the Windows ``MessageBoxW`` function " "so that it supports default parameters and named arguments. The C " "declaration from the windows header file is this::" msgstr "" -#: ../../library/ctypes.rst:1756 ../../library/ctypes.rst:1779 +#: ../../library/ctypes.rst:1741 ../../library/ctypes.rst:1764 msgid "Here is the wrapping with :mod:`ctypes`::" msgstr "" -#: ../../library/ctypes.rst:1764 +#: ../../library/ctypes.rst:1749 msgid "The ``MessageBox`` foreign function can now be called in these ways::" msgstr "" -#: ../../library/ctypes.rst:1770 +#: ../../library/ctypes.rst:1755 msgid "" "A second example demonstrates output parameters. The win32 " "``GetWindowRect`` function retrieves the dimensions of a specified window by " @@ -1803,7 +1785,7 @@ msgid "" "the C declaration::" msgstr "" -#: ../../library/ctypes.rst:1788 +#: ../../library/ctypes.rst:1773 msgid "" "Functions with output parameters will automatically return the output " "parameter value if there is a single one, or a tuple containing the output " @@ -1811,7 +1793,7 @@ msgid "" "now returns a RECT instance, when called." msgstr "" -#: ../../library/ctypes.rst:1793 +#: ../../library/ctypes.rst:1778 msgid "" "Output parameters can be combined with the :attr:`errcheck` protocol to do " "further output processing and error checking. The win32 ``GetWindowRect`` " @@ -1820,7 +1802,7 @@ msgid "" "call failed::" msgstr "" -#: ../../library/ctypes.rst:1806 +#: ../../library/ctypes.rst:1791 msgid "" "If the :attr:`errcheck` function returns the argument tuple it receives " "unchanged, :mod:`ctypes` continues the normal processing it does on the " @@ -1829,46 +1811,46 @@ msgid "" "and return them instead, the normal processing will no longer take place::" msgstr "" -#: ../../library/ctypes.rst:1825 +#: ../../library/ctypes.rst:1810 msgid "Utility functions" msgstr "" -#: ../../library/ctypes.rst:1829 +#: ../../library/ctypes.rst:1814 msgid "" "Returns the address of the memory buffer as integer. *obj* must be an " "instance of a ctypes type." msgstr "" -#: ../../library/ctypes.rst:1832 +#: ../../library/ctypes.rst:1817 msgid "" "Raises an :ref:`auditing event ` ``ctypes.addressof`` with " "argument ``obj``." msgstr "" -#: ../../library/ctypes.rst:1837 +#: ../../library/ctypes.rst:1822 msgid "" "Returns the alignment requirements of a ctypes type. *obj_or_type* must be a " "ctypes type or instance." msgstr "" -#: ../../library/ctypes.rst:1843 +#: ../../library/ctypes.rst:1828 msgid "" "Returns a light-weight pointer to *obj*, which must be an instance of a " "ctypes type. *offset* defaults to zero, and must be an integer that will be " "added to the internal pointer value." msgstr "" -#: ../../library/ctypes.rst:1847 +#: ../../library/ctypes.rst:1832 msgid "``byref(obj, offset)`` corresponds to this C code::" msgstr "" -#: ../../library/ctypes.rst:1851 +#: ../../library/ctypes.rst:1836 msgid "" "The returned object can only be used as a foreign function call parameter. " "It behaves similar to ``pointer(obj)``, but the construction is a lot faster." msgstr "" -#: ../../library/ctypes.rst:1857 +#: ../../library/ctypes.rst:1842 msgid "" "This function is similar to the cast operator in C. It returns a new " "instance of *type* which points to the same memory block as *obj*. *type* " @@ -1876,19 +1858,19 @@ msgid "" "as a pointer." msgstr "" -#: ../../library/ctypes.rst:1865 +#: ../../library/ctypes.rst:1850 msgid "" "This function creates a mutable character buffer. The returned object is a " "ctypes array of :class:`c_char`." msgstr "" -#: ../../library/ctypes.rst:1868 +#: ../../library/ctypes.rst:1853 msgid "" "*init_or_size* must be an integer which specifies the size of the array, or " "a bytes object which will be used to initialize the array items." msgstr "" -#: ../../library/ctypes.rst:1871 +#: ../../library/ctypes.rst:1856 msgid "" "If a bytes object is specified as first argument, the buffer is made one " "item larger than its length so that the last element in the array is a NUL " @@ -1897,25 +1879,25 @@ msgid "" "not be used." msgstr "" -#: ../../library/ctypes.rst:1876 +#: ../../library/ctypes.rst:1861 msgid "" "Raises an :ref:`auditing event ` ``ctypes.create_string_buffer`` " "with arguments ``init``, ``size``." msgstr "" -#: ../../library/ctypes.rst:1881 +#: ../../library/ctypes.rst:1866 msgid "" "This function creates a mutable unicode character buffer. The returned " "object is a ctypes array of :class:`c_wchar`." msgstr "" -#: ../../library/ctypes.rst:1884 +#: ../../library/ctypes.rst:1869 msgid "" "*init_or_size* must be an integer which specifies the size of the array, or " "a string which will be used to initialize the array items." msgstr "" -#: ../../library/ctypes.rst:1887 +#: ../../library/ctypes.rst:1872 msgid "" "If a string is specified as first argument, the buffer is made one item " "larger than the length of the string so that the last element in the array " @@ -1924,27 +1906,27 @@ msgid "" "should not be used." msgstr "" -#: ../../library/ctypes.rst:1893 +#: ../../library/ctypes.rst:1878 msgid "" "Raises an :ref:`auditing event ` ``ctypes.create_unicode_buffer`` " "with arguments ``init``, ``size``." msgstr "" -#: ../../library/ctypes.rst:1898 +#: ../../library/ctypes.rst:1883 msgid "" "Windows only: This function is a hook which allows implementing in-process " "COM servers with ctypes. It is called from the DllCanUnloadNow function " "that the _ctypes extension dll exports." msgstr "" -#: ../../library/ctypes.rst:1905 +#: ../../library/ctypes.rst:1890 msgid "" "Windows only: This function is a hook which allows implementing in-process " "COM servers with ctypes. It is called from the DllGetClassObject function " "that the ``_ctypes`` extension dll exports." msgstr "" -#: ../../library/ctypes.rst:1913 +#: ../../library/ctypes.rst:1898 msgid "" "Try to find a library and return a pathname. *name* is the library name " "without any prefix like ``lib``, suffix like ``.so``, ``.dylib`` or version " @@ -1952,92 +1934,92 @@ msgid "" "If no library can be found, returns ``None``." msgstr "" -#: ../../library/ctypes.rst:1924 +#: ../../library/ctypes.rst:1909 msgid "" "Windows only: return the filename of the VC runtime library used by Python, " "and by the extension modules. If the name of the library cannot be " "determined, ``None`` is returned." msgstr "" -#: ../../library/ctypes.rst:1928 +#: ../../library/ctypes.rst:1913 msgid "" "If you need to free memory, for example, allocated by an extension module " "with a call to the ``free(void *)``, it is important that you use the " "function in the same library that allocated the memory." msgstr "" -#: ../../library/ctypes.rst:1935 +#: ../../library/ctypes.rst:1920 msgid "" "Windows only: Returns a textual description of the error code *code*. If no " "error code is specified, the last error code is used by calling the Windows " "api function GetLastError." msgstr "" -#: ../../library/ctypes.rst:1942 +#: ../../library/ctypes.rst:1927 msgid "" "Windows only: Returns the last error code set by Windows in the calling " "thread. This function calls the Windows `GetLastError()` function directly, " "it does not return the ctypes-private copy of the error code." msgstr "" -#: ../../library/ctypes.rst:1948 +#: ../../library/ctypes.rst:1933 msgid "" "Returns the current value of the ctypes-private copy of the system :data:" "`errno` variable in the calling thread." msgstr "" -#: ../../library/ctypes.rst:1951 +#: ../../library/ctypes.rst:1936 msgid "" "Raises an :ref:`auditing event ` ``ctypes.get_errno`` with no " "arguments." msgstr "" -#: ../../library/ctypes.rst:1955 +#: ../../library/ctypes.rst:1940 msgid "" "Windows only: returns the current value of the ctypes-private copy of the " "system :data:`LastError` variable in the calling thread." msgstr "" -#: ../../library/ctypes.rst:1958 +#: ../../library/ctypes.rst:1943 msgid "" "Raises an :ref:`auditing event ` ``ctypes.get_last_error`` with no " "arguments." msgstr "" -#: ../../library/ctypes.rst:1962 +#: ../../library/ctypes.rst:1947 msgid "" "Same as the standard C memmove library function: copies *count* bytes from " "*src* to *dst*. *dst* and *src* must be integers or ctypes instances that " "can be converted to pointers." msgstr "" -#: ../../library/ctypes.rst:1969 +#: ../../library/ctypes.rst:1954 msgid "" "Same as the standard C memset library function: fills the memory block at " "address *dst* with *count* bytes of value *c*. *dst* must be an integer " "specifying an address, or a ctypes instance." msgstr "" -#: ../../library/ctypes.rst:1976 +#: ../../library/ctypes.rst:1961 msgid "" "This factory function creates and returns a new ctypes pointer type. Pointer " "types are cached and reused internally, so calling this function repeatedly " "is cheap. *type* must be a ctypes type." msgstr "" -#: ../../library/ctypes.rst:1983 +#: ../../library/ctypes.rst:1968 msgid "" "This function creates a new pointer instance, pointing to *obj*. The " "returned object is of the type ``POINTER(type(obj))``." msgstr "" -#: ../../library/ctypes.rst:1986 +#: ../../library/ctypes.rst:1971 msgid "" "Note: If you just want to pass a pointer to an object to a foreign function " "call, you should use ``byref(obj)`` which is much faster." msgstr "" -#: ../../library/ctypes.rst:1992 +#: ../../library/ctypes.rst:1977 msgid "" "This function resizes the internal memory buffer of *obj*, which must be an " "instance of a ctypes type. It is not possible to make the buffer smaller " @@ -2045,51 +2027,51 @@ msgid "" "but it is possible to enlarge the buffer." msgstr "" -#: ../../library/ctypes.rst:2000 +#: ../../library/ctypes.rst:1985 msgid "" "Set the current value of the ctypes-private copy of the system :data:`errno` " "variable in the calling thread to *value* and return the previous value." msgstr "" -#: ../../library/ctypes.rst:2003 +#: ../../library/ctypes.rst:1988 msgid "" "Raises an :ref:`auditing event ` ``ctypes.set_errno`` with " "argument ``errno``." msgstr "" -#: ../../library/ctypes.rst:2008 +#: ../../library/ctypes.rst:1993 msgid "" "Windows only: set the current value of the ctypes-private copy of the " "system :data:`LastError` variable in the calling thread to *value* and " "return the previous value." msgstr "" -#: ../../library/ctypes.rst:2012 +#: ../../library/ctypes.rst:1997 msgid "" "Raises an :ref:`auditing event ` ``ctypes.set_last_error`` with " "argument ``error``." msgstr "" -#: ../../library/ctypes.rst:2017 +#: ../../library/ctypes.rst:2002 msgid "" "Returns the size in bytes of a ctypes type or instance memory buffer. Does " "the same as the C ``sizeof`` operator." msgstr "" -#: ../../library/ctypes.rst:2023 +#: ../../library/ctypes.rst:2008 msgid "" "This function returns the C string starting at memory address *address* as a " "bytes object. If size is specified, it is used as size, otherwise the string " "is assumed to be zero-terminated." msgstr "" -#: ../../library/ctypes.rst:2027 +#: ../../library/ctypes.rst:2012 msgid "" "Raises an :ref:`auditing event ` ``ctypes.string_at`` with " "arguments ``address``, ``size``." msgstr "" -#: ../../library/ctypes.rst:2032 +#: ../../library/ctypes.rst:2017 msgid "" "Windows only: this function is probably the worst-named thing in ctypes. It " "creates an instance of OSError. If *code* is not specified, " @@ -2098,11 +2080,11 @@ msgid "" "error." msgstr "" -#: ../../library/ctypes.rst:2038 +#: ../../library/ctypes.rst:2023 msgid "An instance of :exc:`WindowsError` used to be created." msgstr "" -#: ../../library/ctypes.rst:2044 +#: ../../library/ctypes.rst:2029 msgid "" "This function returns the wide character string starting at memory address " "*address* as a string. If *size* is specified, it is used as the number of " @@ -2110,17 +2092,17 @@ msgid "" "terminated." msgstr "" -#: ../../library/ctypes.rst:2049 +#: ../../library/ctypes.rst:2034 msgid "" "Raises an :ref:`auditing event ` ``ctypes.wstring_at`` with " "arguments ``address``, ``size``." msgstr "" -#: ../../library/ctypes.rst:2055 +#: ../../library/ctypes.rst:2040 msgid "Data types" msgstr "" -#: ../../library/ctypes.rst:2060 +#: ../../library/ctypes.rst:2045 msgid "" "This non-public class is the common base class of all ctypes data types. " "Among other things, all ctypes type instances contain a memory block that " @@ -2130,13 +2112,13 @@ msgid "" "alive in case the memory block contains pointers." msgstr "" -#: ../../library/ctypes.rst:2067 +#: ../../library/ctypes.rst:2052 msgid "" "Common methods of ctypes data types, these are all class methods (to be " "exact, they are methods of the :term:`metaclass`):" msgstr "" -#: ../../library/ctypes.rst:2072 +#: ../../library/ctypes.rst:2057 msgid "" "This method returns a ctypes instance that shares the buffer of the *source* " "object. The *source* object must support the writeable buffer interface. " @@ -2145,13 +2127,13 @@ msgid "" "exc:`ValueError` is raised." msgstr "" -#: ../../library/ctypes.rst:2078 ../../library/ctypes.rst:2088 +#: ../../library/ctypes.rst:2063 ../../library/ctypes.rst:2073 msgid "" "Raises an :ref:`auditing event ` ``ctypes.cdata/buffer`` with " "arguments ``pointer``, ``size``, ``offset``." msgstr "" -#: ../../library/ctypes.rst:2082 +#: ../../library/ctypes.rst:2067 msgid "" "This method creates a ctypes instance, copying the buffer from the *source* " "object buffer which must be readable. The optional *offset* parameter " @@ -2159,25 +2141,25 @@ msgid "" "If the source buffer is not large enough a :exc:`ValueError` is raised." msgstr "" -#: ../../library/ctypes.rst:2092 +#: ../../library/ctypes.rst:2077 msgid "" "This method returns a ctypes type instance using the memory specified by " "*address* which must be an integer." msgstr "" -#: ../../library/ctypes.rst:2095 +#: ../../library/ctypes.rst:None msgid "" "Raises an :ref:`auditing event ` ``ctypes.cdata`` with argument " "``address``." msgstr "" -#: ../../library/ctypes.rst:2097 +#: ../../library/ctypes.rst:2082 msgid "" "This method, and others that indirectly call this method, raises an :ref:" "`auditing event ` ``ctypes.cdata`` with argument ``address``." msgstr "" -#: ../../library/ctypes.rst:2103 +#: ../../library/ctypes.rst:2088 msgid "" "This method adapts *obj* to a ctypes type. It is called with the actual " "object used in a foreign function call when the type is present in the " @@ -2185,25 +2167,25 @@ msgid "" "be used as a function call parameter." msgstr "" -#: ../../library/ctypes.rst:2108 +#: ../../library/ctypes.rst:2093 msgid "" "All ctypes data types have a default implementation of this classmethod that " "normally returns *obj* if that is an instance of the type. Some types " "accept other objects as well." msgstr "" -#: ../../library/ctypes.rst:2114 +#: ../../library/ctypes.rst:2099 msgid "" "This method returns a ctypes type instance exported by a shared library. " "*name* is the name of the symbol that exports the data, *library* is the " "loaded shared library." msgstr "" -#: ../../library/ctypes.rst:2118 +#: ../../library/ctypes.rst:2103 msgid "Common instance variables of ctypes data types:" msgstr "" -#: ../../library/ctypes.rst:2122 +#: ../../library/ctypes.rst:2107 msgid "" "Sometimes ctypes data instances do not own the memory block they contain, " "instead they share part of the memory block of a base object. The :attr:" @@ -2211,13 +2193,13 @@ msgid "" "block." msgstr "" -#: ../../library/ctypes.rst:2129 +#: ../../library/ctypes.rst:2114 msgid "" "This read-only variable is true when the ctypes data instance has allocated " "the memory block itself, false otherwise." msgstr "" -#: ../../library/ctypes.rst:2134 +#: ../../library/ctypes.rst:2119 msgid "" "This member is either ``None`` or a dictionary containing Python objects " "that need to be kept alive so that the memory block contents is kept valid. " @@ -2225,7 +2207,7 @@ msgid "" "dictionary." msgstr "" -#: ../../library/ctypes.rst:2147 +#: ../../library/ctypes.rst:2132 msgid "" "This non-public class is the base class of all fundamental ctypes data " "types. It is mentioned here because it contains the common attributes of the " @@ -2234,11 +2216,11 @@ msgid "" "types that are not and do not contain pointers can now be pickled." msgstr "" -#: ../../library/ctypes.rst:2153 +#: ../../library/ctypes.rst:2138 msgid "Instances have a single attribute:" msgstr "" -#: ../../library/ctypes.rst:2157 +#: ../../library/ctypes.rst:2142 msgid "" "This attribute contains the actual value of the instance. For integer and " "pointer types, it is an integer, for character types, it is a single " @@ -2246,7 +2228,7 @@ msgid "" "bytes object or string." msgstr "" -#: ../../library/ctypes.rst:2162 +#: ../../library/ctypes.rst:2147 msgid "" "When the ``value`` attribute is retrieved from a ctypes instance, usually a " "new object is returned each time. :mod:`ctypes` does *not* implement " @@ -2254,7 +2236,7 @@ msgid "" "true for all other ctypes object instances." msgstr "" -#: ../../library/ctypes.rst:2168 +#: ../../library/ctypes.rst:2153 msgid "" "Fundamental data types, when returned as foreign function call results, or, " "for example, by retrieving structure field members or array items, are " @@ -2263,7 +2245,7 @@ msgid "" "receive a Python bytes object, *not* a :class:`c_char_p` instance." msgstr "" -#: ../../library/ctypes.rst:2176 +#: ../../library/ctypes.rst:2161 msgid "" "Subclasses of fundamental data types do *not* inherit this behavior. So, if " "a foreign functions :attr:`restype` is a subclass of :class:`c_void_p`, you " @@ -2271,25 +2253,25 @@ msgid "" "you can get the value of the pointer by accessing the ``value`` attribute." msgstr "" -#: ../../library/ctypes.rst:2181 +#: ../../library/ctypes.rst:2166 msgid "These are the fundamental ctypes data types:" msgstr "" -#: ../../library/ctypes.rst:2185 +#: ../../library/ctypes.rst:2170 msgid "" "Represents the C :c:type:`signed char` datatype, and interprets the value as " "small integer. The constructor accepts an optional integer initializer; no " "overflow checking is done." msgstr "" -#: ../../library/ctypes.rst:2192 +#: ../../library/ctypes.rst:2177 msgid "" "Represents the C :c:type:`char` datatype, and interprets the value as a " "single character. The constructor accepts an optional string initializer, " "the length of the string must be exactly one character." msgstr "" -#: ../../library/ctypes.rst:2199 +#: ../../library/ctypes.rst:2184 msgid "" "Represents the C :c:type:`char *` datatype when it points to a zero-" "terminated string. For a general character pointer that may also point to " @@ -2297,178 +2279,178 @@ msgid "" "integer address, or a bytes object." msgstr "" -#: ../../library/ctypes.rst:2207 +#: ../../library/ctypes.rst:2192 msgid "" "Represents the C :c:type:`double` datatype. The constructor accepts an " "optional float initializer." msgstr "" -#: ../../library/ctypes.rst:2213 +#: ../../library/ctypes.rst:2198 msgid "" "Represents the C :c:type:`long double` datatype. The constructor accepts an " "optional float initializer. On platforms where ``sizeof(long double) == " "sizeof(double)`` it is an alias to :class:`c_double`." msgstr "" -#: ../../library/ctypes.rst:2219 +#: ../../library/ctypes.rst:2204 msgid "" "Represents the C :c:type:`float` datatype. The constructor accepts an " "optional float initializer." msgstr "" -#: ../../library/ctypes.rst:2225 +#: ../../library/ctypes.rst:2210 msgid "" "Represents the C :c:type:`signed int` datatype. The constructor accepts an " "optional integer initializer; no overflow checking is done. On platforms " "where ``sizeof(int) == sizeof(long)`` it is an alias to :class:`c_long`." msgstr "" -#: ../../library/ctypes.rst:2232 +#: ../../library/ctypes.rst:2217 msgid "" "Represents the C 8-bit :c:type:`signed int` datatype. Usually an alias for :" "class:`c_byte`." msgstr "" -#: ../../library/ctypes.rst:2238 +#: ../../library/ctypes.rst:2223 msgid "" "Represents the C 16-bit :c:type:`signed int` datatype. Usually an alias " "for :class:`c_short`." msgstr "" -#: ../../library/ctypes.rst:2244 +#: ../../library/ctypes.rst:2229 msgid "" "Represents the C 32-bit :c:type:`signed int` datatype. Usually an alias " "for :class:`c_int`." msgstr "" -#: ../../library/ctypes.rst:2250 +#: ../../library/ctypes.rst:2235 msgid "" "Represents the C 64-bit :c:type:`signed int` datatype. Usually an alias " "for :class:`c_longlong`." msgstr "" -#: ../../library/ctypes.rst:2256 +#: ../../library/ctypes.rst:2241 msgid "" "Represents the C :c:type:`signed long` datatype. The constructor accepts an " "optional integer initializer; no overflow checking is done." msgstr "" -#: ../../library/ctypes.rst:2262 +#: ../../library/ctypes.rst:2247 msgid "" "Represents the C :c:type:`signed long long` datatype. The constructor " "accepts an optional integer initializer; no overflow checking is done." msgstr "" -#: ../../library/ctypes.rst:2268 +#: ../../library/ctypes.rst:2253 msgid "" "Represents the C :c:type:`signed short` datatype. The constructor accepts " "an optional integer initializer; no overflow checking is done." msgstr "" -#: ../../library/ctypes.rst:2274 +#: ../../library/ctypes.rst:2259 msgid "Represents the C :c:type:`size_t` datatype." msgstr "" -#: ../../library/ctypes.rst:2279 +#: ../../library/ctypes.rst:2264 msgid "Represents the C :c:type:`ssize_t` datatype." msgstr "" -#: ../../library/ctypes.rst:2286 +#: ../../library/ctypes.rst:2271 msgid "" "Represents the C :c:type:`unsigned char` datatype, it interprets the value " "as small integer. The constructor accepts an optional integer initializer; " "no overflow checking is done." msgstr "" -#: ../../library/ctypes.rst:2293 +#: ../../library/ctypes.rst:2278 msgid "" "Represents the C :c:type:`unsigned int` datatype. The constructor accepts " "an optional integer initializer; no overflow checking is done. On platforms " "where ``sizeof(int) == sizeof(long)`` it is an alias for :class:`c_ulong`." msgstr "" -#: ../../library/ctypes.rst:2300 +#: ../../library/ctypes.rst:2285 msgid "" "Represents the C 8-bit :c:type:`unsigned int` datatype. Usually an alias " "for :class:`c_ubyte`." msgstr "" -#: ../../library/ctypes.rst:2306 +#: ../../library/ctypes.rst:2291 msgid "" "Represents the C 16-bit :c:type:`unsigned int` datatype. Usually an alias " "for :class:`c_ushort`." msgstr "" -#: ../../library/ctypes.rst:2312 +#: ../../library/ctypes.rst:2297 msgid "" "Represents the C 32-bit :c:type:`unsigned int` datatype. Usually an alias " "for :class:`c_uint`." msgstr "" -#: ../../library/ctypes.rst:2318 +#: ../../library/ctypes.rst:2303 msgid "" "Represents the C 64-bit :c:type:`unsigned int` datatype. Usually an alias " "for :class:`c_ulonglong`." msgstr "" -#: ../../library/ctypes.rst:2324 +#: ../../library/ctypes.rst:2309 msgid "" "Represents the C :c:type:`unsigned long` datatype. The constructor accepts " "an optional integer initializer; no overflow checking is done." msgstr "" -#: ../../library/ctypes.rst:2330 +#: ../../library/ctypes.rst:2315 msgid "" "Represents the C :c:type:`unsigned long long` datatype. The constructor " "accepts an optional integer initializer; no overflow checking is done." msgstr "" -#: ../../library/ctypes.rst:2336 +#: ../../library/ctypes.rst:2321 msgid "" "Represents the C :c:type:`unsigned short` datatype. The constructor accepts " "an optional integer initializer; no overflow checking is done." msgstr "" -#: ../../library/ctypes.rst:2342 +#: ../../library/ctypes.rst:2327 msgid "" "Represents the C :c:type:`void *` type. The value is represented as " "integer. The constructor accepts an optional integer initializer." msgstr "" -#: ../../library/ctypes.rst:2348 +#: ../../library/ctypes.rst:2333 msgid "" "Represents the C :c:type:`wchar_t` datatype, and interprets the value as a " "single character unicode string. The constructor accepts an optional string " "initializer, the length of the string must be exactly one character." msgstr "" -#: ../../library/ctypes.rst:2355 +#: ../../library/ctypes.rst:2340 msgid "" "Represents the C :c:type:`wchar_t *` datatype, which must be a pointer to a " "zero-terminated wide character string. The constructor accepts an integer " "address, or a string." msgstr "" -#: ../../library/ctypes.rst:2362 +#: ../../library/ctypes.rst:2347 msgid "" "Represent the C :c:type:`bool` datatype (more accurately, :c:type:`_Bool` " "from C99). Its value can be ``True`` or ``False``, and the constructor " "accepts any object that has a truth value." msgstr "" -#: ../../library/ctypes.rst:2369 +#: ../../library/ctypes.rst:2354 msgid "" "Windows only: Represents a :c:type:`HRESULT` value, which contains success " "or error information for a function or method call." msgstr "" -#: ../../library/ctypes.rst:2375 +#: ../../library/ctypes.rst:2360 msgid "" "Represents the C :c:type:`PyObject *` datatype. Calling this without an " "argument creates a ``NULL`` :c:type:`PyObject *` pointer." msgstr "" -#: ../../library/ctypes.rst:2378 +#: ../../library/ctypes.rst:2363 msgid "" "The :mod:`ctypes.wintypes` module provides quite some other Windows specific " "data types, for example :c:type:`HWND`, :c:type:`WPARAM`, or :c:type:" @@ -2476,33 +2458,33 @@ msgid "" "also defined." msgstr "" -#: ../../library/ctypes.rst:2386 +#: ../../library/ctypes.rst:2371 msgid "Structured data types" msgstr "" -#: ../../library/ctypes.rst:2391 +#: ../../library/ctypes.rst:2376 msgid "Abstract base class for unions in native byte order." msgstr "" -#: ../../library/ctypes.rst:2396 +#: ../../library/ctypes.rst:2381 msgid "Abstract base class for structures in *big endian* byte order." msgstr "" -#: ../../library/ctypes.rst:2401 +#: ../../library/ctypes.rst:2386 msgid "Abstract base class for structures in *little endian* byte order." msgstr "" -#: ../../library/ctypes.rst:2403 +#: ../../library/ctypes.rst:2388 msgid "" "Structures with non-native byte order cannot contain pointer type fields, or " "any other data types containing pointer type fields." msgstr "" -#: ../../library/ctypes.rst:2409 +#: ../../library/ctypes.rst:2394 msgid "Abstract base class for structures in *native* byte order." msgstr "" -#: ../../library/ctypes.rst:2411 +#: ../../library/ctypes.rst:2396 msgid "" "Concrete structure and union types must be created by subclassing one of " "these types, and at least define a :attr:`_fields_` class variable. :mod:" @@ -2510,34 +2492,34 @@ msgid "" "the fields by direct attribute accesses. These are the" msgstr "" -#: ../../library/ctypes.rst:2419 +#: ../../library/ctypes.rst:2404 msgid "" "A sequence defining the structure fields. The items must be 2-tuples or 3-" "tuples. The first item is the name of the field, the second item specifies " "the type of the field; it can be any ctypes data type." msgstr "" -#: ../../library/ctypes.rst:2423 +#: ../../library/ctypes.rst:2408 msgid "" "For integer type fields like :class:`c_int`, a third optional item can be " "given. It must be a small positive integer defining the bit width of the " "field." msgstr "" -#: ../../library/ctypes.rst:2427 +#: ../../library/ctypes.rst:2412 msgid "" "Field names must be unique within one structure or union. This is not " "checked, only one field can be accessed when names are repeated." msgstr "" -#: ../../library/ctypes.rst:2430 +#: ../../library/ctypes.rst:2415 msgid "" "It is possible to define the :attr:`_fields_` class variable *after* the " "class statement that defines the Structure subclass, this allows creating " "data types that directly or indirectly reference themselves::" msgstr "" -#: ../../library/ctypes.rst:2440 +#: ../../library/ctypes.rst:2425 msgid "" "The :attr:`_fields_` class variable must, however, be defined before the " "type is first used (an instance is created, :func:`sizeof` is called on it, " @@ -2545,28 +2527,28 @@ msgid "" "raise an AttributeError." msgstr "" -#: ../../library/ctypes.rst:2445 +#: ../../library/ctypes.rst:2430 msgid "" "It is possible to define sub-subclasses of structure types, they inherit the " "fields of the base class plus the :attr:`_fields_` defined in the sub-" "subclass, if any." msgstr "" -#: ../../library/ctypes.rst:2452 +#: ../../library/ctypes.rst:2437 msgid "" "An optional small integer that allows overriding the alignment of structure " "fields in the instance. :attr:`_pack_` must already be defined when :attr:" "`_fields_` is assigned, otherwise it will have no effect." msgstr "" -#: ../../library/ctypes.rst:2459 +#: ../../library/ctypes.rst:2444 msgid "" "An optional sequence that lists the names of unnamed (anonymous) fields. :" "attr:`_anonymous_` must be already defined when :attr:`_fields_` is " "assigned, otherwise it will have no effect." msgstr "" -#: ../../library/ctypes.rst:2463 +#: ../../library/ctypes.rst:2448 msgid "" "The fields listed in this variable must be structure or union type fields. :" "mod:`ctypes` will create descriptors in the structure type that allows " @@ -2574,11 +2556,11 @@ msgid "" "structure or union field." msgstr "" -#: ../../library/ctypes.rst:2468 +#: ../../library/ctypes.rst:2453 msgid "Here is an example type (Windows)::" msgstr "" -#: ../../library/ctypes.rst:2481 +#: ../../library/ctypes.rst:2466 msgid "" "The ``TYPEDESC`` structure describes a COM data type, the ``vt`` field " "specifies which one of the union fields is valid. Since the ``u`` field is " @@ -2588,7 +2570,7 @@ msgid "" "temporary union instance::" msgstr "" -#: ../../library/ctypes.rst:2493 +#: ../../library/ctypes.rst:2478 msgid "" "It is possible to define sub-subclasses of structures, they inherit the " "fields of the base class. If the subclass definition has a separate :attr:" @@ -2596,7 +2578,7 @@ msgid "" "of the base class." msgstr "" -#: ../../library/ctypes.rst:2498 +#: ../../library/ctypes.rst:2483 msgid "" "Structure and union constructors accept both positional and keyword " "arguments. Positional arguments are used to initialize member fields in the " @@ -2606,15 +2588,15 @@ msgid "" "names not present in :attr:`_fields_`." msgstr "" -#: ../../library/ctypes.rst:2509 +#: ../../library/ctypes.rst:2494 msgid "Arrays and pointers" msgstr "" -#: ../../library/ctypes.rst:2513 +#: ../../library/ctypes.rst:2498 msgid "Abstract base class for arrays." msgstr "" -#: ../../library/ctypes.rst:2515 +#: ../../library/ctypes.rst:2500 msgid "" "The recommended way to create concrete array types is by multiplying any :" "mod:`ctypes` data type with a positive integer. Alternatively, you can " @@ -2624,34 +2606,34 @@ msgid "" "an :class:`Array`." msgstr "" -#: ../../library/ctypes.rst:2525 +#: ../../library/ctypes.rst:2510 msgid "" "A positive integer specifying the number of elements in the array. Out-of-" "range subscripts result in an :exc:`IndexError`. Will be returned by :func:" "`len`." msgstr "" -#: ../../library/ctypes.rst:2532 +#: ../../library/ctypes.rst:2517 msgid "Specifies the type of each element in the array." msgstr "" -#: ../../library/ctypes.rst:2535 +#: ../../library/ctypes.rst:2520 msgid "" "Array subclass constructors accept positional arguments, used to initialize " "the elements in order." msgstr "" -#: ../../library/ctypes.rst:2541 +#: ../../library/ctypes.rst:2526 msgid "Private, abstract base class for pointers." msgstr "" -#: ../../library/ctypes.rst:2543 +#: ../../library/ctypes.rst:2528 msgid "" "Concrete pointer types are created by calling :func:`POINTER` with the type " "that will be pointed to; this is done automatically by :func:`pointer`." msgstr "" -#: ../../library/ctypes.rst:2547 +#: ../../library/ctypes.rst:2532 msgid "" "If a pointer points to an array, its elements can be read and written using " "standard subscript and slice accesses. Pointer objects have no size, so :" @@ -2660,11 +2642,11 @@ msgid "" "probably crash with an access violation (if you're lucky)." msgstr "" -#: ../../library/ctypes.rst:2557 +#: ../../library/ctypes.rst:2542 msgid "Specifies the type pointed to." msgstr "" -#: ../../library/ctypes.rst:2561 +#: ../../library/ctypes.rst:2546 msgid "" "Returns the object to which to pointer points. Assigning to this attribute " "changes the pointer to point to the assigned object." diff --git a/library/curses.po b/library/curses.po index 74b58b22c8..296ed5c862 100644 --- a/library/curses.po +++ b/library/curses.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.7\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2021-09-07 06:52+0000\n" +"POT-Creation-Date: 2020-06-20 18:08+0800\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-" @@ -160,7 +160,7 @@ msgstr "" #: ../../library/curses.rst:114 msgid "" "Return the intensity of the red, green, and blue (RGB) components in the " -"color *color_number*, which must be between ``0`` and ``COLORS - 1``. " +"color *color_number*, which must be between ``0`` and :const:`COLORS`. " "Return a 3-tuple, containing the R,G,B values for the given color, which " "will be between ``0`` (no component) and ``1000`` (maximum amount of " "component)." @@ -168,13 +168,13 @@ msgstr "" #: ../../library/curses.rst:122 msgid "" -"Return the attribute value for displaying text in the specified color pair. " -"Only the first 256 color pairs are supported. This attribute value can be " -"combined with :const:`A_STANDOUT`, :const:`A_REVERSE`, and the other :const:" -"`A_\\*` attributes. :func:`pair_number` is the counterpart to this function." +"Return the attribute value for displaying text in the specified color. This " +"attribute value can be combined with :const:`A_STANDOUT`, :const:" +"`A_REVERSE`, and the other :const:`A_\\*` attributes. :func:`pair_number` " +"is the counterpart to this function." msgstr "" -#: ../../library/curses.rst:131 +#: ../../library/curses.rst:130 msgid "" "Set the cursor state. *visibility* can be set to ``0``, ``1``, or ``2``, " "for invisible, normal, or very visible. If the terminal supports the " @@ -183,7 +183,7 @@ msgid "" "and the \"very visible\" mode is a block cursor." msgstr "" -#: ../../library/curses.rst:140 +#: ../../library/curses.rst:139 msgid "" "Save the current terminal mode as the \"program\" mode, the mode when the " "running program is using curses. (Its counterpart is the \"shell\" mode, " @@ -191,7 +191,7 @@ msgid "" "`reset_prog_mode` will restore this mode." msgstr "" -#: ../../library/curses.rst:148 +#: ../../library/curses.rst:147 msgid "" "Save the current terminal mode as the \"shell\" mode, the mode when the " "running program is not using curses. (Its counterpart is the \"program\" " @@ -199,11 +199,11 @@ msgid "" "func:`reset_shell_mode` will restore this mode." msgstr "" -#: ../../library/curses.rst:156 +#: ../../library/curses.rst:155 msgid "Insert an *ms* millisecond pause in output." msgstr "" -#: ../../library/curses.rst:161 +#: ../../library/curses.rst:160 msgid "" "Update the physical screen. The curses library keeps two data structures, " "one representing the current physical screen contents and a virtual screen " @@ -211,7 +211,7 @@ msgid "" "the physical screen to match the virtual screen." msgstr "" -#: ../../library/curses.rst:166 +#: ../../library/curses.rst:165 msgid "" "The virtual screen may be updated by a :meth:`~window.noutrefresh` call " "after write operations such as :meth:`~window.addstr` have been performed on " @@ -222,24 +222,24 @@ msgid "" "func:`!doupdate`." msgstr "" -#: ../../library/curses.rst:176 +#: ../../library/curses.rst:175 msgid "" "Enter echo mode. In echo mode, each character input is echoed to the screen " "as it is entered." msgstr "" -#: ../../library/curses.rst:182 +#: ../../library/curses.rst:181 msgid "De-initialize the library, and return terminal to normal status." msgstr "" -#: ../../library/curses.rst:187 +#: ../../library/curses.rst:186 msgid "" "Return the user's current erase character as a one-byte bytes object. Under " "Unix operating systems this is a property of the controlling tty of the " "curses program, and is not set by the curses library itself." msgstr "" -#: ../../library/curses.rst:194 +#: ../../library/curses.rst:193 msgid "" "The :func:`.filter` routine, if used, must be called before :func:`initscr` " "is called. The effect is that, during those calls, :envvar:`LINES` is set " @@ -250,23 +250,23 @@ msgid "" "time line editing without touching the rest of the screen." msgstr "" -#: ../../library/curses.rst:204 +#: ../../library/curses.rst:203 msgid "" "Flash the screen. That is, change it to reverse-video and then change it " "back in a short interval. Some people prefer such as 'visible bell' to the " "audible attention signal produced by :func:`beep`." msgstr "" -#: ../../library/curses.rst:211 +#: ../../library/curses.rst:210 msgid "" "Flush all input buffers. This throws away any typeahead that has been " "typed by the user and has not yet been processed by the program." msgstr "" -#: ../../library/curses.rst:217 +#: ../../library/curses.rst:216 msgid "" "After :meth:`~window.getch` returns :const:`KEY_MOUSE` to signal a mouse " -"event, this method should be called to retrieve the queued mouse event, " +"event, this method should be call to retrieve the queued mouse event, " "represented as a 5-tuple ``(id, x, y, z, bstate)``. *id* is an ID value used " "to distinguish multiple devices, and *x*, *y*, *z* are the event's " "coordinates. (*z* is currently unused.) *bstate* is an integer value whose " @@ -278,34 +278,34 @@ msgid "" "const:`BUTTON_ALT`." msgstr "" -#: ../../library/curses.rst:231 +#: ../../library/curses.rst:230 msgid "" "Return the current coordinates of the virtual screen cursor as a tuple ``(y, " "x)``. If :meth:`leaveok ` is currently ``True``, then " "return ``(-1, -1)``." msgstr "" -#: ../../library/curses.rst:237 +#: ../../library/curses.rst:236 msgid "" "Read window related data stored in the file by an earlier :func:`putwin` " "call. The routine then creates and initializes a new window using that data, " "returning the new window object." msgstr "" -#: ../../library/curses.rst:244 +#: ../../library/curses.rst:243 msgid "" "Return ``True`` if the terminal can display colors; otherwise, return " "``False``." msgstr "" -#: ../../library/curses.rst:249 +#: ../../library/curses.rst:248 msgid "" "Return ``True`` if the terminal has insert- and delete-character " "capabilities. This function is included for historical reasons only, as all " "modern software terminal emulators have such capabilities." msgstr "" -#: ../../library/curses.rst:256 +#: ../../library/curses.rst:255 msgid "" "Return ``True`` if the terminal has insert- and delete-line capabilities, or " "can simulate them using scrolling regions. This function is included for " @@ -313,13 +313,13 @@ msgid "" "capabilities." msgstr "" -#: ../../library/curses.rst:264 +#: ../../library/curses.rst:263 msgid "" "Take a key value *ch*, and return ``True`` if the current terminal type " "recognizes a key with that value." msgstr "" -#: ../../library/curses.rst:270 +#: ../../library/curses.rst:269 msgid "" "Used for half-delay mode, which is similar to cbreak mode in that characters " "typed by the user are immediately available to the program. However, after " @@ -328,56 +328,55 @@ msgid "" "``255``. Use :func:`nocbreak` to leave half-delay mode." msgstr "" -#: ../../library/curses.rst:279 +#: ../../library/curses.rst:278 msgid "" "Change the definition of a color, taking the number of the color to be " "changed followed by three RGB values (for the amounts of red, green, and " -"blue components). The value of *color_number* must be between ``0`` and " -"`COLORS - 1`. Each of *r*, *g*, *b*, must be a value between ``0`` and " +"blue components). The value of *color_number* must be between ``0`` and :" +"const:`COLORS`. Each of *r*, *g*, *b*, must be a value between ``0`` and " "``1000``. When :func:`init_color` is used, all occurrences of that color on " "the screen immediately change to the new definition. This function is a no-" "op on most terminals; it is active only if :func:`can_change_color` returns " "``True``." msgstr "" -#: ../../library/curses.rst:290 +#: ../../library/curses.rst:289 msgid "" "Change the definition of a color-pair. It takes three arguments: the number " "of the color-pair to be changed, the foreground color number, and the " "background color number. The value of *pair_number* must be between ``1`` " "and ``COLOR_PAIRS - 1`` (the ``0`` color pair is wired to white on black and " "cannot be changed). The value of *fg* and *bg* arguments must be between " -"``0`` and ``COLORS - 1``, or, after calling :func:`use_default_colors`, " -"``-1``. If the color-pair was previously initialized, the screen is " -"refreshed and all occurrences of that color-pair are changed to the new " -"definition." +"``0`` and :const:`COLORS`. If the color-pair was previously initialized, " +"the screen is refreshed and all occurrences of that color-pair are changed " +"to the new definition." msgstr "" -#: ../../library/curses.rst:303 +#: ../../library/curses.rst:301 msgid "" "Initialize the library. Return a :ref:`window ` " "object which represents the whole screen." msgstr "" -#: ../../library/curses.rst:308 +#: ../../library/curses.rst:306 msgid "" "If there is an error opening the terminal, the underlying curses library may " "cause the interpreter to exit." msgstr "" -#: ../../library/curses.rst:314 +#: ../../library/curses.rst:312 msgid "" "Return ``True`` if :func:`resize_term` would modify the window structure, " "``False`` otherwise." msgstr "" -#: ../../library/curses.rst:320 +#: ../../library/curses.rst:318 msgid "" "Return ``True`` if :func:`endwin` has been called (that is, the curses " "library has been deinitialized)." msgstr "" -#: ../../library/curses.rst:326 +#: ../../library/curses.rst:324 msgid "" "Return the name of the key numbered *k* as a bytes object. The name of a " "key generating printable ASCII character is the key's character. The name " @@ -388,27 +387,27 @@ msgid "" "character." msgstr "" -#: ../../library/curses.rst:336 +#: ../../library/curses.rst:334 msgid "" "Return the user's current line kill character as a one-byte bytes object. " "Under Unix operating systems this is a property of the controlling tty of " "the curses program, and is not set by the curses library itself." msgstr "" -#: ../../library/curses.rst:343 +#: ../../library/curses.rst:341 msgid "" "Return a bytes object containing the terminfo long name field describing the " "current terminal. The maximum length of a verbose description is 128 " "characters. It is defined only after the call to :func:`initscr`." msgstr "" -#: ../../library/curses.rst:350 +#: ../../library/curses.rst:348 msgid "" "If *flag* is ``True``, allow 8-bit characters to be input. If *flag* is " "``False``, allow only 7-bit chars." msgstr "" -#: ../../library/curses.rst:356 +#: ../../library/curses.rst:354 msgid "" "Set the maximum time in milliseconds that can elapse between press and " "release events in order for them to be recognized as a click, and return the " @@ -416,7 +415,7 @@ msgid "" "second." msgstr "" -#: ../../library/curses.rst:363 +#: ../../library/curses.rst:361 msgid "" "Set the mouse events to be reported, and return a tuple ``(availmask, " "oldmask)``. *availmask* indicates which of the specified mouse events can " @@ -425,17 +424,17 @@ msgid "" "never called, no mouse events are ever reported." msgstr "" -#: ../../library/curses.rst:372 +#: ../../library/curses.rst:370 msgid "Sleep for *ms* milliseconds." msgstr "" -#: ../../library/curses.rst:377 +#: ../../library/curses.rst:375 msgid "" "Create and return a pointer to a new pad data structure with the given " "number of lines and columns. Return a pad as a window object." msgstr "" -#: ../../library/curses.rst:380 +#: ../../library/curses.rst:378 msgid "" "A pad is like a window, except that it is not restricted by the screen size, " "and is not necessarily associated with a particular part of the screen. " @@ -451,35 +450,35 @@ msgid "" "to be displayed." msgstr "" -#: ../../library/curses.rst:396 +#: ../../library/curses.rst:394 msgid "" "Return a new :ref:`window `, whose left-upper corner " "is at ``(begin_y, begin_x)``, and whose height/width is *nlines*/*ncols*." msgstr "" -#: ../../library/curses.rst:399 +#: ../../library/curses.rst:397 msgid "" "By default, the window will extend from the specified position to the lower " "right corner of the screen." msgstr "" -#: ../../library/curses.rst:405 +#: ../../library/curses.rst:403 msgid "" "Enter newline mode. This mode translates the return key into newline on " "input, and translates newline into return and line-feed on output. Newline " "mode is initially on." msgstr "" -#: ../../library/curses.rst:412 +#: ../../library/curses.rst:410 msgid "" "Leave cbreak mode. Return to normal \"cooked\" mode with line buffering." msgstr "" -#: ../../library/curses.rst:417 +#: ../../library/curses.rst:415 msgid "Leave echo mode. Echoing of input characters is turned off." msgstr "" -#: ../../library/curses.rst:422 +#: ../../library/curses.rst:420 msgid "" "Leave newline mode. Disable translation of return into newline on input, " "and disable low-level translation of newline into newline/return on output " @@ -489,7 +488,7 @@ msgid "" "also, it will be able to detect the return key on input." msgstr "" -#: ../../library/curses.rst:432 +#: ../../library/curses.rst:430 msgid "" "When the :func:`!noqiflush` routine is used, normal flush of input and " "output queues associated with the ``INTR``, ``QUIT`` and ``SUSP`` characters " @@ -498,63 +497,63 @@ msgid "" "occurred, after the handler exits." msgstr "" -#: ../../library/curses.rst:440 +#: ../../library/curses.rst:438 msgid "Leave raw mode. Return to normal \"cooked\" mode with line buffering." msgstr "" -#: ../../library/curses.rst:445 +#: ../../library/curses.rst:443 msgid "" "Return a tuple ``(fg, bg)`` containing the colors for the requested color " -"pair. The value of *pair_number* must be between ``0`` and ``COLOR_PAIRS - " +"pair. The value of *pair_number* must be between ``1`` and ``COLOR_PAIRS - " "1``." msgstr "" -#: ../../library/curses.rst:451 +#: ../../library/curses.rst:449 msgid "" "Return the number of the color-pair set by the attribute value *attr*. :func:" "`color_pair` is the counterpart to this function." msgstr "" -#: ../../library/curses.rst:457 +#: ../../library/curses.rst:455 msgid "" "Equivalent to ``tputs(str, 1, putchar)``; emit the value of a specified " "terminfo capability for the current terminal. Note that the output of :func:" "`putp` always goes to standard output." msgstr "" -#: ../../library/curses.rst:464 +#: ../../library/curses.rst:462 msgid "" "If *flag* is ``False``, the effect is the same as calling :func:`noqiflush`. " "If *flag* is ``True``, or no argument is provided, the queues will be " "flushed when these control characters are read." msgstr "" -#: ../../library/curses.rst:471 +#: ../../library/curses.rst:469 msgid "" "Enter raw mode. In raw mode, normal line buffering and processing of " "interrupt, quit, suspend, and flow control keys are turned off; characters " "are presented to curses input functions one by one." msgstr "" -#: ../../library/curses.rst:478 +#: ../../library/curses.rst:476 msgid "" "Restore the terminal to \"program\" mode, as previously saved by :func:" "`def_prog_mode`." msgstr "" -#: ../../library/curses.rst:484 +#: ../../library/curses.rst:482 msgid "" "Restore the terminal to \"shell\" mode, as previously saved by :func:" "`def_shell_mode`." msgstr "" -#: ../../library/curses.rst:490 +#: ../../library/curses.rst:488 msgid "" "Restore the state of the terminal modes to what it was at the last call to :" "func:`savetty`." msgstr "" -#: ../../library/curses.rst:496 +#: ../../library/curses.rst:494 msgid "" "Backend function used by :func:`resizeterm`, performing most of the work; " "when resizing the windows, :func:`resize_term` blank-fills the areas that " @@ -564,47 +563,47 @@ msgid "" "to resize these without additional interaction with the application." msgstr "" -#: ../../library/curses.rst:506 +#: ../../library/curses.rst:504 msgid "" "Resize the standard and current windows to the specified dimensions, and " "adjusts other bookkeeping data used by the curses library that record the " "window dimensions (in particular the SIGWINCH handler)." msgstr "" -#: ../../library/curses.rst:513 +#: ../../library/curses.rst:511 msgid "" "Save the current state of the terminal modes in a buffer, usable by :func:" "`resetty`." msgstr "" -#: ../../library/curses.rst:518 +#: ../../library/curses.rst:516 msgid "Retrieves the value set by :func:`set_escdelay`." msgstr "" -#: ../../library/curses.rst:524 +#: ../../library/curses.rst:522 msgid "" "Sets the number of milliseconds to wait after reading an escape character, " "to distinguish between an individual escape character entered on the " "keyboard from escape sequences sent by cursor and function keys." msgstr "" -#: ../../library/curses.rst:532 +#: ../../library/curses.rst:530 msgid "Retrieves the value set by :func:`set_tabsize`." msgstr "" -#: ../../library/curses.rst:538 +#: ../../library/curses.rst:536 msgid "" "Sets the number of columns used by the curses library when converting a tab " "character to spaces as it adds the tab to a window." msgstr "" -#: ../../library/curses.rst:545 +#: ../../library/curses.rst:543 msgid "" "Set the virtual screen cursor to *y*, *x*. If *y* and *x* are both ``-1``, " "then :meth:`leaveok ` is set ``True``." msgstr "" -#: ../../library/curses.rst:551 +#: ../../library/curses.rst:549 msgid "" "Initialize the terminal. *term* is a string giving the terminal name, or " "``None``; if omitted or ``None``, the value of the :envvar:`TERM` " @@ -613,14 +612,14 @@ msgid "" "descriptor for ``sys.stdout`` will be used." msgstr "" -#: ../../library/curses.rst:560 +#: ../../library/curses.rst:558 msgid "" "Must be called if the programmer wants to use colors, and before any other " "color manipulation routine is called. It is good practice to call this " "routine right after :func:`initscr`." msgstr "" -#: ../../library/curses.rst:564 +#: ../../library/curses.rst:562 msgid "" ":func:`start_color` initializes eight basic colors (black, red, green, " "yellow, blue, magenta, cyan, and white), and two global variables in the :" @@ -630,20 +629,20 @@ msgid "" "terminal was just turned on." msgstr "" -#: ../../library/curses.rst:573 +#: ../../library/curses.rst:571 msgid "" "Return a logical OR of all video attributes supported by the terminal. This " "information is useful when a curses program needs complete control over the " "appearance of the screen." msgstr "" -#: ../../library/curses.rst:580 +#: ../../library/curses.rst:578 msgid "" "Return the value of the environment variable :envvar:`TERM`, as a bytes " "object, truncated to 14 characters." msgstr "" -#: ../../library/curses.rst:586 +#: ../../library/curses.rst:584 msgid "" "Return the value of the Boolean capability corresponding to the terminfo " "capability name *capname* as an integer. Return the value ``-1`` if " @@ -651,7 +650,7 @@ msgid "" "from the terminal description." msgstr "" -#: ../../library/curses.rst:594 +#: ../../library/curses.rst:592 msgid "" "Return the value of the numeric capability corresponding to the terminfo " "capability name *capname* as an integer. Return the value ``-2`` if " @@ -659,7 +658,7 @@ msgid "" "from the terminal description." msgstr "" -#: ../../library/curses.rst:602 +#: ../../library/curses.rst:600 msgid "" "Return the value of the string capability corresponding to the terminfo " "capability name *capname* as a bytes object. Return ``None`` if *capname* " @@ -667,7 +666,7 @@ msgid "" "terminal description." msgstr "" -#: ../../library/curses.rst:610 +#: ../../library/curses.rst:608 msgid "" "Instantiate the bytes object *str* with the supplied parameters, where *str* " "should be a parameterized string obtained from the terminfo database. E.g. " @@ -675,13 +674,13 @@ msgid "" "exact result depending on terminal type." msgstr "" -#: ../../library/curses.rst:618 +#: ../../library/curses.rst:616 msgid "" "Specify that the file descriptor *fd* be used for typeahead checking. If " "*fd* is ``-1``, then no typeahead checking is done." msgstr "" -#: ../../library/curses.rst:621 +#: ../../library/curses.rst:619 msgid "" "The curses library does \"line-breakout optimization\" by looking for " "typeahead periodically while updating the screen. If input is found, and it " @@ -691,7 +690,7 @@ msgid "" "typeahead checking." msgstr "" -#: ../../library/curses.rst:630 +#: ../../library/curses.rst:628 msgid "" "Return a bytes object which is a printable representation of the character " "*ch*. Control characters are represented as a caret followed by the " @@ -699,35 +698,35 @@ msgid "" "are." msgstr "" -#: ../../library/curses.rst:637 +#: ../../library/curses.rst:635 msgid "Push *ch* so the next :meth:`~window.getch` will return it." msgstr "" -#: ../../library/curses.rst:641 +#: ../../library/curses.rst:639 msgid "Only one *ch* can be pushed before :meth:`!getch` is called." msgstr "" -#: ../../library/curses.rst:646 +#: ../../library/curses.rst:644 msgid "" "Update :envvar:`LINES` and :envvar:`COLS`. Useful for detecting manual " "screen resize." msgstr "" -#: ../../library/curses.rst:653 +#: ../../library/curses.rst:651 msgid "Push *ch* so the next :meth:`~window.get_wch` will return it." msgstr "" -#: ../../library/curses.rst:657 +#: ../../library/curses.rst:655 msgid "Only one *ch* can be pushed before :meth:`!get_wch` is called." msgstr "" -#: ../../library/curses.rst:664 +#: ../../library/curses.rst:662 msgid "" "Push a :const:`KEY_MOUSE` event onto the input queue, associating the given " "state data with it." msgstr "" -#: ../../library/curses.rst:670 +#: ../../library/curses.rst:668 msgid "" "If used, this function should be called before :func:`initscr` or newterm " "are called. When *flag* is ``False``, the values of lines and columns " @@ -737,7 +736,7 @@ msgid "" "to use the window size if :envvar:`LINES` and :envvar:`COLUMNS` are not set)." msgstr "" -#: ../../library/curses.rst:680 +#: ../../library/curses.rst:678 msgid "" "Allow use of default values for colors on terminals supporting this feature. " "Use this to support transparency in your application. The default color is " @@ -746,7 +745,7 @@ msgid "" "*x* to a red foreground color on the default background." msgstr "" -#: ../../library/curses.rst:689 +#: ../../library/curses.rst:687 msgid "" "Initialize curses and call another callable object, *func*, which should be " "the rest of your curses-using application. If the application raises an " @@ -760,50 +759,50 @@ msgid "" "echo, and disables the terminal keypad." msgstr "" -#: ../../library/curses.rst:703 +#: ../../library/curses.rst:701 msgid "Window Objects" msgstr "" -#: ../../library/curses.rst:705 +#: ../../library/curses.rst:703 msgid "" "Window objects, as returned by :func:`initscr` and :func:`newwin` above, " "have the following methods and attributes:" msgstr "" -#: ../../library/curses.rst:712 +#: ../../library/curses.rst:710 msgid "" "Paint character *ch* at ``(y, x)`` with attributes *attr*, overwriting any " -"character previously painted at that location. By default, the character " +"character previously painter at that location. By default, the character " "position and attributes are the current settings for the window object." msgstr "" -#: ../../library/curses.rst:718 +#: ../../library/curses.rst:716 msgid "" "Writing outside the window, subwindow, or pad raises a :exc:`curses.error`. " "Attempting to write to the lower right corner of a window, subwindow, or pad " "will cause an exception to be raised after the character is printed." msgstr "" -#: ../../library/curses.rst:726 +#: ../../library/curses.rst:724 msgid "" "Paint at most *n* characters of the character string *str* at ``(y, x)`` " "with attributes *attr*, overwriting anything previously on the display." msgstr "" -#: ../../library/curses.rst:734 +#: ../../library/curses.rst:732 msgid "" "Paint the character string *str* at ``(y, x)`` with attributes *attr*, " "overwriting anything previously on the display." msgstr "" -#: ../../library/curses.rst:739 +#: ../../library/curses.rst:737 msgid "" "Writing outside the window, subwindow, or pad raises :exc:`curses.error`. " "Attempting to write to the lower right corner of a window, subwindow, or pad " "will cause an exception to be raised after the string is printed." msgstr "" -#: ../../library/curses.rst:743 +#: ../../library/curses.rst:741 msgid "" "A `bug in ncurses `_, the backend for " "this Python module, can cause SegFaults when resizing windows. This is fixed " @@ -813,44 +812,44 @@ msgid "" "line." msgstr "" -#: ../../library/curses.rst:753 +#: ../../library/curses.rst:751 msgid "" "Remove attribute *attr* from the \"background\" set applied to all writes to " "the current window." msgstr "" -#: ../../library/curses.rst:759 +#: ../../library/curses.rst:757 msgid "" "Add attribute *attr* from the \"background\" set applied to all writes to " "the current window." msgstr "" -#: ../../library/curses.rst:765 +#: ../../library/curses.rst:763 msgid "" "Set the \"background\" set of attributes to *attr*. This set is initially " "``0`` (no attributes)." msgstr "" -#: ../../library/curses.rst:771 +#: ../../library/curses.rst:769 msgid "" "Set the background property of the window to the character *ch*, with " "attributes *attr*. The change is then applied to every character position " "in that window:" msgstr "" -#: ../../library/curses.rst:775 +#: ../../library/curses.rst:773 msgid "" "The attribute of every character in the window is changed to the new " "background attribute." msgstr "" -#: ../../library/curses.rst:778 +#: ../../library/curses.rst:776 msgid "" "Wherever the former background character appears, it is changed to the new " "background character." msgstr "" -#: ../../library/curses.rst:784 +#: ../../library/curses.rst:782 msgid "" "Set the window's background. A window's background consists of a character " "and any combination of attributes. The attribute part of the background is " @@ -861,128 +860,128 @@ msgid "" "delete line/character operations." msgstr "" -#: ../../library/curses.rst:794 +#: ../../library/curses.rst:792 msgid "" "Draw a border around the edges of the window. Each parameter specifies the " "character to use for a specific part of the border; see the table below for " "more details." msgstr "" -#: ../../library/curses.rst:800 +#: ../../library/curses.rst:798 msgid "" "A ``0`` value for any parameter will cause the default character to be used " "for that parameter. Keyword parameters can *not* be used. The defaults are " "listed in this table:" msgstr "" -#: ../../library/curses.rst:805 +#: ../../library/curses.rst:803 msgid "Parameter" msgstr "" -#: ../../library/curses.rst:805 +#: ../../library/curses.rst:803 msgid "Description" msgstr "描述" -#: ../../library/curses.rst:805 +#: ../../library/curses.rst:803 msgid "Default value" msgstr "" -#: ../../library/curses.rst:807 +#: ../../library/curses.rst:805 msgid "*ls*" msgstr "" -#: ../../library/curses.rst:807 +#: ../../library/curses.rst:805 msgid "Left side" msgstr "" -#: ../../library/curses.rst:807 ../../library/curses.rst:809 +#: ../../library/curses.rst:805 ../../library/curses.rst:807 msgid ":const:`ACS_VLINE`" msgstr "" -#: ../../library/curses.rst:809 +#: ../../library/curses.rst:807 msgid "*rs*" msgstr "" -#: ../../library/curses.rst:809 +#: ../../library/curses.rst:807 msgid "Right side" msgstr "" -#: ../../library/curses.rst:811 +#: ../../library/curses.rst:809 msgid "*ts*" msgstr "" -#: ../../library/curses.rst:811 +#: ../../library/curses.rst:809 msgid "Top" msgstr "" -#: ../../library/curses.rst:811 ../../library/curses.rst:813 +#: ../../library/curses.rst:809 ../../library/curses.rst:811 msgid ":const:`ACS_HLINE`" msgstr "" -#: ../../library/curses.rst:813 +#: ../../library/curses.rst:811 msgid "*bs*" msgstr "" -#: ../../library/curses.rst:813 +#: ../../library/curses.rst:811 msgid "Bottom" msgstr "" -#: ../../library/curses.rst:815 +#: ../../library/curses.rst:813 msgid "*tl*" msgstr "" -#: ../../library/curses.rst:815 +#: ../../library/curses.rst:813 msgid "Upper-left corner" msgstr "" -#: ../../library/curses.rst:815 +#: ../../library/curses.rst:813 msgid ":const:`ACS_ULCORNER`" msgstr "" -#: ../../library/curses.rst:817 +#: ../../library/curses.rst:815 msgid "*tr*" msgstr "" -#: ../../library/curses.rst:817 +#: ../../library/curses.rst:815 msgid "Upper-right corner" msgstr "" -#: ../../library/curses.rst:817 +#: ../../library/curses.rst:815 msgid ":const:`ACS_URCORNER`" msgstr "" -#: ../../library/curses.rst:819 +#: ../../library/curses.rst:817 msgid "*bl*" msgstr "" -#: ../../library/curses.rst:819 +#: ../../library/curses.rst:817 msgid "Bottom-left corner" msgstr "" -#: ../../library/curses.rst:819 +#: ../../library/curses.rst:817 msgid ":const:`ACS_LLCORNER`" msgstr "" -#: ../../library/curses.rst:821 +#: ../../library/curses.rst:819 msgid "*br*" msgstr "" -#: ../../library/curses.rst:821 +#: ../../library/curses.rst:819 msgid "Bottom-right corner" msgstr "" -#: ../../library/curses.rst:821 +#: ../../library/curses.rst:819 msgid ":const:`ACS_LRCORNER`" msgstr "" -#: ../../library/curses.rst:827 +#: ../../library/curses.rst:825 msgid "" "Similar to :meth:`border`, but both *ls* and *rs* are *vertch* and both *ts* " "and *bs* are *horch*. The default corner characters are always used by this " "function." msgstr "" -#: ../../library/curses.rst:836 +#: ../../library/curses.rst:834 msgid "" "Set the attributes of *num* characters at the current cursor position, or at " "position ``(y, x)`` if supplied. If *num* is not given or is ``-1``, the " @@ -992,45 +991,45 @@ msgid "" "be redisplayed by the next window refresh." msgstr "" -#: ../../library/curses.rst:846 +#: ../../library/curses.rst:844 msgid "" "Like :meth:`erase`, but also cause the whole window to be repainted upon " "next call to :meth:`refresh`." msgstr "" -#: ../../library/curses.rst:852 +#: ../../library/curses.rst:850 msgid "" "If *flag* is ``True``, the next call to :meth:`refresh` will clear the " "window completely." msgstr "" -#: ../../library/curses.rst:858 +#: ../../library/curses.rst:856 msgid "" "Erase from cursor to the end of the window: all lines below the cursor are " "deleted, and then the equivalent of :meth:`clrtoeol` is performed." msgstr "" -#: ../../library/curses.rst:864 +#: ../../library/curses.rst:862 msgid "Erase from cursor to the end of the line." msgstr "" -#: ../../library/curses.rst:869 +#: ../../library/curses.rst:867 msgid "" "Update the current cursor position of all the ancestors of the window to " "reflect the current cursor position of the window." msgstr "" -#: ../../library/curses.rst:875 +#: ../../library/curses.rst:873 msgid "Delete any character at ``(y, x)``." msgstr "" -#: ../../library/curses.rst:880 +#: ../../library/curses.rst:878 msgid "" "Delete the line under the cursor. All following lines are moved up by one " "line." msgstr "" -#: ../../library/curses.rst:886 +#: ../../library/curses.rst:884 msgid "" "An abbreviation for \"derive window\", :meth:`derwin` is the same as " "calling :meth:`subwin`, except that *begin_y* and *begin_x* are relative to " @@ -1038,13 +1037,13 @@ msgid "" "a window object for the derived window." msgstr "" -#: ../../library/curses.rst:894 +#: ../../library/curses.rst:892 msgid "" "Add character *ch* with attribute *attr*, and immediately call :meth:" "`refresh` on the window." msgstr "" -#: ../../library/curses.rst:900 +#: ../../library/curses.rst:898 msgid "" "Test whether the given pair of screen-relative character-cell coordinates " "are enclosed by the given window, returning ``True`` or ``False``. It is " @@ -1052,7 +1051,7 @@ msgid "" "location of a mouse event." msgstr "" -#: ../../library/curses.rst:908 +#: ../../library/curses.rst:906 msgid "" "Encoding used to encode method arguments (Unicode strings and characters). " "The encoding attribute is inherited from the parent window when a subwindow " @@ -1060,19 +1059,19 @@ msgid "" "encoding is used (see :func:`locale.getpreferredencoding`)." msgstr "" -#: ../../library/curses.rst:918 +#: ../../library/curses.rst:916 msgid "Clear the window." msgstr "" -#: ../../library/curses.rst:923 +#: ../../library/curses.rst:921 msgid "Return a tuple ``(y, x)`` of co-ordinates of upper-left corner." msgstr "" -#: ../../library/curses.rst:928 +#: ../../library/curses.rst:926 msgid "Return the given window's current background character/attribute pair." msgstr "" -#: ../../library/curses.rst:933 +#: ../../library/curses.rst:931 msgid "" "Get a character. Note that the integer returned does *not* have to be in " "ASCII range: function keys, keypad keys and so on are represented by numbers " @@ -1080,14 +1079,14 @@ msgid "" "otherwise wait until a key is pressed." msgstr "" -#: ../../library/curses.rst:941 +#: ../../library/curses.rst:939 msgid "" "Get a wide character. Return a character for most keys, or an integer for " "function keys, keypad keys, and other special keys. In no-delay mode, raise " "an exception if there is no input." msgstr "" -#: ../../library/curses.rst:950 +#: ../../library/curses.rst:948 msgid "" "Get a character, returning a string instead of an integer, as :meth:`getch` " "does. Function keys, keypad keys and other special keys return a multibyte " @@ -1095,35 +1094,35 @@ msgid "" "there is no input." msgstr "" -#: ../../library/curses.rst:958 +#: ../../library/curses.rst:956 msgid "Return a tuple ``(y, x)`` of the height and width of the window." msgstr "" -#: ../../library/curses.rst:963 +#: ../../library/curses.rst:961 msgid "" "Return the beginning coordinates of this window relative to its parent " "window as a tuple ``(y, x)``. Return ``(-1, -1)`` if this window has no " "parent." msgstr "" -#: ../../library/curses.rst:973 +#: ../../library/curses.rst:971 msgid "" "Read a bytes object from the user, with primitive line editing capacity." msgstr "" -#: ../../library/curses.rst:978 +#: ../../library/curses.rst:976 msgid "" "Return a tuple ``(y, x)`` of current cursor position relative to the " "window's upper-left corner." msgstr "" -#: ../../library/curses.rst:985 +#: ../../library/curses.rst:983 msgid "" "Display a horizontal line starting at ``(y, x)`` with length *n* consisting " "of the character *ch*." msgstr "" -#: ../../library/curses.rst:991 +#: ../../library/curses.rst:989 msgid "" "If *flag* is ``False``, curses no longer considers using the hardware insert/" "delete character feature of the terminal; if *flag* is ``True``, use of " @@ -1131,13 +1130,13 @@ msgid "" "initialized, use of character insert/delete is enabled by default." msgstr "" -#: ../../library/curses.rst:999 +#: ../../library/curses.rst:997 msgid "" "If *flag* is ``True``, :mod:`curses` will try and use hardware line editing " "facilities. Otherwise, line insertion/deletion are disabled." msgstr "" -#: ../../library/curses.rst:1005 +#: ../../library/curses.rst:1003 msgid "" "If *flag* is ``True``, any change in the window image automatically causes " "the window to be refreshed; you no longer have to call :meth:`refresh` " @@ -1145,19 +1144,19 @@ msgid "" "calls to wrefresh. This option is disabled by default." msgstr "" -#: ../../library/curses.rst:1013 +#: ../../library/curses.rst:1011 msgid "" "Return the character at the given position in the window. The bottom 8 bits " "are the character proper, and upper bits are the attributes." msgstr "" -#: ../../library/curses.rst:1020 +#: ../../library/curses.rst:1018 msgid "" "Paint character *ch* at ``(y, x)`` with attributes *attr*, moving the line " "from position *x* right by one character." msgstr "" -#: ../../library/curses.rst:1026 +#: ../../library/curses.rst:1024 msgid "" "Insert *nlines* lines into the specified window above the current line. The " "*nlines* bottom lines are lost. For negative *nlines*, delete *nlines* " @@ -1166,13 +1165,13 @@ msgid "" "remains the same." msgstr "" -#: ../../library/curses.rst:1035 +#: ../../library/curses.rst:1033 msgid "" "Insert a blank line under the cursor. All following lines are moved down by " "one line." msgstr "" -#: ../../library/curses.rst:1042 +#: ../../library/curses.rst:1040 msgid "" "Insert a character string (as many characters as will fit on the line) " "before the character under the cursor, up to *n* characters. If *n* is " @@ -1182,7 +1181,7 @@ msgid "" "if specified)." msgstr "" -#: ../../library/curses.rst:1052 +#: ../../library/curses.rst:1050 msgid "" "Insert a character string (as many characters as will fit on the line) " "before the character under the cursor. All characters to the right of the " @@ -1191,7 +1190,7 @@ msgid "" "specified)." msgstr "" -#: ../../library/curses.rst:1061 +#: ../../library/curses.rst:1059 msgid "" "Return a bytes object of characters, extracted from the window starting at " "the current cursor position, or at *y*, *x* if specified. Attributes are " @@ -1199,76 +1198,76 @@ msgid "" "string at most *n* characters long (exclusive of the trailing NUL)." msgstr "" -#: ../../library/curses.rst:1069 +#: ../../library/curses.rst:1067 msgid "" "Return ``True`` if the specified line was modified since the last call to :" "meth:`refresh`; otherwise return ``False``. Raise a :exc:`curses.error` " "exception if *line* is not valid for the given window." msgstr "" -#: ../../library/curses.rst:1076 +#: ../../library/curses.rst:1074 msgid "" "Return ``True`` if the specified window was modified since the last call to :" "meth:`refresh`; otherwise return ``False``." msgstr "" -#: ../../library/curses.rst:1082 +#: ../../library/curses.rst:1080 msgid "" "If *flag* is ``True``, escape sequences generated by some keys (keypad, " "function keys) will be interpreted by :mod:`curses`. If *flag* is ``False``, " "escape sequences will be left as is in the input stream." msgstr "" -#: ../../library/curses.rst:1089 +#: ../../library/curses.rst:1087 msgid "" "If *flag* is ``True``, cursor is left where it is on update, instead of " "being at \"cursor position.\" This reduces cursor movement where possible. " "If possible the cursor will be made invisible." msgstr "" -#: ../../library/curses.rst:1093 +#: ../../library/curses.rst:1091 msgid "" "If *flag* is ``False``, cursor will always be at \"cursor position\" after " "an update." msgstr "" -#: ../../library/curses.rst:1098 +#: ../../library/curses.rst:1096 msgid "Move cursor to ``(new_y, new_x)``." msgstr "" -#: ../../library/curses.rst:1103 +#: ../../library/curses.rst:1101 msgid "" "Move the window inside its parent window. The screen-relative parameters of " "the window are not changed. This routine is used to display different parts " "of the parent window at the same physical position on the screen." msgstr "" -#: ../../library/curses.rst:1110 +#: ../../library/curses.rst:1108 msgid "Move the window so its upper-left corner is at ``(new_y, new_x)``." msgstr "" -#: ../../library/curses.rst:1115 +#: ../../library/curses.rst:1113 msgid "If *flag* is ``True``, :meth:`getch` will be non-blocking." msgstr "" -#: ../../library/curses.rst:1120 +#: ../../library/curses.rst:1118 msgid "If *flag* is ``True``, escape sequences will not be timed out." msgstr "" -#: ../../library/curses.rst:1122 +#: ../../library/curses.rst:1120 msgid "" "If *flag* is ``False``, after a few milliseconds, an escape sequence will " "not be interpreted, and will be left in the input stream as is." msgstr "" -#: ../../library/curses.rst:1128 +#: ../../library/curses.rst:1126 msgid "" "Mark for refresh but wait. This function updates the data structure " "representing the desired state of the window, but does not force an update " "of the physical screen. To accomplish that, call :func:`doupdate`." msgstr "" -#: ../../library/curses.rst:1135 +#: ../../library/curses.rst:1133 msgid "" "Overlay the window on top of *destwin*. The windows need not be the same " "size, only the overlapping region is copied. This copy is non-destructive, " @@ -1276,7 +1275,7 @@ msgid "" "contents of *destwin*." msgstr "" -#: ../../library/curses.rst:1140 +#: ../../library/curses.rst:1138 msgid "" "To get fine-grained control over the copied region, the second form of :meth:" "`overlay` can be used. *sminrow* and *smincol* are the upper-left " @@ -1284,7 +1283,7 @@ msgid "" "in the destination window." msgstr "" -#: ../../library/curses.rst:1148 +#: ../../library/curses.rst:1146 msgid "" "Overwrite the window on top of *destwin*. The windows need not be the same " "size, in which case only the overlapping region is copied. This copy is " @@ -1292,7 +1291,7 @@ msgid "" "the old contents of *destwin*." msgstr "" -#: ../../library/curses.rst:1153 +#: ../../library/curses.rst:1151 msgid "" "To get fine-grained control over the copied region, the second form of :meth:" "`overwrite` can be used. *sminrow* and *smincol* are the upper-left " @@ -1300,31 +1299,31 @@ msgid "" "the destination window." msgstr "" -#: ../../library/curses.rst:1161 +#: ../../library/curses.rst:1159 msgid "" "Write all data associated with the window into the provided file object. " "This information can be later retrieved using the :func:`getwin` function." msgstr "" -#: ../../library/curses.rst:1167 +#: ../../library/curses.rst:1165 msgid "" "Indicate that the *num* screen lines, starting at line *beg*, are corrupted " "and should be completely redrawn on the next :meth:`refresh` call." msgstr "" -#: ../../library/curses.rst:1173 +#: ../../library/curses.rst:1171 msgid "" "Touch the entire window, causing it to be completely redrawn on the next :" "meth:`refresh` call." msgstr "" -#: ../../library/curses.rst:1179 +#: ../../library/curses.rst:1177 msgid "" "Update the display immediately (sync actual screen with previous drawing/" "deleting methods)." msgstr "" -#: ../../library/curses.rst:1182 +#: ../../library/curses.rst:1180 msgid "" "The 6 optional arguments can only be specified when the window is a pad " "created with :func:`newpad`. The additional parameters are needed to " @@ -1339,7 +1338,7 @@ msgid "" "*smincol* are treated as if they were zero." msgstr "" -#: ../../library/curses.rst:1196 +#: ../../library/curses.rst:1194 msgid "" "Reallocate storage for a curses window to adjust its dimensions to the " "specified values. If either dimension is larger than the current values, " @@ -1347,11 +1346,11 @@ msgid "" "rendition (as set by :meth:`bkgdset`) merged into them." msgstr "" -#: ../../library/curses.rst:1204 +#: ../../library/curses.rst:1202 msgid "Scroll the screen or scrolling region upward by *lines* lines." msgstr "" -#: ../../library/curses.rst:1209 +#: ../../library/curses.rst:1207 msgid "" "Control what happens when the cursor of a window is moved off the edge of " "the window or scrolling region, either as a result of a newline action on " @@ -1361,54 +1360,54 @@ msgid "" "scrolling effect on the terminal, it is also necessary to call :meth:`idlok`." msgstr "" -#: ../../library/curses.rst:1219 +#: ../../library/curses.rst:1217 msgid "" "Set the scrolling region from line *top* to line *bottom*. All scrolling " "actions will take place in this region." msgstr "" -#: ../../library/curses.rst:1225 +#: ../../library/curses.rst:1223 msgid "" "Turn off the standout attribute. On some terminals this has the side effect " "of turning off all attributes." msgstr "" -#: ../../library/curses.rst:1231 +#: ../../library/curses.rst:1229 msgid "Turn on attribute *A_STANDOUT*." msgstr "" -#: ../../library/curses.rst:1237 ../../library/curses.rst:1244 +#: ../../library/curses.rst:1235 ../../library/curses.rst:1242 msgid "" "Return a sub-window, whose upper-left corner is at ``(begin_y, begin_x)``, " "and whose width/height is *ncols*/*nlines*." msgstr "" -#: ../../library/curses.rst:1247 +#: ../../library/curses.rst:1245 msgid "" "By default, the sub-window will extend from the specified position to the " "lower right corner of the window." msgstr "" -#: ../../library/curses.rst:1253 +#: ../../library/curses.rst:1251 msgid "" "Touch each location in the window that has been touched in any of its " "ancestor windows. This routine is called by :meth:`refresh`, so it should " "almost never be necessary to call it manually." msgstr "" -#: ../../library/curses.rst:1260 +#: ../../library/curses.rst:1258 msgid "" "If *flag* is ``True``, then :meth:`syncup` is called automatically whenever " "there is a change in the window." msgstr "" -#: ../../library/curses.rst:1266 +#: ../../library/curses.rst:1264 msgid "" "Touch all locations in ancestors of the window that have been changed in " "the window." msgstr "" -#: ../../library/curses.rst:1272 +#: ../../library/curses.rst:1270 msgid "" "Set blocking or non-blocking read behavior for the window. If *delay* is " "negative, blocking read is used (which will wait indefinitely for input). " @@ -1418,7 +1417,7 @@ msgid "" "still no input at the end of that time." msgstr "" -#: ../../library/curses.rst:1282 +#: ../../library/curses.rst:1280 msgid "" "Pretend *count* lines have been changed, starting with line *start*. If " "*changed* is supplied, it specifies whether the affected lines are marked as " @@ -1426,51 +1425,51 @@ msgid "" "``=False``)." msgstr "" -#: ../../library/curses.rst:1289 +#: ../../library/curses.rst:1287 msgid "" "Pretend the whole window has been changed, for purposes of drawing " "optimizations." msgstr "" -#: ../../library/curses.rst:1295 +#: ../../library/curses.rst:1293 msgid "" "Mark all lines in the window as unchanged since the last call to :meth:" "`refresh`." msgstr "" -#: ../../library/curses.rst:1302 +#: ../../library/curses.rst:1300 msgid "" "Display a vertical line starting at ``(y, x)`` with length *n* consisting of " "the character *ch*." msgstr "" -#: ../../library/curses.rst:1307 +#: ../../library/curses.rst:1305 msgid "Constants" msgstr "" -#: ../../library/curses.rst:1309 +#: ../../library/curses.rst:1307 msgid "The :mod:`curses` module defines the following data members:" msgstr "" -#: ../../library/curses.rst:1314 +#: ../../library/curses.rst:1312 msgid "" "Some curses routines that return an integer, such as :meth:`~window." "getch`, return :const:`ERR` upon failure." msgstr "" -#: ../../library/curses.rst:1320 +#: ../../library/curses.rst:1318 msgid "" "Some curses routines that return an integer, such as :func:`napms`, " "return :const:`OK` upon success." msgstr "" -#: ../../library/curses.rst:1326 +#: ../../library/curses.rst:1324 msgid "" "A bytes object representing the current version of the module. Also " "available as :const:`__version__`." msgstr "" -#: ../../library/curses.rst:1332 +#: ../../library/curses.rst:1330 msgid "" "A named tuple containing the three components of the ncurses library " "version: *major*, *minor*, and *patch*. All values are integers. The " @@ -1478,966 +1477,966 @@ msgid "" "is equivalent to ``curses.ncurses_version.major`` and so on." msgstr "" -#: ../../library/curses.rst:1337 +#: ../../library/curses.rst:1335 msgid "Availability: if the ncurses library is used." msgstr "" -#: ../../library/curses.rst:1342 +#: ../../library/curses.rst:1340 msgid "" "Some constants are available to specify character cell attributes. The exact " "constants available are system dependent." msgstr "" -#: ../../library/curses.rst:1346 +#: ../../library/curses.rst:1344 msgid "Attribute" msgstr "" -#: ../../library/curses.rst:1346 ../../library/curses.rst:1394 -#: ../../library/curses.rst:1638 +#: ../../library/curses.rst:1344 ../../library/curses.rst:1392 +#: ../../library/curses.rst:1636 msgid "Meaning" msgstr "" -#: ../../library/curses.rst:1348 +#: ../../library/curses.rst:1346 msgid "``A_ALTCHARSET``" msgstr "" -#: ../../library/curses.rst:1348 +#: ../../library/curses.rst:1346 msgid "Alternate character set mode" msgstr "" -#: ../../library/curses.rst:1350 +#: ../../library/curses.rst:1348 msgid "``A_BLINK``" msgstr "" -#: ../../library/curses.rst:1350 +#: ../../library/curses.rst:1348 msgid "Blink mode" msgstr "" -#: ../../library/curses.rst:1352 +#: ../../library/curses.rst:1350 msgid "``A_BOLD``" msgstr "" -#: ../../library/curses.rst:1352 +#: ../../library/curses.rst:1350 msgid "Bold mode" msgstr "" -#: ../../library/curses.rst:1354 +#: ../../library/curses.rst:1352 msgid "``A_DIM``" msgstr "" -#: ../../library/curses.rst:1354 +#: ../../library/curses.rst:1352 msgid "Dim mode" msgstr "" -#: ../../library/curses.rst:1356 +#: ../../library/curses.rst:1354 msgid "``A_INVIS``" msgstr "" -#: ../../library/curses.rst:1356 +#: ../../library/curses.rst:1354 msgid "Invisible or blank mode" msgstr "" -#: ../../library/curses.rst:1358 +#: ../../library/curses.rst:1356 msgid "``A_ITALIC``" msgstr "" -#: ../../library/curses.rst:1358 +#: ../../library/curses.rst:1356 msgid "Italic mode" msgstr "" -#: ../../library/curses.rst:1360 +#: ../../library/curses.rst:1358 msgid "``A_NORMAL``" msgstr "" -#: ../../library/curses.rst:1360 +#: ../../library/curses.rst:1358 msgid "Normal attribute" msgstr "" -#: ../../library/curses.rst:1362 +#: ../../library/curses.rst:1360 msgid "``A_PROTECT``" msgstr "" -#: ../../library/curses.rst:1362 +#: ../../library/curses.rst:1360 msgid "Protected mode" msgstr "" -#: ../../library/curses.rst:1364 +#: ../../library/curses.rst:1362 msgid "``A_REVERSE``" msgstr "" -#: ../../library/curses.rst:1364 +#: ../../library/curses.rst:1362 msgid "Reverse background and foreground colors" msgstr "" -#: ../../library/curses.rst:1367 +#: ../../library/curses.rst:1365 msgid "``A_STANDOUT``" msgstr "" -#: ../../library/curses.rst:1367 +#: ../../library/curses.rst:1365 msgid "Standout mode" msgstr "" -#: ../../library/curses.rst:1369 +#: ../../library/curses.rst:1367 msgid "``A_UNDERLINE``" msgstr "" -#: ../../library/curses.rst:1369 +#: ../../library/curses.rst:1367 msgid "Underline mode" msgstr "" -#: ../../library/curses.rst:1371 +#: ../../library/curses.rst:1369 msgid "``A_HORIZONTAL``" msgstr "" -#: ../../library/curses.rst:1371 +#: ../../library/curses.rst:1369 msgid "Horizontal highlight" msgstr "" -#: ../../library/curses.rst:1373 +#: ../../library/curses.rst:1371 msgid "``A_LEFT``" msgstr "" -#: ../../library/curses.rst:1373 +#: ../../library/curses.rst:1371 msgid "Left highlight" msgstr "" -#: ../../library/curses.rst:1375 +#: ../../library/curses.rst:1373 msgid "``A_LOW``" msgstr "" -#: ../../library/curses.rst:1375 +#: ../../library/curses.rst:1373 msgid "Low highlight" msgstr "" -#: ../../library/curses.rst:1377 +#: ../../library/curses.rst:1375 msgid "``A_RIGHT``" msgstr "" -#: ../../library/curses.rst:1377 +#: ../../library/curses.rst:1375 msgid "Right highlight" msgstr "" -#: ../../library/curses.rst:1379 +#: ../../library/curses.rst:1377 msgid "``A_TOP``" msgstr "" -#: ../../library/curses.rst:1379 +#: ../../library/curses.rst:1377 msgid "Top highlight" msgstr "" -#: ../../library/curses.rst:1381 +#: ../../library/curses.rst:1379 msgid "``A_VERTICAL``" msgstr "" -#: ../../library/curses.rst:1381 +#: ../../library/curses.rst:1379 msgid "Vertical highlight" msgstr "" -#: ../../library/curses.rst:1383 ../../library/curses.rst:1399 +#: ../../library/curses.rst:1381 ../../library/curses.rst:1397 msgid "``A_CHARTEXT``" msgstr "" -#: ../../library/curses.rst:1383 ../../library/curses.rst:1399 +#: ../../library/curses.rst:1381 ../../library/curses.rst:1397 msgid "Bit-mask to extract a character" msgstr "" -#: ../../library/curses.rst:1387 +#: ../../library/curses.rst:1385 msgid "``A_ITALIC`` was added." msgstr "" -#: ../../library/curses.rst:1390 +#: ../../library/curses.rst:1388 msgid "" "Several constants are available to extract corresponding attributes returned " "by some methods." msgstr "" -#: ../../library/curses.rst:1394 +#: ../../library/curses.rst:1392 msgid "Bit-mask" msgstr "" -#: ../../library/curses.rst:1396 +#: ../../library/curses.rst:1394 msgid "``A_ATTRIBUTES``" msgstr "" -#: ../../library/curses.rst:1396 +#: ../../library/curses.rst:1394 msgid "Bit-mask to extract attributes" msgstr "" -#: ../../library/curses.rst:1402 +#: ../../library/curses.rst:1400 msgid "``A_COLOR``" msgstr "" -#: ../../library/curses.rst:1402 +#: ../../library/curses.rst:1400 msgid "Bit-mask to extract color-pair field information" msgstr "" -#: ../../library/curses.rst:1406 +#: ../../library/curses.rst:1404 msgid "" "Keys are referred to by integer constants with names starting with " "``KEY_``. The exact keycaps available are system dependent." msgstr "" -#: ../../library/curses.rst:1412 +#: ../../library/curses.rst:1410 msgid "Key constant" msgstr "" -#: ../../library/curses.rst:1412 +#: ../../library/curses.rst:1410 msgid "Key" msgstr "" -#: ../../library/curses.rst:1414 +#: ../../library/curses.rst:1412 msgid "``KEY_MIN``" msgstr "" -#: ../../library/curses.rst:1414 +#: ../../library/curses.rst:1412 msgid "Minimum key value" msgstr "" -#: ../../library/curses.rst:1416 +#: ../../library/curses.rst:1414 msgid "``KEY_BREAK``" msgstr "" -#: ../../library/curses.rst:1416 +#: ../../library/curses.rst:1414 msgid "Break key (unreliable)" msgstr "" -#: ../../library/curses.rst:1418 +#: ../../library/curses.rst:1416 msgid "``KEY_DOWN``" msgstr "" -#: ../../library/curses.rst:1418 +#: ../../library/curses.rst:1416 msgid "Down-arrow" msgstr "" -#: ../../library/curses.rst:1420 +#: ../../library/curses.rst:1418 msgid "``KEY_UP``" msgstr "" -#: ../../library/curses.rst:1420 +#: ../../library/curses.rst:1418 msgid "Up-arrow" msgstr "" -#: ../../library/curses.rst:1422 +#: ../../library/curses.rst:1420 msgid "``KEY_LEFT``" msgstr "" -#: ../../library/curses.rst:1422 +#: ../../library/curses.rst:1420 msgid "Left-arrow" msgstr "" -#: ../../library/curses.rst:1424 +#: ../../library/curses.rst:1422 msgid "``KEY_RIGHT``" msgstr "" -#: ../../library/curses.rst:1424 +#: ../../library/curses.rst:1422 msgid "Right-arrow" msgstr "" -#: ../../library/curses.rst:1426 +#: ../../library/curses.rst:1424 msgid "``KEY_HOME``" msgstr "" -#: ../../library/curses.rst:1426 +#: ../../library/curses.rst:1424 msgid "Home key (upward+left arrow)" msgstr "" -#: ../../library/curses.rst:1428 +#: ../../library/curses.rst:1426 msgid "``KEY_BACKSPACE``" msgstr "" -#: ../../library/curses.rst:1428 +#: ../../library/curses.rst:1426 msgid "Backspace (unreliable)" msgstr "" -#: ../../library/curses.rst:1430 +#: ../../library/curses.rst:1428 msgid "``KEY_F0``" msgstr "" -#: ../../library/curses.rst:1430 +#: ../../library/curses.rst:1428 msgid "Function keys. Up to 64 function keys are supported." msgstr "" -#: ../../library/curses.rst:1433 +#: ../../library/curses.rst:1431 msgid "``KEY_Fn``" msgstr "" -#: ../../library/curses.rst:1433 +#: ../../library/curses.rst:1431 msgid "Value of function key *n*" msgstr "" -#: ../../library/curses.rst:1435 +#: ../../library/curses.rst:1433 msgid "``KEY_DL``" msgstr "" -#: ../../library/curses.rst:1435 +#: ../../library/curses.rst:1433 msgid "Delete line" msgstr "" -#: ../../library/curses.rst:1437 +#: ../../library/curses.rst:1435 msgid "``KEY_IL``" msgstr "" -#: ../../library/curses.rst:1437 +#: ../../library/curses.rst:1435 msgid "Insert line" msgstr "" -#: ../../library/curses.rst:1439 +#: ../../library/curses.rst:1437 msgid "``KEY_DC``" msgstr "" -#: ../../library/curses.rst:1439 +#: ../../library/curses.rst:1437 msgid "Delete character" msgstr "" -#: ../../library/curses.rst:1441 +#: ../../library/curses.rst:1439 msgid "``KEY_IC``" msgstr "" -#: ../../library/curses.rst:1441 +#: ../../library/curses.rst:1439 msgid "Insert char or enter insert mode" msgstr "" -#: ../../library/curses.rst:1443 +#: ../../library/curses.rst:1441 msgid "``KEY_EIC``" msgstr "" -#: ../../library/curses.rst:1443 +#: ../../library/curses.rst:1441 msgid "Exit insert char mode" msgstr "" -#: ../../library/curses.rst:1445 +#: ../../library/curses.rst:1443 msgid "``KEY_CLEAR``" msgstr "" -#: ../../library/curses.rst:1445 +#: ../../library/curses.rst:1443 msgid "Clear screen" msgstr "" -#: ../../library/curses.rst:1447 +#: ../../library/curses.rst:1445 msgid "``KEY_EOS``" msgstr "" -#: ../../library/curses.rst:1447 +#: ../../library/curses.rst:1445 msgid "Clear to end of screen" msgstr "" -#: ../../library/curses.rst:1449 +#: ../../library/curses.rst:1447 msgid "``KEY_EOL``" msgstr "" -#: ../../library/curses.rst:1449 +#: ../../library/curses.rst:1447 msgid "Clear to end of line" msgstr "" -#: ../../library/curses.rst:1451 +#: ../../library/curses.rst:1449 msgid "``KEY_SF``" msgstr "" -#: ../../library/curses.rst:1451 +#: ../../library/curses.rst:1449 msgid "Scroll 1 line forward" msgstr "" -#: ../../library/curses.rst:1453 +#: ../../library/curses.rst:1451 msgid "``KEY_SR``" msgstr "" -#: ../../library/curses.rst:1453 +#: ../../library/curses.rst:1451 msgid "Scroll 1 line backward (reverse)" msgstr "" -#: ../../library/curses.rst:1455 +#: ../../library/curses.rst:1453 msgid "``KEY_NPAGE``" msgstr "" -#: ../../library/curses.rst:1455 +#: ../../library/curses.rst:1453 msgid "Next page" msgstr "" -#: ../../library/curses.rst:1457 +#: ../../library/curses.rst:1455 msgid "``KEY_PPAGE``" msgstr "" -#: ../../library/curses.rst:1457 +#: ../../library/curses.rst:1455 msgid "Previous page" msgstr "" -#: ../../library/curses.rst:1459 +#: ../../library/curses.rst:1457 msgid "``KEY_STAB``" msgstr "" -#: ../../library/curses.rst:1459 +#: ../../library/curses.rst:1457 msgid "Set tab" msgstr "" -#: ../../library/curses.rst:1461 +#: ../../library/curses.rst:1459 msgid "``KEY_CTAB``" msgstr "" -#: ../../library/curses.rst:1461 +#: ../../library/curses.rst:1459 msgid "Clear tab" msgstr "" -#: ../../library/curses.rst:1463 +#: ../../library/curses.rst:1461 msgid "``KEY_CATAB``" msgstr "" -#: ../../library/curses.rst:1463 +#: ../../library/curses.rst:1461 msgid "Clear all tabs" msgstr "" -#: ../../library/curses.rst:1465 +#: ../../library/curses.rst:1463 msgid "``KEY_ENTER``" msgstr "" -#: ../../library/curses.rst:1465 +#: ../../library/curses.rst:1463 msgid "Enter or send (unreliable)" msgstr "" -#: ../../library/curses.rst:1467 +#: ../../library/curses.rst:1465 msgid "``KEY_SRESET``" msgstr "" -#: ../../library/curses.rst:1467 +#: ../../library/curses.rst:1465 msgid "Soft (partial) reset (unreliable)" msgstr "" -#: ../../library/curses.rst:1469 +#: ../../library/curses.rst:1467 msgid "``KEY_RESET``" msgstr "" -#: ../../library/curses.rst:1469 +#: ../../library/curses.rst:1467 msgid "Reset or hard reset (unreliable)" msgstr "" -#: ../../library/curses.rst:1471 +#: ../../library/curses.rst:1469 msgid "``KEY_PRINT``" msgstr "" -#: ../../library/curses.rst:1471 +#: ../../library/curses.rst:1469 msgid "Print" msgstr "" -#: ../../library/curses.rst:1473 +#: ../../library/curses.rst:1471 msgid "``KEY_LL``" msgstr "" -#: ../../library/curses.rst:1473 +#: ../../library/curses.rst:1471 msgid "Home down or bottom (lower left)" msgstr "" -#: ../../library/curses.rst:1475 +#: ../../library/curses.rst:1473 msgid "``KEY_A1``" msgstr "" -#: ../../library/curses.rst:1475 +#: ../../library/curses.rst:1473 msgid "Upper left of keypad" msgstr "" -#: ../../library/curses.rst:1477 +#: ../../library/curses.rst:1475 msgid "``KEY_A3``" msgstr "" -#: ../../library/curses.rst:1477 +#: ../../library/curses.rst:1475 msgid "Upper right of keypad" msgstr "" -#: ../../library/curses.rst:1479 +#: ../../library/curses.rst:1477 msgid "``KEY_B2``" msgstr "" -#: ../../library/curses.rst:1479 +#: ../../library/curses.rst:1477 msgid "Center of keypad" msgstr "" -#: ../../library/curses.rst:1481 +#: ../../library/curses.rst:1479 msgid "``KEY_C1``" msgstr "" -#: ../../library/curses.rst:1481 +#: ../../library/curses.rst:1479 msgid "Lower left of keypad" msgstr "" -#: ../../library/curses.rst:1483 +#: ../../library/curses.rst:1481 msgid "``KEY_C3``" msgstr "" -#: ../../library/curses.rst:1483 +#: ../../library/curses.rst:1481 msgid "Lower right of keypad" msgstr "" -#: ../../library/curses.rst:1485 +#: ../../library/curses.rst:1483 msgid "``KEY_BTAB``" msgstr "" -#: ../../library/curses.rst:1485 +#: ../../library/curses.rst:1483 msgid "Back tab" msgstr "" -#: ../../library/curses.rst:1487 +#: ../../library/curses.rst:1485 msgid "``KEY_BEG``" msgstr "" -#: ../../library/curses.rst:1487 +#: ../../library/curses.rst:1485 msgid "Beg (beginning)" msgstr "" -#: ../../library/curses.rst:1489 +#: ../../library/curses.rst:1487 msgid "``KEY_CANCEL``" msgstr "" -#: ../../library/curses.rst:1489 +#: ../../library/curses.rst:1487 msgid "Cancel" msgstr "" -#: ../../library/curses.rst:1491 +#: ../../library/curses.rst:1489 msgid "``KEY_CLOSE``" msgstr "" -#: ../../library/curses.rst:1491 +#: ../../library/curses.rst:1489 msgid "Close" msgstr "" -#: ../../library/curses.rst:1493 +#: ../../library/curses.rst:1491 msgid "``KEY_COMMAND``" msgstr "" -#: ../../library/curses.rst:1493 +#: ../../library/curses.rst:1491 msgid "Cmd (command)" msgstr "" -#: ../../library/curses.rst:1495 +#: ../../library/curses.rst:1493 msgid "``KEY_COPY``" msgstr "" -#: ../../library/curses.rst:1495 +#: ../../library/curses.rst:1493 msgid "Copy" msgstr "" -#: ../../library/curses.rst:1497 +#: ../../library/curses.rst:1495 msgid "``KEY_CREATE``" msgstr "" -#: ../../library/curses.rst:1497 +#: ../../library/curses.rst:1495 msgid "Create" msgstr "" -#: ../../library/curses.rst:1499 +#: ../../library/curses.rst:1497 msgid "``KEY_END``" msgstr "" -#: ../../library/curses.rst:1499 +#: ../../library/curses.rst:1497 msgid "End" msgstr "" -#: ../../library/curses.rst:1501 +#: ../../library/curses.rst:1499 msgid "``KEY_EXIT``" msgstr "" -#: ../../library/curses.rst:1501 +#: ../../library/curses.rst:1499 msgid "Exit" msgstr "" -#: ../../library/curses.rst:1503 +#: ../../library/curses.rst:1501 msgid "``KEY_FIND``" msgstr "" -#: ../../library/curses.rst:1503 +#: ../../library/curses.rst:1501 msgid "Find" msgstr "" -#: ../../library/curses.rst:1505 +#: ../../library/curses.rst:1503 msgid "``KEY_HELP``" msgstr "" -#: ../../library/curses.rst:1505 +#: ../../library/curses.rst:1503 msgid "Help" msgstr "" -#: ../../library/curses.rst:1507 +#: ../../library/curses.rst:1505 msgid "``KEY_MARK``" msgstr "" -#: ../../library/curses.rst:1507 +#: ../../library/curses.rst:1505 msgid "Mark" msgstr "" -#: ../../library/curses.rst:1509 +#: ../../library/curses.rst:1507 msgid "``KEY_MESSAGE``" msgstr "" -#: ../../library/curses.rst:1509 +#: ../../library/curses.rst:1507 msgid "Message" msgstr "" -#: ../../library/curses.rst:1511 +#: ../../library/curses.rst:1509 msgid "``KEY_MOVE``" msgstr "" -#: ../../library/curses.rst:1511 +#: ../../library/curses.rst:1509 msgid "Move" msgstr "" -#: ../../library/curses.rst:1513 +#: ../../library/curses.rst:1511 msgid "``KEY_NEXT``" msgstr "" -#: ../../library/curses.rst:1513 +#: ../../library/curses.rst:1511 msgid "Next" msgstr "" -#: ../../library/curses.rst:1515 +#: ../../library/curses.rst:1513 msgid "``KEY_OPEN``" msgstr "" -#: ../../library/curses.rst:1515 +#: ../../library/curses.rst:1513 msgid "Open" msgstr "" -#: ../../library/curses.rst:1517 +#: ../../library/curses.rst:1515 msgid "``KEY_OPTIONS``" msgstr "" -#: ../../library/curses.rst:1517 +#: ../../library/curses.rst:1515 msgid "Options" msgstr "" -#: ../../library/curses.rst:1519 +#: ../../library/curses.rst:1517 msgid "``KEY_PREVIOUS``" msgstr "" -#: ../../library/curses.rst:1519 +#: ../../library/curses.rst:1517 msgid "Prev (previous)" msgstr "" -#: ../../library/curses.rst:1521 +#: ../../library/curses.rst:1519 msgid "``KEY_REDO``" msgstr "" -#: ../../library/curses.rst:1521 +#: ../../library/curses.rst:1519 msgid "Redo" msgstr "" -#: ../../library/curses.rst:1523 +#: ../../library/curses.rst:1521 msgid "``KEY_REFERENCE``" msgstr "" -#: ../../library/curses.rst:1523 +#: ../../library/curses.rst:1521 msgid "Ref (reference)" msgstr "" -#: ../../library/curses.rst:1525 +#: ../../library/curses.rst:1523 msgid "``KEY_REFRESH``" msgstr "" -#: ../../library/curses.rst:1525 +#: ../../library/curses.rst:1523 msgid "Refresh" msgstr "" -#: ../../library/curses.rst:1527 +#: ../../library/curses.rst:1525 msgid "``KEY_REPLACE``" msgstr "" -#: ../../library/curses.rst:1527 +#: ../../library/curses.rst:1525 msgid "Replace" msgstr "" -#: ../../library/curses.rst:1529 +#: ../../library/curses.rst:1527 msgid "``KEY_RESTART``" msgstr "" -#: ../../library/curses.rst:1529 +#: ../../library/curses.rst:1527 msgid "Restart" msgstr "" -#: ../../library/curses.rst:1531 +#: ../../library/curses.rst:1529 msgid "``KEY_RESUME``" msgstr "" -#: ../../library/curses.rst:1531 +#: ../../library/curses.rst:1529 msgid "Resume" msgstr "" -#: ../../library/curses.rst:1533 +#: ../../library/curses.rst:1531 msgid "``KEY_SAVE``" msgstr "" -#: ../../library/curses.rst:1533 +#: ../../library/curses.rst:1531 msgid "Save" msgstr "" -#: ../../library/curses.rst:1535 +#: ../../library/curses.rst:1533 msgid "``KEY_SBEG``" msgstr "" -#: ../../library/curses.rst:1535 +#: ../../library/curses.rst:1533 msgid "Shifted Beg (beginning)" msgstr "" -#: ../../library/curses.rst:1537 +#: ../../library/curses.rst:1535 msgid "``KEY_SCANCEL``" msgstr "" -#: ../../library/curses.rst:1537 +#: ../../library/curses.rst:1535 msgid "Shifted Cancel" msgstr "" -#: ../../library/curses.rst:1539 +#: ../../library/curses.rst:1537 msgid "``KEY_SCOMMAND``" msgstr "" -#: ../../library/curses.rst:1539 +#: ../../library/curses.rst:1537 msgid "Shifted Command" msgstr "" -#: ../../library/curses.rst:1541 +#: ../../library/curses.rst:1539 msgid "``KEY_SCOPY``" msgstr "" -#: ../../library/curses.rst:1541 +#: ../../library/curses.rst:1539 msgid "Shifted Copy" msgstr "" -#: ../../library/curses.rst:1543 +#: ../../library/curses.rst:1541 msgid "``KEY_SCREATE``" msgstr "" -#: ../../library/curses.rst:1543 +#: ../../library/curses.rst:1541 msgid "Shifted Create" msgstr "" -#: ../../library/curses.rst:1545 +#: ../../library/curses.rst:1543 msgid "``KEY_SDC``" msgstr "" -#: ../../library/curses.rst:1545 +#: ../../library/curses.rst:1543 msgid "Shifted Delete char" msgstr "" -#: ../../library/curses.rst:1547 +#: ../../library/curses.rst:1545 msgid "``KEY_SDL``" msgstr "" -#: ../../library/curses.rst:1547 +#: ../../library/curses.rst:1545 msgid "Shifted Delete line" msgstr "" -#: ../../library/curses.rst:1549 +#: ../../library/curses.rst:1547 msgid "``KEY_SELECT``" msgstr "" -#: ../../library/curses.rst:1549 +#: ../../library/curses.rst:1547 msgid "Select" msgstr "" -#: ../../library/curses.rst:1551 +#: ../../library/curses.rst:1549 msgid "``KEY_SEND``" msgstr "" -#: ../../library/curses.rst:1551 +#: ../../library/curses.rst:1549 msgid "Shifted End" msgstr "" -#: ../../library/curses.rst:1553 +#: ../../library/curses.rst:1551 msgid "``KEY_SEOL``" msgstr "" -#: ../../library/curses.rst:1553 +#: ../../library/curses.rst:1551 msgid "Shifted Clear line" msgstr "" -#: ../../library/curses.rst:1555 +#: ../../library/curses.rst:1553 msgid "``KEY_SEXIT``" msgstr "" -#: ../../library/curses.rst:1555 +#: ../../library/curses.rst:1553 msgid "Shifted Exit" msgstr "" -#: ../../library/curses.rst:1557 +#: ../../library/curses.rst:1555 msgid "``KEY_SFIND``" msgstr "" -#: ../../library/curses.rst:1557 +#: ../../library/curses.rst:1555 msgid "Shifted Find" msgstr "" -#: ../../library/curses.rst:1559 +#: ../../library/curses.rst:1557 msgid "``KEY_SHELP``" msgstr "" -#: ../../library/curses.rst:1559 +#: ../../library/curses.rst:1557 msgid "Shifted Help" msgstr "" -#: ../../library/curses.rst:1561 +#: ../../library/curses.rst:1559 msgid "``KEY_SHOME``" msgstr "" -#: ../../library/curses.rst:1561 +#: ../../library/curses.rst:1559 msgid "Shifted Home" msgstr "" -#: ../../library/curses.rst:1563 +#: ../../library/curses.rst:1561 msgid "``KEY_SIC``" msgstr "" -#: ../../library/curses.rst:1563 +#: ../../library/curses.rst:1561 msgid "Shifted Input" msgstr "" -#: ../../library/curses.rst:1565 +#: ../../library/curses.rst:1563 msgid "``KEY_SLEFT``" msgstr "" -#: ../../library/curses.rst:1565 +#: ../../library/curses.rst:1563 msgid "Shifted Left arrow" msgstr "" -#: ../../library/curses.rst:1567 +#: ../../library/curses.rst:1565 msgid "``KEY_SMESSAGE``" msgstr "" -#: ../../library/curses.rst:1567 +#: ../../library/curses.rst:1565 msgid "Shifted Message" msgstr "" -#: ../../library/curses.rst:1569 +#: ../../library/curses.rst:1567 msgid "``KEY_SMOVE``" msgstr "" -#: ../../library/curses.rst:1569 +#: ../../library/curses.rst:1567 msgid "Shifted Move" msgstr "" -#: ../../library/curses.rst:1571 +#: ../../library/curses.rst:1569 msgid "``KEY_SNEXT``" msgstr "" -#: ../../library/curses.rst:1571 +#: ../../library/curses.rst:1569 msgid "Shifted Next" msgstr "" -#: ../../library/curses.rst:1573 +#: ../../library/curses.rst:1571 msgid "``KEY_SOPTIONS``" msgstr "" -#: ../../library/curses.rst:1573 +#: ../../library/curses.rst:1571 msgid "Shifted Options" msgstr "" -#: ../../library/curses.rst:1575 +#: ../../library/curses.rst:1573 msgid "``KEY_SPREVIOUS``" msgstr "" -#: ../../library/curses.rst:1575 +#: ../../library/curses.rst:1573 msgid "Shifted Prev" msgstr "" -#: ../../library/curses.rst:1577 +#: ../../library/curses.rst:1575 msgid "``KEY_SPRINT``" msgstr "" -#: ../../library/curses.rst:1577 +#: ../../library/curses.rst:1575 msgid "Shifted Print" msgstr "" -#: ../../library/curses.rst:1579 +#: ../../library/curses.rst:1577 msgid "``KEY_SREDO``" msgstr "" -#: ../../library/curses.rst:1579 +#: ../../library/curses.rst:1577 msgid "Shifted Redo" msgstr "" -#: ../../library/curses.rst:1581 +#: ../../library/curses.rst:1579 msgid "``KEY_SREPLACE``" msgstr "" -#: ../../library/curses.rst:1581 +#: ../../library/curses.rst:1579 msgid "Shifted Replace" msgstr "" -#: ../../library/curses.rst:1583 +#: ../../library/curses.rst:1581 msgid "``KEY_SRIGHT``" msgstr "" -#: ../../library/curses.rst:1583 +#: ../../library/curses.rst:1581 msgid "Shifted Right arrow" msgstr "" -#: ../../library/curses.rst:1585 +#: ../../library/curses.rst:1583 msgid "``KEY_SRSUME``" msgstr "" -#: ../../library/curses.rst:1585 +#: ../../library/curses.rst:1583 msgid "Shifted Resume" msgstr "" -#: ../../library/curses.rst:1587 +#: ../../library/curses.rst:1585 msgid "``KEY_SSAVE``" msgstr "" -#: ../../library/curses.rst:1587 +#: ../../library/curses.rst:1585 msgid "Shifted Save" msgstr "" -#: ../../library/curses.rst:1589 +#: ../../library/curses.rst:1587 msgid "``KEY_SSUSPEND``" msgstr "" -#: ../../library/curses.rst:1589 +#: ../../library/curses.rst:1587 msgid "Shifted Suspend" msgstr "" -#: ../../library/curses.rst:1591 +#: ../../library/curses.rst:1589 msgid "``KEY_SUNDO``" msgstr "" -#: ../../library/curses.rst:1591 +#: ../../library/curses.rst:1589 msgid "Shifted Undo" msgstr "" -#: ../../library/curses.rst:1593 +#: ../../library/curses.rst:1591 msgid "``KEY_SUSPEND``" msgstr "" -#: ../../library/curses.rst:1593 +#: ../../library/curses.rst:1591 msgid "Suspend" msgstr "" -#: ../../library/curses.rst:1595 +#: ../../library/curses.rst:1593 msgid "``KEY_UNDO``" msgstr "" -#: ../../library/curses.rst:1595 +#: ../../library/curses.rst:1593 msgid "Undo" msgstr "" -#: ../../library/curses.rst:1597 +#: ../../library/curses.rst:1595 msgid "``KEY_MOUSE``" msgstr "" -#: ../../library/curses.rst:1597 +#: ../../library/curses.rst:1595 msgid "Mouse event has occurred" msgstr "" -#: ../../library/curses.rst:1599 +#: ../../library/curses.rst:1597 msgid "``KEY_RESIZE``" msgstr "" -#: ../../library/curses.rst:1599 +#: ../../library/curses.rst:1597 msgid "Terminal resize event" msgstr "" -#: ../../library/curses.rst:1601 +#: ../../library/curses.rst:1599 msgid "``KEY_MAX``" msgstr "" -#: ../../library/curses.rst:1601 +#: ../../library/curses.rst:1599 msgid "Maximum key value" msgstr "" -#: ../../library/curses.rst:1604 +#: ../../library/curses.rst:1602 msgid "" "On VT100s and their software emulations, such as X terminal emulators, there " "are normally at least four function keys (:const:`KEY_F1`, :const:`KEY_F2`, :" @@ -2448,64 +2447,64 @@ msgid "" "function keys); also, the following keypad mappings are standard:" msgstr "" -#: ../../library/curses.rst:1613 +#: ../../library/curses.rst:1611 msgid "Keycap" msgstr "" -#: ../../library/curses.rst:1613 ../../library/curses.rst:1730 -#: ../../library/curses.rst:1854 +#: ../../library/curses.rst:1611 ../../library/curses.rst:1728 +#: ../../library/curses.rst:1852 msgid "Constant" msgstr "" -#: ../../library/curses.rst:1615 +#: ../../library/curses.rst:1613 msgid ":kbd:`Insert`" msgstr "" -#: ../../library/curses.rst:1615 +#: ../../library/curses.rst:1613 msgid "KEY_IC" msgstr "" -#: ../../library/curses.rst:1617 +#: ../../library/curses.rst:1615 msgid ":kbd:`Delete`" msgstr "" -#: ../../library/curses.rst:1617 +#: ../../library/curses.rst:1615 msgid "KEY_DC" msgstr "" -#: ../../library/curses.rst:1619 +#: ../../library/curses.rst:1617 msgid ":kbd:`Home`" msgstr "" -#: ../../library/curses.rst:1619 +#: ../../library/curses.rst:1617 msgid "KEY_HOME" msgstr "" -#: ../../library/curses.rst:1621 +#: ../../library/curses.rst:1619 msgid ":kbd:`End`" msgstr "" -#: ../../library/curses.rst:1621 +#: ../../library/curses.rst:1619 msgid "KEY_END" msgstr "" -#: ../../library/curses.rst:1623 +#: ../../library/curses.rst:1621 msgid ":kbd:`Page Up`" msgstr "" -#: ../../library/curses.rst:1623 +#: ../../library/curses.rst:1621 msgid "KEY_PPAGE" msgstr "" -#: ../../library/curses.rst:1625 +#: ../../library/curses.rst:1623 msgid ":kbd:`Page Down`" msgstr "" -#: ../../library/curses.rst:1625 +#: ../../library/curses.rst:1623 msgid "KEY_NPAGE" msgstr "" -#: ../../library/curses.rst:1628 +#: ../../library/curses.rst:1626 msgid "" "The following table lists characters from the alternate character set. These " "are inherited from the VT100 terminal, and will generally be available on " @@ -2513,435 +2512,435 @@ msgid "" "available, curses falls back on a crude printable ASCII approximation." msgstr "" -#: ../../library/curses.rst:1635 +#: ../../library/curses.rst:1633 msgid "These are available only after :func:`initscr` has been called." msgstr "" -#: ../../library/curses.rst:1638 +#: ../../library/curses.rst:1636 msgid "ACS code" msgstr "" -#: ../../library/curses.rst:1640 +#: ../../library/curses.rst:1638 msgid "``ACS_BBSS``" msgstr "" -#: ../../library/curses.rst:1640 +#: ../../library/curses.rst:1638 msgid "alternate name for upper right corner" msgstr "" -#: ../../library/curses.rst:1642 +#: ../../library/curses.rst:1640 msgid "``ACS_BLOCK``" msgstr "" -#: ../../library/curses.rst:1642 +#: ../../library/curses.rst:1640 msgid "solid square block" msgstr "" -#: ../../library/curses.rst:1644 +#: ../../library/curses.rst:1642 msgid "``ACS_BOARD``" msgstr "" -#: ../../library/curses.rst:1644 +#: ../../library/curses.rst:1642 msgid "board of squares" msgstr "" -#: ../../library/curses.rst:1646 +#: ../../library/curses.rst:1644 msgid "``ACS_BSBS``" msgstr "" -#: ../../library/curses.rst:1646 +#: ../../library/curses.rst:1644 msgid "alternate name for horizontal line" msgstr "" -#: ../../library/curses.rst:1648 +#: ../../library/curses.rst:1646 msgid "``ACS_BSSB``" msgstr "" -#: ../../library/curses.rst:1648 +#: ../../library/curses.rst:1646 msgid "alternate name for upper left corner" msgstr "" -#: ../../library/curses.rst:1650 +#: ../../library/curses.rst:1648 msgid "``ACS_BSSS``" msgstr "" -#: ../../library/curses.rst:1650 +#: ../../library/curses.rst:1648 msgid "alternate name for top tee" msgstr "" -#: ../../library/curses.rst:1652 +#: ../../library/curses.rst:1650 msgid "``ACS_BTEE``" msgstr "" -#: ../../library/curses.rst:1652 +#: ../../library/curses.rst:1650 msgid "bottom tee" msgstr "" -#: ../../library/curses.rst:1654 +#: ../../library/curses.rst:1652 msgid "``ACS_BULLET``" msgstr "" -#: ../../library/curses.rst:1654 +#: ../../library/curses.rst:1652 msgid "bullet" msgstr "" -#: ../../library/curses.rst:1656 +#: ../../library/curses.rst:1654 msgid "``ACS_CKBOARD``" msgstr "" -#: ../../library/curses.rst:1656 +#: ../../library/curses.rst:1654 msgid "checker board (stipple)" msgstr "" -#: ../../library/curses.rst:1658 +#: ../../library/curses.rst:1656 msgid "``ACS_DARROW``" msgstr "" -#: ../../library/curses.rst:1658 +#: ../../library/curses.rst:1656 msgid "arrow pointing down" msgstr "" -#: ../../library/curses.rst:1660 +#: ../../library/curses.rst:1658 msgid "``ACS_DEGREE``" msgstr "" -#: ../../library/curses.rst:1660 +#: ../../library/curses.rst:1658 msgid "degree symbol" msgstr "" -#: ../../library/curses.rst:1662 +#: ../../library/curses.rst:1660 msgid "``ACS_DIAMOND``" msgstr "" -#: ../../library/curses.rst:1662 +#: ../../library/curses.rst:1660 msgid "diamond" msgstr "" -#: ../../library/curses.rst:1664 +#: ../../library/curses.rst:1662 msgid "``ACS_GEQUAL``" msgstr "" -#: ../../library/curses.rst:1664 +#: ../../library/curses.rst:1662 msgid "greater-than-or-equal-to" msgstr "" -#: ../../library/curses.rst:1666 +#: ../../library/curses.rst:1664 msgid "``ACS_HLINE``" msgstr "" -#: ../../library/curses.rst:1666 +#: ../../library/curses.rst:1664 msgid "horizontal line" msgstr "" -#: ../../library/curses.rst:1668 +#: ../../library/curses.rst:1666 msgid "``ACS_LANTERN``" msgstr "" -#: ../../library/curses.rst:1668 +#: ../../library/curses.rst:1666 msgid "lantern symbol" msgstr "" -#: ../../library/curses.rst:1670 +#: ../../library/curses.rst:1668 msgid "``ACS_LARROW``" msgstr "" -#: ../../library/curses.rst:1670 +#: ../../library/curses.rst:1668 msgid "left arrow" msgstr "" -#: ../../library/curses.rst:1672 +#: ../../library/curses.rst:1670 msgid "``ACS_LEQUAL``" msgstr "" -#: ../../library/curses.rst:1672 +#: ../../library/curses.rst:1670 msgid "less-than-or-equal-to" msgstr "" -#: ../../library/curses.rst:1674 +#: ../../library/curses.rst:1672 msgid "``ACS_LLCORNER``" msgstr "" -#: ../../library/curses.rst:1674 +#: ../../library/curses.rst:1672 msgid "lower left-hand corner" msgstr "" -#: ../../library/curses.rst:1676 +#: ../../library/curses.rst:1674 msgid "``ACS_LRCORNER``" msgstr "" -#: ../../library/curses.rst:1676 +#: ../../library/curses.rst:1674 msgid "lower right-hand corner" msgstr "" -#: ../../library/curses.rst:1678 +#: ../../library/curses.rst:1676 msgid "``ACS_LTEE``" msgstr "" -#: ../../library/curses.rst:1678 +#: ../../library/curses.rst:1676 msgid "left tee" msgstr "" -#: ../../library/curses.rst:1680 +#: ../../library/curses.rst:1678 msgid "``ACS_NEQUAL``" msgstr "" -#: ../../library/curses.rst:1680 +#: ../../library/curses.rst:1678 msgid "not-equal sign" msgstr "" -#: ../../library/curses.rst:1682 +#: ../../library/curses.rst:1680 msgid "``ACS_PI``" msgstr "" -#: ../../library/curses.rst:1682 +#: ../../library/curses.rst:1680 msgid "letter pi" msgstr "" -#: ../../library/curses.rst:1684 +#: ../../library/curses.rst:1682 msgid "``ACS_PLMINUS``" msgstr "" -#: ../../library/curses.rst:1684 +#: ../../library/curses.rst:1682 msgid "plus-or-minus sign" msgstr "" -#: ../../library/curses.rst:1686 +#: ../../library/curses.rst:1684 msgid "``ACS_PLUS``" msgstr "" -#: ../../library/curses.rst:1686 +#: ../../library/curses.rst:1684 msgid "big plus sign" msgstr "" -#: ../../library/curses.rst:1688 +#: ../../library/curses.rst:1686 msgid "``ACS_RARROW``" msgstr "" -#: ../../library/curses.rst:1688 +#: ../../library/curses.rst:1686 msgid "right arrow" msgstr "" -#: ../../library/curses.rst:1690 +#: ../../library/curses.rst:1688 msgid "``ACS_RTEE``" msgstr "" -#: ../../library/curses.rst:1690 +#: ../../library/curses.rst:1688 msgid "right tee" msgstr "" -#: ../../library/curses.rst:1692 +#: ../../library/curses.rst:1690 msgid "``ACS_S1``" msgstr "" -#: ../../library/curses.rst:1692 +#: ../../library/curses.rst:1690 msgid "scan line 1" msgstr "" -#: ../../library/curses.rst:1694 +#: ../../library/curses.rst:1692 msgid "``ACS_S3``" msgstr "" -#: ../../library/curses.rst:1694 +#: ../../library/curses.rst:1692 msgid "scan line 3" msgstr "" -#: ../../library/curses.rst:1696 +#: ../../library/curses.rst:1694 msgid "``ACS_S7``" msgstr "" -#: ../../library/curses.rst:1696 +#: ../../library/curses.rst:1694 msgid "scan line 7" msgstr "" -#: ../../library/curses.rst:1698 +#: ../../library/curses.rst:1696 msgid "``ACS_S9``" msgstr "" -#: ../../library/curses.rst:1698 +#: ../../library/curses.rst:1696 msgid "scan line 9" msgstr "" -#: ../../library/curses.rst:1700 +#: ../../library/curses.rst:1698 msgid "``ACS_SBBS``" msgstr "" -#: ../../library/curses.rst:1700 +#: ../../library/curses.rst:1698 msgid "alternate name for lower right corner" msgstr "" -#: ../../library/curses.rst:1702 +#: ../../library/curses.rst:1700 msgid "``ACS_SBSB``" msgstr "" -#: ../../library/curses.rst:1702 +#: ../../library/curses.rst:1700 msgid "alternate name for vertical line" msgstr "" -#: ../../library/curses.rst:1704 +#: ../../library/curses.rst:1702 msgid "``ACS_SBSS``" msgstr "" -#: ../../library/curses.rst:1704 +#: ../../library/curses.rst:1702 msgid "alternate name for right tee" msgstr "" -#: ../../library/curses.rst:1706 +#: ../../library/curses.rst:1704 msgid "``ACS_SSBB``" msgstr "" -#: ../../library/curses.rst:1706 +#: ../../library/curses.rst:1704 msgid "alternate name for lower left corner" msgstr "" -#: ../../library/curses.rst:1708 +#: ../../library/curses.rst:1706 msgid "``ACS_SSBS``" msgstr "" -#: ../../library/curses.rst:1708 +#: ../../library/curses.rst:1706 msgid "alternate name for bottom tee" msgstr "" -#: ../../library/curses.rst:1710 +#: ../../library/curses.rst:1708 msgid "``ACS_SSSB``" msgstr "" -#: ../../library/curses.rst:1710 +#: ../../library/curses.rst:1708 msgid "alternate name for left tee" msgstr "" -#: ../../library/curses.rst:1712 +#: ../../library/curses.rst:1710 msgid "``ACS_SSSS``" msgstr "" -#: ../../library/curses.rst:1712 +#: ../../library/curses.rst:1710 msgid "alternate name for crossover or big plus" msgstr "" -#: ../../library/curses.rst:1714 +#: ../../library/curses.rst:1712 msgid "``ACS_STERLING``" msgstr "" -#: ../../library/curses.rst:1714 +#: ../../library/curses.rst:1712 msgid "pound sterling" msgstr "" -#: ../../library/curses.rst:1716 +#: ../../library/curses.rst:1714 msgid "``ACS_TTEE``" msgstr "" -#: ../../library/curses.rst:1716 +#: ../../library/curses.rst:1714 msgid "top tee" msgstr "" -#: ../../library/curses.rst:1718 +#: ../../library/curses.rst:1716 msgid "``ACS_UARROW``" msgstr "" -#: ../../library/curses.rst:1718 +#: ../../library/curses.rst:1716 msgid "up arrow" msgstr "" -#: ../../library/curses.rst:1720 +#: ../../library/curses.rst:1718 msgid "``ACS_ULCORNER``" msgstr "" -#: ../../library/curses.rst:1720 +#: ../../library/curses.rst:1718 msgid "upper left corner" msgstr "" -#: ../../library/curses.rst:1722 +#: ../../library/curses.rst:1720 msgid "``ACS_URCORNER``" msgstr "" -#: ../../library/curses.rst:1722 +#: ../../library/curses.rst:1720 msgid "upper right corner" msgstr "" -#: ../../library/curses.rst:1724 +#: ../../library/curses.rst:1722 msgid "``ACS_VLINE``" msgstr "" -#: ../../library/curses.rst:1724 +#: ../../library/curses.rst:1722 msgid "vertical line" msgstr "" -#: ../../library/curses.rst:1727 +#: ../../library/curses.rst:1725 msgid "The following table lists the predefined colors:" msgstr "" -#: ../../library/curses.rst:1730 +#: ../../library/curses.rst:1728 msgid "Color" msgstr "" -#: ../../library/curses.rst:1732 +#: ../../library/curses.rst:1730 msgid "``COLOR_BLACK``" msgstr "" -#: ../../library/curses.rst:1732 +#: ../../library/curses.rst:1730 msgid "Black" msgstr "" -#: ../../library/curses.rst:1734 +#: ../../library/curses.rst:1732 msgid "``COLOR_BLUE``" msgstr "" -#: ../../library/curses.rst:1734 +#: ../../library/curses.rst:1732 msgid "Blue" msgstr "" -#: ../../library/curses.rst:1736 +#: ../../library/curses.rst:1734 msgid "``COLOR_CYAN``" msgstr "" -#: ../../library/curses.rst:1736 +#: ../../library/curses.rst:1734 msgid "Cyan (light greenish blue)" msgstr "" -#: ../../library/curses.rst:1738 +#: ../../library/curses.rst:1736 msgid "``COLOR_GREEN``" msgstr "" -#: ../../library/curses.rst:1738 +#: ../../library/curses.rst:1736 msgid "Green" msgstr "" -#: ../../library/curses.rst:1740 +#: ../../library/curses.rst:1738 msgid "``COLOR_MAGENTA``" msgstr "" -#: ../../library/curses.rst:1740 +#: ../../library/curses.rst:1738 msgid "Magenta (purplish red)" msgstr "" -#: ../../library/curses.rst:1742 +#: ../../library/curses.rst:1740 msgid "``COLOR_RED``" msgstr "" -#: ../../library/curses.rst:1742 +#: ../../library/curses.rst:1740 msgid "Red" msgstr "" -#: ../../library/curses.rst:1744 +#: ../../library/curses.rst:1742 msgid "``COLOR_WHITE``" msgstr "" -#: ../../library/curses.rst:1744 +#: ../../library/curses.rst:1742 msgid "White" msgstr "" -#: ../../library/curses.rst:1746 +#: ../../library/curses.rst:1744 msgid "``COLOR_YELLOW``" msgstr "" -#: ../../library/curses.rst:1746 +#: ../../library/curses.rst:1744 msgid "Yellow" msgstr "" -#: ../../library/curses.rst:1751 +#: ../../library/curses.rst:1749 msgid ":mod:`curses.textpad` --- Text input widget for curses programs" msgstr "" -#: ../../library/curses.rst:1759 +#: ../../library/curses.rst:1757 msgid "" "The :mod:`curses.textpad` module provides a :class:`Textbox` class that " "handles elementary text editing in a curses window, supporting a set of " @@ -2951,11 +2950,11 @@ msgid "" "purposes." msgstr "" -#: ../../library/curses.rst:1765 +#: ../../library/curses.rst:1763 msgid "The module :mod:`curses.textpad` defines the following function:" msgstr "" -#: ../../library/curses.rst:1770 +#: ../../library/curses.rst:1768 msgid "" "Draw a rectangle. The first argument must be a window object; the remaining " "arguments are coordinates relative to that window. The second and third " @@ -2967,15 +2966,15 @@ msgid "" "will be drawn with ASCII dashes, vertical bars, and plus signs." msgstr "" -#: ../../library/curses.rst:1783 +#: ../../library/curses.rst:1781 msgid "Textbox objects" msgstr "" -#: ../../library/curses.rst:1785 +#: ../../library/curses.rst:1783 msgid "You can instantiate a :class:`Textbox` object as follows:" msgstr "" -#: ../../library/curses.rst:1790 +#: ../../library/curses.rst:1788 msgid "" "Return a textbox widget object. The *win* argument should be a curses :ref:" "`window ` object in which the textbox is to be " @@ -2984,11 +2983,11 @@ msgid "" "instance's :attr:`stripspaces` flag is initially on." msgstr "" -#: ../../library/curses.rst:1796 +#: ../../library/curses.rst:1794 msgid ":class:`Textbox` objects have the following methods:" msgstr "" -#: ../../library/curses.rst:1801 +#: ../../library/curses.rst:1799 msgid "" "This is the entry point you will normally use. It accepts editing " "keystrokes until one of the termination keystrokes is entered. If " @@ -2999,167 +2998,167 @@ msgid "" "`stripspaces` attribute." msgstr "" -#: ../../library/curses.rst:1812 +#: ../../library/curses.rst:1810 msgid "" "Process a single command keystroke. Here are the supported special " "keystrokes:" msgstr "" -#: ../../library/curses.rst:1816 ../../library/curses.rst:1854 +#: ../../library/curses.rst:1814 ../../library/curses.rst:1852 msgid "Keystroke" msgstr "" -#: ../../library/curses.rst:1816 +#: ../../library/curses.rst:1814 msgid "Action" msgstr "" -#: ../../library/curses.rst:1818 +#: ../../library/curses.rst:1816 msgid ":kbd:`Control-A`" msgstr "" -#: ../../library/curses.rst:1818 +#: ../../library/curses.rst:1816 msgid "Go to left edge of window." msgstr "" -#: ../../library/curses.rst:1820 ../../library/curses.rst:1856 +#: ../../library/curses.rst:1818 ../../library/curses.rst:1854 msgid ":kbd:`Control-B`" msgstr "" -#: ../../library/curses.rst:1820 +#: ../../library/curses.rst:1818 msgid "Cursor left, wrapping to previous line if appropriate." msgstr "" -#: ../../library/curses.rst:1823 +#: ../../library/curses.rst:1821 msgid ":kbd:`Control-D`" msgstr "" -#: ../../library/curses.rst:1823 +#: ../../library/curses.rst:1821 msgid "Delete character under cursor." msgstr "" -#: ../../library/curses.rst:1825 +#: ../../library/curses.rst:1823 msgid ":kbd:`Control-E`" msgstr "" -#: ../../library/curses.rst:1825 +#: ../../library/curses.rst:1823 msgid "Go to right edge (stripspaces off) or end of line (stripspaces on)." msgstr "" -#: ../../library/curses.rst:1828 ../../library/curses.rst:1858 +#: ../../library/curses.rst:1826 ../../library/curses.rst:1856 msgid ":kbd:`Control-F`" msgstr "" -#: ../../library/curses.rst:1828 +#: ../../library/curses.rst:1826 msgid "Cursor right, wrapping to next line when appropriate." msgstr "" -#: ../../library/curses.rst:1831 +#: ../../library/curses.rst:1829 msgid ":kbd:`Control-G`" msgstr "" -#: ../../library/curses.rst:1831 +#: ../../library/curses.rst:1829 msgid "Terminate, returning the window contents." msgstr "" -#: ../../library/curses.rst:1833 +#: ../../library/curses.rst:1831 msgid ":kbd:`Control-H`" msgstr "" -#: ../../library/curses.rst:1833 +#: ../../library/curses.rst:1831 msgid "Delete character backward." msgstr "" -#: ../../library/curses.rst:1835 +#: ../../library/curses.rst:1833 msgid ":kbd:`Control-J`" msgstr "" -#: ../../library/curses.rst:1835 +#: ../../library/curses.rst:1833 msgid "Terminate if the window is 1 line, otherwise insert newline." msgstr "" -#: ../../library/curses.rst:1838 +#: ../../library/curses.rst:1836 msgid ":kbd:`Control-K`" msgstr "" -#: ../../library/curses.rst:1838 +#: ../../library/curses.rst:1836 msgid "If line is blank, delete it, otherwise clear to end of line." msgstr "" -#: ../../library/curses.rst:1841 +#: ../../library/curses.rst:1839 msgid ":kbd:`Control-L`" msgstr "" -#: ../../library/curses.rst:1841 +#: ../../library/curses.rst:1839 msgid "Refresh screen." msgstr "" -#: ../../library/curses.rst:1843 ../../library/curses.rst:1862 +#: ../../library/curses.rst:1841 ../../library/curses.rst:1860 msgid ":kbd:`Control-N`" msgstr "" -#: ../../library/curses.rst:1843 +#: ../../library/curses.rst:1841 msgid "Cursor down; move down one line." msgstr "" -#: ../../library/curses.rst:1845 +#: ../../library/curses.rst:1843 msgid ":kbd:`Control-O`" msgstr "" -#: ../../library/curses.rst:1845 +#: ../../library/curses.rst:1843 msgid "Insert a blank line at cursor location." msgstr "" -#: ../../library/curses.rst:1847 ../../library/curses.rst:1860 +#: ../../library/curses.rst:1845 ../../library/curses.rst:1858 msgid ":kbd:`Control-P`" msgstr "" -#: ../../library/curses.rst:1847 +#: ../../library/curses.rst:1845 msgid "Cursor up; move up one line." msgstr "" -#: ../../library/curses.rst:1850 +#: ../../library/curses.rst:1848 msgid "" "Move operations do nothing if the cursor is at an edge where the movement is " "not possible. The following synonyms are supported where possible:" msgstr "" -#: ../../library/curses.rst:1856 +#: ../../library/curses.rst:1854 msgid ":const:`KEY_LEFT`" msgstr "" -#: ../../library/curses.rst:1858 +#: ../../library/curses.rst:1856 msgid ":const:`KEY_RIGHT`" msgstr "" -#: ../../library/curses.rst:1860 +#: ../../library/curses.rst:1858 msgid ":const:`KEY_UP`" msgstr "" -#: ../../library/curses.rst:1862 +#: ../../library/curses.rst:1860 msgid ":const:`KEY_DOWN`" msgstr "" -#: ../../library/curses.rst:1864 +#: ../../library/curses.rst:1862 msgid ":const:`KEY_BACKSPACE`" msgstr "" -#: ../../library/curses.rst:1864 +#: ../../library/curses.rst:1862 msgid ":kbd:`Control-h`" msgstr "" -#: ../../library/curses.rst:1867 +#: ../../library/curses.rst:1865 msgid "" "All other keystrokes are treated as a command to insert the given character " "and move right (with line wrapping)." msgstr "" -#: ../../library/curses.rst:1873 +#: ../../library/curses.rst:1871 msgid "" "Return the window contents as a string; whether blanks in the window are " "included is affected by the :attr:`stripspaces` member." msgstr "" -#: ../../library/curses.rst:1879 +#: ../../library/curses.rst:1877 msgid "" "This attribute is a flag which controls the interpretation of blanks in the " "window. When it is on, trailing blanks on each line are ignored; any cursor " diff --git a/library/dataclasses.po b/library/dataclasses.po index fc750e452a..8e73a2b42a 100644 --- a/library/dataclasses.po +++ b/library/dataclasses.po @@ -5,7 +5,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.7\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2021-09-07 06:52+0000\n" +"POT-Creation-Date: 2020-06-20 18:08+0800\n" "PO-Revision-Date: 2018-07-15 18:56+0800\n" "Last-Translator: \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -34,11 +34,11 @@ msgstr "" #: ../../library/dataclasses.rst:19 msgid "" "The member variables to use in these generated methods are defined using :" -"pep:`526` type annotations. For example, this code::" +"pep:`526` type annotations. For example this code::" msgstr "" #: ../../library/dataclasses.rst:34 -msgid "will add, among other things, a :meth:`__init__` that looks like::" +msgid "Will add, among other things, a :meth:`__init__` that looks like::" msgstr "" #: ../../library/dataclasses.rst:41 @@ -60,7 +60,7 @@ msgstr "" #: ../../library/dataclasses.rst:54 msgid "" "The :func:`dataclass` decorator examines the class to find ``field``\\s. A " -"``field`` is defined as a class variable that has a :term:`type annotation " +"``field`` is defined as class variable that has a :term:`type annotation " "`. With two exceptions described below, nothing in :" "func:`dataclass` examines the type specified in the variable annotation." msgstr "" @@ -74,10 +74,9 @@ msgstr "" #: ../../library/dataclasses.rst:63 msgid "" "The :func:`dataclass` decorator will add various \"dunder\" methods to the " -"class, described below. If any of the added methods already exist in the " +"class, described below. If any of the added methods already exist on the " "class, the behavior depends on the parameter, as documented below. The " -"decorator returns the same class that it is called on; no new class is " -"created." +"decorator returns the same class that is called on; no new class is created." msgstr "" #: ../../library/dataclasses.rst:69 @@ -169,7 +168,7 @@ msgstr "" #: ../../library/dataclasses.rst:139 msgid "" -"If :meth:`__hash__` is not explicitly defined, or if it is set to ``None``, " +"If :meth:`__hash__` is not explicit defined, or if it is set to ``None``, " "then :func:`dataclass` *may* add an implicit :meth:`__hash__` method. " "Although not recommended, you can force :func:`dataclass` to create a :meth:" "`__hash__` method with ``unsafe_hash=True``. This might be the case if your " @@ -219,8 +218,8 @@ msgstr "" #: ../../library/dataclasses.rst:177 msgid "" ":exc:`TypeError` will be raised if a field without a default value follows a " -"field with a default value. This is true whether this occurs in a single " -"class, or as a result of class inheritance." +"field with a default value. This is true either when this occurs in a " +"single class, or as a result of class inheritance." msgstr "" #: ../../library/dataclasses.rst:183 @@ -409,7 +408,7 @@ msgstr "" #: ../../library/dataclasses.rst:364 msgid "" -"Creates a new object of the same type as ``instance``, replacing fields with " +"Creates a new object of the same type of ``instance``, replacing fields with " "values from ``changes``. If ``instance`` is not a Data Class, raises :exc:" "`TypeError`. If values in ``changes`` do not specify fields, raises :exc:" "`TypeError`." @@ -481,31 +480,16 @@ msgstr "" #: ../../library/dataclasses.rst:425 msgid "" -"The :meth:`__init__` method generated by :func:`dataclass` does not call " -"base class :meth:`__init__` methods. If the base class has an :meth:" -"`__init__` method that has to be called, it is common to call this method in " -"a :meth:`__post_init__` method::" -msgstr "" - -#: ../../library/dataclasses.rst:442 -msgid "" -"Note, however, that in general the dataclass-generated :meth:`__init__` " -"methods don't need to be called, since the derived dataclass will take care " -"of initializing all fields of any base class that is a dataclass itself." -msgstr "" - -#: ../../library/dataclasses.rst:446 -msgid "" "See the section below on init-only variables for ways to pass parameters to :" "meth:`__post_init__`. Also see the warning about how :func:`replace` " "handles ``init=False`` fields." msgstr "" -#: ../../library/dataclasses.rst:451 +#: ../../library/dataclasses.rst:430 msgid "Class variables" msgstr "" -#: ../../library/dataclasses.rst:453 +#: ../../library/dataclasses.rst:432 msgid "" "One of two places where :func:`dataclass` actually inspects the type of a " "field is to determine if a field is a class variable as defined in :pep:" @@ -515,11 +499,11 @@ msgid "" "pseudo-fields are not returned by the module-level :func:`fields` function." msgstr "" -#: ../../library/dataclasses.rst:462 +#: ../../library/dataclasses.rst:441 msgid "Init-only variables" msgstr "" -#: ../../library/dataclasses.rst:464 +#: ../../library/dataclasses.rst:443 msgid "" "The other place where :func:`dataclass` inspects a type annotation is to " "determine if a field is an init-only variable. It does this by seeing if " @@ -531,23 +515,23 @@ msgid "" "`__post_init__` method. They are not otherwise used by dataclasses." msgstr "" -#: ../../library/dataclasses.rst:474 +#: ../../library/dataclasses.rst:453 msgid "" "For example, suppose a field will be initialized from a database, if a value " "is not provided when creating the class::" msgstr "" -#: ../../library/dataclasses.rst:489 +#: ../../library/dataclasses.rst:468 msgid "" "In this case, :func:`fields` will return :class:`Field` objects for ``i`` " "and ``j``, but not for ``database``." msgstr "" -#: ../../library/dataclasses.rst:493 +#: ../../library/dataclasses.rst:472 msgid "Frozen instances" msgstr "" -#: ../../library/dataclasses.rst:495 +#: ../../library/dataclasses.rst:474 msgid "" "It is not possible to create truly immutable Python objects. However, by " "passing ``frozen=True`` to the :meth:`dataclass` decorator you can emulate " @@ -556,18 +540,18 @@ msgid "" "`FrozenInstanceError` when invoked." msgstr "" -#: ../../library/dataclasses.rst:501 +#: ../../library/dataclasses.rst:480 msgid "" "There is a tiny performance penalty when using ``frozen=True``: :meth:" "`__init__` cannot use simple assignment to initialize fields, and must use :" "meth:`object.__setattr__`." msgstr "" -#: ../../library/dataclasses.rst:506 +#: ../../library/dataclasses.rst:485 msgid "Inheritance" msgstr "" -#: ../../library/dataclasses.rst:508 +#: ../../library/dataclasses.rst:487 msgid "" "When the dataclass is being created by the :meth:`dataclass` decorator, it " "looks through all of the class's base classes in reverse MRO (that is, " @@ -579,28 +563,28 @@ msgid "" "derived classes override base classes. An example::" msgstr "" -#: ../../library/dataclasses.rst:528 +#: ../../library/dataclasses.rst:507 msgid "" "The final list of fields is, in order, ``x``, ``y``, ``z``. The final type " "of ``x`` is ``int``, as specified in class ``C``." msgstr "" -#: ../../library/dataclasses.rst:531 +#: ../../library/dataclasses.rst:510 msgid "The generated :meth:`__init__` method for ``C`` will look like::" msgstr "" -#: ../../library/dataclasses.rst:536 +#: ../../library/dataclasses.rst:515 msgid "Default factory functions" msgstr "" -#: ../../library/dataclasses.rst:538 +#: ../../library/dataclasses.rst:517 msgid "" "If a :func:`field` specifies a ``default_factory``, it is called with zero " "arguments when a default value for the field is needed. For example, to " "create a new instance of a list, use::" msgstr "" -#: ../../library/dataclasses.rst:544 +#: ../../library/dataclasses.rst:523 msgid "" "If a field is excluded from :meth:`__init__` (using ``init=False``) and the " "field also specifies ``default_factory``, then the default factory function " @@ -608,31 +592,31 @@ msgid "" "happens because there is no other way to give the field an initial value." msgstr "" -#: ../../library/dataclasses.rst:551 +#: ../../library/dataclasses.rst:530 msgid "Mutable default values" msgstr "" -#: ../../library/dataclasses.rst:553 +#: ../../library/dataclasses.rst:532 msgid "" "Python stores default member variable values in class attributes. Consider " "this example, not using dataclasses::" msgstr "" -#: ../../library/dataclasses.rst:568 +#: ../../library/dataclasses.rst:547 msgid "" "Note that the two instances of class ``C`` share the same class variable " "``x``, as expected." msgstr "" -#: ../../library/dataclasses.rst:571 +#: ../../library/dataclasses.rst:550 msgid "Using dataclasses, *if* this code was valid::" msgstr "" -#: ../../library/dataclasses.rst:579 +#: ../../library/dataclasses.rst:558 msgid "it would generate code similar to::" msgstr "" -#: ../../library/dataclasses.rst:590 +#: ../../library/dataclasses.rst:569 msgid "" "This has the same issue as the original example using class ``C``. That is, " "two instances of class ``D`` that do not specify a value for ``x`` when " @@ -644,19 +628,18 @@ msgid "" "partial solution, but it does protect against many common errors." msgstr "" -#: ../../library/dataclasses.rst:600 +#: ../../library/dataclasses.rst:579 msgid "" "Using default factory functions is a way to create new instances of mutable " "types as default values for fields::" msgstr "" -#: ../../library/dataclasses.rst:610 +#: ../../library/dataclasses.rst:589 msgid "Exceptions" msgstr "" -#: ../../library/dataclasses.rst:614 +#: ../../library/dataclasses.rst:593 msgid "" "Raised when an implicitly defined :meth:`__setattr__` or :meth:`__delattr__` " -"is called on a dataclass which was defined with ``frozen=True``. It is a " -"subclass of :exc:`AttributeError`." +"is called on a dataclass which was defined with ``frozen=True``." msgstr "" diff --git a/library/decimal.po b/library/decimal.po index a2b2b78b11..31de811d60 100644 --- a/library/decimal.po +++ b/library/decimal.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.7\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2021-09-07 06:52+0000\n" +"POT-Creation-Date: 2020-06-20 18:08+0800\n" "PO-Revision-Date: 2018-05-23 14:43+0000\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -836,12 +836,12 @@ msgstr "" msgid "Return the square root of the argument to full precision." msgstr "" -#: ../../library/decimal.rst:861 ../../library/decimal.rst:1440 +#: ../../library/decimal.rst:861 ../../library/decimal.rst:1437 msgid "" "Convert to a string, using engineering notation if an exponent is needed." msgstr "" -#: ../../library/decimal.rst:863 ../../library/decimal.rst:1442 +#: ../../library/decimal.rst:863 ../../library/decimal.rst:1439 msgid "" "Engineering notation has an exponent which is a multiple of 3. This can " "leave up to 3 digits to the left of the decimal place and may require the " @@ -1336,40 +1336,34 @@ msgstr "" #: ../../library/decimal.rst:1360 msgid "" -"``Decimal(0) ** Decimal(0)`` results in ``InvalidOperation``, and if " -"``InvalidOperation`` is not trapped, then results in ``Decimal('NaN')``." -msgstr "" - -#: ../../library/decimal.rst:1363 -msgid "" "The C module computes :meth:`power` in terms of the correctly-rounded :meth:" "`exp` and :meth:`ln` functions. The result is well-defined but only \"almost " "always correctly-rounded\"." msgstr "" -#: ../../library/decimal.rst:1368 +#: ../../library/decimal.rst:1365 msgid "" "With three arguments, compute ``(x**y) % modulo``. For the three argument " "form, the following restrictions on the arguments hold:" msgstr "" -#: ../../library/decimal.rst:1371 +#: ../../library/decimal.rst:1368 msgid "all three arguments must be integral" msgstr "" -#: ../../library/decimal.rst:1372 +#: ../../library/decimal.rst:1369 msgid "``y`` must be nonnegative" msgstr "" -#: ../../library/decimal.rst:1373 +#: ../../library/decimal.rst:1370 msgid "at least one of ``x`` or ``y`` must be nonzero" msgstr "" -#: ../../library/decimal.rst:1374 +#: ../../library/decimal.rst:1371 msgid "``modulo`` must be nonzero and have at most 'precision' digits" msgstr "" -#: ../../library/decimal.rst:1376 +#: ../../library/decimal.rst:1373 msgid "" "The value resulting from ``Context.power(x, y, modulo)`` is equal to the " "value that would be obtained by computing ``(x**y) % modulo`` with unbounded " @@ -1378,110 +1372,110 @@ msgid "" "result is always exact." msgstr "" -#: ../../library/decimal.rst:1386 +#: ../../library/decimal.rst:1383 msgid "Returns a value equal to *x* (rounded), having the exponent of *y*." msgstr "" -#: ../../library/decimal.rst:1391 +#: ../../library/decimal.rst:1388 msgid "Just returns 10, as this is Decimal, :)" msgstr "" -#: ../../library/decimal.rst:1396 +#: ../../library/decimal.rst:1393 msgid "Returns the remainder from integer division." msgstr "" -#: ../../library/decimal.rst:1398 +#: ../../library/decimal.rst:1395 msgid "" "The sign of the result, if non-zero, is the same as that of the original " "dividend." msgstr "" -#: ../../library/decimal.rst:1404 +#: ../../library/decimal.rst:1401 msgid "" "Returns ``x - y * n``, where *n* is the integer nearest the exact value of " "``x / y`` (if the result is 0 then its sign will be the sign of *x*)." msgstr "" -#: ../../library/decimal.rst:1410 +#: ../../library/decimal.rst:1407 msgid "Returns a rotated copy of *x*, *y* times." msgstr "" -#: ../../library/decimal.rst:1415 +#: ../../library/decimal.rst:1412 msgid "Returns ``True`` if the two operands have the same exponent." msgstr "" -#: ../../library/decimal.rst:1420 +#: ../../library/decimal.rst:1417 msgid "Returns the first operand after adding the second value its exp." msgstr "" -#: ../../library/decimal.rst:1425 +#: ../../library/decimal.rst:1422 msgid "Returns a shifted copy of *x*, *y* times." msgstr "" -#: ../../library/decimal.rst:1430 +#: ../../library/decimal.rst:1427 msgid "Square root of a non-negative number to context precision." msgstr "" -#: ../../library/decimal.rst:1435 +#: ../../library/decimal.rst:1432 msgid "Return the difference between *x* and *y*." msgstr "" -#: ../../library/decimal.rst:1449 +#: ../../library/decimal.rst:1446 msgid "Rounds to an integer." msgstr "" -#: ../../library/decimal.rst:1454 +#: ../../library/decimal.rst:1451 msgid "Converts a number to a string using scientific notation." msgstr "" -#: ../../library/decimal.rst:1461 +#: ../../library/decimal.rst:1458 msgid "Constants" msgstr "" -#: ../../library/decimal.rst:1463 +#: ../../library/decimal.rst:1460 msgid "" "The constants in this section are only relevant for the C module. They are " "also included in the pure Python version for compatibility." msgstr "" -#: ../../library/decimal.rst:1467 +#: ../../library/decimal.rst:1464 msgid "32-bit" msgstr "" -#: ../../library/decimal.rst:1467 +#: ../../library/decimal.rst:1464 msgid "64-bit" msgstr "" -#: ../../library/decimal.rst:1469 ../../library/decimal.rst:1471 +#: ../../library/decimal.rst:1466 ../../library/decimal.rst:1468 msgid ":const:`425000000`" msgstr "" -#: ../../library/decimal.rst:1469 ../../library/decimal.rst:1471 +#: ../../library/decimal.rst:1466 ../../library/decimal.rst:1468 msgid ":const:`999999999999999999`" msgstr "" -#: ../../library/decimal.rst:1473 +#: ../../library/decimal.rst:1470 msgid ":const:`-425000000`" msgstr "" -#: ../../library/decimal.rst:1473 +#: ../../library/decimal.rst:1470 msgid ":const:`-999999999999999999`" msgstr "" -#: ../../library/decimal.rst:1475 +#: ../../library/decimal.rst:1472 msgid ":const:`-849999999`" msgstr "" -#: ../../library/decimal.rst:1475 +#: ../../library/decimal.rst:1472 msgid ":const:`-1999999999999999997`" msgstr "" -#: ../../library/decimal.rst:1481 +#: ../../library/decimal.rst:1478 msgid "" "The value is ``True``. Deprecated, because Python now always has threads." msgstr "" -#: ../../library/decimal.rst:1487 +#: ../../library/decimal.rst:1484 msgid "" "The default value is ``True``. If Python is compiled ``--without-decimal-" "contextvar``, the C version uses a thread-local rather than a coroutine-" @@ -1489,59 +1483,59 @@ msgid "" "nested context scenarios." msgstr "" -#: ../../library/decimal.rst:1491 +#: ../../library/decimal.rst:1488 msgid "backported to 3.7 and 3.8." msgstr "" -#: ../../library/decimal.rst:1495 +#: ../../library/decimal.rst:1492 msgid "Rounding modes" msgstr "" -#: ../../library/decimal.rst:1499 +#: ../../library/decimal.rst:1496 msgid "Round towards :const:`Infinity`." msgstr "" -#: ../../library/decimal.rst:1503 +#: ../../library/decimal.rst:1500 msgid "Round towards zero." msgstr "" -#: ../../library/decimal.rst:1507 +#: ../../library/decimal.rst:1504 msgid "Round towards :const:`-Infinity`." msgstr "" -#: ../../library/decimal.rst:1511 +#: ../../library/decimal.rst:1508 msgid "Round to nearest with ties going towards zero." msgstr "" -#: ../../library/decimal.rst:1515 +#: ../../library/decimal.rst:1512 msgid "Round to nearest with ties going to nearest even integer." msgstr "" -#: ../../library/decimal.rst:1519 +#: ../../library/decimal.rst:1516 msgid "Round to nearest with ties going away from zero." msgstr "" -#: ../../library/decimal.rst:1523 +#: ../../library/decimal.rst:1520 msgid "Round away from zero." msgstr "" -#: ../../library/decimal.rst:1527 +#: ../../library/decimal.rst:1524 msgid "" "Round away from zero if last digit after rounding towards zero would have " "been 0 or 5; otherwise round towards zero." msgstr "" -#: ../../library/decimal.rst:1534 +#: ../../library/decimal.rst:1531 msgid "Signals" msgstr "" -#: ../../library/decimal.rst:1536 +#: ../../library/decimal.rst:1533 msgid "" "Signals represent conditions that arise during computation. Each corresponds " "to one context flag and one context trap enabler." msgstr "" -#: ../../library/decimal.rst:1539 +#: ../../library/decimal.rst:1536 msgid "" "The context flag is set whenever the condition is encountered. After the " "computation, flags may be checked for informational purposes (for instance, " @@ -1549,7 +1543,7 @@ msgid "" "sure to clear all flags before starting the next computation." msgstr "" -#: ../../library/decimal.rst:1544 +#: ../../library/decimal.rst:1541 msgid "" "If the context's trap enabler is set for the signal, then the condition " "causes a Python exception to be raised. For example, if the :class:" @@ -1557,26 +1551,26 @@ msgid "" "raised upon encountering the condition." msgstr "" -#: ../../library/decimal.rst:1552 +#: ../../library/decimal.rst:1549 msgid "Altered an exponent to fit representation constraints." msgstr "" -#: ../../library/decimal.rst:1554 +#: ../../library/decimal.rst:1551 msgid "" "Typically, clamping occurs when an exponent falls outside the context's :" "attr:`Emin` and :attr:`Emax` limits. If possible, the exponent is reduced " "to fit by adding zeros to the coefficient." msgstr "" -#: ../../library/decimal.rst:1561 +#: ../../library/decimal.rst:1558 msgid "Base class for other signals and a subclass of :exc:`ArithmeticError`." msgstr "" -#: ../../library/decimal.rst:1566 +#: ../../library/decimal.rst:1563 msgid "Signals the division of a non-infinite number by zero." msgstr "" -#: ../../library/decimal.rst:1568 +#: ../../library/decimal.rst:1565 msgid "" "Can occur with division, modulo division, or when raising a number to a " "negative power. If this signal is not trapped, returns :const:`Infinity` " @@ -1584,32 +1578,32 @@ msgid "" "calculation." msgstr "" -#: ../../library/decimal.rst:1575 +#: ../../library/decimal.rst:1572 msgid "Indicates that rounding occurred and the result is not exact." msgstr "" -#: ../../library/decimal.rst:1577 +#: ../../library/decimal.rst:1574 msgid "" "Signals when non-zero digits were discarded during rounding. The rounded " "result is returned. The signal flag or trap is used to detect when results " "are inexact." msgstr "" -#: ../../library/decimal.rst:1584 +#: ../../library/decimal.rst:1581 msgid "An invalid operation was performed." msgstr "" -#: ../../library/decimal.rst:1586 +#: ../../library/decimal.rst:1583 msgid "" "Indicates that an operation was requested that does not make sense. If not " "trapped, returns :const:`NaN`. Possible causes include::" msgstr "" -#: ../../library/decimal.rst:1602 +#: ../../library/decimal.rst:1599 msgid "Numerical overflow." msgstr "" -#: ../../library/decimal.rst:1604 +#: ../../library/decimal.rst:1601 msgid "" "Indicates the exponent is larger than :attr:`Emax` after rounding has " "occurred. If not trapped, the result depends on the rounding mode, either " @@ -1618,11 +1612,11 @@ msgid "" "`Rounded` are also signaled." msgstr "" -#: ../../library/decimal.rst:1613 +#: ../../library/decimal.rst:1610 msgid "Rounding occurred though possibly no information was lost." msgstr "" -#: ../../library/decimal.rst:1615 +#: ../../library/decimal.rst:1612 msgid "" "Signaled whenever rounding discards digits; even if those digits are zero " "(such as rounding :const:`5.00` to :const:`5.0`). If not trapped, returns " @@ -1630,31 +1624,31 @@ msgid "" "digits." msgstr "" -#: ../../library/decimal.rst:1623 +#: ../../library/decimal.rst:1620 msgid "Exponent was lower than :attr:`Emin` prior to rounding." msgstr "" -#: ../../library/decimal.rst:1625 +#: ../../library/decimal.rst:1622 msgid "" "Occurs when an operation result is subnormal (the exponent is too small). If " "not trapped, returns the result unchanged." msgstr "" -#: ../../library/decimal.rst:1631 +#: ../../library/decimal.rst:1628 msgid "Numerical underflow with result rounded to zero." msgstr "" -#: ../../library/decimal.rst:1633 +#: ../../library/decimal.rst:1630 msgid "" "Occurs when a subnormal result is pushed to zero by rounding. :class:" "`Inexact` and :class:`Subnormal` are also signaled." msgstr "" -#: ../../library/decimal.rst:1639 +#: ../../library/decimal.rst:1636 msgid "Enable stricter semantics for mixing floats and Decimals." msgstr "" -#: ../../library/decimal.rst:1641 +#: ../../library/decimal.rst:1638 msgid "" "If the signal is not trapped (default), mixing floats and Decimals is " "permitted in the :class:`~decimal.Decimal` constructor, :meth:`~decimal." @@ -1665,26 +1659,26 @@ msgid "" "Context.create_decimal_from_float` do not set the flag." msgstr "" -#: ../../library/decimal.rst:1649 +#: ../../library/decimal.rst:1646 msgid "" "Otherwise (the signal is trapped), only equality comparisons and explicit " "conversions are silent. All other mixed operations raise :exc:" "`FloatOperation`." msgstr "" -#: ../../library/decimal.rst:1653 +#: ../../library/decimal.rst:1650 msgid "The following table summarizes the hierarchy of signals::" msgstr "" -#: ../../library/decimal.rst:1674 +#: ../../library/decimal.rst:1671 msgid "Floating Point Notes" msgstr "" -#: ../../library/decimal.rst:1678 +#: ../../library/decimal.rst:1675 msgid "Mitigating round-off error with increased precision" msgstr "" -#: ../../library/decimal.rst:1680 +#: ../../library/decimal.rst:1677 msgid "" "The use of decimal floating point eliminates decimal representation error " "(making it possible to represent :const:`0.1` exactly); however, some " @@ -1692,7 +1686,7 @@ msgid "" "fixed precision." msgstr "" -#: ../../library/decimal.rst:1684 +#: ../../library/decimal.rst:1681 msgid "" "The effects of round-off error can be amplified by the addition or " "subtraction of nearly offsetting quantities resulting in loss of " @@ -1701,24 +1695,24 @@ msgid "" "of the associative and distributive properties of addition:" msgstr "" -#: ../../library/decimal.rst:1708 +#: ../../library/decimal.rst:1705 msgid "" "The :mod:`decimal` module makes it possible to restore the identities by " "expanding the precision sufficiently to avoid loss of significance:" msgstr "" -#: ../../library/decimal.rst:1728 +#: ../../library/decimal.rst:1725 msgid "Special values" msgstr "" -#: ../../library/decimal.rst:1730 +#: ../../library/decimal.rst:1727 msgid "" "The number system for the :mod:`decimal` module provides special values " "including :const:`NaN`, :const:`sNaN`, :const:`-Infinity`, :const:" "`Infinity`, and two zeros, :const:`+0` and :const:`-0`." msgstr "" -#: ../../library/decimal.rst:1734 +#: ../../library/decimal.rst:1731 msgid "" "Infinities can be constructed directly with: ``Decimal('Infinity')``. Also, " "they can arise from dividing by zero when the :exc:`DivisionByZero` signal " @@ -1727,14 +1721,14 @@ msgid "" "representable number." msgstr "" -#: ../../library/decimal.rst:1739 +#: ../../library/decimal.rst:1736 msgid "" "The infinities are signed (affine) and can be used in arithmetic operations " "where they get treated as very large, indeterminate numbers. For instance, " "adding a constant to infinity gives another infinite result." msgstr "" -#: ../../library/decimal.rst:1743 +#: ../../library/decimal.rst:1740 msgid "" "Some operations are indeterminate and return :const:`NaN`, or if the :exc:" "`InvalidOperation` signal is trapped, raise an exception. For example, " @@ -1745,14 +1739,14 @@ msgid "" "the calculation to proceed while flagging specific results as invalid." msgstr "" -#: ../../library/decimal.rst:1751 +#: ../../library/decimal.rst:1748 msgid "" "A variant is :const:`sNaN` which signals rather than remaining quiet after " "every operation. This is a useful return value when an invalid result needs " "to interrupt a calculation for special handling." msgstr "" -#: ../../library/decimal.rst:1755 +#: ../../library/decimal.rst:1752 msgid "" "The behavior of Python's comparison operators can be a little surprising " "where a :const:`NaN` is involved. A test for equality where one of the " @@ -1769,7 +1763,7 @@ msgid "" "methods instead." msgstr "" -#: ../../library/decimal.rst:1768 +#: ../../library/decimal.rst:1765 msgid "" "The signed zeros can result from calculations that underflow. They keep the " "sign that would have resulted if the calculation had been carried out to " @@ -1777,7 +1771,7 @@ msgid "" "negative zeros are treated as equal and their sign is informational." msgstr "" -#: ../../library/decimal.rst:1773 +#: ../../library/decimal.rst:1770 msgid "" "In addition to the two signed zeros which are distinct yet equal, there are " "various representations of zero with differing precisions yet equivalent in " @@ -1786,11 +1780,11 @@ msgid "" "that the following calculation returns a value equal to zero:" msgstr "" -#: ../../library/decimal.rst:1788 +#: ../../library/decimal.rst:1785 msgid "Working with threads" msgstr "" -#: ../../library/decimal.rst:1790 +#: ../../library/decimal.rst:1787 msgid "" "The :func:`getcontext` function accesses a different :class:`Context` object " "for each thread. Having separate thread contexts means that threads may " @@ -1798,20 +1792,20 @@ msgid "" "other threads." msgstr "" -#: ../../library/decimal.rst:1794 +#: ../../library/decimal.rst:1791 msgid "" "Likewise, the :func:`setcontext` function automatically assigns its target " "to the current thread." msgstr "" -#: ../../library/decimal.rst:1797 +#: ../../library/decimal.rst:1794 msgid "" "If :func:`setcontext` has not been called before :func:`getcontext`, then :" "func:`getcontext` will automatically create a new context for use in the " "current thread." msgstr "" -#: ../../library/decimal.rst:1801 +#: ../../library/decimal.rst:1798 msgid "" "The new context is copied from a prototype context called *DefaultContext*. " "To control the defaults so that each thread will use the same values " @@ -1820,50 +1814,50 @@ msgid "" "a race condition between threads calling :func:`getcontext`. For example::" msgstr "" -#: ../../library/decimal.rst:1826 +#: ../../library/decimal.rst:1823 msgid "Recipes" msgstr "" -#: ../../library/decimal.rst:1828 +#: ../../library/decimal.rst:1825 msgid "" "Here are a few recipes that serve as utility functions and that demonstrate " "ways to work with the :class:`Decimal` class::" msgstr "" -#: ../../library/decimal.rst:1983 +#: ../../library/decimal.rst:1980 msgid "Decimal FAQ" msgstr "" -#: ../../library/decimal.rst:1985 +#: ../../library/decimal.rst:1982 msgid "" "Q. It is cumbersome to type ``decimal.Decimal('1234.5')``. Is there a way " "to minimize typing when using the interactive interpreter?" msgstr "" -#: ../../library/decimal.rst:1988 +#: ../../library/decimal.rst:1985 msgid "A. Some users abbreviate the constructor to just a single letter:" msgstr "" -#: ../../library/decimal.rst:1994 +#: ../../library/decimal.rst:1991 msgid "" "Q. In a fixed-point application with two decimal places, some inputs have " "many places and need to be rounded. Others are not supposed to have excess " "digits and need to be validated. What methods should be used?" msgstr "" -#: ../../library/decimal.rst:1998 +#: ../../library/decimal.rst:1995 msgid "" "A. The :meth:`quantize` method rounds to a fixed number of decimal places. " "If the :const:`Inexact` trap is set, it is also useful for validation:" msgstr "" -#: ../../library/decimal.rst:2016 +#: ../../library/decimal.rst:2013 msgid "" "Q. Once I have valid two place inputs, how do I maintain that invariant " "throughout an application?" msgstr "" -#: ../../library/decimal.rst:2019 +#: ../../library/decimal.rst:2016 msgid "" "A. Some operations like addition, subtraction, and multiplication by an " "integer will automatically preserve fixed point. Others operations, like " @@ -1871,13 +1865,13 @@ msgid "" "places and need to be followed-up with a :meth:`quantize` step:" msgstr "" -#: ../../library/decimal.rst:2037 +#: ../../library/decimal.rst:2034 msgid "" "In developing fixed-point applications, it is convenient to define functions " "to handle the :meth:`quantize` step:" msgstr "" -#: ../../library/decimal.rst:2050 +#: ../../library/decimal.rst:2047 msgid "" "Q. There are many ways to express the same value. The numbers :const:" "`200`, :const:`200.000`, :const:`2E2`, and :const:`.02E+4` all have the same " @@ -1885,19 +1879,19 @@ msgid "" "recognizable canonical value?" msgstr "" -#: ../../library/decimal.rst:2055 +#: ../../library/decimal.rst:2052 msgid "" "A. The :meth:`normalize` method maps all equivalent values to a single " "representative:" msgstr "" -#: ../../library/decimal.rst:2062 +#: ../../library/decimal.rst:2059 msgid "" "Q. Some decimal values always print with exponential notation. Is there a " "way to get a non-exponential representation?" msgstr "" -#: ../../library/decimal.rst:2065 +#: ../../library/decimal.rst:2062 msgid "" "A. For some values, exponential notation is the only way to express the " "number of significant places in the coefficient. For example, expressing :" @@ -1905,31 +1899,31 @@ msgid "" "original's two-place significance." msgstr "" -#: ../../library/decimal.rst:2070 +#: ../../library/decimal.rst:2067 msgid "" "If an application does not care about tracking significance, it is easy to " "remove the exponent and trailing zeroes, losing significance, but keeping " "the value unchanged:" msgstr "" -#: ../../library/decimal.rst:2080 +#: ../../library/decimal.rst:2077 msgid "Q. Is there a way to convert a regular float to a :class:`Decimal`?" msgstr "" -#: ../../library/decimal.rst:2082 +#: ../../library/decimal.rst:2079 msgid "" "A. Yes, any binary floating point number can be exactly expressed as a " "Decimal though an exact conversion may take more precision than intuition " "would suggest:" msgstr "" -#: ../../library/decimal.rst:2091 +#: ../../library/decimal.rst:2088 msgid "" "Q. Within a complex calculation, how can I make sure that I haven't gotten a " "spurious result because of insufficient precision or rounding anomalies." msgstr "" -#: ../../library/decimal.rst:2094 +#: ../../library/decimal.rst:2091 msgid "" "A. The decimal module makes it easy to test results. A best practice is to " "re-run calculations using greater precision and with various rounding modes. " @@ -1937,14 +1931,14 @@ msgid "" "issues, ill-conditioned inputs, or a numerically unstable algorithm." msgstr "" -#: ../../library/decimal.rst:2099 +#: ../../library/decimal.rst:2096 msgid "" "Q. I noticed that context precision is applied to the results of operations " "but not to the inputs. Is there anything to watch out for when mixing " "values of different precisions?" msgstr "" -#: ../../library/decimal.rst:2103 +#: ../../library/decimal.rst:2100 msgid "" "A. Yes. The principle is that all values are considered to be exact and so " "is the arithmetic on those values. Only the results are rounded. The " @@ -1953,23 +1947,23 @@ msgid "" "haven't been rounded:" msgstr "" -#: ../../library/decimal.rst:2116 +#: ../../library/decimal.rst:2113 msgid "" "The solution is either to increase precision or to force rounding of inputs " "using the unary plus operation:" msgstr "" -#: ../../library/decimal.rst:2125 +#: ../../library/decimal.rst:2122 msgid "" "Alternatively, inputs can be rounded upon creation using the :meth:`Context." "create_decimal` method:" msgstr "" -#: ../../library/decimal.rst:2131 +#: ../../library/decimal.rst:2128 msgid "Q. Is the CPython implementation fast for large numbers?" msgstr "" -#: ../../library/decimal.rst:2133 +#: ../../library/decimal.rst:2130 msgid "" "A. Yes. In the CPython and PyPy3 implementations, the C/CFFI versions of " "the decimal module integrate the high speed `libmpdec \n" "Language-Team: LANGUAGE \n" -"Language: \n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" diff --git a/library/dialog.po b/library/dialog.po index 7ff2178ce5..70501ee6dc 100644 --- a/library/dialog.po +++ b/library/dialog.po @@ -8,11 +8,10 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.9\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2021-09-07 06:52+0000\n" +"POT-Creation-Date: 2020-06-20 18:08+0800\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" -"Language: \n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" diff --git a/library/difflib.po b/library/difflib.po index fc8c989484..0af651e8dd 100644 --- a/library/difflib.po +++ b/library/difflib.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.7\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2021-09-07 06:52+0000\n" +"POT-Creation-Date: 2020-06-20 18:08+0800\n" "PO-Revision-Date: 2016-11-19 00:29+0000\n" "Last-Translator: Liang-Bo Wang \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -29,13 +29,13 @@ msgstr "" #: ../../library/difflib.rst:20 msgid "" "This module provides classes and functions for comparing sequences. It can " -"be used for example, for comparing files, and can produce information about " -"file differences in various formats, including HTML and context and unified " +"be used for example, for comparing files, and can produce difference " +"information in various formats, including HTML and context and unified " "diffs. For comparing directories and files, see also, the :mod:`filecmp` " "module." msgstr "" -#: ../../library/difflib.rst:29 +#: ../../library/difflib.rst:28 msgid "" "This is a flexible class for comparing pairs of sequences of any type, so " "long as the sequence elements are :term:`hashable`. The basic algorithm " @@ -51,7 +51,7 @@ msgid "" "to people." msgstr "" -#: ../../library/difflib.rst:41 +#: ../../library/difflib.rst:40 msgid "" "**Timing:** The basic Ratcliff-Obershelp algorithm is cubic time in the " "worst case and quadratic time in the expected case. :class:`SequenceMatcher` " @@ -60,7 +60,7 @@ msgid "" "common; best case time is linear." msgstr "" -#: ../../library/difflib.rst:47 +#: ../../library/difflib.rst:46 msgid "" "**Automatic junk heuristic:** :class:`SequenceMatcher` supports a heuristic " "that automatically treats certain sequence items as junk. The heuristic " @@ -72,11 +72,11 @@ msgid "" "``False`` when creating the :class:`SequenceMatcher`." msgstr "" -#: ../../library/difflib.rst:55 ../../library/difflib.rst:388 +#: ../../library/difflib.rst:54 ../../library/difflib.rst:387 msgid "The *autojunk* parameter." msgstr "" -#: ../../library/difflib.rst:61 +#: ../../library/difflib.rst:60 msgid "" "This is a class for comparing sequences of lines of text, and producing " "human-readable differences or deltas. Differ uses :class:`SequenceMatcher` " @@ -84,58 +84,58 @@ msgid "" "within similar (near-matching) lines." msgstr "" -#: ../../library/difflib.rst:66 +#: ../../library/difflib.rst:65 msgid "Each line of a :class:`Differ` delta begins with a two-letter code:" msgstr "" -#: ../../library/difflib.rst:69 +#: ../../library/difflib.rst:68 msgid "Code" msgstr "" -#: ../../library/difflib.rst:69 ../../library/difflib.rst:498 +#: ../../library/difflib.rst:68 ../../library/difflib.rst:497 msgid "Meaning" msgstr "" -#: ../../library/difflib.rst:71 +#: ../../library/difflib.rst:70 msgid "``'- '``" msgstr "" -#: ../../library/difflib.rst:71 +#: ../../library/difflib.rst:70 msgid "line unique to sequence 1" msgstr "" -#: ../../library/difflib.rst:73 +#: ../../library/difflib.rst:72 msgid "``'+ '``" msgstr "" -#: ../../library/difflib.rst:73 +#: ../../library/difflib.rst:72 msgid "line unique to sequence 2" msgstr "" -#: ../../library/difflib.rst:75 +#: ../../library/difflib.rst:74 msgid "``' '``" msgstr "" -#: ../../library/difflib.rst:75 +#: ../../library/difflib.rst:74 msgid "line common to both sequences" msgstr "" -#: ../../library/difflib.rst:77 +#: ../../library/difflib.rst:76 msgid "``'? '``" msgstr "" -#: ../../library/difflib.rst:77 +#: ../../library/difflib.rst:76 msgid "line not present in either input sequence" msgstr "" -#: ../../library/difflib.rst:80 +#: ../../library/difflib.rst:79 msgid "" "Lines beginning with '``?``' attempt to guide the eye to intraline " "differences, and were not present in either input sequence. These lines can " "be confusing if the sequences contain tab characters." msgstr "" -#: ../../library/difflib.rst:87 +#: ../../library/difflib.rst:86 msgid "" "This class can be used to create an HTML table (or a complete HTML file " "containing the table) showing a side by side, line by line comparison of " @@ -143,27 +143,27 @@ msgid "" "generated in either full or contextual difference mode." msgstr "" -#: ../../library/difflib.rst:92 +#: ../../library/difflib.rst:91 msgid "The constructor for this class is:" msgstr "" -#: ../../library/difflib.rst:97 +#: ../../library/difflib.rst:96 msgid "Initializes instance of :class:`HtmlDiff`." msgstr "" -#: ../../library/difflib.rst:99 +#: ../../library/difflib.rst:98 msgid "" "*tabsize* is an optional keyword argument to specify tab stop spacing and " "defaults to ``8``." msgstr "" -#: ../../library/difflib.rst:102 +#: ../../library/difflib.rst:101 msgid "" "*wrapcolumn* is an optional keyword to specify column number where lines are " "broken and wrapped, defaults to ``None`` where lines are not wrapped." msgstr "" -#: ../../library/difflib.rst:105 +#: ../../library/difflib.rst:104 msgid "" "*linejunk* and *charjunk* are optional keyword arguments passed into :func:" "`ndiff` (used by :class:`HtmlDiff` to generate the side by side HTML " @@ -171,24 +171,24 @@ msgid "" "and descriptions." msgstr "" -#: ../../library/difflib.rst:109 +#: ../../library/difflib.rst:108 msgid "The following methods are public:" msgstr "" -#: ../../library/difflib.rst:114 +#: ../../library/difflib.rst:113 msgid "" "Compares *fromlines* and *tolines* (lists of strings) and returns a string " "which is a complete HTML file containing a table showing line by line " "differences with inter-line and intra-line changes highlighted." msgstr "" -#: ../../library/difflib.rst:118 +#: ../../library/difflib.rst:117 msgid "" "*fromdesc* and *todesc* are optional keyword arguments to specify from/to " "file column header strings (both default to an empty string)." msgstr "" -#: ../../library/difflib.rst:121 +#: ../../library/difflib.rst:120 msgid "" "*context* and *numlines* are both optional keyword arguments. Set *context* " "to ``True`` when contextual differences are to be shown, else the default is " @@ -201,51 +201,51 @@ msgid "" "without any leading context)." msgstr "" -#: ../../library/difflib.rst:132 +#: ../../library/difflib.rst:131 msgid "" "*fromdesc* and *todesc* are interpreted as unescaped HTML and should be " "properly escaped while receiving input from untrusted sources." msgstr "" -#: ../../library/difflib.rst:135 +#: ../../library/difflib.rst:134 msgid "" "*charset* keyword-only argument was added. The default charset of HTML " "document changed from ``'ISO-8859-1'`` to ``'utf-8'``." msgstr "" -#: ../../library/difflib.rst:141 +#: ../../library/difflib.rst:140 msgid "" "Compares *fromlines* and *tolines* (lists of strings) and returns a string " "which is a complete HTML table showing line by line differences with inter-" "line and intra-line changes highlighted." msgstr "" -#: ../../library/difflib.rst:145 +#: ../../library/difflib.rst:144 msgid "" "The arguments for this method are the same as those for the :meth:" "`make_file` method." msgstr "" -#: ../../library/difflib.rst:148 +#: ../../library/difflib.rst:147 msgid "" ":file:`Tools/scripts/diff.py` is a command-line front-end to this class and " "contains a good example of its use." msgstr "" -#: ../../library/difflib.rst:154 +#: ../../library/difflib.rst:153 msgid "" "Compare *a* and *b* (lists of strings); return a delta (a :term:`generator` " "generating the delta lines) in context diff format." msgstr "" -#: ../../library/difflib.rst:157 +#: ../../library/difflib.rst:156 msgid "" "Context diffs are a compact way of showing just the lines that have changed " "plus a few lines of context. The changes are shown in a before/after " "style. The number of context lines is set by *n* which defaults to three." msgstr "" -#: ../../library/difflib.rst:161 +#: ../../library/difflib.rst:160 msgid "" "By default, the diff control lines (those with ``***`` or ``---``) are " "created with a trailing newline. This is helpful so that inputs created " @@ -254,13 +254,13 @@ msgid "" "trailing newlines." msgstr "" -#: ../../library/difflib.rst:167 ../../library/difflib.rst:298 +#: ../../library/difflib.rst:166 ../../library/difflib.rst:297 msgid "" "For inputs that do not have trailing newlines, set the *lineterm* argument " "to ``\"\"`` so that the output will be uniformly newline free." msgstr "" -#: ../../library/difflib.rst:170 ../../library/difflib.rst:301 +#: ../../library/difflib.rst:169 ../../library/difflib.rst:300 msgid "" "The context diff format normally has a header for filenames and modification " "times. Any or all of these may be specified using strings for *fromfile*, " @@ -269,11 +269,11 @@ msgid "" "default to blanks." msgstr "" -#: ../../library/difflib.rst:193 ../../library/difflib.rst:322 +#: ../../library/difflib.rst:192 ../../library/difflib.rst:321 msgid "See :ref:`difflib-interface` for a more detailed example." msgstr "" -#: ../../library/difflib.rst:198 +#: ../../library/difflib.rst:197 msgid "" "Return a list of the best \"good enough\" matches. *word* is a sequence for " "which close matches are desired (typically a string), and *possibilities* is " @@ -281,37 +281,37 @@ msgid "" "strings)." msgstr "" -#: ../../library/difflib.rst:202 +#: ../../library/difflib.rst:201 msgid "" "Optional argument *n* (default ``3``) is the maximum number of close matches " "to return; *n* must be greater than ``0``." msgstr "" -#: ../../library/difflib.rst:205 +#: ../../library/difflib.rst:204 msgid "" "Optional argument *cutoff* (default ``0.6``) is a float in the range [0, 1]. " "Possibilities that don't score at least that similar to *word* are ignored." msgstr "" -#: ../../library/difflib.rst:208 +#: ../../library/difflib.rst:207 msgid "" "The best (no more than *n*) matches among the possibilities are returned in " "a list, sorted by similarity score, most similar first." msgstr "" -#: ../../library/difflib.rst:224 +#: ../../library/difflib.rst:223 msgid "" "Compare *a* and *b* (lists of strings); return a :class:`Differ`\\ -style " "delta (a :term:`generator` generating the delta lines)." msgstr "" -#: ../../library/difflib.rst:227 +#: ../../library/difflib.rst:226 msgid "" "Optional keyword parameters *linejunk* and *charjunk* are filtering " "functions (or ``None``):" msgstr "" -#: ../../library/difflib.rst:230 +#: ../../library/difflib.rst:229 msgid "" "*linejunk*: A function that accepts a single string argument, and returns " "true if the string is junk, or false if not. The default is ``None``. There " @@ -322,7 +322,7 @@ msgid "" "this usually works better than using this function." msgstr "" -#: ../../library/difflib.rst:238 +#: ../../library/difflib.rst:237 msgid "" "*charjunk*: A function that accepts a character (a string of length 1), and " "returns if the character is junk, or false if not. The default is module-" @@ -330,33 +330,33 @@ msgid "" "characters (a blank or tab; it's a bad idea to include newline in this!)." msgstr "" -#: ../../library/difflib.rst:243 +#: ../../library/difflib.rst:242 msgid "" ":file:`Tools/scripts/ndiff.py` is a command-line front-end to this function." msgstr "" -#: ../../library/difflib.rst:261 +#: ../../library/difflib.rst:260 msgid "Return one of the two sequences that generated a delta." msgstr "" -#: ../../library/difflib.rst:263 +#: ../../library/difflib.rst:262 msgid "" "Given a *sequence* produced by :meth:`Differ.compare` or :func:`ndiff`, " "extract lines originating from file 1 or 2 (parameter *which*), stripping " "off line prefixes." msgstr "" -#: ../../library/difflib.rst:267 +#: ../../library/difflib.rst:266 msgid "Example:" msgstr "" -#: ../../library/difflib.rst:284 +#: ../../library/difflib.rst:283 msgid "" "Compare *a* and *b* (lists of strings); return a delta (a :term:`generator` " "generating the delta lines) in unified diff format." msgstr "" -#: ../../library/difflib.rst:287 +#: ../../library/difflib.rst:286 msgid "" "Unified diffs are a compact way of showing just the lines that have changed " "plus a few lines of context. The changes are shown in an inline style " @@ -364,7 +364,7 @@ msgid "" "set by *n* which defaults to three." msgstr "" -#: ../../library/difflib.rst:292 +#: ../../library/difflib.rst:291 msgid "" "By default, the diff control lines (those with ``---``, ``+++``, or ``@@``) " "are created with a trailing newline. This is helpful so that inputs created " @@ -373,14 +373,14 @@ msgid "" "trailing newlines." msgstr "" -#: ../../library/difflib.rst:326 +#: ../../library/difflib.rst:325 msgid "" "Compare *a* and *b* (lists of bytes objects) using *dfunc*; yield a sequence " "of delta lines (also bytes) in the format returned by *dfunc*. *dfunc* must " "be a callable, typically either :func:`unified_diff` or :func:`context_diff`." msgstr "" -#: ../../library/difflib.rst:331 +#: ../../library/difflib.rst:330 msgid "" "Allows you to compare data with unknown or inconsistent encoding. All inputs " "except *n* must be bytes objects, not str. Works by losslessly converting " @@ -390,42 +390,42 @@ msgid "" "unknown/inconsistent encodings as *a* and *b*." msgstr "" -#: ../../library/difflib.rst:342 +#: ../../library/difflib.rst:341 msgid "" "Return ``True`` for ignorable lines. The line *line* is ignorable if *line* " "is blank or contains a single ``'#'``, otherwise it is not ignorable. Used " "as a default for parameter *linejunk* in :func:`ndiff` in older versions." msgstr "" -#: ../../library/difflib.rst:349 +#: ../../library/difflib.rst:348 msgid "" "Return ``True`` for ignorable characters. The character *ch* is ignorable " "if *ch* is a space or tab, otherwise it is not ignorable. Used as a default " "for parameter *charjunk* in :func:`ndiff`." msgstr "" -#: ../../library/difflib.rst:357 +#: ../../library/difflib.rst:356 msgid "" "`Pattern Matching: The Gestalt Approach `_" msgstr "" -#: ../../library/difflib.rst:357 +#: ../../library/difflib.rst:356 msgid "" "Discussion of a similar algorithm by John W. Ratcliff and D. E. Metzener. " "This was published in `Dr. Dobb's Journal `_ in " "July, 1988." msgstr "" -#: ../../library/difflib.rst:364 +#: ../../library/difflib.rst:363 msgid "SequenceMatcher Objects" msgstr "" -#: ../../library/difflib.rst:366 +#: ../../library/difflib.rst:365 msgid "The :class:`SequenceMatcher` class has this constructor:" msgstr "" -#: ../../library/difflib.rst:371 +#: ../../library/difflib.rst:370 msgid "" "Optional argument *isjunk* must be ``None`` (the default) or a one-argument " "function that takes a sequence element and returns true if and only if the " @@ -434,26 +434,26 @@ msgid "" "ignored. For example, pass::" msgstr "" -#: ../../library/difflib.rst:379 +#: ../../library/difflib.rst:378 msgid "" "if you're comparing lines as sequences of characters, and don't want to " "synch up on blanks or hard tabs." msgstr "" -#: ../../library/difflib.rst:382 +#: ../../library/difflib.rst:381 msgid "" "The optional arguments *a* and *b* are sequences to be compared; both " "default to empty strings. The elements of both sequences must be :term:" "`hashable`." msgstr "" -#: ../../library/difflib.rst:385 +#: ../../library/difflib.rst:384 msgid "" "The optional argument *autojunk* can be used to disable the automatic junk " "heuristic." msgstr "" -#: ../../library/difflib.rst:391 +#: ../../library/difflib.rst:390 msgid "" "SequenceMatcher objects get three data attributes: *bjunk* is the set of " "elements of *b* for which *isjunk* is ``True``; *bpopular* is the set of non-" @@ -463,19 +463,19 @@ msgid "" "`set_seqs` or :meth:`set_seq2`." msgstr "" -#: ../../library/difflib.rst:398 +#: ../../library/difflib.rst:397 msgid "The *bjunk* and *bpopular* attributes." msgstr "" -#: ../../library/difflib.rst:401 +#: ../../library/difflib.rst:400 msgid ":class:`SequenceMatcher` objects have the following methods:" msgstr "" -#: ../../library/difflib.rst:405 +#: ../../library/difflib.rst:404 msgid "Set the two sequences to be compared." msgstr "" -#: ../../library/difflib.rst:407 +#: ../../library/difflib.rst:406 msgid "" ":class:`SequenceMatcher` computes and caches detailed information about the " "second sequence, so if you want to compare one sequence against many " @@ -483,23 +483,23 @@ msgid "" "call :meth:`set_seq1` repeatedly, once for each of the other sequences." msgstr "" -#: ../../library/difflib.rst:415 +#: ../../library/difflib.rst:414 msgid "" "Set the first sequence to be compared. The second sequence to be compared " "is not changed." msgstr "" -#: ../../library/difflib.rst:421 +#: ../../library/difflib.rst:420 msgid "" "Set the second sequence to be compared. The first sequence to be compared " "is not changed." msgstr "" -#: ../../library/difflib.rst:427 +#: ../../library/difflib.rst:426 msgid "Find longest matching block in ``a[alo:ahi]`` and ``b[blo:bhi]``." msgstr "" -#: ../../library/difflib.rst:429 +#: ../../library/difflib.rst:428 msgid "" "If *isjunk* was omitted or ``None``, :meth:`find_longest_match` returns " "``(i, j, k)`` such that ``a[i:i+k]`` is equal to ``b[j:j+k]``, where ``alo " @@ -511,7 +511,7 @@ msgid "" "that starts earliest in *b*." msgstr "" -#: ../../library/difflib.rst:442 +#: ../../library/difflib.rst:441 msgid "" "If *isjunk* was provided, first the longest matching block is determined as " "above, but with the additional restriction that no junk element appears in " @@ -520,7 +520,7 @@ msgid "" "junk except as identical junk happens to be adjacent to an interesting match." msgstr "" -#: ../../library/difflib.rst:449 +#: ../../library/difflib.rst:448 msgid "" "Here's the same example as before, but considering blanks to be junk. That " "prevents ``' abcd'`` from matching the ``' abcd'`` at the tail end of the " @@ -528,26 +528,26 @@ msgid "" "matches the leftmost ``'abcd'`` in the second sequence:" msgstr "" -#: ../../library/difflib.rst:458 +#: ../../library/difflib.rst:457 msgid "If no blocks match, this returns ``(alo, blo, 0)``." msgstr "" -#: ../../library/difflib.rst:460 +#: ../../library/difflib.rst:459 msgid "This method returns a :term:`named tuple` ``Match(a, b, size)``." msgstr "" -#: ../../library/difflib.rst:462 +#: ../../library/difflib.rst:461 msgid "Added default arguments." msgstr "" -#: ../../library/difflib.rst:468 +#: ../../library/difflib.rst:467 msgid "" "Return list of triples describing non-overlapping matching subsequences. " "Each triple is of the form ``(i, j, n)``, and means that ``a[i:i+n] == b[j:j" "+n]``. The triples are monotonically increasing in *i* and *j*." msgstr "" -#: ../../library/difflib.rst:473 +#: ../../library/difflib.rst:472 msgid "" "The last triple is a dummy, and has the value ``(len(a), len(b), 0)``. It " "is the only triple with ``n == 0``. If ``(i, j, n)`` and ``(i', j', n')`` " @@ -556,7 +556,7 @@ msgid "" "triples always describe non-adjacent equal blocks." msgstr "" -#: ../../library/difflib.rst:490 +#: ../../library/difflib.rst:489 msgid "" "Return list of 5-tuples describing how to turn *a* into *b*. Each tuple is " "of the form ``(tag, i1, i2, j1, j2)``. The first tuple has ``i1 == j1 == " @@ -564,101 +564,101 @@ msgid "" "tuple, and, likewise, *j1* equal to the previous *j2*." msgstr "" -#: ../../library/difflib.rst:495 +#: ../../library/difflib.rst:494 msgid "The *tag* values are strings, with these meanings:" msgstr "" -#: ../../library/difflib.rst:498 +#: ../../library/difflib.rst:497 msgid "Value" msgstr "" -#: ../../library/difflib.rst:500 +#: ../../library/difflib.rst:499 msgid "``'replace'``" msgstr "" -#: ../../library/difflib.rst:500 +#: ../../library/difflib.rst:499 msgid "``a[i1:i2]`` should be replaced by ``b[j1:j2]``." msgstr "" -#: ../../library/difflib.rst:503 +#: ../../library/difflib.rst:502 msgid "``'delete'``" msgstr "" -#: ../../library/difflib.rst:503 +#: ../../library/difflib.rst:502 msgid "``a[i1:i2]`` should be deleted. Note that ``j1 == j2`` in this case." msgstr "" -#: ../../library/difflib.rst:506 +#: ../../library/difflib.rst:505 msgid "``'insert'``" msgstr "" -#: ../../library/difflib.rst:506 +#: ../../library/difflib.rst:505 msgid "" "``b[j1:j2]`` should be inserted at ``a[i1:i1]``. Note that ``i1 == i2`` in " "this case." msgstr "" -#: ../../library/difflib.rst:510 +#: ../../library/difflib.rst:509 msgid "``'equal'``" msgstr "" -#: ../../library/difflib.rst:510 +#: ../../library/difflib.rst:509 msgid "``a[i1:i2] == b[j1:j2]`` (the sub-sequences are equal)." msgstr "" -#: ../../library/difflib.rst:514 +#: ../../library/difflib.rst:513 msgid "For example::" msgstr "" -#: ../../library/difflib.rst:531 +#: ../../library/difflib.rst:530 msgid "Return a :term:`generator` of groups with up to *n* lines of context." msgstr "" -#: ../../library/difflib.rst:533 +#: ../../library/difflib.rst:532 msgid "" "Starting with the groups returned by :meth:`get_opcodes`, this method splits " "out smaller change clusters and eliminates intervening ranges which have no " "changes." msgstr "" -#: ../../library/difflib.rst:537 +#: ../../library/difflib.rst:536 msgid "The groups are returned in the same format as :meth:`get_opcodes`." msgstr "" -#: ../../library/difflib.rst:542 +#: ../../library/difflib.rst:541 msgid "" "Return a measure of the sequences' similarity as a float in the range [0, 1]." msgstr "" -#: ../../library/difflib.rst:545 +#: ../../library/difflib.rst:544 msgid "" "Where T is the total number of elements in both sequences, and M is the " "number of matches, this is 2.0\\*M / T. Note that this is ``1.0`` if the " "sequences are identical, and ``0.0`` if they have nothing in common." msgstr "" -#: ../../library/difflib.rst:549 +#: ../../library/difflib.rst:548 msgid "" "This is expensive to compute if :meth:`get_matching_blocks` or :meth:" "`get_opcodes` hasn't already been called, in which case you may want to try :" "meth:`quick_ratio` or :meth:`real_quick_ratio` first to get an upper bound." msgstr "" -#: ../../library/difflib.rst:556 +#: ../../library/difflib.rst:555 msgid "" "Caution: The result of a :meth:`ratio` call may depend on the order of the " "arguments. For instance::" msgstr "" -#: ../../library/difflib.rst:567 +#: ../../library/difflib.rst:566 msgid "Return an upper bound on :meth:`ratio` relatively quickly." msgstr "" -#: ../../library/difflib.rst:572 +#: ../../library/difflib.rst:571 msgid "Return an upper bound on :meth:`ratio` very quickly." msgstr "" -#: ../../library/difflib.rst:575 +#: ../../library/difflib.rst:574 msgid "" "The three methods that return the ratio of matching to total characters can " "give different results due to differing levels of approximation, although :" @@ -666,57 +666,57 @@ msgid "" "as :meth:`ratio`:" msgstr "" -#: ../../library/difflib.rst:592 +#: ../../library/difflib.rst:591 msgid "SequenceMatcher Examples" msgstr "" -#: ../../library/difflib.rst:594 +#: ../../library/difflib.rst:593 msgid "This example compares two strings, considering blanks to be \"junk\":" msgstr "" -#: ../../library/difflib.rst:600 +#: ../../library/difflib.rst:599 msgid "" ":meth:`ratio` returns a float in [0, 1], measuring the similarity of the " "sequences. As a rule of thumb, a :meth:`ratio` value over 0.6 means the " "sequences are close matches:" msgstr "" -#: ../../library/difflib.rst:607 +#: ../../library/difflib.rst:606 msgid "" "If you're only interested in where the sequences match, :meth:" "`get_matching_blocks` is handy:" msgstr "" -#: ../../library/difflib.rst:616 +#: ../../library/difflib.rst:615 msgid "" "Note that the last tuple returned by :meth:`get_matching_blocks` is always a " "dummy, ``(len(a), len(b), 0)``, and this is the only case in which the last " "tuple element (number of elements matched) is ``0``." msgstr "" -#: ../../library/difflib.rst:620 +#: ../../library/difflib.rst:619 msgid "" "If you want to know how to change the first sequence into the second, use :" "meth:`get_opcodes`:" msgstr "" -#: ../../library/difflib.rst:631 +#: ../../library/difflib.rst:630 msgid "" "The :func:`get_close_matches` function in this module which shows how simple " "code building on :class:`SequenceMatcher` can be used to do useful work." msgstr "" -#: ../../library/difflib.rst:635 +#: ../../library/difflib.rst:634 msgid "" "`Simple version control recipe `_ for a small application built with :class:`SequenceMatcher`." msgstr "" -#: ../../library/difflib.rst:643 +#: ../../library/difflib.rst:642 msgid "Differ Objects" msgstr "" -#: ../../library/difflib.rst:645 +#: ../../library/difflib.rst:644 msgid "" "Note that :class:`Differ`\\ -generated deltas make no claim to be " "**minimal** diffs. To the contrary, minimal diffs are often counter-" @@ -726,31 +726,31 @@ msgid "" "longer diff." msgstr "" -#: ../../library/difflib.rst:651 +#: ../../library/difflib.rst:650 msgid "The :class:`Differ` class has this constructor:" msgstr "" -#: ../../library/difflib.rst:657 +#: ../../library/difflib.rst:655 msgid "" "Optional keyword parameters *linejunk* and *charjunk* are for filter " "functions (or ``None``):" msgstr "" -#: ../../library/difflib.rst:660 +#: ../../library/difflib.rst:658 msgid "" "*linejunk*: A function that accepts a single string argument, and returns " "true if the string is junk. The default is ``None``, meaning that no line " "is considered junk." msgstr "" -#: ../../library/difflib.rst:664 +#: ../../library/difflib.rst:662 msgid "" "*charjunk*: A function that accepts a single character argument (a string of " "length 1), and returns true if the character is junk. The default is " "``None``, meaning that no character is considered junk." msgstr "" -#: ../../library/difflib.rst:668 +#: ../../library/difflib.rst:666 msgid "" "These junk-filtering functions speed up matching to find differences and do " "not cause any differing lines or characters to be ignored. Read the " @@ -758,17 +758,17 @@ msgid "" "*isjunk* parameter for an explanation." msgstr "" -#: ../../library/difflib.rst:674 +#: ../../library/difflib.rst:672 msgid "" ":class:`Differ` objects are used (deltas generated) via a single method:" msgstr "" -#: ../../library/difflib.rst:679 +#: ../../library/difflib.rst:677 msgid "" "Compare two sequences of lines, and generate the delta (a sequence of lines)." msgstr "" -#: ../../library/difflib.rst:681 +#: ../../library/difflib.rst:679 msgid "" "Each sequence must contain individual single-line strings ending with " "newlines. Such sequences can be obtained from the :meth:`~io.IOBase." @@ -777,11 +777,11 @@ msgid "" "IOBase.writelines` method of a file-like object." msgstr "" -#: ../../library/difflib.rst:692 +#: ../../library/difflib.rst:690 msgid "Differ Example" msgstr "" -#: ../../library/difflib.rst:694 +#: ../../library/difflib.rst:692 msgid "" "This example compares two texts. First we set up the texts, sequences of " "individual single-line strings ending with newlines (such sequences can also " @@ -789,34 +789,34 @@ msgid "" "objects):" msgstr "" -#: ../../library/difflib.rst:713 +#: ../../library/difflib.rst:711 msgid "Next we instantiate a Differ object:" msgstr "" -#: ../../library/difflib.rst:717 +#: ../../library/difflib.rst:715 msgid "" "Note that when instantiating a :class:`Differ` object we may pass functions " "to filter out line and character \"junk.\" See the :meth:`Differ` " "constructor for details." msgstr "" -#: ../../library/difflib.rst:721 +#: ../../library/difflib.rst:719 msgid "Finally, we compare the two:" msgstr "" -#: ../../library/difflib.rst:725 +#: ../../library/difflib.rst:723 msgid "``result`` is a list of strings, so let's pretty-print it:" msgstr "" -#: ../../library/difflib.rst:740 +#: ../../library/difflib.rst:738 msgid "As a single multi-line string it looks like this:" msgstr "" -#: ../../library/difflib.rst:759 +#: ../../library/difflib.rst:757 msgid "A command-line interface to difflib" msgstr "" -#: ../../library/difflib.rst:761 +#: ../../library/difflib.rst:759 msgid "" "This example shows how to use difflib to create a ``diff``-like utility. It " "is also contained in the Python source distribution, as :file:`Tools/scripts/" diff --git a/library/dis.po b/library/dis.po index ab86c20b3e..ec71362280 100644 --- a/library/dis.po +++ b/library/dis.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.7\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2021-09-07 06:52+0000\n" +"POT-Creation-Date: 2020-06-20 18:08+0800\n" "PO-Revision-Date: 2018-07-27 16:55+0800\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -387,8 +387,8 @@ msgstr "" #: ../../library/dis.rst:349 msgid "" -"Lifts second, third and fourth stack items one position up, moves top down " -"to position four." +"Lifts second, third and forth stack items one position up, moves top down to " +"position four." msgstr "" #: ../../library/dis.rst:357 @@ -638,7 +638,7 @@ msgstr "" #: ../../library/dis.rst:643 msgid "" -"Calls ``list.append(TOS1[-i], TOS)``. Used to implement list comprehensions." +"Calls ``list.append(TOS[-i], TOS)``. Used to implement list comprehensions." msgstr "" #: ../../library/dis.rst:648 @@ -728,7 +728,7 @@ msgstr "" msgid "" "This opcode performs several operations before a with block starts. First, " "it loads :meth:`~object.__exit__` from the context manager and pushes it " -"onto the stack for later use by :opcode:`WITH_EXCEPT_START`. Then, :meth:" +"onto the stack for later use by :opcode:`WITH_CLEANUP_START`. Then, :meth:" "`~object.__enter__` is called, and a finally block pointing to *delta* is " "pushed. Finally, the result of calling the ``__enter__()`` method is pushed " "onto the stack. The next opcode will either ignore it (:opcode:`POP_TOP`), " diff --git a/library/email.compat32-message.po b/library/email.compat32-message.po index b5464a434b..fd7be0c4e8 100644 --- a/library/email.compat32-message.po +++ b/library/email.compat32-message.po @@ -5,7 +5,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.7\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2021-09-07 06:52+0000\n" +"POT-Creation-Date: 2020-06-20 18:08+0800\n" "PO-Revision-Date: 2018-07-15 18:56+0800\n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" "tw)\n" @@ -46,7 +46,7 @@ msgstr "" #: ../../library/email.compat32-message.rst:25 msgid "" "An email message consists of *headers* and a *payload*. Headers must be :" -"rfc:`5322` style names and values, where the field name and value are " +"rfc:`5233` style names and values, where the field name and value are " "separated by a colon. The colon is not part of either the field name or the " "field value. The payload may be a simple text message, or a binary object, " "or a structured sequence of sub-messages each with their own set of headers " diff --git a/library/email.po b/library/email.po index 43fd256179..f482119671 100644 --- a/library/email.po +++ b/library/email.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.7\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2021-09-07 06:52+0000\n" +"POT-Creation-Date: 2018-10-19 17:24+0800\n" "PO-Revision-Date: 2018-05-23 16:01+0000\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -32,7 +32,7 @@ msgid "" "specifically *not* designed to do any sending of email messages to SMTP (:" "rfc:`2821`), NNTP, or other servers; those are functions of modules such as :" "mod:`smtplib` and :mod:`nntplib`. The :mod:`email` package attempts to be " -"as RFC-compliant as possible, supporting :rfc:`5322` and :rfc:`6532`, as " +"as RFC-compliant as possible, supporting :rfc:`5233` and :rfc:`6532`, as " "well as such MIME-related RFCs as :rfc:`2045`, :rfc:`2046`, :rfc:`2047`, :" "rfc:`2183`, and :rfc:`2231`." msgstr "" diff --git a/library/email.utils.po b/library/email.utils.po index e4cc9e132b..39ae364042 100644 --- a/library/email.utils.po +++ b/library/email.utils.po @@ -8,11 +8,10 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.9\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2021-09-07 06:52+0000\n" +"POT-Creation-Date: 2020-06-20 18:08+0800\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" -"Language: \n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" diff --git a/library/ensurepip.po b/library/ensurepip.po index 3675dbe12e..4f7b3b001b 100644 --- a/library/ensurepip.po +++ b/library/ensurepip.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.7\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2021-09-07 06:52+0000\n" +"POT-Creation-Date: 2020-06-20 18:08+0800\n" "PO-Revision-Date: 2018-05-23 16:01+0000\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -193,7 +193,7 @@ msgid "" "bootstrapping operation." msgstr "" -#: ../../library/ensurepip.rst:122 +#: ../../library/ensurepip.rst:123 msgid "" "Raises an :ref:`auditing event ` ``ensurepip.bootstrap`` with " "argument ``root``." diff --git a/library/enum.po b/library/enum.po index 2012b08aa0..51a20cd9dc 100644 --- a/library/enum.po +++ b/library/enum.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.7\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2021-09-07 06:52+0000\n" +"POT-Creation-Date: 2020-06-20 18:08+0800\n" "PO-Revision-Date: 2018-05-23 16:01+0000\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -33,21 +33,11 @@ msgid "" "identity, and the enumeration itself can be iterated over." msgstr "" -#: ../../library/enum.rst:22 -msgid "Case of Enum Members" -msgstr "" - #: ../../library/enum.rst:24 -msgid "" -"Because Enums are used to represent constants we recommend using UPPER_CASE " -"names for enum members, and will be using that style in our examples." -msgstr "" - -#: ../../library/enum.rst:30 msgid "Module Contents" msgstr "" -#: ../../library/enum.rst:32 +#: ../../library/enum.rst:26 msgid "" "This module defines four enumeration classes that can be used to define " "unique sets of names and values: :class:`Enum`, :class:`IntEnum`, :class:" @@ -55,51 +45,51 @@ msgid "" "`unique`, and one helper, :class:`auto`." msgstr "" -#: ../../library/enum.rst:39 +#: ../../library/enum.rst:33 msgid "" "Base class for creating enumerated constants. See section `Functional API`_ " "for an alternate construction syntax." msgstr "" -#: ../../library/enum.rst:44 +#: ../../library/enum.rst:38 msgid "" "Base class for creating enumerated constants that are also subclasses of :" "class:`int`." msgstr "" -#: ../../library/enum.rst:49 +#: ../../library/enum.rst:43 msgid "" "Base class for creating enumerated constants that can be combined using the " "bitwise operators without losing their :class:`IntFlag` membership. :class:" "`IntFlag` members are also subclasses of :class:`int`." msgstr "" -#: ../../library/enum.rst:55 +#: ../../library/enum.rst:49 msgid "" "Base class for creating enumerated constants that can be combined using the " "bitwise operations without losing their :class:`Flag` membership." msgstr "" -#: ../../library/enum.rst:61 +#: ../../library/enum.rst:54 msgid "" "Enum class decorator that ensures only one name is bound to any one value." msgstr "" -#: ../../library/enum.rst:65 +#: ../../library/enum.rst:58 msgid "" "Instances are replaced with an appropriate value for Enum members. By " "default, the initial value starts at 1." msgstr "" -#: ../../library/enum.rst:67 +#: ../../library/enum.rst:60 msgid "``Flag``, ``IntFlag``, ``auto``" msgstr "" -#: ../../library/enum.rst:71 +#: ../../library/enum.rst:64 msgid "Creating an Enum" msgstr "" -#: ../../library/enum.rst:73 +#: ../../library/enum.rst:66 msgid "" "Enumerations are created using the :keyword:`class` syntax, which makes them " "easy to read and write. An alternative creation method is described in " @@ -107,11 +97,11 @@ msgid "" "follows::" msgstr "" -#: ../../library/enum.rst:85 +#: ../../library/enum.rst:78 msgid "Enum member values" msgstr "" -#: ../../library/enum.rst:87 +#: ../../library/enum.rst:80 msgid "" "Member values can be anything: :class:`int`, :class:`str`, etc.. If the " "exact value is unimportant you may use :class:`auto` instances and an " @@ -119,86 +109,86 @@ msgid "" "class:`auto` with other values." msgstr "" -#: ../../library/enum.rst:92 +#: ../../library/enum.rst:85 msgid "Nomenclature" msgstr "" -#: ../../library/enum.rst:94 +#: ../../library/enum.rst:87 msgid "The class :class:`Color` is an *enumeration* (or *enum*)" msgstr "" -#: ../../library/enum.rst:95 +#: ../../library/enum.rst:88 msgid "" "The attributes :attr:`Color.RED`, :attr:`Color.GREEN`, etc., are " "*enumeration members* (or *enum members*) and are functionally constants." msgstr "" -#: ../../library/enum.rst:97 +#: ../../library/enum.rst:90 msgid "" "The enum members have *names* and *values* (the name of :attr:`Color.RED` is " "``RED``, the value of :attr:`Color.BLUE` is ``3``, etc.)" msgstr "" -#: ../../library/enum.rst:103 +#: ../../library/enum.rst:96 msgid "" "Even though we use the :keyword:`class` syntax to create Enums, Enums are " "not normal Python classes. See `How are Enums different?`_ for more details." msgstr "" -#: ../../library/enum.rst:107 +#: ../../library/enum.rst:100 msgid "Enumeration members have human readable string representations::" msgstr "" -#: ../../library/enum.rst:112 +#: ../../library/enum.rst:105 msgid "...while their ``repr`` has more information::" msgstr "" -#: ../../library/enum.rst:117 +#: ../../library/enum.rst:110 msgid "The *type* of an enumeration member is the enumeration it belongs to::" msgstr "" -#: ../../library/enum.rst:125 +#: ../../library/enum.rst:118 msgid "Enum members also have a property that contains just their item name::" msgstr "" -#: ../../library/enum.rst:130 +#: ../../library/enum.rst:123 msgid "Enumerations support iteration, in definition order::" msgstr "" -#: ../../library/enum.rst:146 +#: ../../library/enum.rst:139 msgid "" "Enumeration members are hashable, so they can be used in dictionaries and " "sets::" msgstr "" -#: ../../library/enum.rst:156 +#: ../../library/enum.rst:149 msgid "Programmatic access to enumeration members and their attributes" msgstr "" -#: ../../library/enum.rst:158 +#: ../../library/enum.rst:151 msgid "" "Sometimes it's useful to access members in enumerations programmatically (i." "e. situations where ``Color.RED`` won't do because the exact color is not " "known at program-writing time). ``Enum`` allows such access::" msgstr "" -#: ../../library/enum.rst:167 +#: ../../library/enum.rst:160 msgid "If you want to access enum members by *name*, use item access::" msgstr "" -#: ../../library/enum.rst:174 +#: ../../library/enum.rst:167 msgid "If you have an enum member and need its :attr:`name` or :attr:`value`::" msgstr "" -#: ../../library/enum.rst:184 +#: ../../library/enum.rst:177 msgid "Duplicating enum members and values" msgstr "" -#: ../../library/enum.rst:186 +#: ../../library/enum.rst:179 msgid "Having two enum members with the same name is invalid::" msgstr "" -#: ../../library/enum.rst:196 +#: ../../library/enum.rst:189 msgid "" "However, two enum members are allowed to have the same value. Given two " "members A and B with the same value (and A defined first), B is an alias to " @@ -206,108 +196,108 @@ msgid "" "of B will also return A::" msgstr "" -#: ../../library/enum.rst:216 +#: ../../library/enum.rst:209 msgid "" "Attempting to create a member with the same name as an already defined " "attribute (another member, a method, etc.) or attempting to create an " "attribute with the same name as a member is not allowed." msgstr "" -#: ../../library/enum.rst:222 +#: ../../library/enum.rst:215 msgid "Ensuring unique enumeration values" msgstr "" -#: ../../library/enum.rst:224 +#: ../../library/enum.rst:217 msgid "" "By default, enumerations allow multiple names as aliases for the same value. " "When this behavior isn't desired, the following decorator can be used to " "ensure each value is used only once in the enumeration:" msgstr "" -#: ../../library/enum.rst:230 +#: ../../library/enum.rst:223 msgid "" "A :keyword:`class` decorator specifically for enumerations. It searches an " "enumeration's :attr:`__members__` gathering any aliases it finds; if any are " "found :exc:`ValueError` is raised with the details::" msgstr "" -#: ../../library/enum.rst:248 +#: ../../library/enum.rst:241 msgid "Using automatic values" msgstr "" -#: ../../library/enum.rst:250 +#: ../../library/enum.rst:243 msgid "If the exact value is unimportant you can use :class:`auto`::" msgstr "" -#: ../../library/enum.rst:261 +#: ../../library/enum.rst:254 msgid "" "The values are chosen by :func:`_generate_next_value_`, which can be " "overridden::" msgstr "" -#: ../../library/enum.rst:279 +#: ../../library/enum.rst:272 msgid "" -"The goal of the default :meth:`_generate_next_value_` method is to provide " +"The goal of the default :meth:`_generate_next_value_` methods is to provide " "the next :class:`int` in sequence with the last :class:`int` provided, but " "the way it does this is an implementation detail and may change." msgstr "" -#: ../../library/enum.rst:285 +#: ../../library/enum.rst:278 msgid "" "The :meth:`_generate_next_value_` method must be defined before any members." msgstr "" -#: ../../library/enum.rst:288 +#: ../../library/enum.rst:281 msgid "Iteration" msgstr "" -#: ../../library/enum.rst:290 +#: ../../library/enum.rst:283 msgid "Iterating over the members of an enum does not provide the aliases::" msgstr "" -#: ../../library/enum.rst:295 +#: ../../library/enum.rst:288 msgid "" "The special attribute ``__members__`` is a read-only ordered mapping of " "names to members. It includes all names defined in the enumeration, " "including the aliases::" msgstr "" -#: ../../library/enum.rst:307 +#: ../../library/enum.rst:300 msgid "" "The ``__members__`` attribute can be used for detailed programmatic access " "to the enumeration members. For example, finding all the aliases::" msgstr "" -#: ../../library/enum.rst:315 +#: ../../library/enum.rst:308 msgid "Comparisons" msgstr "" -#: ../../library/enum.rst:317 +#: ../../library/enum.rst:310 msgid "Enumeration members are compared by identity::" msgstr "" -#: ../../library/enum.rst:326 +#: ../../library/enum.rst:319 msgid "" "Ordered comparisons between enumeration values are *not* supported. Enum " "members are not integers (but see `IntEnum`_ below)::" msgstr "" -#: ../../library/enum.rst:334 +#: ../../library/enum.rst:327 msgid "Equality comparisons are defined though::" msgstr "" -#: ../../library/enum.rst:343 +#: ../../library/enum.rst:336 msgid "" "Comparisons against non-enumeration values will always compare not equal " "(again, :class:`IntEnum` was explicitly designed to behave differently, see " "below)::" msgstr "" -#: ../../library/enum.rst:352 +#: ../../library/enum.rst:345 msgid "Allowed members and attributes of enumerations" msgstr "" -#: ../../library/enum.rst:354 +#: ../../library/enum.rst:347 msgid "" "The examples above use integers for enumeration values. Using integers is " "short and handy (and provided by default by the `Functional API`_), but not " @@ -316,17 +306,17 @@ msgid "" "enumerations can have arbitrary values." msgstr "" -#: ../../library/enum.rst:360 +#: ../../library/enum.rst:353 msgid "" "Enumerations are Python classes, and can have methods and special methods as " "usual. If we have this enumeration::" msgstr "" -#: ../../library/enum.rst:380 +#: ../../library/enum.rst:373 msgid "Then::" msgstr "" -#: ../../library/enum.rst:389 +#: ../../library/enum.rst:382 msgid "" "The rules for what is allowed are as follows: names that start and end with " "a single underscore are reserved by enum and cannot be used; all other " @@ -336,35 +326,35 @@ msgid "" "names listed in :attr:`_ignore_`." msgstr "" -#: ../../library/enum.rst:396 +#: ../../library/enum.rst:389 msgid "" "Note: if your enumeration defines :meth:`__new__` and/or :meth:`__init__` " "then any value(s) given to the enum member will be passed into those " "methods. See `Planet`_ for an example." msgstr "" -#: ../../library/enum.rst:402 +#: ../../library/enum.rst:395 msgid "Restricted Enum subclassing" msgstr "" -#: ../../library/enum.rst:404 +#: ../../library/enum.rst:397 msgid "" "A new :class:`Enum` class must have one base Enum class, up to one concrete " "data type, and as many :class:`object`-based mixin classes as needed. The " "order of these base classes is::" msgstr "" -#: ../../library/enum.rst:411 +#: ../../library/enum.rst:404 msgid "" "Also, subclassing an enumeration is allowed only if the enumeration does not " "define any members. So this is forbidden::" msgstr "" -#: ../../library/enum.rst:421 +#: ../../library/enum.rst:414 msgid "But this is allowed::" msgstr "" -#: ../../library/enum.rst:432 +#: ../../library/enum.rst:425 msgid "" "Allowing subclassing of enums that define members would lead to a violation " "of some important invariants of types and instances. On the other hand, it " @@ -372,49 +362,49 @@ msgid "" "enumerations. (See `OrderedEnum`_ for an example.)" msgstr "" -#: ../../library/enum.rst:439 +#: ../../library/enum.rst:432 msgid "Pickling" msgstr "" -#: ../../library/enum.rst:441 +#: ../../library/enum.rst:434 msgid "Enumerations can be pickled and unpickled::" msgstr "" -#: ../../library/enum.rst:448 +#: ../../library/enum.rst:441 msgid "" "The usual restrictions for pickling apply: picklable enums must be defined " "in the top level of a module, since unpickling requires them to be " "importable from that module." msgstr "" -#: ../../library/enum.rst:454 +#: ../../library/enum.rst:447 msgid "" "With pickle protocol version 4 it is possible to easily pickle enums nested " "in other classes." msgstr "" -#: ../../library/enum.rst:457 +#: ../../library/enum.rst:450 msgid "" "It is possible to modify how Enum members are pickled/unpickled by defining :" "meth:`__reduce_ex__` in the enumeration class." msgstr "" -#: ../../library/enum.rst:462 +#: ../../library/enum.rst:455 msgid "Functional API" msgstr "" -#: ../../library/enum.rst:464 +#: ../../library/enum.rst:457 msgid "" "The :class:`Enum` class is callable, providing the following functional API::" msgstr "" -#: ../../library/enum.rst:476 +#: ../../library/enum.rst:469 msgid "" "The semantics of this API resemble :class:`~collections.namedtuple`. The " "first argument of the call to :class:`Enum` is the name of the enumeration." msgstr "" -#: ../../library/enum.rst:479 +#: ../../library/enum.rst:472 msgid "" "The second argument is the *source* of enumeration member names. It can be " "a whitespace-separated string of names, a sequence of names, a sequence of 2-" @@ -426,14 +416,14 @@ msgid "" "assignment to :class:`Animal` is equivalent to::" msgstr "" -#: ../../library/enum.rst:495 +#: ../../library/enum.rst:488 msgid "" "The reason for defaulting to ``1`` as the starting number and not ``0`` is " "that ``0`` is ``False`` in a boolean sense, but enum members all evaluate to " "``True``." msgstr "" -#: ../../library/enum.rst:499 +#: ../../library/enum.rst:492 msgid "" "Pickling enums created with the functional API can be tricky as frame stack " "implementation details are used to try and figure out which module the " @@ -442,14 +432,14 @@ msgid "" "The solution is to specify the module name explicitly as follows::" msgstr "" -#: ../../library/enum.rst:509 +#: ../../library/enum.rst:502 msgid "" "If ``module`` is not supplied, and Enum cannot determine what it is, the new " "Enum members will not be unpicklable; to keep errors closer to the source, " "pickling will be disabled." msgstr "" -#: ../../library/enum.rst:513 +#: ../../library/enum.rst:506 msgid "" "The new pickle protocol 4 also, in some circumstances, relies on :attr:" "`~definition.__qualname__` being set to the location where pickle will be " @@ -457,7 +447,7 @@ msgid "" "class SomeData in the global scope::" msgstr "" -#: ../../library/enum.rst:520 +#: ../../library/enum.rst:513 msgid "The complete signature is::" msgstr "" @@ -465,7 +455,7 @@ msgstr "" msgid "value" msgstr "" -#: ../../library/enum.rst:524 +#: ../../library/enum.rst:517 msgid "What the new Enum class will record as its name." msgstr "" @@ -473,21 +463,21 @@ msgstr "" msgid "names" msgstr "" -#: ../../library/enum.rst:526 +#: ../../library/enum.rst:519 msgid "" "The Enum members. This can be a whitespace or comma separated string " "(values will start at 1 unless otherwise specified)::" msgstr "" -#: ../../library/enum.rst:531 +#: ../../library/enum.rst:524 msgid "or an iterator of names::" msgstr "" -#: ../../library/enum.rst:535 +#: ../../library/enum.rst:528 msgid "or an iterator of (name, value) pairs::" msgstr "" -#: ../../library/enum.rst:539 +#: ../../library/enum.rst:532 msgid "or a mapping::" msgstr "" @@ -495,7 +485,7 @@ msgstr "" msgid "module" msgstr "" -#: ../../library/enum.rst:543 +#: ../../library/enum.rst:536 msgid "name of module where new Enum class can be found." msgstr "" @@ -503,7 +493,7 @@ msgstr "" msgid "qualname" msgstr "" -#: ../../library/enum.rst:545 +#: ../../library/enum.rst:538 msgid "where in module new Enum class can be found." msgstr "" @@ -511,7 +501,7 @@ msgstr "" msgid "type" msgstr "" -#: ../../library/enum.rst:547 +#: ../../library/enum.rst:540 msgid "type to mix in to new Enum class." msgstr "" @@ -519,23 +509,23 @@ msgstr "" msgid "start" msgstr "" -#: ../../library/enum.rst:549 +#: ../../library/enum.rst:542 msgid "number to start counting at if only names are passed in." msgstr "" -#: ../../library/enum.rst:551 +#: ../../library/enum.rst:544 msgid "The *start* parameter was added." msgstr "" -#: ../../library/enum.rst:556 +#: ../../library/enum.rst:549 msgid "Derived Enumerations" msgstr "" -#: ../../library/enum.rst:559 +#: ../../library/enum.rst:552 msgid "IntEnum" msgstr "" -#: ../../library/enum.rst:561 +#: ../../library/enum.rst:554 msgid "" "The first variation of :class:`Enum` that is provided is also a subclass of :" "class:`int`. Members of an :class:`IntEnum` can be compared to integers; by " @@ -543,22 +533,22 @@ msgid "" "each other::" msgstr "" -#: ../../library/enum.rst:582 +#: ../../library/enum.rst:575 msgid "" "However, they still can't be compared to standard :class:`Enum` " "enumerations::" msgstr "" -#: ../../library/enum.rst:595 +#: ../../library/enum.rst:588 msgid "" ":class:`IntEnum` values behave like integers in other ways you'd expect::" msgstr "" -#: ../../library/enum.rst:606 +#: ../../library/enum.rst:599 msgid "IntFlag" msgstr "" -#: ../../library/enum.rst:608 +#: ../../library/enum.rst:601 msgid "" "The next variation of :class:`Enum` provided, :class:`IntFlag`, is also " "based on :class:`int`. The difference being :class:`IntFlag` members can be " @@ -569,32 +559,32 @@ msgid "" "operations will lose the :class:`IntFlag` membership." msgstr "" -#: ../../library/enum.rst:618 +#: ../../library/enum.rst:611 msgid "Sample :class:`IntFlag` class::" msgstr "" -#: ../../library/enum.rst:634 +#: ../../library/enum.rst:627 msgid "It is also possible to name the combinations::" msgstr "" -#: ../../library/enum.rst:646 +#: ../../library/enum.rst:639 msgid "" "Another important difference between :class:`IntFlag` and :class:`Enum` is " "that if no flags are set (the value is 0), its boolean evaluation is :data:" "`False`::" msgstr "" -#: ../../library/enum.rst:654 +#: ../../library/enum.rst:647 msgid "" "Because :class:`IntFlag` members are also subclasses of :class:`int` they " "can be combined with them::" msgstr "" -#: ../../library/enum.rst:662 +#: ../../library/enum.rst:655 msgid "Flag" msgstr "" -#: ../../library/enum.rst:664 +#: ../../library/enum.rst:657 msgid "" "The last variation is :class:`Flag`. Like :class:`IntFlag`, :class:`Flag` " "members can be combined using the bitwise operators (&, \\|, ^, ~). Unlike :" @@ -604,25 +594,25 @@ msgid "" "value and let :class:`Flag` select an appropriate value." msgstr "" -#: ../../library/enum.rst:673 +#: ../../library/enum.rst:666 msgid "" "Like :class:`IntFlag`, if a combination of :class:`Flag` members results in " "no flags being set, the boolean evaluation is :data:`False`::" msgstr "" -#: ../../library/enum.rst:687 +#: ../../library/enum.rst:680 msgid "" "Individual flags should have values that are powers of two (1, 2, 4, " "8, ...), while combinations of flags won't::" msgstr "" -#: ../../library/enum.rst:699 +#: ../../library/enum.rst:692 msgid "" "Giving a name to the \"no flags set\" condition does not change its boolean " "value::" msgstr "" -#: ../../library/enum.rst:715 +#: ../../library/enum.rst:708 msgid "" "For the majority of new code, :class:`Enum` and :class:`Flag` are strongly " "recommended, since :class:`IntEnum` and :class:`IntFlag` break some semantic " @@ -633,35 +623,35 @@ msgid "" "enumerations, or for interoperability with other systems." msgstr "" -#: ../../library/enum.rst:725 +#: ../../library/enum.rst:718 msgid "Others" msgstr "" -#: ../../library/enum.rst:727 +#: ../../library/enum.rst:720 msgid "" "While :class:`IntEnum` is part of the :mod:`enum` module, it would be very " "simple to implement independently::" msgstr "" -#: ../../library/enum.rst:733 +#: ../../library/enum.rst:726 msgid "" "This demonstrates how similar derived enumerations can be defined; for " "example a :class:`StrEnum` that mixes in :class:`str` instead of :class:" "`int`." msgstr "" -#: ../../library/enum.rst:736 +#: ../../library/enum.rst:729 msgid "Some rules:" msgstr "" -#: ../../library/enum.rst:738 +#: ../../library/enum.rst:731 msgid "" "When subclassing :class:`Enum`, mix-in types must appear before :class:" "`Enum` itself in the sequence of bases, as in the :class:`IntEnum` example " "above." msgstr "" -#: ../../library/enum.rst:741 +#: ../../library/enum.rst:734 msgid "" "While :class:`Enum` can have members of any type, once you mix in an " "additional type, all the members must have values of that type, e.g. :class:" @@ -669,21 +659,21 @@ msgid "" "methods and don't specify another type." msgstr "" -#: ../../library/enum.rst:745 +#: ../../library/enum.rst:738 msgid "" "When another data type is mixed in, the :attr:`value` attribute is *not the " "same* as the enum member itself, although it is equivalent and will compare " "equal." msgstr "" -#: ../../library/enum.rst:748 +#: ../../library/enum.rst:741 msgid "" "%-style formatting: `%s` and `%r` call the :class:`Enum` class's :meth:" "`__str__` and :meth:`__repr__` respectively; other codes (such as `%i` or `" "%h` for IntEnum) treat the enum member as its mixed-in type." msgstr "" -#: ../../library/enum.rst:751 +#: ../../library/enum.rst:744 msgid "" ":ref:`Formatted string literals `, :meth:`str.format`, and :func:" "`format` will use the mixed-in type's :meth:`__format__` unless :meth:" @@ -693,28 +683,28 @@ msgid "" "`__str__` and :meth:`__repr__` methods." msgstr "" -#: ../../library/enum.rst:759 +#: ../../library/enum.rst:752 msgid "When to use :meth:`__new__` vs. :meth:`__init__`" msgstr "" -#: ../../library/enum.rst:761 +#: ../../library/enum.rst:754 msgid "" ":meth:`__new__` must be used whenever you want to customize the actual value " "of the :class:`Enum` member. Any other modifications may go in either :meth:" "`__new__` or :meth:`__init__`, with :meth:`__init__` being preferred." msgstr "" -#: ../../library/enum.rst:765 +#: ../../library/enum.rst:758 msgid "" "For example, if you want to pass several items to the constructor, but only " "want one of them to be the value::" msgstr "" -#: ../../library/enum.rst:791 +#: ../../library/enum.rst:784 msgid "Interesting examples" msgstr "" -#: ../../library/enum.rst:793 +#: ../../library/enum.rst:786 msgid "" "While :class:`Enum`, :class:`IntEnum`, :class:`IntFlag`, and :class:`Flag` " "are expected to cover the majority of use-cases, they cannot cover them " @@ -722,159 +712,147 @@ msgid "" "used directly, or as examples for creating one's own." msgstr "" -#: ../../library/enum.rst:800 +#: ../../library/enum.rst:793 msgid "Omitting values" msgstr "" -#: ../../library/enum.rst:802 +#: ../../library/enum.rst:795 msgid "" "In many use-cases one doesn't care what the actual value of an enumeration " "is. There are several ways to define this type of simple enumeration:" msgstr "" -#: ../../library/enum.rst:805 +#: ../../library/enum.rst:798 msgid "use instances of :class:`auto` for the value" msgstr "" -#: ../../library/enum.rst:806 +#: ../../library/enum.rst:799 msgid "use instances of :class:`object` as the value" msgstr "" -#: ../../library/enum.rst:807 +#: ../../library/enum.rst:800 msgid "use a descriptive string as the value" msgstr "" -#: ../../library/enum.rst:808 +#: ../../library/enum.rst:801 msgid "" "use a tuple as the value and a custom :meth:`__new__` to replace the tuple " "with an :class:`int` value" msgstr "" -#: ../../library/enum.rst:811 +#: ../../library/enum.rst:804 msgid "" "Using any of these methods signifies to the user that these values are not " "important, and also enables one to add, remove, or reorder members without " "having to renumber the remaining members." msgstr "" -#: ../../library/enum.rst:815 +#: ../../library/enum.rst:808 msgid "" "Whichever method you choose, you should provide a :meth:`repr` that also " "hides the (unimportant) value::" msgstr "" -#: ../../library/enum.rst:825 +#: ../../library/enum.rst:818 msgid "Using :class:`auto`" msgstr "" -#: ../../library/enum.rst:827 +#: ../../library/enum.rst:820 msgid "Using :class:`auto` would look like::" msgstr "" -#: ../../library/enum.rst:839 +#: ../../library/enum.rst:832 msgid "Using :class:`object`" msgstr "" -#: ../../library/enum.rst:841 +#: ../../library/enum.rst:834 msgid "Using :class:`object` would look like::" msgstr "" -#: ../../library/enum.rst:853 +#: ../../library/enum.rst:846 msgid "Using a descriptive string" msgstr "" -#: ../../library/enum.rst:855 +#: ../../library/enum.rst:848 msgid "Using a string as the value would look like::" msgstr "" -#: ../../library/enum.rst:869 +#: ../../library/enum.rst:862 msgid "Using a custom :meth:`__new__`" msgstr "" -#: ../../library/enum.rst:871 +#: ../../library/enum.rst:864 msgid "Using an auto-numbering :meth:`__new__` would look like::" msgstr "" -#: ../../library/enum.rst:890 -msgid "" -"To make a more general purpose ``AutoNumber``, add ``*args`` to the " -"signature::" -msgstr "" - -#: ../../library/enum.rst:900 -msgid "" -"Then when you inherit from ``AutoNumber`` you can write your own " -"``__init__`` to handle any extra arguments::" -msgstr "" - -#: ../../library/enum.rst:919 +#: ../../library/enum.rst:886 msgid "" "The :meth:`__new__` method, if defined, is used during creation of the Enum " "members; it is then replaced by Enum's :meth:`__new__` which is used after " "class creation for lookup of existing members." msgstr "" -#: ../../library/enum.rst:925 +#: ../../library/enum.rst:892 msgid "OrderedEnum" msgstr "" -#: ../../library/enum.rst:927 +#: ../../library/enum.rst:894 msgid "" "An ordered enumeration that is not based on :class:`IntEnum` and so " "maintains the normal :class:`Enum` invariants (such as not being comparable " "to other enumerations)::" msgstr "" -#: ../../library/enum.rst:961 +#: ../../library/enum.rst:928 msgid "DuplicateFreeEnum" msgstr "" -#: ../../library/enum.rst:963 +#: ../../library/enum.rst:930 msgid "" "Raises an error if a duplicate member name is found instead of creating an " "alias::" msgstr "" -#: ../../library/enum.rst:988 +#: ../../library/enum.rst:955 msgid "" "This is a useful example for subclassing Enum to add or change other " "behaviors as well as disallowing aliases. If the only desired change is " "disallowing aliases, the :func:`unique` decorator can be used instead." msgstr "" -#: ../../library/enum.rst:994 +#: ../../library/enum.rst:961 msgid "Planet" msgstr "" -#: ../../library/enum.rst:996 +#: ../../library/enum.rst:963 msgid "" "If :meth:`__new__` or :meth:`__init__` is defined the value of the enum " "member will be passed to those methods::" msgstr "" -#: ../../library/enum.rst:1024 +#: ../../library/enum.rst:991 msgid "TimePeriod" msgstr "" -#: ../../library/enum.rst:1026 +#: ../../library/enum.rst:993 msgid "An example to show the :attr:`_ignore_` attribute in use::" msgstr "" -#: ../../library/enum.rst:1043 +#: ../../library/enum.rst:1010 msgid "How are Enums different?" msgstr "" -#: ../../library/enum.rst:1045 +#: ../../library/enum.rst:1012 msgid "" "Enums have a custom metaclass that affects many aspects of both derived Enum " "classes and their instances (members)." msgstr "" -#: ../../library/enum.rst:1050 +#: ../../library/enum.rst:1017 msgid "Enum Classes" msgstr "" -#: ../../library/enum.rst:1052 +#: ../../library/enum.rst:1019 msgid "" "The :class:`EnumMeta` metaclass is responsible for providing the :meth:" "`__contains__`, :meth:`__dir__`, :meth:`__iter__` and other methods that " @@ -885,11 +863,11 @@ msgid "" "meth:`__str__` and :meth:`__repr__`)." msgstr "" -#: ../../library/enum.rst:1062 +#: ../../library/enum.rst:1029 msgid "Enum Members (aka instances)" msgstr "" -#: ../../library/enum.rst:1064 +#: ../../library/enum.rst:1031 msgid "" "The most interesting thing about Enum members is that they are singletons. :" "class:`EnumMeta` creates them all while it is creating the :class:`Enum` " @@ -898,102 +876,91 @@ msgid "" "instances." msgstr "" -#: ../../library/enum.rst:1072 +#: ../../library/enum.rst:1039 msgid "Finer Points" msgstr "" -#: ../../library/enum.rst:1075 +#: ../../library/enum.rst:1042 msgid "Supported ``__dunder__`` names" msgstr "" -#: ../../library/enum.rst:1077 +#: ../../library/enum.rst:1044 msgid "" ":attr:`__members__` is a read-only ordered mapping of ``member_name``:" "``member`` items. It is only available on the class." msgstr "" -#: ../../library/enum.rst:1080 +#: ../../library/enum.rst:1047 msgid "" ":meth:`__new__`, if specified, must create and return the enum members; it " "is also a very good idea to set the member's :attr:`_value_` appropriately. " "Once all the members are created it is no longer used." msgstr "" -#: ../../library/enum.rst:1086 +#: ../../library/enum.rst:1053 msgid "Supported ``_sunder_`` names" msgstr "" -#: ../../library/enum.rst:1088 +#: ../../library/enum.rst:1055 msgid "``_name_`` -- name of the member" msgstr "" -#: ../../library/enum.rst:1089 +#: ../../library/enum.rst:1056 msgid "" "``_value_`` -- value of the member; can be set / modified in ``__new__``" msgstr "" -#: ../../library/enum.rst:1091 +#: ../../library/enum.rst:1058 msgid "" "``_missing_`` -- a lookup function used when a value is not found; may be " "overridden" msgstr "" -#: ../../library/enum.rst:1093 +#: ../../library/enum.rst:1060 msgid "" "``_ignore_`` -- a list of names, either as a :class:`list` or a :class:" "`str`, that will not be transformed into members, and will be removed from " "the final class" msgstr "" -#: ../../library/enum.rst:1096 +#: ../../library/enum.rst:1063 msgid "" "``_order_`` -- used in Python 2/3 code to ensure member order is consistent " "(class attribute, removed during class creation)" msgstr "" -#: ../../library/enum.rst:1098 +#: ../../library/enum.rst:1065 msgid "" "``_generate_next_value_`` -- used by the `Functional API`_ and by :class:" "`auto` to get an appropriate value for an enum member; may be overridden" msgstr "" -#: ../../library/enum.rst:1102 +#: ../../library/enum.rst:1069 msgid "``_missing_``, ``_order_``, ``_generate_next_value_``" msgstr "" -#: ../../library/enum.rst:1103 +#: ../../library/enum.rst:1070 msgid "``_ignore_``" msgstr "" -#: ../../library/enum.rst:1105 +#: ../../library/enum.rst:1072 msgid "" "To help keep Python 2 / Python 3 code in sync an :attr:`_order_` attribute " "can be provided. It will be checked against the actual order of the " "enumeration and raise an error if the two do not match::" msgstr "" -#: ../../library/enum.rst:1121 +#: ../../library/enum.rst:1088 msgid "" "In Python 2 code the :attr:`_order_` attribute is necessary as definition " "order is lost before it can be recorded." msgstr "" -#: ../../library/enum.rst:1126 -msgid "_Private__names" -msgstr "" - -#: ../../library/enum.rst:1128 -msgid "" -"Private names will be normal attributes in Python 3.10 instead of either an " -"error or a member (depending on if the name ends with an underscore). Using " -"these names in 3.9 will issue a :exc:`DeprecationWarning`." -msgstr "" - -#: ../../library/enum.rst:1134 +#: ../../library/enum.rst:1092 msgid "``Enum`` member type" msgstr "" -#: ../../library/enum.rst:1136 +#: ../../library/enum.rst:1094 msgid "" ":class:`Enum` members are instances of their :class:`Enum` class, and are " "normally accessed as ``EnumClass.member``. Under certain circumstances they " @@ -1003,11 +970,11 @@ msgid "" "uppercase names for members)::" msgstr "" -#: ../../library/enum.rst:1157 +#: ../../library/enum.rst:1115 msgid "Boolean value of ``Enum`` classes and members" msgstr "" -#: ../../library/enum.rst:1159 +#: ../../library/enum.rst:1117 msgid "" ":class:`Enum` members that are mixed with non-:class:`Enum` types (such as :" "class:`int`, :class:`str`, etc.) are evaluated according to the mixed-in " @@ -1016,26 +983,26 @@ msgid "" "to your class::" msgstr "" -#: ../../library/enum.rst:1168 +#: ../../library/enum.rst:1126 msgid ":class:`Enum` classes always evaluate as :data:`True`." msgstr "" -#: ../../library/enum.rst:1172 +#: ../../library/enum.rst:1130 msgid "``Enum`` classes with methods" msgstr "" -#: ../../library/enum.rst:1174 +#: ../../library/enum.rst:1132 msgid "" "If you give your :class:`Enum` subclass extra methods, like the `Planet`_ " "class above, those methods will show up in a :func:`dir` of the member, but " "not of the class::" msgstr "" -#: ../../library/enum.rst:1185 +#: ../../library/enum.rst:1143 msgid "Combining members of ``Flag``" msgstr "" -#: ../../library/enum.rst:1187 +#: ../../library/enum.rst:1145 msgid "" "If a combination of Flag members is not named, the :func:`repr` will include " "all named flags and all named combinations of flags that are in the value::" diff --git a/library/exceptions.po b/library/exceptions.po index 7f507f478a..87ac975ac0 100644 --- a/library/exceptions.po +++ b/library/exceptions.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.7\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2021-09-07 06:52+0000\n" +"POT-Creation-Date: 2020-06-20 18:08+0800\n" "PO-Revision-Date: 2018-05-23 16:01+0000\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -74,20 +74,19 @@ msgstr "" msgid "" "When raising a new exception (rather than using a bare ``raise`` to re-raise " "the exception currently being handled), the implicit exception context can " -"be supplemented with an explicit cause by using :keyword:`from` with :" +"be supplemented with an explicit cause by using :keyword:`from` with :" "keyword:`raise`::" msgstr "" #: ../../library/exceptions.rst:50 msgid "" -"The expression following :keyword:`from` must be an exception or " -"``None``. It will be set as :attr:`__cause__` on the raised exception. " -"Setting :attr:`__cause__` also implicitly sets the :attr:" -"`__suppress_context__` attribute to ``True``, so that using ``raise new_exc " -"from None`` effectively replaces the old exception with the new one for " -"display purposes (e.g. converting :exc:`KeyError` to :exc:`AttributeError`), " -"while leaving the old exception available in :attr:`__context__` for " -"introspection when debugging." +"The expression following :keyword:`from` must be an exception or ``None``. " +"It will be set as :attr:`__cause__` on the raised exception. Setting :attr:" +"`__cause__` also implicitly sets the :attr:`__suppress_context__` attribute " +"to ``True``, so that using ``raise new_exc from None`` effectively replaces " +"the old exception with the new one for display purposes (e.g. converting :" +"exc:`KeyError` to :exc:`AttributeError`), while leaving the old exception " +"available in :attr:`__context__` for introspection when debugging." msgstr "" #: ../../library/exceptions.rst:59 @@ -456,65 +455,38 @@ msgstr "" #: ../../library/exceptions.rst:395 msgid "" "Raised when the parser encounters a syntax error. This may occur in an :" -"keyword:`import` statement, in a call to the built-in functions :func:" -"`compile`, :func:`exec`, or :func:`eval`, or when reading the initial script " -"or standard input (also interactively)." +"keyword:`import` statement, in a call to the built-in functions :func:`exec` " +"or :func:`eval`, or when reading the initial script or standard input (also " +"interactively)." msgstr "" -#: ../../library/exceptions.rst:401 +#: ../../library/exceptions.rst:400 msgid "" -"The :func:`str` of the exception instance returns only the error message. " -"Details is a tuple whose members are also available as separate attributes." +"Instances of this class have attributes :attr:`filename`, :attr:`lineno`, :" +"attr:`offset` and :attr:`text` for easier access to the details. :func:" +"`str` of the exception instance returns only the message." msgstr "" -#: ../../library/exceptions.rst:406 -msgid "The name of the file the syntax error occurred in." -msgstr "" - -#: ../../library/exceptions.rst:410 -msgid "" -"Which line number in the file the error occurred in. This is 1-indexed: the " -"first line in the file has a ``lineno`` of 1." -msgstr "" - -#: ../../library/exceptions.rst:415 -msgid "" -"The column in the line where the error occurred. This is 1-indexed: the " -"first character in the line has an ``offset`` of 1." -msgstr "" - -#: ../../library/exceptions.rst:420 -msgid "The source code text involved in the error." -msgstr "" - -#: ../../library/exceptions.rst:422 -msgid "" -"For errors in f-string fields, the message is prefixed by \"f-string: \" and " -"the offsets are offsets in a text constructed from the replacement " -"expression. For example, compiling f'Bad {a b} field' results in this args " -"attribute: ('f-string: ...', ('', 1, 4, '(a b)\\n'))." -msgstr "" - -#: ../../library/exceptions.rst:430 +#: ../../library/exceptions.rst:407 msgid "" "Base class for syntax errors related to incorrect indentation. This is a " "subclass of :exc:`SyntaxError`." msgstr "" -#: ../../library/exceptions.rst:436 +#: ../../library/exceptions.rst:413 msgid "" "Raised when indentation contains an inconsistent use of tabs and spaces. " "This is a subclass of :exc:`IndentationError`." msgstr "" -#: ../../library/exceptions.rst:442 +#: ../../library/exceptions.rst:419 msgid "" "Raised when the interpreter finds an internal error, but the situation does " "not look so serious to cause it to abandon all hope. The associated value is " "a string indicating what went wrong (in low-level terms)." msgstr "" -#: ../../library/exceptions.rst:446 +#: ../../library/exceptions.rst:423 msgid "" "You should report this to the author or maintainer of your Python " "interpreter. Be sure to report the version of the Python interpreter (``sys." @@ -523,7 +495,7 @@ msgid "" "possible the source of the program that triggered the error." msgstr "" -#: ../../library/exceptions.rst:455 +#: ../../library/exceptions.rst:432 msgid "" "This exception is raised by the :func:`sys.exit` function. It inherits " "from :exc:`BaseException` instead of :exc:`Exception` so that it is not " @@ -537,7 +509,7 @@ msgid "" "printed and the exit status is one." msgstr "" -#: ../../library/exceptions.rst:466 +#: ../../library/exceptions.rst:443 msgid "" "A call to :func:`sys.exit` is translated into an exception so that clean-up " "handlers (:keyword:`finally` clauses of :keyword:`try` statements) can be " @@ -547,20 +519,20 @@ msgid "" "child process after a call to :func:`os.fork`)." msgstr "" -#: ../../library/exceptions.rst:475 +#: ../../library/exceptions.rst:452 msgid "" "The exit status or error message that is passed to the constructor. " "(Defaults to ``None``.)" msgstr "" -#: ../../library/exceptions.rst:481 +#: ../../library/exceptions.rst:458 msgid "" "Raised when an operation or function is applied to an object of " "inappropriate type. The associated value is a string giving details about " "the type mismatch." msgstr "" -#: ../../library/exceptions.rst:484 +#: ../../library/exceptions.rst:461 msgid "" "This exception may be raised by user code to indicate that an attempted " "operation on an object is not supported, and is not meant to be. If an " @@ -568,7 +540,7 @@ msgid "" "implementation, :exc:`NotImplementedError` is the proper exception to raise." msgstr "" -#: ../../library/exceptions.rst:489 +#: ../../library/exceptions.rst:466 msgid "" "Passing arguments of the wrong type (e.g. passing a :class:`list` when an :" "class:`int` is expected) should result in a :exc:`TypeError`, but passing " @@ -576,135 +548,135 @@ msgid "" "should result in a :exc:`ValueError`." msgstr "" -#: ../../library/exceptions.rst:496 +#: ../../library/exceptions.rst:473 msgid "" "Raised when a reference is made to a local variable in a function or method, " "but no value has been bound to that variable. This is a subclass of :exc:" "`NameError`." msgstr "" -#: ../../library/exceptions.rst:503 +#: ../../library/exceptions.rst:480 msgid "" "Raised when a Unicode-related encoding or decoding error occurs. It is a " "subclass of :exc:`ValueError`." msgstr "" -#: ../../library/exceptions.rst:506 +#: ../../library/exceptions.rst:483 msgid "" ":exc:`UnicodeError` has attributes that describe the encoding or decoding " "error. For example, ``err.object[err.start:err.end]`` gives the particular " "invalid input that the codec failed on." msgstr "" -#: ../../library/exceptions.rst:512 +#: ../../library/exceptions.rst:489 msgid "The name of the encoding that raised the error." msgstr "" -#: ../../library/exceptions.rst:516 +#: ../../library/exceptions.rst:493 msgid "A string describing the specific codec error." msgstr "" -#: ../../library/exceptions.rst:520 +#: ../../library/exceptions.rst:497 msgid "The object the codec was attempting to encode or decode." msgstr "" -#: ../../library/exceptions.rst:524 +#: ../../library/exceptions.rst:501 msgid "The first index of invalid data in :attr:`object`." msgstr "" -#: ../../library/exceptions.rst:528 +#: ../../library/exceptions.rst:505 msgid "The index after the last invalid data in :attr:`object`." msgstr "" -#: ../../library/exceptions.rst:533 +#: ../../library/exceptions.rst:510 msgid "" "Raised when a Unicode-related error occurs during encoding. It is a " "subclass of :exc:`UnicodeError`." msgstr "" -#: ../../library/exceptions.rst:539 +#: ../../library/exceptions.rst:516 msgid "" "Raised when a Unicode-related error occurs during decoding. It is a " "subclass of :exc:`UnicodeError`." msgstr "" -#: ../../library/exceptions.rst:545 +#: ../../library/exceptions.rst:522 msgid "" "Raised when a Unicode-related error occurs during translating. It is a " "subclass of :exc:`UnicodeError`." msgstr "" -#: ../../library/exceptions.rst:551 +#: ../../library/exceptions.rst:528 msgid "" "Raised when an operation or function receives an argument that has the right " "type but an inappropriate value, and the situation is not described by a " "more precise exception such as :exc:`IndexError`." msgstr "" -#: ../../library/exceptions.rst:558 +#: ../../library/exceptions.rst:535 msgid "" "Raised when the second argument of a division or modulo operation is zero. " "The associated value is a string indicating the type of the operands and the " "operation." msgstr "" -#: ../../library/exceptions.rst:563 +#: ../../library/exceptions.rst:540 msgid "" "The following exceptions are kept for compatibility with previous versions; " "starting from Python 3.3, they are aliases of :exc:`OSError`." msgstr "" -#: ../../library/exceptions.rst:572 +#: ../../library/exceptions.rst:549 msgid "Only available on Windows." msgstr "" -#: ../../library/exceptions.rst:576 +#: ../../library/exceptions.rst:553 msgid "OS exceptions" msgstr "" -#: ../../library/exceptions.rst:578 +#: ../../library/exceptions.rst:555 msgid "" "The following exceptions are subclasses of :exc:`OSError`, they get raised " "depending on the system error code." msgstr "" -#: ../../library/exceptions.rst:583 +#: ../../library/exceptions.rst:560 msgid "" "Raised when an operation would block on an object (e.g. socket) set for non-" "blocking operation. Corresponds to :c:data:`errno` ``EAGAIN``, ``EALREADY``, " "``EWOULDBLOCK`` and ``EINPROGRESS``." msgstr "" -#: ../../library/exceptions.rst:588 +#: ../../library/exceptions.rst:565 msgid "" "In addition to those of :exc:`OSError`, :exc:`BlockingIOError` can have one " "more attribute:" msgstr "" -#: ../../library/exceptions.rst:593 +#: ../../library/exceptions.rst:570 msgid "" "An integer containing the number of characters written to the stream before " "it blocked. This attribute is available when using the buffered I/O classes " "from the :mod:`io` module." msgstr "" -#: ../../library/exceptions.rst:599 +#: ../../library/exceptions.rst:576 msgid "" "Raised when an operation on a child process failed. Corresponds to :c:data:" "`errno` ``ECHILD``." msgstr "" -#: ../../library/exceptions.rst:604 +#: ../../library/exceptions.rst:581 msgid "A base class for connection-related issues." msgstr "" -#: ../../library/exceptions.rst:606 +#: ../../library/exceptions.rst:583 msgid "" "Subclasses are :exc:`BrokenPipeError`, :exc:`ConnectionAbortedError`, :exc:" "`ConnectionRefusedError` and :exc:`ConnectionResetError`." msgstr "" -#: ../../library/exceptions.rst:611 +#: ../../library/exceptions.rst:588 msgid "" "A subclass of :exc:`ConnectionError`, raised when trying to write on a pipe " "while the other end has been closed, or trying to write on a socket which " @@ -712,180 +684,175 @@ msgid "" "``ESHUTDOWN``." msgstr "" -#: ../../library/exceptions.rst:618 +#: ../../library/exceptions.rst:595 msgid "" "A subclass of :exc:`ConnectionError`, raised when a connection attempt is " "aborted by the peer. Corresponds to :c:data:`errno` ``ECONNABORTED``." msgstr "" -#: ../../library/exceptions.rst:624 +#: ../../library/exceptions.rst:601 msgid "" "A subclass of :exc:`ConnectionError`, raised when a connection attempt is " "refused by the peer. Corresponds to :c:data:`errno` ``ECONNREFUSED``." msgstr "" -#: ../../library/exceptions.rst:630 +#: ../../library/exceptions.rst:607 msgid "" "A subclass of :exc:`ConnectionError`, raised when a connection is reset by " "the peer. Corresponds to :c:data:`errno` ``ECONNRESET``." msgstr "" -#: ../../library/exceptions.rst:636 +#: ../../library/exceptions.rst:613 msgid "" "Raised when trying to create a file or directory which already exists. " "Corresponds to :c:data:`errno` ``EEXIST``." msgstr "" -#: ../../library/exceptions.rst:641 +#: ../../library/exceptions.rst:618 msgid "" "Raised when a file or directory is requested but doesn't exist. Corresponds " "to :c:data:`errno` ``ENOENT``." msgstr "" -#: ../../library/exceptions.rst:646 +#: ../../library/exceptions.rst:623 msgid "" "Raised when a system call is interrupted by an incoming signal. Corresponds " "to :c:data:`errno` :py:data:`~errno.EINTR`." msgstr "" -#: ../../library/exceptions.rst:649 +#: ../../library/exceptions.rst:626 msgid "" "Python now retries system calls when a syscall is interrupted by a signal, " "except if the signal handler raises an exception (see :pep:`475` for the " "rationale), instead of raising :exc:`InterruptedError`." msgstr "" -#: ../../library/exceptions.rst:656 +#: ../../library/exceptions.rst:633 msgid "" "Raised when a file operation (such as :func:`os.remove`) is requested on a " "directory. Corresponds to :c:data:`errno` ``EISDIR``." msgstr "" -#: ../../library/exceptions.rst:662 +#: ../../library/exceptions.rst:639 msgid "" "Raised when a directory operation (such as :func:`os.listdir`) is requested " -"on something which is not a directory. On most POSIX platforms, it may also " -"be raised if an operation attempts to open or traverse a non-directory file " -"as if it were a directory. Corresponds to :c:data:`errno` ``ENOTDIR``." +"on something which is not a directory. Corresponds to :c:data:`errno` " +"``ENOTDIR``." msgstr "" -#: ../../library/exceptions.rst:670 +#: ../../library/exceptions.rst:645 msgid "" "Raised when trying to run an operation without the adequate access rights - " "for example filesystem permissions. Corresponds to :c:data:`errno` " "``EACCES`` and ``EPERM``." msgstr "" -#: ../../library/exceptions.rst:676 +#: ../../library/exceptions.rst:651 msgid "" "Raised when a given process doesn't exist. Corresponds to :c:data:`errno` " "``ESRCH``." msgstr "" -#: ../../library/exceptions.rst:681 +#: ../../library/exceptions.rst:656 msgid "" "Raised when a system function timed out at the system level. Corresponds to :" "c:data:`errno` ``ETIMEDOUT``." msgstr "" -#: ../../library/exceptions.rst:684 +#: ../../library/exceptions.rst:659 msgid "All the above :exc:`OSError` subclasses were added." msgstr "" -#: ../../library/exceptions.rst:690 +#: ../../library/exceptions.rst:665 msgid ":pep:`3151` - Reworking the OS and IO exception hierarchy" msgstr "" -#: ../../library/exceptions.rst:696 +#: ../../library/exceptions.rst:671 msgid "Warnings" msgstr "" -#: ../../library/exceptions.rst:698 +#: ../../library/exceptions.rst:673 msgid "" "The following exceptions are used as warning categories; see the :ref:" "`warning-categories` documentation for more details." msgstr "" -#: ../../library/exceptions.rst:703 +#: ../../library/exceptions.rst:678 msgid "Base class for warning categories." msgstr "" -#: ../../library/exceptions.rst:708 +#: ../../library/exceptions.rst:683 msgid "Base class for warnings generated by user code." msgstr "" -#: ../../library/exceptions.rst:713 +#: ../../library/exceptions.rst:688 msgid "" "Base class for warnings about deprecated features when those warnings are " "intended for other Python developers." msgstr "" -#: ../../library/exceptions.rst:716 +#: ../../library/exceptions.rst:691 msgid "" "Ignored by the default warning filters, except in the ``__main__`` module (:" "pep:`565`). Enabling the :ref:`Python Development Mode ` shows this " "warning." msgstr "" -#: ../../library/exceptions.rst:720 ../../library/exceptions.rst:736 -msgid "The deprecation policy is described in :pep:`387`." -msgstr "" - -#: ../../library/exceptions.rst:725 +#: ../../library/exceptions.rst:698 msgid "" "Base class for warnings about features which are obsolete and expected to be " "deprecated in the future, but are not deprecated at the moment." msgstr "" -#: ../../library/exceptions.rst:729 +#: ../../library/exceptions.rst:702 msgid "" "This class is rarely used as emitting a warning about a possible upcoming " "deprecation is unusual, and :exc:`DeprecationWarning` is preferred for " "already active deprecations." msgstr "" -#: ../../library/exceptions.rst:733 ../../library/exceptions.rst:759 -#: ../../library/exceptions.rst:777 +#: ../../library/exceptions.rst:706 ../../library/exceptions.rst:730 +#: ../../library/exceptions.rst:748 msgid "" "Ignored by the default warning filters. Enabling the :ref:`Python " "Development Mode ` shows this warning." msgstr "" -#: ../../library/exceptions.rst:741 +#: ../../library/exceptions.rst:712 msgid "Base class for warnings about dubious syntax." msgstr "" -#: ../../library/exceptions.rst:746 +#: ../../library/exceptions.rst:717 msgid "Base class for warnings about dubious runtime behavior." msgstr "" -#: ../../library/exceptions.rst:751 +#: ../../library/exceptions.rst:722 msgid "" "Base class for warnings about deprecated features when those warnings are " "intended for end users of applications that are written in Python." msgstr "" -#: ../../library/exceptions.rst:757 +#: ../../library/exceptions.rst:728 msgid "Base class for warnings about probable mistakes in module imports." msgstr "" -#: ../../library/exceptions.rst:765 +#: ../../library/exceptions.rst:736 msgid "Base class for warnings related to Unicode." msgstr "" -#: ../../library/exceptions.rst:770 +#: ../../library/exceptions.rst:741 msgid "" "Base class for warnings related to :class:`bytes` and :class:`bytearray`." msgstr "" -#: ../../library/exceptions.rst:775 +#: ../../library/exceptions.rst:746 msgid "Base class for warnings related to resource usage." msgstr "" -#: ../../library/exceptions.rst:785 +#: ../../library/exceptions.rst:756 msgid "Exception hierarchy" msgstr "" -#: ../../library/exceptions.rst:787 +#: ../../library/exceptions.rst:758 msgid "The class hierarchy for built-in exceptions is:" msgstr "" diff --git a/library/filecmp.po b/library/filecmp.po index 7c1064f4a6..1cfbb65784 100644 --- a/library/filecmp.po +++ b/library/filecmp.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.7\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2021-09-07 06:52+0000\n" +"POT-Creation-Date: 2018-06-26 18:54+0800\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-" @@ -45,37 +45,30 @@ msgstr "" #: ../../library/filecmp.rst:25 msgid "" -"If *shallow* is true and the :func:`os.stat` signatures (file type, size, " -"and modification time) of both files are identical, the files are taken to " -"be equal." +"If *shallow* is true, files with identical :func:`os.stat` signatures are " +"taken to be equal. Otherwise, the contents of the files are compared." msgstr "" -#: ../../library/filecmp.rst:29 -msgid "" -"Otherwise, the files are treated as different if their sizes or contents " -"differ." -msgstr "" - -#: ../../library/filecmp.rst:31 +#: ../../library/filecmp.rst:28 msgid "" "Note that no external programs are called from this function, giving it " "portability and efficiency." msgstr "" -#: ../../library/filecmp.rst:34 +#: ../../library/filecmp.rst:31 msgid "" "This function uses a cache for past comparisons and the results, with cache " "entries invalidated if the :func:`os.stat` information for the file " "changes. The entire cache may be cleared using :func:`clear_cache`." msgstr "" -#: ../../library/filecmp.rst:41 +#: ../../library/filecmp.rst:38 msgid "" "Compare the files in the two directories *dir1* and *dir2* whose names are " "given by *common*." msgstr "" -#: ../../library/filecmp.rst:44 +#: ../../library/filecmp.rst:41 msgid "" "Returns three lists of file names: *match*, *mismatch*, *errors*. *match* " "contains the list of files that match, *mismatch* contains the names of " @@ -85,31 +78,31 @@ msgid "" "could not be done for some other reason." msgstr "" -#: ../../library/filecmp.rst:51 +#: ../../library/filecmp.rst:48 msgid "" "The *shallow* parameter has the same meaning and default value as for :func:" "`filecmp.cmp`." msgstr "" -#: ../../library/filecmp.rst:54 +#: ../../library/filecmp.rst:51 msgid "" "For example, ``cmpfiles('a', 'b', ['c', 'd/e'])`` will compare ``a/c`` with " "``b/c`` and ``a/d/e`` with ``b/d/e``. ``'c'`` and ``'d/e'`` will each be in " "one of the three returned lists." msgstr "" -#: ../../library/filecmp.rst:61 +#: ../../library/filecmp.rst:58 msgid "" "Clear the filecmp cache. This may be useful if a file is compared so quickly " "after it is modified that it is within the mtime resolution of the " "underlying filesystem." msgstr "" -#: ../../library/filecmp.rst:71 +#: ../../library/filecmp.rst:68 msgid "The :class:`dircmp` class" msgstr "" -#: ../../library/filecmp.rst:75 +#: ../../library/filecmp.rst:72 msgid "" "Construct a new directory comparison object, to compare the directories *a* " "and *b*. *ignore* is a list of names to ignore, and defaults to :attr:" @@ -117,113 +110,113 @@ msgid "" "to ``[os.curdir, os.pardir]``." msgstr "" -#: ../../library/filecmp.rst:80 +#: ../../library/filecmp.rst:77 msgid "" "The :class:`dircmp` class compares files by doing *shallow* comparisons as " "described for :func:`filecmp.cmp`." msgstr "" -#: ../../library/filecmp.rst:83 +#: ../../library/filecmp.rst:80 msgid "The :class:`dircmp` class provides the following methods:" msgstr "" -#: ../../library/filecmp.rst:87 +#: ../../library/filecmp.rst:84 msgid "Print (to :data:`sys.stdout`) a comparison between *a* and *b*." msgstr "" -#: ../../library/filecmp.rst:91 +#: ../../library/filecmp.rst:88 msgid "" "Print a comparison between *a* and *b* and common immediate subdirectories." msgstr "" -#: ../../library/filecmp.rst:96 +#: ../../library/filecmp.rst:93 msgid "" "Print a comparison between *a* and *b* and common subdirectories " "(recursively)." msgstr "" -#: ../../library/filecmp.rst:99 +#: ../../library/filecmp.rst:96 msgid "" "The :class:`dircmp` class offers a number of interesting attributes that may " "be used to get various bits of information about the directory trees being " "compared." msgstr "" -#: ../../library/filecmp.rst:103 +#: ../../library/filecmp.rst:100 msgid "" "Note that via :meth:`__getattr__` hooks, all attributes are computed lazily, " "so there is no speed penalty if only those attributes which are lightweight " "to compute are used." msgstr "" -#: ../../library/filecmp.rst:110 +#: ../../library/filecmp.rst:107 msgid "The directory *a*." msgstr "" -#: ../../library/filecmp.rst:115 +#: ../../library/filecmp.rst:112 msgid "The directory *b*." msgstr "" -#: ../../library/filecmp.rst:120 +#: ../../library/filecmp.rst:117 msgid "Files and subdirectories in *a*, filtered by *hide* and *ignore*." msgstr "" -#: ../../library/filecmp.rst:125 +#: ../../library/filecmp.rst:122 msgid "Files and subdirectories in *b*, filtered by *hide* and *ignore*." msgstr "" -#: ../../library/filecmp.rst:130 +#: ../../library/filecmp.rst:127 msgid "Files and subdirectories in both *a* and *b*." msgstr "" -#: ../../library/filecmp.rst:135 +#: ../../library/filecmp.rst:132 msgid "Files and subdirectories only in *a*." msgstr "" -#: ../../library/filecmp.rst:140 +#: ../../library/filecmp.rst:137 msgid "Files and subdirectories only in *b*." msgstr "" -#: ../../library/filecmp.rst:145 +#: ../../library/filecmp.rst:142 msgid "Subdirectories in both *a* and *b*." msgstr "" -#: ../../library/filecmp.rst:150 +#: ../../library/filecmp.rst:147 msgid "Files in both *a* and *b*." msgstr "" -#: ../../library/filecmp.rst:155 +#: ../../library/filecmp.rst:152 msgid "" "Names in both *a* and *b*, such that the type differs between the " "directories, or names for which :func:`os.stat` reports an error." msgstr "" -#: ../../library/filecmp.rst:161 +#: ../../library/filecmp.rst:158 msgid "" "Files which are identical in both *a* and *b*, using the class's file " "comparison operator." msgstr "" -#: ../../library/filecmp.rst:167 +#: ../../library/filecmp.rst:164 msgid "" "Files which are in both *a* and *b*, whose contents differ according to the " "class's file comparison operator." msgstr "" -#: ../../library/filecmp.rst:173 +#: ../../library/filecmp.rst:170 msgid "Files which are in both *a* and *b*, but could not be compared." msgstr "" -#: ../../library/filecmp.rst:178 +#: ../../library/filecmp.rst:175 msgid "" "A dictionary mapping names in :attr:`common_dirs` to :class:`dircmp` objects." msgstr "" -#: ../../library/filecmp.rst:185 +#: ../../library/filecmp.rst:182 msgid "List of directories ignored by :class:`dircmp` by default." msgstr "" -#: ../../library/filecmp.rst:188 +#: ../../library/filecmp.rst:185 msgid "" "Here is a simplified example of using the ``subdirs`` attribute to search " "recursively through two directories to show common different files::" diff --git a/library/fnmatch.po b/library/fnmatch.po index 4931023be8..834cd724e7 100644 --- a/library/fnmatch.po +++ b/library/fnmatch.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.7\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2021-09-07 06:52+0000\n" +"POT-Creation-Date: 2020-06-20 18:08+0800\n" "PO-Revision-Date: 2018-05-23 16:02+0000\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -112,9 +112,9 @@ msgstr "" #: ../../library/fnmatch.rst:78 msgid "" -"Construct a list from those elements of the iterable *names* that match " -"*pattern*. It is the same as ``[n for n in names if fnmatch(n, pattern)]``, " -"but implemented more efficiently." +"Return the subset of the list of *names* that match *pattern*. It is the " +"same as ``[n for n in names if fnmatch(n, pattern)]``, but implemented more " +"efficiently." msgstr "" #: ../../library/fnmatch.rst:84 diff --git a/library/ftplib.po b/library/ftplib.po index 2f497d31df..d194e24b1f 100644 --- a/library/ftplib.po +++ b/library/ftplib.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.7\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2021-09-07 06:52+0000\n" +"POT-Creation-Date: 2020-06-20 18:08+0800\n" "PO-Revision-Date: 2018-05-23 16:02+0000\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -44,11 +44,11 @@ msgstr "" msgid "Here's a sample session using the :mod:`ftplib` module::" msgstr "" -#: ../../library/ftplib.rst:46 +#: ../../library/ftplib.rst:44 msgid "The module defines the following items:" msgstr "" -#: ../../library/ftplib.rst:50 +#: ../../library/ftplib.rst:48 msgid "" "Return a new instance of the :class:`FTP` class. When *host* is given, the " "method call ``connect(host)`` is made. When *user* is given, additionally " @@ -61,20 +61,20 @@ msgid "" "specifies the encoding for directories and filenames." msgstr "" -#: ../../library/ftplib.rst:60 +#: ../../library/ftplib.rst:58 msgid "The :class:`FTP` class supports the :keyword:`with` statement, e.g.:" msgstr "" -#: ../../library/ftplib.rst:74 +#: ../../library/ftplib.rst:72 msgid "Support for the :keyword:`with` statement was added." msgstr "" -#: ../../library/ftplib.rst:77 ../../library/ftplib.rst:103 -#: ../../library/ftplib.rst:212 +#: ../../library/ftplib.rst:75 ../../library/ftplib.rst:101 +#: ../../library/ftplib.rst:210 msgid "*source_address* parameter was added." msgstr "" -#: ../../library/ftplib.rst:80 ../../library/ftplib.rst:118 +#: ../../library/ftplib.rst:78 ../../library/ftplib.rst:116 msgid "" "If the *timeout* parameter is set to be zero, it will raise a :class:" "`ValueError` to prevent the creation of a non-blocking socket. The " @@ -82,7 +82,7 @@ msgid "" "UTF-8 to follow :rfc:`2640`." msgstr "" -#: ../../library/ftplib.rst:88 +#: ../../library/ftplib.rst:86 msgid "" "A :class:`FTP` subclass which adds TLS support to FTP as described in :rfc:" "`4217`. Connect as usual to port 21 implicitly securing the FTP control " @@ -94,54 +94,54 @@ msgid "" "best practices." msgstr "" -#: ../../library/ftplib.rst:97 +#: ../../library/ftplib.rst:95 msgid "" "*keyfile* and *certfile* are a legacy alternative to *context* -- they can " "point to PEM-formatted private key and certificate chain files " "(respectively) for the SSL connection." msgstr "" -#: ../../library/ftplib.rst:106 +#: ../../library/ftplib.rst:104 msgid "" "The class now supports hostname check with :attr:`ssl.SSLContext." "check_hostname` and *Server Name Indication* (see :data:`ssl.HAS_SNI`)." msgstr "" -#: ../../library/ftplib.rst:113 +#: ../../library/ftplib.rst:111 msgid "" "*keyfile* and *certfile* are deprecated in favor of *context*. Please use :" "meth:`ssl.SSLContext.load_cert_chain` instead, or let :func:`ssl." "create_default_context` select the system's trusted CA certificates for you." msgstr "" -#: ../../library/ftplib.rst:124 +#: ../../library/ftplib.rst:122 msgid "Here's a sample session using the :class:`FTP_TLS` class::" msgstr "" -#: ../../library/ftplib.rst:137 +#: ../../library/ftplib.rst:135 msgid "Exception raised when an unexpected reply is received from the server." msgstr "" -#: ../../library/ftplib.rst:142 +#: ../../library/ftplib.rst:140 msgid "" "Exception raised when an error code signifying a temporary error (response " "codes in the range 400--499) is received." msgstr "" -#: ../../library/ftplib.rst:148 +#: ../../library/ftplib.rst:146 msgid "" "Exception raised when an error code signifying a permanent error (response " "codes in the range 500--599) is received." msgstr "" -#: ../../library/ftplib.rst:154 +#: ../../library/ftplib.rst:152 msgid "" "Exception raised when a reply is received from the server that does not fit " "the response specifications of the File Transfer Protocol, i.e. begin with a " "digit in the range 1--5." msgstr "" -#: ../../library/ftplib.rst:161 +#: ../../library/ftplib.rst:159 msgid "" "The set of all exceptions (as a tuple) that methods of :class:`FTP` " "instances may raise as a result of problems with the FTP connection (as " @@ -149,22 +149,22 @@ msgid "" "four exceptions listed above as well as :exc:`OSError` and :exc:`EOFError`." msgstr "" -#: ../../library/ftplib.rst:171 +#: ../../library/ftplib.rst:169 msgid "Module :mod:`netrc`" msgstr "" -#: ../../library/ftplib.rst:170 +#: ../../library/ftplib.rst:168 msgid "" "Parser for the :file:`.netrc` file format. The file :file:`.netrc` is " "typically used by FTP clients to load user authentication information before " "prompting the user." msgstr "" -#: ../../library/ftplib.rst:178 +#: ../../library/ftplib.rst:176 msgid "FTP Objects" msgstr "" -#: ../../library/ftplib.rst:180 +#: ../../library/ftplib.rst:178 msgid "" "Several methods are available in two flavors: one for handling text files " "and another for binary files. These are named for the command which is used " @@ -172,11 +172,11 @@ msgid "" "version." msgstr "" -#: ../../library/ftplib.rst:184 +#: ../../library/ftplib.rst:182 msgid ":class:`FTP` instances have the following methods:" msgstr "" -#: ../../library/ftplib.rst:189 +#: ../../library/ftplib.rst:187 msgid "" "Set the instance's debugging level. This controls the amount of debugging " "output printed. The default, ``0``, produces no debugging output. A value " @@ -186,7 +186,7 @@ msgid "" "connection." msgstr "" -#: ../../library/ftplib.rst:198 +#: ../../library/ftplib.rst:196 msgid "" "Connect to the given host and port. The default port number is ``21``, as " "specified by the FTP protocol specification. It is rarely needed to specify " @@ -199,20 +199,20 @@ msgid "" "port)`` for the socket to bind to as its source address before connecting." msgstr "" -#: ../../library/ftplib.rst:210 +#: ../../library/ftplib.rst:209 msgid "" "Raises an :ref:`auditing event ` ``ftplib.connect`` with arguments " "``self``, ``host``, ``port``." msgstr "" -#: ../../library/ftplib.rst:218 +#: ../../library/ftplib.rst:216 msgid "" "Return the welcome message sent by the server in reply to the initial " "connection. (This message sometimes contains disclaimers or help " "information that may be relevant to the user.)" msgstr "" -#: ../../library/ftplib.rst:225 +#: ../../library/ftplib.rst:223 msgid "" "Log in as the given *user*. The *passwd* and *acct* parameters are optional " "and default to the empty string. If no *user* is specified, it defaults to " @@ -224,31 +224,31 @@ msgid "" "parameter supplies \"accounting information\"; few systems implement this." msgstr "" -#: ../../library/ftplib.rst:237 +#: ../../library/ftplib.rst:235 msgid "" "Abort a file transfer that is in progress. Using this does not always work, " "but it's worth a try." msgstr "" -#: ../../library/ftplib.rst:243 +#: ../../library/ftplib.rst:241 msgid "" "Send a simple command string to the server and return the response string." msgstr "" -#: ../../library/ftplib.rst:245 ../../library/ftplib.rst:254 +#: ../../library/ftplib.rst:243 ../../library/ftplib.rst:252 msgid "" "Raises an :ref:`auditing event ` ``ftplib.sendcmd`` with arguments " "``self``, ``cmd``." msgstr "" -#: ../../library/ftplib.rst:250 +#: ../../library/ftplib.rst:248 msgid "" "Send a simple command string to the server and handle the response. Return " "nothing if a response code corresponding to success (codes in the range " "200--299) is received. Raise :exc:`error_reply` otherwise." msgstr "" -#: ../../library/ftplib.rst:259 +#: ../../library/ftplib.rst:257 msgid "" "Retrieve a file in binary transfer mode. *cmd* should be an appropriate " "``RETR`` command: ``'RETR filename'``. The *callback* function is called for " @@ -260,7 +260,7 @@ msgid "" "`transfercmd` method." msgstr "" -#: ../../library/ftplib.rst:271 +#: ../../library/ftplib.rst:269 msgid "" "Retrieve a file or directory listing in the encoding specified by the " "*encoding* parameter at initialization. *cmd* should be an appropriate " @@ -272,13 +272,13 @@ msgid "" "*callback* prints the line to ``sys.stdout``." msgstr "" -#: ../../library/ftplib.rst:284 +#: ../../library/ftplib.rst:282 msgid "" "Enable \"passive\" mode if *val* is true, otherwise disable passive mode. " "Passive mode is on by default." msgstr "" -#: ../../library/ftplib.rst:290 +#: ../../library/ftplib.rst:288 msgid "" "Store a file in binary transfer mode. *cmd* should be an appropriate " "``STOR`` command: ``\"STOR filename\"``. *fp* is a :term:`file object` " @@ -289,11 +289,11 @@ msgid "" "*rest* means the same thing as in the :meth:`transfercmd` method." msgstr "" -#: ../../library/ftplib.rst:298 +#: ../../library/ftplib.rst:296 msgid "*rest* parameter added." msgstr "" -#: ../../library/ftplib.rst:304 +#: ../../library/ftplib.rst:302 msgid "" "Store a file in line mode. *cmd* should be an appropriate ``STOR`` command " "(see :meth:`storbinary`). Lines are read until EOF from the :term:`file " @@ -302,7 +302,7 @@ msgid "" "parameter callable that is called on each line after it is sent." msgstr "" -#: ../../library/ftplib.rst:313 +#: ../../library/ftplib.rst:311 msgid "" "Initiate a transfer over the data connection. If the transfer is active, " "send an ``EPRT`` or ``PORT`` command and the transfer command specified by " @@ -311,7 +311,7 @@ msgid "" "command. Either way, return the socket for the connection." msgstr "" -#: ../../library/ftplib.rst:319 +#: ../../library/ftplib.rst:317 msgid "" "If optional *rest* is given, a ``REST`` command is sent to the server, " "passing *rest* as an argument. *rest* is usually a byte offset into the " @@ -324,7 +324,7 @@ msgid "" "simply call :meth:`transfercmd` without a *rest* argument." msgstr "" -#: ../../library/ftplib.rst:332 +#: ../../library/ftplib.rst:330 msgid "" "Like :meth:`transfercmd`, but returns a tuple of the data connection and the " "expected size of the data. If the expected size could not be computed, " @@ -332,7 +332,7 @@ msgid "" "same thing as in :meth:`transfercmd`." msgstr "" -#: ../../library/ftplib.rst:340 +#: ../../library/ftplib.rst:338 msgid "" "List a directory in a standardized format by using ``MLSD`` command (:rfc:" "`3659`). If *path* is omitted the current directory is assumed. *facts* is " @@ -344,7 +344,7 @@ msgid "" "but server is not guaranteed to return all requested facts." msgstr "" -#: ../../library/ftplib.rst:354 +#: ../../library/ftplib.rst:352 msgid "" "Return a list of file names as returned by the ``NLST`` command. The " "optional *argument* is a directory to list (default is the current server " @@ -352,11 +352,11 @@ msgid "" "the ``NLST`` command." msgstr "" -#: ../../library/ftplib.rst:359 ../../library/ftplib.rst:371 +#: ../../library/ftplib.rst:357 ../../library/ftplib.rst:369 msgid "If your server supports the command, :meth:`mlsd` offers a better API." msgstr "" -#: ../../library/ftplib.rst:364 +#: ../../library/ftplib.rst:362 msgid "" "Produce a directory listing as returned by the ``LIST`` command, printing it " "to standard output. The optional *argument* is a directory to list (default " @@ -366,34 +366,34 @@ msgid "" "default prints to ``sys.stdout``. This method returns ``None``." msgstr "" -#: ../../library/ftplib.rst:376 +#: ../../library/ftplib.rst:374 msgid "Rename file *fromname* on the server to *toname*." msgstr "" -#: ../../library/ftplib.rst:381 +#: ../../library/ftplib.rst:379 msgid "" "Remove the file named *filename* from the server. If successful, returns " "the text of the response, otherwise raises :exc:`error_perm` on permission " "errors or :exc:`error_reply` on other errors." msgstr "" -#: ../../library/ftplib.rst:388 +#: ../../library/ftplib.rst:386 msgid "Set the current directory on the server." msgstr "" -#: ../../library/ftplib.rst:393 +#: ../../library/ftplib.rst:391 msgid "Create a new directory on the server." msgstr "" -#: ../../library/ftplib.rst:398 +#: ../../library/ftplib.rst:396 msgid "Return the pathname of the current directory on the server." msgstr "" -#: ../../library/ftplib.rst:403 +#: ../../library/ftplib.rst:401 msgid "Remove the directory named *dirname* on the server." msgstr "" -#: ../../library/ftplib.rst:408 +#: ../../library/ftplib.rst:406 msgid "" "Request the size of the file named *filename* on the server. On success, " "the size of the file is returned as an integer, otherwise ``None`` is " @@ -401,7 +401,7 @@ msgid "" "supported by many common server implementations." msgstr "" -#: ../../library/ftplib.rst:416 +#: ../../library/ftplib.rst:414 msgid "" "Send a ``QUIT`` command to the server and close the connection. This is the " "\"polite\" way to close a connection, but it may raise an exception if the " @@ -410,7 +410,7 @@ msgid "" "for subsequent calls (see below)." msgstr "" -#: ../../library/ftplib.rst:425 +#: ../../library/ftplib.rst:423 msgid "" "Close the connection unilaterally. This should not be applied to an already " "closed connection such as after a successful call to :meth:`~FTP.quit`. " @@ -419,43 +419,43 @@ msgid "" "connection by issuing another :meth:`login` method)." msgstr "" -#: ../../library/ftplib.rst:433 +#: ../../library/ftplib.rst:431 msgid "FTP_TLS Objects" msgstr "" -#: ../../library/ftplib.rst:435 +#: ../../library/ftplib.rst:433 msgid "" ":class:`FTP_TLS` class inherits from :class:`FTP`, defining these additional " "objects:" msgstr "" -#: ../../library/ftplib.rst:439 +#: ../../library/ftplib.rst:437 msgid "The SSL version to use (defaults to :attr:`ssl.PROTOCOL_SSLv23`)." msgstr "" -#: ../../library/ftplib.rst:443 +#: ../../library/ftplib.rst:441 msgid "" "Set up a secure control connection by using TLS or SSL, depending on what is " "specified in the :attr:`ssl_version` attribute." msgstr "" -#: ../../library/ftplib.rst:446 +#: ../../library/ftplib.rst:444 msgid "" "The method now supports hostname check with :attr:`ssl.SSLContext." "check_hostname` and *Server Name Indication* (see :data:`ssl.HAS_SNI`)." msgstr "" -#: ../../library/ftplib.rst:453 +#: ../../library/ftplib.rst:451 msgid "" "Revert control channel back to plaintext. This can be useful to take " "advantage of firewalls that know how to handle NAT with non-secure FTP " "without opening fixed ports." msgstr "" -#: ../../library/ftplib.rst:461 +#: ../../library/ftplib.rst:459 msgid "Set up secure data connection." msgstr "" -#: ../../library/ftplib.rst:465 +#: ../../library/ftplib.rst:463 msgid "Set up clear text data connection." msgstr "" diff --git a/library/functions.po b/library/functions.po index 7c37c994a4..b18f11f5c1 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-07 06:52+0000\n" +"POT-Creation-Date: 2020-06-20 18:08+0800\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-" @@ -364,8 +364,8 @@ msgid "" "If prefix \"0b\" is desired or not, you can use either of the following ways." msgstr "如果不一定需要字首“0b”,還可以使用如下的方法。" -#: ../../library/functions.rst:101 ../../library/functions.rst:757 -#: ../../library/functions.rst:1044 +#: ../../library/functions.rst:101 ../../library/functions.rst:751 +#: ../../library/functions.rst:1036 #, fuzzy msgid "See also :func:`format` for more information." msgstr "另見 :func:`format` 獲取更多資訊。" @@ -386,8 +386,8 @@ msgstr "" "`typesnumeric`)。其他類不能繼承自它。它只有 ``False`` 和 ``True`` 兩個例項" "(參見 :ref:`bltin-boolean-values`)。" -#: ../../library/functions.rst:115 ../../library/functions.rst:625 -#: ../../library/functions.rst:841 +#: ../../library/functions.rst:115 ../../library/functions.rst:626 +#: ../../library/functions.rst:833 msgid "*x* is now a positional-only parameter." msgstr "" @@ -403,7 +403,7 @@ msgid "" "you to drop into the debugger of choice." msgstr "" -#: ../../library/functions.rst:130 +#: ../../library/functions.rst:131 msgid "" "Raises an :ref:`auditing event ` ``builtins.breakpoint`` with " "argument ``breakpointhook``." @@ -449,9 +449,8 @@ msgstr "" #: ../../library/functions.rst:153 #, fuzzy msgid "" -"If it is an object conforming to the :ref:`buffer interface " -"`, a read-only buffer of the object will be used to " -"initialize the bytes array." +"If it is an object conforming to the *buffer* interface, a read-only buffer " +"of the object will be used to initialize the bytes array." msgstr "" "如果是一個符合 *buffer* 介面的物件,該物件的只讀 buffer 會用來初始化位元組陣" "列。" @@ -632,33 +631,40 @@ msgstr "" #: ../../library/functions.rst:248 msgid "" -"The optional arguments *flags* and *dont_inherit* control which :ref:" -"`compiler options ` should be activated and which :ref:" -"`future features ` should be allowed. If neither is present (or both " -"are zero) the code is compiled with the same flags that affect the code that " -"is calling :func:`compile`. If the *flags* argument is given and " -"*dont_inherit* is not (or is zero) then the compiler options and the future " -"statements specified by the *flags* argument are used in addition to those " -"that would be used anyway. If *dont_inherit* is a non-zero integer then the " -"*flags* argument is it -- the flags (future features and compiler options) " -"in the surrounding code are ignored." +"The optional arguments *flags* and *dont_inherit* control which :ref:`future " +"statements ` affect the compilation of *source*. If neither is " +"present (or both are zero) the code is compiled with those future statements " +"that are in effect in the code that is calling :func:`compile`. If the " +"*flags* argument is given and *dont_inherit* is not (or is zero) then the " +"future statements specified by the *flags* argument are used in addition to " +"those that would be used anyway. If *dont_inherit* is a non-zero integer " +"then the *flags* argument is it -- the future statements in effect around " +"the call to compile are ignored." msgstr "" -#: ../../library/functions.rst:259 +#: ../../library/functions.rst:258 #, fuzzy msgid "" -"Compiler options and future statements are specified by bits which can be " -"bitwise ORed together to specify multiple options. The bitfield required to " -"specify a given future feature can be found as the :attr:`~__future__." -"_Feature.compiler_flag` attribute on the :class:`~__future__._Feature` " -"instance in the :mod:`__future__` module. :ref:`Compiler flags ` can be found in :mod:`ast` module, with ``PyCF_`` prefix." +"Future statements are specified by bits which can be bitwise ORed together " +"to specify multiple statements. The bitfield required to specify a given " +"feature can be found as the :attr:`~__future__._Feature.compiler_flag` " +"attribute on the :class:`~__future__._Feature` instance in the :mod:" +"`__future__` module." msgstr "" "Future 語句使用位元位來指定,多個語句可以通過按位或來指定。具體特性的位元位可" "以通過 :mod:`__future__` 模組中的 :class:`~__future__._Feature` 類的例項的 :" "attr:`~__future__._Feature.compiler_flag` 屬性來獲得。" -#: ../../library/functions.rst:267 +#: ../../library/functions.rst:263 +msgid "" +"The optional argument *flags* also controls whether the compiled source is " +"allowed to contain top-level ``await``, ``async for`` and ``async with``. " +"When the bit ``ast.PyCF_ALLOW_TOP_LEVEL_AWAIT`` is set, the return code " +"object has ``CO_COROUTINE`` set in ``co_code``, and can be interactively " +"executed via ``await eval(code_object)``." +msgstr "" + +#: ../../library/functions.rst:269 #, fuzzy msgid "" "The argument *optimize* specifies the optimization level of the compiler; " @@ -671,7 +677,7 @@ msgstr "" "O` 選項相同的優化級別。顯式級別為 ``0`` (沒有優化;``__debug__`` 為真)、" "``1`` (斷言被刪除, ``__debug__`` 為假)或 ``2`` (文件字串也被刪除)。" -#: ../../library/functions.rst:273 +#: ../../library/functions.rst:275 #, fuzzy msgid "" "This function raises :exc:`SyntaxError` if the compiled source is invalid, " @@ -680,27 +686,27 @@ msgstr "" "如果編譯的原始碼不合法,此函式會觸發 :exc:`SyntaxError` 異常;如果原始碼包含 " "null 位元組,則會觸發 :exc:`ValueError` 異常。" -#: ../../library/functions.rst:276 +#: ../../library/functions.rst:278 #, fuzzy msgid "" "If you want to parse Python code into its AST representation, see :func:`ast." "parse`." msgstr "如果您想分析 Python 程式碼的 AST 表示,請參閱 :func:`ast.parse`。" -#: ../../library/functions.rst:279 +#: ../../library/functions.rst:None msgid "" "Raises an :ref:`auditing event ` ``compile`` with arguments " "``source``, ``filename``." msgstr "" -#: ../../library/functions.rst:281 +#: ../../library/functions.rst:283 msgid "" "Raises an :ref:`auditing event ` ``compile`` with arguments " "``source`` and ``filename``. This event may also be raised by implicit " "compilation." msgstr "" -#: ../../library/functions.rst:287 +#: ../../library/functions.rst:289 #, fuzzy msgid "" "When compiling a string with multi-line code in ``'single'`` or ``'eval'`` " @@ -711,7 +717,7 @@ msgstr "" "在 ``'single'`` 或 ``'eval'`` 模式編譯多行程式碼字串時,輸入必須以至少一個換" "行符結尾。 這使 :mod:`code` 模組更容易檢測語句的完整性。" -#: ../../library/functions.rst:294 +#: ../../library/functions.rst:296 #, fuzzy msgid "" "It is possible to crash the Python interpreter with a sufficiently large/" @@ -721,7 +727,7 @@ msgstr "" "如果編譯足夠大或者足夠複雜的字串成 AST 物件時,Python 直譯器會因為 Python " "AST 編譯器的棧深度限制而奔潰。" -#: ../../library/functions.rst:298 +#: ../../library/functions.rst:300 #, fuzzy msgid "" "Allowed use of Windows and Mac newlines. Also input in ``'exec'`` mode does " @@ -730,20 +736,20 @@ msgstr "" "允許使用 Windows 和 Mac 的換行符。在 ``'exec'`` 模式不再需要以換行符結尾。增" "加了 *optimize* 形參。" -#: ../../library/functions.rst:302 +#: ../../library/functions.rst:304 #, fuzzy msgid "" "Previously, :exc:`TypeError` was raised when null bytes were encountered in " "*source*." msgstr "之前 *source* 中包含 null 位元組的話會觸發 :exc:`TypeError` 異常。" -#: ../../library/functions.rst:306 +#: ../../library/functions.rst:308 msgid "" "``ast.PyCF_ALLOW_TOP_LEVEL_AWAIT`` can now be passed in flags to enable " "support for top-level ``await``, ``async for``, and ``async with``." msgstr "" -#: ../../library/functions.rst:313 +#: ../../library/functions.rst:315 #, fuzzy msgid "" "Return a complex number with the value *real* + *imag*\\*1j or convert a " @@ -761,7 +767,7 @@ msgstr "" "預設值為零,建構函式會像 :class:`int` 和 :class:`float` 一樣進行數值轉換。如" "果兩個實參都省略,則返回 ``0j``。" -#: ../../library/functions.rst:322 +#: ../../library/functions.rst:324 msgid "" "For a general Python object ``x``, ``complex(x)`` delegates to ``x." "__complex__()``. If ``__complex__()`` is not defined then it falls back to :" @@ -769,7 +775,7 @@ msgid "" "meth:`__index__`." msgstr "" -#: ../../library/functions.rst:329 +#: ../../library/functions.rst:331 #, fuzzy msgid "" "When converting from a string, the string must not contain whitespace around " @@ -780,24 +786,24 @@ msgstr "" "``complex('1+2j')`` 是合法的,但 ``complex('1 + 2j')`` 會觸發 :exc:" "`ValueError` 異常。" -#: ../../library/functions.rst:334 +#: ../../library/functions.rst:336 #, fuzzy msgid "The complex type is described in :ref:`typesnumeric`." msgstr ":ref:`typesnumeric` 描述了複數型別。" -#: ../../library/functions.rst:336 ../../library/functions.rst:622 -#: ../../library/functions.rst:838 +#: ../../library/functions.rst:338 ../../library/functions.rst:623 +#: ../../library/functions.rst:830 #, fuzzy msgid "Grouping digits with underscores as in code literals is allowed." msgstr "您可以使用下劃線將程式碼文字中的數字進行分組。" -#: ../../library/functions.rst:339 +#: ../../library/functions.rst:341 msgid "" "Falls back to :meth:`__index__` if :meth:`__complex__` and :meth:`__float__` " "are not defined." msgstr "" -#: ../../library/functions.rst:346 +#: ../../library/functions.rst:348 #, fuzzy msgid "" "This is a relative of :func:`setattr`. The arguments are an object and a " @@ -809,7 +815,7 @@ msgstr "" "屬性。如果物件允許,該函式將刪除指定的屬性。例如 ``delattr(x, 'foobar')`` 等" "價於 ``del x.foobar`` 。" -#: ../../library/functions.rst:358 +#: ../../library/functions.rst:360 #, fuzzy msgid "" "Create a new dictionary. The :class:`dict` object is the dictionary class. " @@ -818,7 +824,7 @@ msgstr "" "建立一個新的字典。:class:`dict` 物件是一個字典類。參見 :class:`dict` 和 :ref:" "`typesmapping` 瞭解這個類。" -#: ../../library/functions.rst:361 +#: ../../library/functions.rst:363 #, fuzzy msgid "" "For other containers see the built-in :class:`list`, :class:`set`, and :" @@ -827,7 +833,7 @@ msgstr "" "其他容器型別,請參見內建的 :class:`list`、:class:`set` 和 :class:`tuple` 類," "以及 :mod:`collections` 模組。" -#: ../../library/functions.rst:367 +#: ../../library/functions.rst:369 #, fuzzy msgid "" "Without arguments, return the list of names in the current local scope. " @@ -837,7 +843,7 @@ msgstr "" "如果沒有實參,則返回當前本地作用域中的名稱列表。如果有實參,它會嘗試返回該物" "件的有效屬性列表。" -#: ../../library/functions.rst:370 +#: ../../library/functions.rst:372 #, fuzzy msgid "" "If the object has a method named :meth:`__dir__`, this method will be called " @@ -849,7 +855,7 @@ msgstr "" "個屬性列表。這允許實現自定義 :func:`__getattr__` 或 :func:`__getattribute__` " "函式的物件能夠自定義 :func:`dir` 來報告它們的屬性。" -#: ../../library/functions.rst:375 +#: ../../library/functions.rst:377 #, fuzzy msgid "" "If the object does not provide :meth:`__dir__`, the function tries its best " @@ -862,7 +868,7 @@ msgstr "" "__dict__` 屬性和型別物件收集資訊。結果列表並不總是完整的,如果物件有自定義 :" "func:`__getattr__`,那結果可能不準確。" -#: ../../library/functions.rst:380 +#: ../../library/functions.rst:382 #, fuzzy msgid "" "The default :func:`dir` mechanism behaves differently with different types " @@ -872,14 +878,14 @@ msgstr "" "預設的 :func:`dir` 機制對不同型別的物件行為不同,它會試圖返回最相關而不是最全" "的資訊:" -#: ../../library/functions.rst:384 +#: ../../library/functions.rst:386 #, fuzzy msgid "" "If the object is a module object, the list contains the names of the " "module's attributes." msgstr "如果物件是模組物件,則列表包含模組的屬性名稱。" -#: ../../library/functions.rst:387 +#: ../../library/functions.rst:389 #, fuzzy msgid "" "If the object is a type or class object, the list contains the names of its " @@ -888,7 +894,7 @@ msgstr "" "如果物件是型別或類物件,則列表包含它們的屬性名稱,並且遞迴查詢所有基類的屬" "性。" -#: ../../library/functions.rst:390 +#: ../../library/functions.rst:392 #, fuzzy msgid "" "Otherwise, the list contains the object's attributes' names, the names of " @@ -898,12 +904,12 @@ msgstr "" "否則,列表包含物件的屬性名稱,它的類屬性名稱,並且遞迴查詢它的類的所有基類的" "屬性。" -#: ../../library/functions.rst:394 +#: ../../library/functions.rst:396 #, fuzzy msgid "The resulting list is sorted alphabetically. For example:" msgstr "返回的列表按字母表排序。例如:" -#: ../../library/functions.rst:413 +#: ../../library/functions.rst:415 #, fuzzy msgid "" "Because :func:`dir` is supplied primarily as a convenience for use at an " @@ -916,7 +922,7 @@ msgstr "" "字集合,而不是試圖保證結果的嚴格性或一致性,它具體的行為也可能在不同版本之間" "改變。例如,當實參是一個類時,metaclass 的屬性不包含在結果列表中。" -#: ../../library/functions.rst:423 +#: ../../library/functions.rst:425 #, fuzzy msgid "" "Take two (non complex) numbers as arguments and return a pair of numbers " @@ -934,7 +940,7 @@ msgstr "" "能會比 1 小。在任何情況下, ``q * b + a % b`` 和 *a* 基本相等;如果 ``a % " "b`` 非零,它的符號和 *b* 一樣,並且 ``0 <= abs(a % b) < abs(b)`` 。" -#: ../../library/functions.rst:435 +#: ../../library/functions.rst:437 #, fuzzy msgid "" "Return an enumerate object. *iterable* must be a sequence, an :term:" @@ -948,12 +954,12 @@ msgstr "" "返回一個元組,裡面包含一個計數值(從 *start* 開始,預設為 0)和通過迭代 " "*iterable* 獲得的值。" -#: ../../library/functions.rst:447 +#: ../../library/functions.rst:449 #, fuzzy msgid "Equivalent to::" msgstr "等價於::" -#: ../../library/functions.rst:458 +#: ../../library/functions.rst:460 #, fuzzy msgid "" "The arguments are a string and optional globals and locals. If provided, " @@ -963,7 +969,7 @@ msgstr "" "實參是一個字串,以及可選的 globals 和 locals。*globals* 實參必須是一個字典。" "*locals* 可以是任何對映物件。" -#: ../../library/functions.rst:462 +#: ../../library/functions.rst:464 #, fuzzy msgid "" "The *expression* argument is parsed and evaluated as a Python expression " @@ -988,13 +994,13 @@ msgstr "" "字典。如果兩個字典變數都被省略了,則在 :func:`eval` 被呼叫的環境中執行表示" "式。函式的返回值是表示式執行的結果。語法錯誤會產生異常。如:" -#: ../../library/functions.rst:476 +#: ../../library/functions.rst:478 msgid "" "The return value is the result of the evaluated expression. Syntax errors " "are reported as exceptions. Example:" msgstr "" -#: ../../library/functions.rst:483 +#: ../../library/functions.rst:485 #, fuzzy msgid "" "This function can also be used to execute arbitrary code objects (such as " @@ -1006,7 +1012,7 @@ msgstr "" "下,引數是程式碼物件,而不是字串。如果編譯該物件時的 *mode* 實參是 " "``'exec'`` 那麼 :func:`eval` 返回值為 ``None`` 。" -#: ../../library/functions.rst:488 +#: ../../library/functions.rst:490 #, fuzzy msgid "" "Hints: dynamic execution of statements is supported by the :func:`exec` " @@ -1018,7 +1024,7 @@ msgstr "" "函式各自返回當前的全域性和本地字典,因此您可以將它們傳遞給 :func:`eval` 或 :" "func:`exec` 來使用。" -#: ../../library/functions.rst:493 +#: ../../library/functions.rst:495 #, fuzzy msgid "" "See :func:`ast.literal_eval` for a function that can safely evaluate strings " @@ -1027,19 +1033,19 @@ msgstr "" "另外可以參閱 :func:`ast.literal_eval`,該函式可以安全執行僅包含文字的表示式字" "串。" -#: ../../library/functions.rst:496 ../../library/functions.rst:532 +#: ../../library/functions.rst:None msgid "" "Raises an :ref:`auditing event ` ``exec`` with argument " "``code_object``." msgstr "" -#: ../../library/functions.rst:498 ../../library/functions.rst:534 +#: ../../library/functions.rst:500 ../../library/functions.rst:535 msgid "" "Raises an :ref:`auditing event ` ``exec`` with the code object as " "the argument. Code compilation events may also be raised." msgstr "" -#: ../../library/functions.rst:505 +#: ../../library/functions.rst:507 #, fuzzy msgid "" "This function supports dynamic execution of Python code. *object* must be " @@ -1048,9 +1054,9 @@ msgid "" "error occurs). [#]_ If it is a code object, it is simply executed. In all " "cases, the code that's executed is expected to be valid as file input (see " "the section \"File input\" in the Reference Manual). Be aware that the :" -"keyword:`nonlocal`, :keyword:`yield`, and :keyword:`return` statements may " -"not be used outside of function definitions even within the context of code " -"passed to the :func:`exec` function. The return value is ``None``." +"keyword:`return` and :keyword:`yield` statements may not be used outside of " +"function definitions even within the context of code passed to the :func:" +"`exec` function. The return value is ``None``." msgstr "" "這個函式支援動態執行 Python 程式碼。*object* 必須是字串或者程式碼物件。如果是" "字串,那麼該字串將被解析為一系列 Python 語句並執行(除非發生語法錯誤)。[#]_ " @@ -1059,7 +1065,7 @@ msgstr "" "`exec` 函式的程式碼的上下文中,:keyword:`return` 和 :keyword:`yield` 語句也不" "能在函式定義之外使用。該函式返回值是 ``None`` 。" -#: ../../library/functions.rst:516 +#: ../../library/functions.rst:517 #, fuzzy msgid "" "In all cases, if the optional parts are omitted, the code is executed in the " @@ -1079,7 +1085,7 @@ msgstr "" "是相同的字典。如果 exec 有兩個不同的 *globals* 和 *locals* 物件,程式碼就像嵌" "入在類定義中一樣執行。" -#: ../../library/functions.rst:526 +#: ../../library/functions.rst:527 #, fuzzy msgid "" "If the *globals* dictionary does not contain a value for the key " @@ -1093,7 +1099,7 @@ msgstr "" "以通過將自己的 ``__builtins__`` 字典插入到 *globals* 中來控制可以使用哪些內建" "程式碼。" -#: ../../library/functions.rst:539 +#: ../../library/functions.rst:540 #, fuzzy msgid "" "The built-in functions :func:`globals` and :func:`locals` return the current " @@ -1103,7 +1109,7 @@ msgstr "" "內建 :func:`globals` 和 :func:`locals` 函式各自返回當前的全域性和本地字典,因" "此可以將它們傳遞給 :func:`exec` 的第二個和第三個實參。" -#: ../../library/functions.rst:545 +#: ../../library/functions.rst:546 #, fuzzy msgid "" "The default *locals* act as described for function :func:`locals` below: " @@ -1115,7 +1121,7 @@ msgstr "" "預設的 *locals* 字典。如果您想在 :func:`exec` 函式返回時知道程式碼對 " "*locals* 的變動,請明確地傳遞 *locals* 字典。" -#: ../../library/functions.rst:553 +#: ../../library/functions.rst:554 #, fuzzy msgid "" "Construct an iterator from those elements of *iterable* for which *function* " @@ -1129,7 +1135,7 @@ msgstr "" "是 ``None`` ,則會假設它是一個身份函式,即 *iterable* 中所有返回假的元素會被" "移除。" -#: ../../library/functions.rst:559 +#: ../../library/functions.rst:560 #, fuzzy msgid "" "Note that ``filter(function, iterable)`` is equivalent to the generator " @@ -1141,7 +1147,7 @@ msgstr "" "不是 ``None`` 的時候為 ``(item for item in iterable if function(item))``;" "function 是 ``None`` 的時候為 ``(item for item in iterable if item)`` 。" -#: ../../library/functions.rst:564 +#: ../../library/functions.rst:565 #, fuzzy msgid "" "See :func:`itertools.filterfalse` for the complementary function that " @@ -1150,12 +1156,12 @@ msgstr "" "請參閱 :func:`itertools.filterfalse` 瞭解,只有 *function* 返回 false 時才選" "取 *iterable* 中元素的補充函式。" -#: ../../library/functions.rst:574 +#: ../../library/functions.rst:575 #, fuzzy msgid "Return a floating point number constructed from a number or string *x*." msgstr "返回從數字或字串 *x* 生成的浮點數。" -#: ../../library/functions.rst:576 +#: ../../library/functions.rst:577 #, fuzzy msgid "" "If the argument is a string, it should contain a decimal number, optionally " @@ -1171,7 +1177,7 @@ msgstr "" "參也可以是 NaN(非數字)、正負無窮大的字串。確切地說,除去首尾的空格後,輸入" "必須遵循以下語法:" -#: ../../library/functions.rst:591 +#: ../../library/functions.rst:592 #, fuzzy msgid "" "Here ``floatnumber`` is the form of a Python floating-point literal, " @@ -1182,7 +1188,7 @@ msgstr "" "這裡, ``floatnumber`` 是 Python 浮點數的字串形式,詳見 :ref:`floating`。字母" "大小寫都可以,例如,“inf”、“Inf”、“INFINITY”、“iNfINity” 都可以表示正無窮大。" -#: ../../library/functions.rst:596 +#: ../../library/functions.rst:597 #, fuzzy msgid "" "Otherwise, if the argument is an integer or a floating point number, a " @@ -1194,7 +1200,7 @@ msgstr "" "內)的浮點數。如果實參在 Python 浮點精度範圍外,則會觸發 :exc:" "`OverflowError`。" -#: ../../library/functions.rst:601 +#: ../../library/functions.rst:602 #, fuzzy msgid "" "For a general Python object ``x``, ``float(x)`` delegates to ``x." @@ -1203,26 +1209,26 @@ msgid "" msgstr "" "對於一般的 Python 物件 ``x`` , ``float(x)`` 指派給 ``x.__float__()`` 。" -#: ../../library/functions.rst:605 +#: ../../library/functions.rst:606 #, fuzzy msgid "If no argument is given, ``0.0`` is returned." msgstr "如果沒有實參,則返回 ``0.0`` 。" -#: ../../library/functions.rst:607 +#: ../../library/functions.rst:608 #, fuzzy msgid "Examples::" msgstr "例如::" -#: ../../library/functions.rst:620 +#: ../../library/functions.rst:621 #, fuzzy msgid "The float type is described in :ref:`typesnumeric`." msgstr ":ref:`typesnumeric` 描述了浮點型別。" -#: ../../library/functions.rst:628 +#: ../../library/functions.rst:629 msgid "Falls back to :meth:`__index__` if :meth:`__float__` is not defined." msgstr "" -#: ../../library/functions.rst:638 +#: ../../library/functions.rst:639 #, fuzzy msgid "" "Convert a *value* to a \"formatted\" representation, as controlled by " @@ -1234,7 +1240,7 @@ msgstr "" "於 *value* 實參的型別,但是大多數內建型別使用標準格式化語法::ref:" "`formatspec`。" -#: ../../library/functions.rst:643 +#: ../../library/functions.rst:644 #, fuzzy msgid "" "The default *format_spec* is an empty string which usually gives the same " @@ -1243,7 +1249,7 @@ msgstr "" "預設的 *format_spec* 是一個空字串,它通常和呼叫 :func:`str(value)` 的結" "果相同。" -#: ../../library/functions.rst:646 +#: ../../library/functions.rst:647 #, fuzzy msgid "" "A call to ``format(value, format_spec)`` is translated to ``type(value)." @@ -1258,7 +1264,7 @@ msgstr "" "不會呼叫。如果搜尋到 :mod:`object` 有這個方法但 *format_spec* 不為空," "*format_spec* 或返回值不是字串,會觸發 :exc:`TypeError` 異常。" -#: ../../library/functions.rst:653 +#: ../../library/functions.rst:654 #, fuzzy msgid "" "``object().__format__(format_spec)`` raises :exc:`TypeError` if " @@ -1267,7 +1273,7 @@ msgstr "" "當 *format_spec* 不是空字串時, ``object().__format__(format_spec)`` 會觸" "發 :exc:`TypeError`。" -#: ../../library/functions.rst:662 +#: ../../library/functions.rst:663 #, fuzzy msgid "" "Return a new :class:`frozenset` object, optionally with elements taken from " @@ -1278,7 +1284,7 @@ msgstr "" "``frozenset`` 是一個內建的類。有關此類的文件,請參閱 :class:`frozenset` 和 :" "ref:`types-set`。" -#: ../../library/functions.rst:666 +#: ../../library/functions.rst:667 #, fuzzy msgid "" "For other containers see the built-in :class:`set`, :class:`list`, :class:" @@ -1287,7 +1293,7 @@ msgstr "" "請參閱內建的 :class:`set`、:class:`list`、:class:`tuple` 和 :class:`dict` " "類,以及 :mod:`collections` 模組來了解其它的容器。" -#: ../../library/functions.rst:673 +#: ../../library/functions.rst:674 #, fuzzy msgid "" "Return the value of the named attribute of *object*. *name* must be a " @@ -1301,15 +1307,7 @@ msgstr "" "屬性的值。例如, ``getattr(x, 'foobar')`` 等同於 ``x.foobar``。如果指定的屬性" "不存在,且提供了 *default* 值,則返回它,否則觸發 :exc:`AttributeError`。" -#: ../../library/functions.rst:681 -msgid "" -"Since :ref:`private name mangling ` happens at " -"compilation time, one must manually mangle a private attribute's (attributes " -"with two leading underscores) name in order to retrieve it with :func:" -"`getattr`." -msgstr "" - -#: ../../library/functions.rst:689 +#: ../../library/functions.rst:683 #, fuzzy msgid "" "Return a dictionary representing the current global symbol table. This is " @@ -1320,7 +1318,7 @@ msgstr "" "返回表示當前全域性符號表的字典。這總是當前模組的字典(在函式或方法中,不是呼" "叫它的模組,而是定義它的模組)。" -#: ../../library/functions.rst:696 +#: ../../library/functions.rst:690 #, fuzzy msgid "" "The arguments are an object and a string. The result is ``True`` if the " @@ -1332,7 +1330,7 @@ msgstr "" "否則返回 ``False``。(此功能是通過呼叫 ``getattr(object, name)`` 看是否有 :" "exc:`AttributeError` 異常來實現的。)" -#: ../../library/functions.rst:704 +#: ../../library/functions.rst:698 #, fuzzy msgid "" "Return the hash value of the object (if it has one). Hash values are " @@ -1344,7 +1342,7 @@ msgstr "" "速比較字典的鍵。相同大小的數字變數有相同的雜湊值(即使它們型別不同,如 1 和 " "1.0)。" -#: ../../library/functions.rst:711 +#: ../../library/functions.rst:705 #, fuzzy msgid "" "For objects with custom :meth:`__hash__` methods, note that :func:`hash` " @@ -1354,7 +1352,7 @@ msgstr "" "如果物件實現了自己的 :meth:`__hash__` 方法,請注意,:func:`hash` 根據機器的字" "長來截斷返回值。另請參閱 :meth:`__hash__`。" -#: ../../library/functions.rst:717 +#: ../../library/functions.rst:711 #, fuzzy msgid "" "Invoke the built-in help system. (This function is intended for interactive " @@ -1369,7 +1367,7 @@ msgstr "" "文件主題中搜索該字串,並在控制檯上列印幫助資訊。如果實參是其他任意物件,則會" "生成該物件的幫助頁。" -#: ../../library/functions.rst:724 +#: ../../library/functions.rst:718 msgid "" "Note that if a slash(/) appears in the parameter list of a function, when " "invoking :func:`help`, it means that the parameters prior to the slash are " @@ -1377,13 +1375,13 @@ msgid "" "parameters `." msgstr "" -#: ../../library/functions.rst:729 +#: ../../library/functions.rst:723 #, fuzzy msgid "" "This function is added to the built-in namespace by the :mod:`site` module." msgstr "該函式通過 :mod:`site` 模組加入到內建名稱空間。" -#: ../../library/functions.rst:731 +#: ../../library/functions.rst:725 #, fuzzy msgid "" "Changes to :mod:`pydoc` and :mod:`inspect` mean that the reported signatures " @@ -1391,7 +1389,7 @@ msgid "" msgstr "" ":mod:`pydoc` 和 :mod:`inspect` 的變更使得可呼叫物件的簽名信息更加全面和一致。" -#: ../../library/functions.rst:738 +#: ../../library/functions.rst:732 #, fuzzy msgid "" "Convert an integer number to a lowercase hexadecimal string prefixed with " @@ -1401,7 +1399,7 @@ msgstr "" "將整數轉換為以“0x”為字首的小寫十六進位制字串。如果 *x* 不是 Python :class:" "`int` 物件,則必須定義返回整數的 :meth:`__index__` 方法。一些例子:" -#: ../../library/functions.rst:747 +#: ../../library/functions.rst:741 #, fuzzy msgid "" "If you want to convert an integer number to an uppercase or lower " @@ -1411,21 +1409,21 @@ msgstr "" "如果要將整數轉換為大寫或小寫的十六進位制字串,並可選擇有無“0x”字首,則可以使" "用如下方法:" -#: ../../library/functions.rst:759 +#: ../../library/functions.rst:753 #, fuzzy msgid "" "See also :func:`int` for converting a hexadecimal string to an integer using " "a base of 16." msgstr "另請參閱 :func:`int` 將十六進位制字串轉換為以 16 為基數的整數。" -#: ../../library/functions.rst:764 +#: ../../library/functions.rst:758 #, fuzzy msgid "" "To obtain a hexadecimal string representation for a float, use the :meth:" "`float.hex` method." msgstr "如果要獲取浮點數的十六進位制字串形式,請使用 :meth:`float.hex` 方法。" -#: ../../library/functions.rst:770 +#: ../../library/functions.rst:764 #, fuzzy msgid "" "Return the \"identity\" of an object. This is an integer which is " @@ -1436,13 +1434,7 @@ msgstr "" "返回物件的“標識值”。該值是一個整數,在此物件的生命週期中保證是唯一且恆定的。" "兩個生命期不重疊的物件可能具有相同的 :func:`id` 值。" -#: ../../library/functions.rst:777 -msgid "" -"Raises an :ref:`auditing event ` ``builtins.id`` with argument " -"``id``." -msgstr "" - -#: ../../library/functions.rst:782 +#: ../../library/functions.rst:774 #, fuzzy msgid "" "If the *prompt* argument is present, it is written to standard output " @@ -1454,7 +1446,7 @@ msgstr "" "輸入中讀取一行,將其轉換為字串(除了末尾的換行符)並返回。當讀取到 EOF 時,則" "觸發 :exc:`EOFError`。例如::" -#: ../../library/functions.rst:792 +#: ../../library/functions.rst:784 #, fuzzy msgid "" "If the :mod:`readline` module was loaded, then :func:`input` will use it to " @@ -1463,31 +1455,31 @@ msgstr "" "如果載入了 :mod:`readline` 模組,:func:`input` 將使用它來提供複雜的行編輯和歷" "史記錄功能。" -#: ../../library/functions.rst:795 +#: ../../library/functions.rst:None msgid "" "Raises an :ref:`auditing event ` ``builtins.input`` with argument " "``prompt``." msgstr "" -#: ../../library/functions.rst:797 +#: ../../library/functions.rst:789 msgid "" "Raises an :ref:`auditing event ` ``builtins.input`` with argument " "``prompt`` before reading input" msgstr "" -#: ../../library/functions.rst:800 +#: ../../library/functions.rst:None msgid "" "Raises an :ref:`auditing event ` ``builtins.input/result`` with " "argument ``result``." msgstr "" -#: ../../library/functions.rst:802 +#: ../../library/functions.rst:794 msgid "" "Raises an auditing event ``builtins.input/result`` with the result after " "successfully reading input." msgstr "" -#: ../../library/functions.rst:809 +#: ../../library/functions.rst:801 #, fuzzy msgid "" "Return an integer object constructed from a number or string *x*, or return " @@ -1500,7 +1492,7 @@ msgstr "" "果 *x* 定義了 :meth:`__int__`,``int(x)`` 返回 ``x.__int__()`` 。如果 *x* 定" "義了 :meth:`__trunc__`,它返回 ``x.__trunc__()`` 。對於浮點數,它向零舍入。" -#: ../../library/functions.rst:816 +#: ../../library/functions.rst:808 #, fuzzy msgid "" "If *x* is not a number or if *base* is given, then *x* must be a string, :" @@ -1526,12 +1518,12 @@ msgstr "" "以 ``int('010', 0)`` 是非法的,但 ``int('010')`` 和 ``int('010', 8)`` 是合法" "的。" -#: ../../library/functions.rst:829 +#: ../../library/functions.rst:821 #, fuzzy msgid "The integer type is described in :ref:`typesnumeric`." msgstr "整數型別定義請參閱 :ref:`typesnumeric` 。" -#: ../../library/functions.rst:831 +#: ../../library/functions.rst:823 #, fuzzy msgid "" "If *base* is not an instance of :class:`int` and the *base* object has a :" @@ -1544,11 +1536,11 @@ msgstr "" "`base.__int__ ` 而不是 :meth:`base.__index__ `。" -#: ../../library/functions.rst:844 +#: ../../library/functions.rst:836 msgid "Falls back to :meth:`__index__` if :meth:`__int__` is not defined." msgstr "" -#: ../../library/functions.rst:850 +#: ../../library/functions.rst:842 #, fuzzy msgid "" "Return ``True`` if the *object* argument is an instance of the *classinfo* " @@ -1565,20 +1557,20 @@ msgstr "" "組,如果 *object* 是其中的任何一個的例項則返回 true。 如果 *classinfo* 既不是" "型別,也不是型別元組或型別的遞迴元組,那麼會觸發 :exc:`TypeError` 異常。" -#: ../../library/functions.rst:862 +#: ../../library/functions.rst:854 #, fuzzy msgid "" "Return ``True`` if *class* is a subclass (direct, indirect or :term:`virtual " "`) of *classinfo*. A class is considered a subclass of " -"itself. *classinfo* may be a tuple of class objects, in which case return " -"``True`` if *class* is a subclass of any entry in *classinfo*. In any other " -"case, a :exc:`TypeError` exception is raised." +"itself. *classinfo* may be a tuple of class objects, in which case every " +"entry in *classinfo* will be checked. In any other case, a :exc:`TypeError` " +"exception is raised." msgstr "" "如果 *class* 是 *classinfo* 的子類(直接、間接或 :term:`虛擬` 的),則返回 true。*classinfo* 可以是類物件的元組,此時 *classinfo* " "中的每個元素都會被檢查。其他情況,會觸發 :exc:`TypeError` 異常。" -#: ../../library/functions.rst:871 +#: ../../library/functions.rst:863 #, fuzzy msgid "" "Return an :term:`iterator` object. The first argument is interpreted very " @@ -1602,19 +1594,19 @@ msgstr "" "會不帶實參地呼叫 *object*;如果返回的結果是 *sentinel* 則觸發 :exc:" "`StopIteration`,否則返回呼叫結果。" -#: ../../library/functions.rst:884 +#: ../../library/functions.rst:876 #, fuzzy msgid "See also :ref:`typeiter`." msgstr "另請參閱 :ref:`typeiter`。" -#: ../../library/functions.rst:886 +#: ../../library/functions.rst:878 msgid "" "One useful application of the second form of :func:`iter` is to build a " "block-reader. For example, reading fixed-width blocks from a binary database " "file until the end of file is reached::" msgstr "" -#: ../../library/functions.rst:898 +#: ../../library/functions.rst:890 #, fuzzy msgid "" "Return the length (the number of items) of an object. The argument may be a " @@ -1624,13 +1616,13 @@ msgstr "" "返回物件的長度(元素個數)。實參可以是序列(如 string、bytes、tuple、list 或 " "range 等)或集合(如 dictionary、set 或 frozen set 等)。" -#: ../../library/functions.rst:904 +#: ../../library/functions.rst:896 msgid "" "``len`` raises :exc:`OverflowError` on lengths larger than :data:`sys." "maxsize`, such as :class:`range(2 ** 100) `." msgstr "" -#: ../../library/functions.rst:912 +#: ../../library/functions.rst:904 #, fuzzy msgid "" "Rather than being a function, :class:`list` is actually a mutable sequence " @@ -1639,7 +1631,7 @@ msgstr "" "除了是函式,:class:`list` 也是可變序列型別,詳情請參閱 :ref:`typesseq-list` " "和 :ref:`typesseq`。" -#: ../../library/functions.rst:918 +#: ../../library/functions.rst:910 #, fuzzy msgid "" "Update and return a dictionary representing the current local symbol table. " @@ -1650,7 +1642,7 @@ msgstr "" "更新並返回表示當前本地符號表的字典。在函式塊而不是類塊中呼叫 :func:`locals` " "時會返回自由變數。" -#: ../../library/functions.rst:924 +#: ../../library/functions.rst:916 #, fuzzy msgid "" "The contents of this dictionary should not be modified; changes may not " @@ -1658,7 +1650,7 @@ msgid "" msgstr "" "不要更改此字典的內容;更改不會影響直譯器使用的區域性變數或自由變數的值。" -#: ../../library/functions.rst:929 +#: ../../library/functions.rst:921 #, fuzzy msgid "" "Return an iterator that applies *function* to every item of *iterable*, " @@ -1673,14 +1665,14 @@ msgstr "" "行獲取的元素。當有多個迭代器時,最短的迭代器耗盡則整個迭代結束。如果函式的輸" "入已經是元組實參,請參閱 :func:`itertools.starmap`。" -#: ../../library/functions.rst:940 +#: ../../library/functions.rst:932 #, fuzzy msgid "" "Return the largest item in an iterable or the largest of two or more " "arguments." msgstr "返回可迭代物件中最大的元素,或者返回兩個及以上實參中最大的。" -#: ../../library/functions.rst:943 +#: ../../library/functions.rst:935 #, fuzzy msgid "" "If one positional argument is provided, it should be an :term:`iterable`. " @@ -1691,7 +1683,7 @@ msgstr "" "件中最大的元素;如果提供了兩個及以上的 positional 實參,則返回最大的 " "positional 實參。" -#: ../../library/functions.rst:948 ../../library/functions.rst:985 +#: ../../library/functions.rst:940 ../../library/functions.rst:977 #, fuzzy msgid "" "There are two optional keyword-only arguments. The *key* argument specifies " @@ -1704,7 +1696,7 @@ msgstr "" "`list.sort` 的。*default* 實參是當可迭代物件為空時返回的值。如果可迭代物件為" "空,並且沒有給 *default* ,則會觸發 :exc:`ValueError`。" -#: ../../library/functions.rst:954 +#: ../../library/functions.rst:946 #, fuzzy msgid "" "If multiple items are maximal, the function returns the first one " @@ -1716,16 +1708,16 @@ msgstr "" "``sorted(iterable, key=keyfunc, reverse=True)[0]`` 和 ``heapq.nlargest(1, " "iterable, key=keyfunc)`` 保持一致。" -#: ../../library/functions.rst:959 ../../library/functions.rst:996 +#: ../../library/functions.rst:951 ../../library/functions.rst:988 #, fuzzy msgid "The *default* keyword-only argument." msgstr "keyword-only 實參 *default* 。" -#: ../../library/functions.rst:962 ../../library/functions.rst:999 +#: ../../library/functions.rst:954 ../../library/functions.rst:991 msgid "The *key* can be ``None``." msgstr "" -#: ../../library/functions.rst:970 +#: ../../library/functions.rst:962 #, fuzzy msgid "" "Return a \"memory view\" object created from the given argument. See :ref:" @@ -1734,14 +1726,14 @@ msgstr "" "返回由給定實參建立的“記憶體檢視”物件。有關詳細資訊,請參閱 :ref:" "`typememoryview`。" -#: ../../library/functions.rst:977 +#: ../../library/functions.rst:969 #, fuzzy msgid "" "Return the smallest item in an iterable or the smallest of two or more " "arguments." msgstr "返回可迭代物件中最小的元素,或者返回兩個及以上實參中最小的。" -#: ../../library/functions.rst:980 +#: ../../library/functions.rst:972 #, fuzzy msgid "" "If one positional argument is provided, it should be an :term:`iterable`. " @@ -1752,7 +1744,7 @@ msgstr "" "最小的元素;如果提供了兩個及以上的 positional 實參,則返回最小的 positional " "實參。" -#: ../../library/functions.rst:991 +#: ../../library/functions.rst:983 #, fuzzy msgid "" "If multiple items are minimal, the function returns the first one " @@ -1764,7 +1756,7 @@ msgstr "" "``sorted(iterable, key=keyfunc)[0]`` 和 ``heapq.nsmallest(1, iterable, " "key=keyfunc)`` 保持一致。" -#: ../../library/functions.rst:1005 +#: ../../library/functions.rst:997 #, fuzzy msgid "" "Retrieve the next item from the *iterator* by calling its :meth:`~iterator." @@ -1774,7 +1766,7 @@ msgstr "" "通過呼叫 *iterator* 的 :meth:`~iterator.__next__` 方法獲取下一個元素。如果迭" "代器耗盡,則返回給定的 *default*,如果沒有預設值則觸發 :exc:`StopIteration`。" -#: ../../library/functions.rst:1012 +#: ../../library/functions.rst:1004 #, fuzzy msgid "" "Return a new featureless object. :class:`object` is a base for all classes. " @@ -1784,7 +1776,7 @@ msgstr "" "返回一個沒有特徵的新物件。:class:`object` 是所有類的基類。它具有所有 Python " "類例項的通用方法。這個函式不接受任何實參。" -#: ../../library/functions.rst:1018 +#: ../../library/functions.rst:1010 #, fuzzy msgid "" ":class:`object` does *not* have a :attr:`~object.__dict__`, so you can't " @@ -1793,7 +1785,7 @@ msgstr "" "由於 :class:`object` 沒有 :attr:`~object.__dict__`,因此無法將任意屬性賦給 :" "class:`object` 的例項。" -#: ../../library/functions.rst:1024 +#: ../../library/functions.rst:1016 #, fuzzy msgid "" "Convert an integer number to an octal string prefixed with \"0o\". The " @@ -1805,7 +1797,7 @@ msgstr "" "式。如果 *x* 不是 Python 的 :class:`int` 物件,那它需要定義 :meth:" "`__index__` 方法返回一個整數。一些例子:" -#: ../../library/functions.rst:1034 +#: ../../library/functions.rst:1026 #, fuzzy msgid "" "If you want to convert an integer number to octal string either with prefix " @@ -1813,17 +1805,16 @@ msgid "" msgstr "" "如果要將整數轉換為八進位制字串,並可選擇有無“0o”字首,則可以使用如下方法:" -#: ../../library/functions.rst:1051 +#: ../../library/functions.rst:1043 #, fuzzy msgid "" "Open *file* and return a corresponding :term:`file object`. If the file " -"cannot be opened, an :exc:`OSError` is raised. See :ref:`tut-files` for more " -"examples of how to use this function." +"cannot be opened, an :exc:`OSError` is raised." msgstr "" "開啟 *file* 並返回對應的 :term:`file object`。如果該檔案不能開啟,則觸發 :" "exc:`OSError`。" -#: ../../library/functions.rst:1055 +#: ../../library/functions.rst:1046 #, fuzzy msgid "" "*file* is a :term:`path-like object` giving the pathname (absolute or " @@ -1836,7 +1827,7 @@ msgstr "" "term:`path-like object`;也可能是要被封裝的檔案描述符的數字。(如果是檔案描述" "符,它會隨著返回的 I/O 物件關閉而關閉,除非 *closefd* 是 ``False`` 。)" -#: ../../library/functions.rst:1061 +#: ../../library/functions.rst:1052 #, fuzzy msgid "" "*mode* is an optional string that specifies the mode in which the file is " @@ -1858,80 +1849,80 @@ msgstr "" "getpreferredencoding(False)`` 來獲取本地編碼。(要讀取和寫入原始位元組,請使" "用二進位制模式並不要指定 *encoding*。)可用的模式有:" -#: ../../library/functions.rst:1078 +#: ../../library/functions.rst:1069 #, fuzzy msgid "Character" msgstr "字元" -#: ../../library/functions.rst:1078 +#: ../../library/functions.rst:1069 #, fuzzy msgid "Meaning" msgstr "意義" -#: ../../library/functions.rst:1080 +#: ../../library/functions.rst:1071 msgid "``'r'``" msgstr "``'r'``" -#: ../../library/functions.rst:1080 +#: ../../library/functions.rst:1071 #, fuzzy msgid "open for reading (default)" msgstr "讀取(預設)" -#: ../../library/functions.rst:1081 +#: ../../library/functions.rst:1072 msgid "``'w'``" msgstr "``'w'``" -#: ../../library/functions.rst:1081 +#: ../../library/functions.rst:1072 #, fuzzy msgid "open for writing, truncating the file first" msgstr "写入,并先截断文件" -#: ../../library/functions.rst:1082 +#: ../../library/functions.rst:1073 msgid "``'x'``" msgstr "``'x'``" -#: ../../library/functions.rst:1082 +#: ../../library/functions.rst:1073 #, fuzzy msgid "open for exclusive creation, failing if the file already exists" msgstr "排它性创建,如果文件已存在则失败" -#: ../../library/functions.rst:1083 +#: ../../library/functions.rst:1074 msgid "``'a'``" msgstr "``'a'``" -#: ../../library/functions.rst:1083 +#: ../../library/functions.rst:1074 #, fuzzy msgid "open for writing, appending to the end of the file if it exists" msgstr "写入,如果文件存在则在末尾追加" -#: ../../library/functions.rst:1084 +#: ../../library/functions.rst:1075 msgid "``'b'``" msgstr "``'b'``" -#: ../../library/functions.rst:1084 +#: ../../library/functions.rst:1075 #, fuzzy msgid "binary mode" msgstr "二进制模式" -#: ../../library/functions.rst:1085 +#: ../../library/functions.rst:1076 msgid "``'t'``" msgstr "``'t'``" -#: ../../library/functions.rst:1085 +#: ../../library/functions.rst:1076 #, fuzzy msgid "text mode (default)" msgstr "文字模式(預設)" -#: ../../library/functions.rst:1086 +#: ../../library/functions.rst:1077 msgid "``'+'``" msgstr "" -#: ../../library/functions.rst:1086 +#: ../../library/functions.rst:1077 #, fuzzy msgid "open for updating (reading and writing)" msgstr "更新磁碟檔案(讀取並寫入)" -#: ../../library/functions.rst:1089 +#: ../../library/functions.rst:1080 #, fuzzy msgid "" "The default mode is ``'r'`` (open for reading text, synonym of ``'rt'``). " @@ -1941,7 +1932,7 @@ msgstr "" "預設的模式是 ``'r'`` (開啟並讀取文字,同 ``'rt'`` )。對於二進位制寫入, " "``'w+b'`` 模式開啟並把檔案截斷成 0 位元組; ``'r+b'`` 則不會截斷。" -#: ../../library/functions.rst:1093 +#: ../../library/functions.rst:1084 msgid "" "As mentioned in the :ref:`io-overview`, Python distinguishes between binary " "and text I/O. Files opened in binary mode (including ``'b'`` in the *mode* " @@ -1952,7 +1943,7 @@ msgid "" "specified *encoding* if given." msgstr "" -#: ../../library/functions.rst:1101 +#: ../../library/functions.rst:1092 msgid "" "There is an additional mode character permitted, ``'U'``, which no longer " "has any effect, and is considered deprecated. It previously enabled :term:" @@ -1961,14 +1952,14 @@ msgid "" "parameter>` parameter for further details." msgstr "" -#: ../../library/functions.rst:1109 +#: ../../library/functions.rst:1100 msgid "" "Python doesn't depend on the underlying operating system's notion of text " "files; all the processing is done by Python itself, and is therefore " "platform-independent." msgstr "" -#: ../../library/functions.rst:1113 +#: ../../library/functions.rst:1104 msgid "" "*buffering* is an optional integer used to set the buffering policy. Pass 0 " "to switch buffering off (only allowed in binary mode), 1 to select line " @@ -1977,7 +1968,7 @@ msgid "" "given, the default buffering policy works as follows:" msgstr "" -#: ../../library/functions.rst:1119 +#: ../../library/functions.rst:1110 msgid "" "Binary files are buffered in fixed-size chunks; the size of the buffer is " "chosen using a heuristic trying to determine the underlying device's \"block " @@ -1985,14 +1976,14 @@ msgid "" "the buffer will typically be 4096 or 8192 bytes long." msgstr "" -#: ../../library/functions.rst:1124 +#: ../../library/functions.rst:1115 msgid "" "\"Interactive\" text files (files for which :meth:`~io.IOBase.isatty` " "returns ``True``) use line buffering. Other text files use the policy " "described above for binary files." msgstr "" -#: ../../library/functions.rst:1128 +#: ../../library/functions.rst:1119 msgid "" "*encoding* is the name of the encoding used to decode or encode the file. " "This should only be used in text mode. The default encoding is platform " @@ -2001,7 +1992,7 @@ msgid "" "module for the list of supported encodings." msgstr "" -#: ../../library/functions.rst:1135 +#: ../../library/functions.rst:1126 msgid "" "*errors* is an optional string that specifies how encoding and decoding " "errors are to be handled—this cannot be used in binary mode. A variety of " @@ -2010,60 +2001,60 @@ msgid "" "register_error` is also valid. The standard names include:" msgstr "" -#: ../../library/functions.rst:1143 +#: ../../library/functions.rst:1134 msgid "" "``'strict'`` to raise a :exc:`ValueError` exception if there is an encoding " "error. The default value of ``None`` has the same effect." msgstr "" -#: ../../library/functions.rst:1147 +#: ../../library/functions.rst:1138 msgid "" "``'ignore'`` ignores errors. Note that ignoring encoding errors can lead to " "data loss." msgstr "" -#: ../../library/functions.rst:1150 +#: ../../library/functions.rst:1141 msgid "" "``'replace'`` causes a replacement marker (such as ``'?'``) to be inserted " "where there is malformed data." msgstr "" -#: ../../library/functions.rst:1153 +#: ../../library/functions.rst:1144 msgid "" -"``'surrogateescape'`` will represent any incorrect bytes as low surrogate " -"code units ranging from U+DC80 to U+DCFF. These surrogate code units will " -"then be turned back into the same bytes when the ``surrogateescape`` error " -"handler is used when writing data. This is useful for processing files in " -"an unknown encoding." +"``'surrogateescape'`` will represent any incorrect bytes as code points in " +"the Unicode Private Use Area ranging from U+DC80 to U+DCFF. These private " +"code points will then be turned back into the same bytes when the " +"``surrogateescape`` error handler is used when writing data. This is useful " +"for processing files in an unknown encoding." msgstr "" -#: ../../library/functions.rst:1160 +#: ../../library/functions.rst:1151 msgid "" "``'xmlcharrefreplace'`` is only supported when writing to a file. Characters " "not supported by the encoding are replaced with the appropriate XML " "character reference ``&#nnn;``." msgstr "" -#: ../../library/functions.rst:1164 +#: ../../library/functions.rst:1155 msgid "" "``'backslashreplace'`` replaces malformed data by Python's backslashed " "escape sequences." msgstr "" -#: ../../library/functions.rst:1167 +#: ../../library/functions.rst:1158 msgid "" "``'namereplace'`` (also only supported when writing) replaces unsupported " "characters with ``\\N{...}`` escape sequences." msgstr "" -#: ../../library/functions.rst:1175 +#: ../../library/functions.rst:1166 msgid "" "*newline* controls how :term:`universal newlines` mode works (it only " "applies to text mode). It can be ``None``, ``''``, ``'\\n'``, ``'\\r'``, " "and ``'\\r\\n'``. It works as follows:" msgstr "" -#: ../../library/functions.rst:1179 +#: ../../library/functions.rst:1170 msgid "" "When reading input from the stream, if *newline* is ``None``, universal " "newlines mode is enabled. Lines in the input can end in ``'\\n'``, " @@ -2074,7 +2065,7 @@ msgid "" "given string, and the line ending is returned to the caller untranslated." msgstr "" -#: ../../library/functions.rst:1187 +#: ../../library/functions.rst:1178 msgid "" "When writing output to the stream, if *newline* is ``None``, any ``'\\n'`` " "characters written are translated to the system default line separator, :" @@ -2083,7 +2074,7 @@ msgid "" "characters written are translated to the given string." msgstr "" -#: ../../library/functions.rst:1193 +#: ../../library/functions.rst:1184 msgid "" "If *closefd* is ``False`` and a file descriptor rather than a filename was " "given, the underlying file descriptor will be kept open when the file is " @@ -2091,7 +2082,7 @@ msgid "" "otherwise an error will be raised." msgstr "" -#: ../../library/functions.rst:1198 +#: ../../library/functions.rst:1189 msgid "" "A custom opener can be used by passing a callable as *opener*. The " "underlying file descriptor for the file object is then obtained by calling " @@ -2100,12 +2091,12 @@ msgid "" "similar to passing ``None``)." msgstr "" -#: ../../library/functions.rst:1204 +#: ../../library/functions.rst:1195 #, fuzzy msgid "The newly created file is :ref:`non-inheritable `." msgstr "新建立的檔案是 :ref:`不可繼承的 `。" -#: ../../library/functions.rst:1206 +#: ../../library/functions.rst:1197 #, fuzzy msgid "" "The following example uses the :ref:`dir_fd ` parameter of the :func:" @@ -2114,7 +2105,7 @@ msgstr "" "下面的示例使用 :func:`os.open` 函式返回值傳給 :ref:`dir_fd ` 的形參," "從給定的目錄中用相對路徑開啟檔案::" -#: ../../library/functions.rst:1219 +#: ../../library/functions.rst:1210 msgid "" "The type of :term:`file object` returned by the :func:`open` function " "depends on the mode. When :func:`open` is used to open a file in a text " @@ -2129,7 +2120,7 @@ msgid "" "FileIO`, is returned." msgstr "" -#: ../../library/functions.rst:1240 +#: ../../library/functions.rst:1231 #, fuzzy msgid "" "See also the file handling modules, such as, :mod:`fileinput`, :mod:`io` " @@ -2139,34 +2130,34 @@ msgstr "" "另請參閱檔案操作模組,例如 :mod:`fileinput`、:mod:`io` (聲明瞭 :func:" "`open`)、:mod:`os`、:mod:`os.path`、:mod:`tempfile` 和 :mod:`shutil`。" -#: ../../library/functions.rst:1244 +#: ../../library/functions.rst:1236 msgid "" "Raises an :ref:`auditing event ` ``open`` with arguments ``file``, " "``mode``, ``flags``." msgstr "" -#: ../../library/functions.rst:1246 +#: ../../library/functions.rst:1237 msgid "" "The ``mode`` and ``flags`` arguments may have been modified or inferred from " "the original call." msgstr "" -#: ../../library/functions.rst:1252 +#: ../../library/functions.rst:1243 #, fuzzy msgid "The *opener* parameter was added." msgstr "增加了 *opener* 形參。" -#: ../../library/functions.rst:1253 +#: ../../library/functions.rst:1244 #, fuzzy msgid "The ``'x'`` mode was added." msgstr "增加了 ``'x'`` 模式。" -#: ../../library/functions.rst:1254 +#: ../../library/functions.rst:1245 #, fuzzy msgid ":exc:`IOError` used to be raised, it is now an alias of :exc:`OSError`." msgstr "過去觸發的 :exc:`IOError`,現在是 :exc:`OSError` 的別名。" -#: ../../library/functions.rst:1255 +#: ../../library/functions.rst:1246 #, fuzzy msgid "" ":exc:`FileExistsError` is now raised if the file opened in exclusive " @@ -2175,17 +2166,17 @@ msgstr "" "如果檔案已存在但使用了排它性建立模式( ``'x'`` ),現在會觸發 :exc:" "`FileExistsError`。" -#: ../../library/functions.rst:1261 +#: ../../library/functions.rst:1252 #, fuzzy msgid "The file is now non-inheritable." msgstr "檔案現在禁止繼承。" -#: ../../library/functions.rst:1265 +#: ../../library/functions.rst:1256 #, fuzzy msgid "The ``'U'`` mode." msgstr "``'U'`` 模式。" -#: ../../library/functions.rst:1270 +#: ../../library/functions.rst:1261 #, fuzzy msgid "" "If the system call is interrupted and the signal handler does not raise an " @@ -2195,17 +2186,17 @@ msgstr "" "如果系統呼叫被中斷,但訊號處理程式沒有觸發異常,此函式現在會重試系統呼叫,而" "不是觸發 :exc:`InterruptedError` 異常(原因詳見 :pep:`475`)。" -#: ../../library/functions.rst:1273 +#: ../../library/functions.rst:1264 #, fuzzy msgid "The ``'namereplace'`` error handler was added." msgstr "增加了 ``'namereplace'`` 錯誤處理介面。" -#: ../../library/functions.rst:1278 +#: ../../library/functions.rst:1269 #, fuzzy msgid "Support added to accept objects implementing :class:`os.PathLike`." msgstr "增加對實現了 :class:`os.PathLike` 物件的支援。" -#: ../../library/functions.rst:1279 +#: ../../library/functions.rst:1270 #, fuzzy msgid "" "On Windows, opening a console buffer may return a subclass of :class:`io." @@ -2214,7 +2205,7 @@ msgstr "" "在 Windows 上,開啟一個控制檯緩衝區將返回 :class:`io.RawIOBase` 的子類,而不" "是 :class:`io.FileIO`。" -#: ../../library/functions.rst:1284 +#: ../../library/functions.rst:1275 #, fuzzy msgid "" "Given a string representing one Unicode character, return an integer " @@ -2226,7 +2217,7 @@ msgstr "" "``ord('a')`` 返回整數 ``97``, ``ord('€')`` (歐元符合)返回 ``8364`` 。這" "是 :func:`chr` 的逆函式。" -#: ../../library/functions.rst:1292 +#: ../../library/functions.rst:1283 #, fuzzy msgid "" "Return *base* to the power *exp*; if *mod* is present, return *base* to the " @@ -2237,7 +2228,7 @@ msgstr "" "返回 *x* 的 *y* 次冪;如果 *z* 存在,則對 *z* 取餘(比直接 ``pow(x, y) % z`` " "計算更高效)。兩個引數形式的 ``pow(x, y)`` 等價於冪運算子: ``x**y``。" -#: ../../library/functions.rst:1297 +#: ../../library/functions.rst:1288 msgid "" "The arguments must have numeric types. With mixed operand types, the " "coercion rules for binary arithmetic operators apply. For :class:`int` " @@ -2247,7 +2238,7 @@ msgid "" "returns ``100``, but ``10**-2`` returns ``0.01``." msgstr "" -#: ../../library/functions.rst:1304 +#: ../../library/functions.rst:1295 msgid "" "For :class:`int` operands *base* and *exp*, if *mod* is present, *mod* must " "also be of integer type and *mod* must be nonzero. If *mod* is present and " @@ -2256,29 +2247,29 @@ msgid "" "*base* modulo *mod*." msgstr "" -#: ../../library/functions.rst:1310 +#: ../../library/functions.rst:1301 msgid "Here's an example of computing an inverse for ``38`` modulo ``97``::" msgstr "" -#: ../../library/functions.rst:1317 +#: ../../library/functions.rst:1308 msgid "" "For :class:`int` operands, the three-argument form of ``pow`` now allows the " "second argument to be negative, permitting computation of modular inverses." msgstr "" -#: ../../library/functions.rst:1322 +#: ../../library/functions.rst:1313 msgid "" "Allow keyword arguments. Formerly, only positional arguments were supported." msgstr "" -#: ../../library/functions.rst:1329 +#: ../../library/functions.rst:1320 msgid "" "Print *objects* to the text stream *file*, separated by *sep* and followed " "by *end*. *sep*, *end*, *file* and *flush*, if present, must be given as " "keyword arguments." msgstr "" -#: ../../library/functions.rst:1333 +#: ../../library/functions.rst:1324 msgid "" "All non-keyword arguments are converted to strings like :func:`str` does and " "written to the stream, separated by *sep* and followed by *end*. Both *sep* " @@ -2287,7 +2278,7 @@ msgid "" "*end*." msgstr "" -#: ../../library/functions.rst:1339 +#: ../../library/functions.rst:1330 msgid "" "The *file* argument must be an object with a ``write(string)`` method; if it " "is not present or ``None``, :data:`sys.stdout` will be used. Since printed " @@ -2295,40 +2286,40 @@ msgid "" "binary mode file objects. For these, use ``file.write(...)`` instead." msgstr "" -#: ../../library/functions.rst:1344 +#: ../../library/functions.rst:1335 msgid "" "Whether output is buffered is usually determined by *file*, but if the " "*flush* keyword argument is true, the stream is forcibly flushed." msgstr "" -#: ../../library/functions.rst:1347 +#: ../../library/functions.rst:1338 #, fuzzy msgid "Added the *flush* keyword argument." msgstr "增加了 *flush* keyword 實參。" -#: ../../library/functions.rst:1353 +#: ../../library/functions.rst:1344 #, fuzzy msgid "Return a property attribute." msgstr "返回 property 屬性。" -#: ../../library/functions.rst:1355 +#: ../../library/functions.rst:1346 msgid "" "*fget* is a function for getting an attribute value. *fset* is a function " "for setting an attribute value. *fdel* is a function for deleting an " "attribute value. And *doc* creates a docstring for the attribute." msgstr "" -#: ../../library/functions.rst:1359 +#: ../../library/functions.rst:1350 msgid "A typical use is to define a managed attribute ``x``::" msgstr "" -#: ../../library/functions.rst:1376 +#: ../../library/functions.rst:1367 msgid "" "If *c* is an instance of *C*, ``c.x`` will invoke the getter, ``c.x = " "value`` will invoke the setter and ``del c.x`` the deleter." msgstr "" -#: ../../library/functions.rst:1379 +#: ../../library/functions.rst:1370 msgid "" "If given, *doc* will be the docstring of the property attribute. Otherwise, " "the property will copy *fget*'s docstring (if it exists). This makes it " @@ -2336,14 +2327,14 @@ msgid "" "term:`decorator`::" msgstr "" -#: ../../library/functions.rst:1392 +#: ../../library/functions.rst:1383 msgid "" "The ``@property`` decorator turns the :meth:`voltage` method into a \"getter" "\" for a read-only attribute with the same name, and it sets the docstring " "for *voltage* to \"Get the current voltage.\"" msgstr "" -#: ../../library/functions.rst:1396 +#: ../../library/functions.rst:1387 msgid "" "A property object has :attr:`~property.getter`, :attr:`~property.setter`, " "and :attr:`~property.deleter` methods usable as decorators that create a " @@ -2351,30 +2342,30 @@ msgid "" "decorated function. This is best explained with an example::" msgstr "" -#: ../../library/functions.rst:1418 +#: ../../library/functions.rst:1409 msgid "" "This code is exactly equivalent to the first example. Be sure to give the " "additional functions the same name as the original property (``x`` in this " "case.)" msgstr "" -#: ../../library/functions.rst:1422 +#: ../../library/functions.rst:1413 msgid "" "The returned property object also has the attributes ``fget``, ``fset``, and " "``fdel`` corresponding to the constructor arguments." msgstr "" -#: ../../library/functions.rst:1425 +#: ../../library/functions.rst:1416 msgid "The docstrings of property objects are now writeable." msgstr "" -#: ../../library/functions.rst:1434 +#: ../../library/functions.rst:1425 msgid "" "Rather than being a function, :class:`range` is actually an immutable " "sequence type, as documented in :ref:`typesseq-range` and :ref:`typesseq`." msgstr "" -#: ../../library/functions.rst:1440 +#: ../../library/functions.rst:1431 msgid "" "Return a string containing a printable representation of an object. For " "many types, this function makes an attempt to return a string that would " @@ -2385,7 +2376,7 @@ msgid "" "function returns for its instances by defining a :meth:`__repr__` method." msgstr "" -#: ../../library/functions.rst:1451 +#: ../../library/functions.rst:1442 msgid "" "Return a reverse :term:`iterator`. *seq* must be an object which has a :" "meth:`__reversed__` method or supports the sequence protocol (the :meth:" @@ -2393,14 +2384,14 @@ msgid "" "starting at ``0``)." msgstr "" -#: ../../library/functions.rst:1459 +#: ../../library/functions.rst:1450 msgid "" "Return *number* rounded to *ndigits* precision after the decimal point. If " "*ndigits* is omitted or is ``None``, it returns the nearest integer to its " "input." msgstr "" -#: ../../library/functions.rst:1463 +#: ../../library/functions.rst:1454 msgid "" "For the built-in types supporting :func:`round`, values are rounded to the " "closest multiple of 10 to the power minus *ndigits*; if two multiples are " @@ -2411,13 +2402,13 @@ msgid "" "``None``. Otherwise the return value has the same type as *number*." msgstr "" -#: ../../library/functions.rst:1472 +#: ../../library/functions.rst:1463 msgid "" "For a general Python object ``number``, ``round`` delegates to ``number." "__round__``." msgstr "" -#: ../../library/functions.rst:1477 +#: ../../library/functions.rst:1468 msgid "" "The behavior of :func:`round` for floats can be surprising: for example, " "``round(2.675, 2)`` gives ``2.67`` instead of the expected ``2.68``. This is " @@ -2426,21 +2417,21 @@ msgid "" "information." msgstr "" -#: ../../library/functions.rst:1488 +#: ../../library/functions.rst:1479 msgid "" "Return a new :class:`set` object, optionally with elements taken from " "*iterable*. ``set`` is a built-in class. See :class:`set` and :ref:`types-" "set` for documentation about this class." msgstr "" -#: ../../library/functions.rst:1492 +#: ../../library/functions.rst:1483 msgid "" "For other containers see the built-in :class:`frozenset`, :class:`list`, :" "class:`tuple`, and :class:`dict` classes, as well as the :mod:`collections` " "module." msgstr "" -#: ../../library/functions.rst:1499 +#: ../../library/functions.rst:1490 msgid "" "This is the counterpart of :func:`getattr`. The arguments are an object, a " "string and an arbitrary value. The string may name an existing attribute or " @@ -2449,14 +2440,7 @@ msgid "" "equivalent to ``x.foobar = 123``." msgstr "" -#: ../../library/functions.rst:1507 -msgid "" -"Since :ref:`private name mangling ` happens at " -"compilation time, one must manually mangle a private attribute's (attributes " -"with two leading underscores) name in order to set it with :func:`setattr`." -msgstr "" - -#: ../../library/functions.rst:1518 +#: ../../library/functions.rst:1502 msgid "" "Return a :term:`slice` object representing the set of indices specified by " "``range(start, stop, step)``. The *start* and *step* arguments default to " @@ -2470,35 +2454,35 @@ msgid "" "iterator." msgstr "" -#: ../../library/functions.rst:1531 +#: ../../library/functions.rst:1515 msgid "Return a new sorted list from the items in *iterable*." msgstr "" -#: ../../library/functions.rst:1533 +#: ../../library/functions.rst:1517 msgid "" "Has two optional arguments which must be specified as keyword arguments." msgstr "有兩個選擇性參數,只能使用關鍵字參數指定。" -#: ../../library/functions.rst:1535 +#: ../../library/functions.rst:1519 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:1523 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:1526 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:1529 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 +2490,22 @@ msgid "" "example, sort by department, then by salary grade)." msgstr "" -#: ../../library/functions.rst:1550 +#: ../../library/functions.rst:1534 msgid "" "For sorting examples and a brief sorting tutorial, see :ref:`sortinghowto`." msgstr "" -#: ../../library/functions.rst:1554 +#: ../../library/functions.rst:1538 msgid "Transform a method into a static method." msgstr "" -#: ../../library/functions.rst:1556 +#: ../../library/functions.rst:1540 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:1547 #, fuzzy msgid "" "The ``@staticmethod`` form is a function :term:`decorator` -- see :ref:" @@ -2530,20 +2514,20 @@ msgstr "" "``@classmethod`` 形式是一個函式 :term:`decorator` - 參見 :ref:`function` 中關" "於函式定義的詳細介紹。" -#: ../../library/functions.rst:1566 +#: ../../library/functions.rst:1550 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:1553 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:1557 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 +2536,30 @@ msgid "" "cases, use this idiom::" msgstr "" -#: ../../library/functions.rst:1582 +#: ../../library/functions.rst:1566 #, fuzzy msgid "For more information on static methods, see :ref:`types`." msgstr "關於類方法的更多資訊,請參考文件 :ref:`types` 中的標準型別的層次。" -#: ../../library/functions.rst:1593 +#: ../../library/functions.rst:1577 msgid "" "Return a :class:`str` version of *object*. See :func:`str` for details." msgstr "" -#: ../../library/functions.rst:1595 +#: ../../library/functions.rst:1579 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:1585 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:1589 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 +2568,32 @@ msgid "" "using :func:`itertools.chain`." msgstr "" -#: ../../library/functions.rst:1611 +#: ../../library/functions.rst:1595 #, fuzzy msgid "The *start* parameter can be specified as a keyword argument." msgstr "有兩個選擇性參數,只能使用關鍵字參數指定。" -#: ../../library/functions.rst:1616 +#: ../../library/functions.rst:1600 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:1604 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:1608 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:1612 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 +2601,7 @@ msgid "" "hierarchy is updated." msgstr "" -#: ../../library/functions.rst:1633 +#: ../../library/functions.rst:1617 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 +2609,7 @@ msgid "" "(this is useful for classmethods)." msgstr "" -#: ../../library/functions.rst:1638 +#: ../../library/functions.rst:1622 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,31 +2617,31 @@ msgid "" "closely parallels the use of *super* in other programming languages." msgstr "" -#: ../../library/functions.rst:1643 +#: ../../library/functions.rst:1627 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 " "found in statically compiled languages or languages that only support single " "inheritance. This makes it possible to implement \"diamond diagrams\" where " "multiple base classes implement the same method. Good design dictates that " -"such implementations have the same calling signature in every case (because " -"the order of calls is determined at runtime, because that order adapts to " -"changes in the class hierarchy, and because that order can include sibling " -"classes that are unknown prior to runtime)." +"this method have the same calling signature in every case (because the order " +"of calls is determined at runtime, because that order adapts to changes in " +"the class hierarchy, and because that order can include sibling classes that " +"are unknown prior to runtime)." msgstr "" -#: ../../library/functions.rst:1653 +#: ../../library/functions.rst:1637 msgid "For both use cases, a typical superclass call looks like this::" msgstr "" -#: ../../library/functions.rst:1660 +#: ../../library/functions.rst:1644 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:1648 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 +2651,7 @@ msgid "" "using statements or operators such as ``super()[name]``." msgstr "" -#: ../../library/functions.rst:1671 +#: ../../library/functions.rst:1655 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,75 +2661,61 @@ msgid "" "accessing the current instance for ordinary methods." msgstr "" -#: ../../library/functions.rst:1678 +#: ../../library/functions.rst:1662 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:1671 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:1680 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:1684 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:1688 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 " -"class name and becomes the :attr:`~definition.__name__` attribute. The " -"*bases* tuple contains the base classes and becomes the :attr:`~class." -"__bases__` attribute; if empty, :class:`object`, the ultimate base of all " -"classes, is added. The *dict* dictionary contains attribute and method " -"definitions for the class body; it may be copied or wrapped before becoming " -"the :attr:`~object.__dict__` attribute. The following two statements create " -"identical :class:`type` objects:" +"class name and becomes the :attr:`~definition.__name__` attribute; the " +"*bases* tuple itemizes the base classes and becomes the :attr:`~class." +"__bases__` attribute; and the *dict* dictionary is the namespace containing " +"definitions for class body and is copied to a standard dictionary to become " +"the :attr:`~object.__dict__` attribute. For example, the following two " +"statements create identical :class:`type` objects:" msgstr "" -#: ../../library/functions.rst:1719 +#: ../../library/functions.rst:1702 msgid "See also :ref:`bltin-type-objects`." msgstr "" -#: ../../library/functions.rst:1721 -msgid "" -"Keyword arguments provided to the three argument form are passed to the " -"appropriate metaclass machinery (usually :meth:`~object.__init_subclass__`) " -"in the same way that keywords in a class definition (besides *metaclass*) " -"would." -msgstr "" - -#: ../../library/functions.rst:1726 -#, fuzzy -msgid "See also :ref:`class-customization`." -msgstr "另請參閱 :ref:`typeiter`。" - -#: ../../library/functions.rst:1728 +#: ../../library/functions.rst:1704 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:1710 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:1713 msgid "" "Objects such as modules and instances have an updateable :attr:`~object." "__dict__` attribute; however, other objects may have write restrictions on " @@ -2753,25 +2723,18 @@ msgid "" "`types.MappingProxyType` to prevent direct dictionary updates)." msgstr "" -#: ../../library/functions.rst:1742 +#: ../../library/functions.rst:1718 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 -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:1725 msgid "Make an iterator that aggregates elements from each of the iterables." msgstr "" -#: ../../library/functions.rst:1754 +#: ../../library/functions.rst:1727 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 +2743,7 @@ msgid "" "an empty iterator. Equivalent to::" msgstr "" -#: ../../library/functions.rst:1773 +#: ../../library/functions.rst:1746 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 +2752,26 @@ msgid "" "This has the effect of dividing the input into n-length chunks." msgstr "" -#: ../../library/functions.rst:1779 +#: ../../library/functions.rst:1752 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:1756 msgid "" ":func:`zip` in conjunction with the ``*`` operator can be used to unzip a " "list::" msgstr "" -#: ../../library/functions.rst:1804 +#: ../../library/functions.rst:1777 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:1780 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 +2783,7 @@ msgid "" "discouraged in favor of :func:`importlib.import_module`." msgstr "" -#: ../../library/functions.rst:1816 +#: ../../library/functions.rst:1789 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 +2793,7 @@ msgid "" "determine the package context of the :keyword:`import` statement." msgstr "" -#: ../../library/functions.rst:1823 +#: ../../library/functions.rst:1796 msgid "" "*level* specifies whether to use absolute or relative imports. ``0`` (the " "default) means only perform absolute imports. Positive values for *level* " @@ -2839,7 +2802,7 @@ msgid "" "details)." msgstr "" -#: ../../library/functions.rst:1829 +#: ../../library/functions.rst:1802 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 +2810,58 @@ msgid "" "given, the module named by *name* is returned." msgstr "" -#: ../../library/functions.rst:1834 +#: ../../library/functions.rst:1807 msgid "" "For example, the statement ``import spam`` results in bytecode resembling " "the following code::" msgstr "" -#: ../../library/functions.rst:1839 +#: ../../library/functions.rst:1812 msgid "The statement ``import spam.ham`` results in this call::" msgstr "" -#: ../../library/functions.rst:1843 +#: ../../library/functions.rst:1816 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:1819 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:1826 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:1830 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:1833 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:1837 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:1842 msgid "Footnotes" msgstr "註解" -#: ../../library/functions.rst:1870 +#: ../../library/functions.rst:1843 #, fuzzy msgid "" "Note that the parser only accepts the Unix-style end of line convention. If " diff --git a/library/functools.po b/library/functools.po index ccdd2d8475..2ecab81817 100644 --- a/library/functools.po +++ b/library/functools.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.7\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2021-09-07 06:52+0000\n" +"POT-Creation-Date: 2020-06-20 18:08+0800\n" "PO-Revision-Date: 2018-05-23 16:02+0000\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -53,7 +53,7 @@ msgid "" "`lru_cache()` with a size limit." msgstr "" -#: ../../library/functools.rst:39 ../../library/functools.rst:255 +#: ../../library/functools.rst:39 ../../library/functools.rst:230 msgid "For example::" msgstr "" @@ -65,59 +65,23 @@ msgid "" "computed properties of instances that are otherwise effectively immutable." msgstr "" -#: ../../library/functools.rst:62 ../../library/functools.rst:127 -#: ../../library/functools.rst:340 +#: ../../library/functools.rst:62 ../../library/functools.rst:102 +#: ../../library/functools.rst:315 msgid "Example::" msgstr "" -#: ../../library/functools.rst:73 -msgid "" -"The mechanics of :func:`cached_property` are somewhat different from :func:" -"`property`. A regular property blocks attribute writes unless a setter is " -"defined. In contrast, a *cached_property* allows writes." -msgstr "" - -#: ../../library/functools.rst:77 -msgid "" -"The *cached_property* decorator only runs on lookups and only when an " -"attribute of the same name doesn't exist. When it does run, the " -"*cached_property* writes to the attribute with the same name. Subsequent " -"attribute reads and writes take precedence over the *cached_property* method " -"and it works like a normal attribute." -msgstr "" - -#: ../../library/functools.rst:83 +#: ../../library/functools.rst:80 msgid "" -"The cached value can be cleared by deleting the attribute. This allows the " -"*cached_property* method to run again." -msgstr "" - -#: ../../library/functools.rst:86 -msgid "" -"Note, this decorator interferes with the operation of :pep:`412` key-sharing " -"dictionaries. This means that instance dictionaries can take more space " -"than usual." +"This decorator requires that the ``__dict__`` attribute on each instance be " +"a mutable mapping. This means it will not work with some types, such as " +"metaclasses (since the ``__dict__`` attributes on type instances are read-" +"only proxies for the class namespace), and those that specify ``__slots__`` " +"without including ``__dict__`` as one of the defined slots (as such classes " +"don't provide a ``__dict__`` attribute at all)." msgstr "" #: ../../library/functools.rst:90 msgid "" -"Also, this decorator requires that the ``__dict__`` attribute on each " -"instance be a mutable mapping. This means it will not work with some types, " -"such as metaclasses (since the ``__dict__`` attributes on type instances are " -"read-only proxies for the class namespace), and those that specify " -"``__slots__`` without including ``__dict__`` as one of the defined slots (as " -"such classes don't provide a ``__dict__`` attribute at all)." -msgstr "" - -#: ../../library/functools.rst:97 -msgid "" -"If a mutable mapping is not available or if space-efficient key sharing is " -"desired, an effect similar to :func:`cached_property` can be achieved by a " -"stacking :func:`property` on top of :func:`cache`::" -msgstr "" - -#: ../../library/functools.rst:115 -msgid "" "Transform an old-style comparison function to a :term:`key function`. Used " "with tools that accept key functions (such as :func:`sorted`, :func:`min`, :" "func:`max`, :func:`heapq.nlargest`, :func:`heapq.nsmallest`, :func:" @@ -126,7 +90,7 @@ msgid "" "comparison functions." msgstr "" -#: ../../library/functools.rst:122 +#: ../../library/functools.rst:97 msgid "" "A comparison function is any callable that accept two arguments, compares " "them, and returns a negative number for less-than, zero for equality, or a " @@ -134,52 +98,52 @@ msgid "" "one argument and returns another value to be used as the sort key." msgstr "" -#: ../../library/functools.rst:131 +#: ../../library/functools.rst:106 msgid "" "For sorting examples and a brief sorting tutorial, see :ref:`sortinghowto`." msgstr "" -#: ../../library/functools.rst:139 +#: ../../library/functools.rst:114 msgid "" "Decorator to wrap a function with a memoizing callable that saves up to the " "*maxsize* most recent calls. It can save time when an expensive or I/O " "bound function is periodically called with the same arguments." msgstr "" -#: ../../library/functools.rst:143 +#: ../../library/functools.rst:118 msgid "" "Since a dictionary is used to cache results, the positional and keyword " "arguments to the function must be hashable." msgstr "" -#: ../../library/functools.rst:146 +#: ../../library/functools.rst:121 msgid "" "Distinct argument patterns may be considered to be distinct calls with " "separate cache entries. For example, `f(a=1, b=2)` and `f(b=2, a=1)` differ " "in their keyword argument order and may have two separate cache entries." msgstr "" -#: ../../library/functools.rst:151 +#: ../../library/functools.rst:126 msgid "" "If *user_function* is specified, it must be a callable. This allows the " "*lru_cache* decorator to be applied directly to a user function, leaving the " "*maxsize* at its default value of 128::" msgstr "" -#: ../../library/functools.rst:160 +#: ../../library/functools.rst:135 msgid "" "If *maxsize* is set to ``None``, the LRU feature is disabled and the cache " "can grow without bound." msgstr "" -#: ../../library/functools.rst:163 +#: ../../library/functools.rst:138 msgid "" "If *typed* is set to true, function arguments of different types will be " "cached separately. For example, ``f(3)`` and ``f(3.0)`` will be treated as " "distinct calls with distinct results." msgstr "" -#: ../../library/functools.rst:167 +#: ../../library/functools.rst:142 msgid "" "The wrapped function is instrumented with a :func:`cache_parameters` " "function that returns a new :class:`dict` showing the values for *maxsize* " @@ -187,7 +151,7 @@ msgid "" "has no effect." msgstr "" -#: ../../library/functools.rst:172 +#: ../../library/functools.rst:147 msgid "" "To help measure the effectiveness of the cache and tune the *maxsize* " "parameter, the wrapped function is instrumented with a :func:`cache_info` " @@ -196,20 +160,20 @@ msgid "" "misses are approximate." msgstr "" -#: ../../library/functools.rst:178 +#: ../../library/functools.rst:153 msgid "" "The decorator also provides a :func:`cache_clear` function for clearing or " "invalidating the cache." msgstr "" -#: ../../library/functools.rst:181 +#: ../../library/functools.rst:156 msgid "" "The original underlying function is accessible through the :attr:" "`__wrapped__` attribute. This is useful for introspection, for bypassing " "the cache, or for rewrapping the function with a different cache." msgstr "" -#: ../../library/functools.rst:185 +#: ../../library/functools.rst:160 msgid "" "An `LRU (least recently used) cache `_ works best when the " @@ -219,7 +183,7 @@ msgid "" "long-running processes such as web servers." msgstr "" -#: ../../library/functools.rst:192 +#: ../../library/functools.rst:167 msgid "" "In general, the LRU cache should only be used when you want to reuse " "previously computed values. Accordingly, it doesn't make sense to cache " @@ -227,44 +191,44 @@ msgid "" "objects on each call, or impure functions such as time() or random()." msgstr "" -#: ../../library/functools.rst:197 +#: ../../library/functools.rst:172 msgid "Example of an LRU cache for static web content::" msgstr "" -#: ../../library/functools.rst:216 +#: ../../library/functools.rst:191 msgid "" "Example of efficiently computing `Fibonacci numbers `_ using a cache to implement a `dynamic " "programming `_ technique::" msgstr "" -#: ../../library/functools.rst:236 +#: ../../library/functools.rst:211 msgid "Added the *typed* option." msgstr "" -#: ../../library/functools.rst:239 +#: ../../library/functools.rst:214 msgid "Added the *user_function* option." msgstr "" -#: ../../library/functools.rst:242 +#: ../../library/functools.rst:217 msgid "Added the function :func:`cache_parameters`" msgstr "" -#: ../../library/functools.rst:247 +#: ../../library/functools.rst:222 msgid "" "Given a class defining one or more rich comparison ordering methods, this " "class decorator supplies the rest. This simplifies the effort involved in " "specifying all of the possible rich comparison operations:" msgstr "" -#: ../../library/functools.rst:251 +#: ../../library/functools.rst:226 msgid "" "The class must define one of :meth:`__lt__`, :meth:`__le__`, :meth:`__gt__`, " "or :meth:`__ge__`. In addition, the class should supply an :meth:`__eq__` " "method." msgstr "" -#: ../../library/functools.rst:275 +#: ../../library/functools.rst:250 msgid "" "While this decorator makes it easy to create well behaved totally ordered " "types, it *does* come at the cost of slower execution and more complex stack " @@ -273,13 +237,13 @@ msgid "" "rich comparison methods instead is likely to provide an easy speed boost." msgstr "" -#: ../../library/functools.rst:284 +#: ../../library/functools.rst:259 msgid "" "Returning NotImplemented from the underlying comparison function for " "unrecognised types is now supported." msgstr "" -#: ../../library/functools.rst:290 +#: ../../library/functools.rst:265 msgid "" "Return a new :ref:`partial object` which when called will " "behave like *func* called with the positional arguments *args* and keyword " @@ -288,7 +252,7 @@ msgid "" "extend and override *keywords*. Roughly equivalent to::" msgstr "" -#: ../../library/functools.rst:306 +#: ../../library/functools.rst:281 msgid "" "The :func:`partial` is used for partial function application which \"freezes" "\" some portion of a function's arguments and/or keywords resulting in a new " @@ -297,20 +261,20 @@ msgid "" "the *base* argument defaults to two:" msgstr "" -#: ../../library/functools.rst:321 +#: ../../library/functools.rst:296 msgid "" "Return a new :class:`partialmethod` descriptor which behaves like :class:" "`partial` except that it is designed to be used as a method definition " "rather than being directly callable." msgstr "" -#: ../../library/functools.rst:325 +#: ../../library/functools.rst:300 msgid "" "*func* must be a :term:`descriptor` or a callable (objects which are both, " "like normal functions, are handled as descriptors)." msgstr "" -#: ../../library/functools.rst:328 +#: ../../library/functools.rst:303 msgid "" "When *func* is a descriptor (such as a normal Python function, :func:" "`classmethod`, :func:`staticmethod`, :func:`abstractmethod` or another " @@ -319,7 +283,7 @@ msgid "" "objects>` returned as the result." msgstr "" -#: ../../library/functools.rst:334 +#: ../../library/functools.rst:309 msgid "" "When *func* is a non-descriptor callable, an appropriate bound method is " "created dynamically. This behaves like a normal Python function when used as " @@ -328,7 +292,7 @@ msgid "" "`partialmethod` constructor." msgstr "" -#: ../../library/functools.rst:365 +#: ../../library/functools.rst:340 msgid "" "Apply *function* of two arguments cumulatively to the items of *iterable*, " "from left to right, so as to reduce the iterable to a single value. For " @@ -341,30 +305,30 @@ msgid "" "the first item is returned." msgstr "" -#: ../../library/functools.rst:374 +#: ../../library/functools.rst:349 msgid "Roughly equivalent to::" msgstr "" -#: ../../library/functools.rst:386 +#: ../../library/functools.rst:361 msgid "" "See :func:`itertools.accumulate` for an iterator that yields all " "intermediate values." msgstr "" -#: ../../library/functools.rst:391 +#: ../../library/functools.rst:366 msgid "" "Transform a function into a :term:`single-dispatch ` :term:" "`generic function`." msgstr "" -#: ../../library/functools.rst:394 +#: ../../library/functools.rst:369 msgid "" "To define a generic function, decorate it with the ``@singledispatch`` " "decorator. Note that the dispatch happens on the type of the first argument, " "create your function accordingly::" msgstr "" -#: ../../library/functools.rst:405 +#: ../../library/functools.rst:380 msgid "" "To add overloaded implementations to the function, use the :func:`register` " "attribute of the generic function. It is a decorator. For functions " @@ -372,32 +336,32 @@ msgid "" "argument automatically::" msgstr "" -#: ../../library/functools.rst:423 +#: ../../library/functools.rst:398 msgid "" "For code which doesn't use type annotations, the appropriate type argument " "can be passed explicitly to the decorator itself::" msgstr "" -#: ../../library/functools.rst:434 +#: ../../library/functools.rst:409 msgid "" "To enable registering lambdas and pre-existing functions, the :func:" "`register` attribute can be used in a functional form::" msgstr "" -#: ../../library/functools.rst:442 +#: ../../library/functools.rst:417 msgid "" "The :func:`register` attribute returns the undecorated function which " "enables decorator stacking, pickling, as well as creating unit tests for " "each variant independently::" msgstr "" -#: ../../library/functools.rst:456 +#: ../../library/functools.rst:431 msgid "" "When called, the generic function dispatches on the type of the first " "argument::" msgstr "" -#: ../../library/functools.rst:476 +#: ../../library/functools.rst:451 msgid "" "Where there is no registered implementation for a specific type, its method " "resolution order is used to find a more generic implementation. The original " @@ -405,42 +369,42 @@ msgid "" "``object`` type, which means it is used if no better implementation is found." msgstr "" -#: ../../library/functools.rst:482 +#: ../../library/functools.rst:457 msgid "" "If an implementation registered to :term:`abstract base class`, virtual " "subclasses will be dispatched to that implementation::" msgstr "" -#: ../../library/functools.rst:496 +#: ../../library/functools.rst:471 msgid "" "To check which implementation will the generic function choose for a given " "type, use the ``dispatch()`` attribute::" msgstr "" -#: ../../library/functools.rst:504 +#: ../../library/functools.rst:479 msgid "" "To access all registered implementations, use the read-only ``registry`` " "attribute::" msgstr "" -#: ../../library/functools.rst:518 +#: ../../library/functools.rst:493 msgid "The :func:`register` attribute supports using type annotations." msgstr "" -#: ../../library/functools.rst:524 +#: ../../library/functools.rst:499 msgid "" "Transform a method into a :term:`single-dispatch ` :term:" "`generic function`." msgstr "" -#: ../../library/functools.rst:527 +#: ../../library/functools.rst:502 msgid "" "To define a generic method, decorate it with the ``@singledispatchmethod`` " "decorator. Note that the dispatch happens on the type of the first non-self " "or non-cls argument, create your function accordingly::" msgstr "" -#: ../../library/functools.rst:544 +#: ../../library/functools.rst:519 msgid "" "``@singledispatchmethod`` supports nesting with other decorators such as " "``@classmethod``. Note that to allow for ``dispatcher.register``, " @@ -448,13 +412,13 @@ msgid "" "``Negator`` class with the ``neg`` methods being class bound::" msgstr "" -#: ../../library/functools.rst:565 +#: ../../library/functools.rst:540 msgid "" "The same pattern can be used for other similar decorators: ``staticmethod``, " "``abstractmethod``, and others." msgstr "" -#: ../../library/functools.rst:573 +#: ../../library/functools.rst:548 msgid "" "Update a *wrapper* function to look like the *wrapped* function. The " "optional arguments are tuples to specify which attributes of the original " @@ -468,7 +432,7 @@ msgid "" "``__dict__``, i.e. the instance dictionary)." msgstr "" -#: ../../library/functools.rst:583 +#: ../../library/functools.rst:558 msgid "" "To allow access to the original function for introspection and other " "purposes (e.g. bypassing a caching decorator such as :func:`lru_cache`), " @@ -476,7 +440,7 @@ msgid "" "that refers to the function being wrapped." msgstr "" -#: ../../library/functools.rst:588 +#: ../../library/functools.rst:563 msgid "" "The main intended use for this function is in :term:`decorator` functions " "which wrap the decorated function and return the wrapper. If the wrapper " @@ -485,7 +449,7 @@ msgid "" "is typically less than helpful." msgstr "" -#: ../../library/functools.rst:594 +#: ../../library/functools.rst:569 msgid "" ":func:`update_wrapper` may be used with callables other than functions. Any " "attributes named in *assigned* or *updated* that are missing from the object " @@ -494,26 +458,26 @@ msgid "" "wrapper function itself is missing any attributes named in *updated*." msgstr "" -#: ../../library/functools.rst:600 +#: ../../library/functools.rst:575 msgid "Automatic addition of the ``__wrapped__`` attribute." msgstr "" -#: ../../library/functools.rst:603 +#: ../../library/functools.rst:578 msgid "Copying of the ``__annotations__`` attribute by default." msgstr "" -#: ../../library/functools.rst:606 +#: ../../library/functools.rst:581 msgid "Missing attributes no longer trigger an :exc:`AttributeError`." msgstr "" -#: ../../library/functools.rst:609 +#: ../../library/functools.rst:584 msgid "" "The ``__wrapped__`` attribute now always refers to the wrapped function, " "even if that function defined a ``__wrapped__`` attribute. (see :issue:" "`17482`)" msgstr "" -#: ../../library/functools.rst:617 +#: ../../library/functools.rst:592 msgid "" "This is a convenience function for invoking :func:`update_wrapper` as a " "function decorator when defining a wrapper function. It is equivalent to " @@ -521,42 +485,42 @@ msgid "" "updated=updated)``. For example::" msgstr "" -#: ../../library/functools.rst:643 +#: ../../library/functools.rst:618 msgid "" "Without the use of this decorator factory, the name of the example function " "would have been ``'wrapper'``, and the docstring of the original :func:" "`example` would have been lost." msgstr "" -#: ../../library/functools.rst:651 +#: ../../library/functools.rst:626 msgid ":class:`partial` Objects" msgstr "" -#: ../../library/functools.rst:653 +#: ../../library/functools.rst:628 msgid "" ":class:`partial` objects are callable objects created by :func:`partial`. " "They have three read-only attributes:" msgstr "" -#: ../../library/functools.rst:659 +#: ../../library/functools.rst:634 msgid "" "A callable object or function. Calls to the :class:`partial` object will be " "forwarded to :attr:`func` with new arguments and keywords." msgstr "" -#: ../../library/functools.rst:665 +#: ../../library/functools.rst:640 msgid "" "The leftmost positional arguments that will be prepended to the positional " "arguments provided to a :class:`partial` object call." msgstr "" -#: ../../library/functools.rst:671 +#: ../../library/functools.rst:646 msgid "" "The keyword arguments that will be supplied when the :class:`partial` object " "is called." msgstr "" -#: ../../library/functools.rst:674 +#: ../../library/functools.rst:649 msgid "" ":class:`partial` objects are like :class:`function` objects in that they are " "callable, weak referencable, and can have attributes. There are some " diff --git a/library/gc.po b/library/gc.po index 39b62beeb5..94ce899219 100644 --- a/library/gc.po +++ b/library/gc.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.7\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2021-09-07 06:52+0000\n" +"POT-Creation-Date: 2020-06-20 18:08+0800\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-" @@ -90,43 +90,37 @@ msgstr "" msgid "New *generation* parameter." msgstr "" -#: ../../library/gc.rst:75 -msgid "" -"Raises an :ref:`auditing event ` ``gc.get_objects`` with argument " -"``generation``." -msgstr "" - -#: ../../library/gc.rst:79 +#: ../../library/gc.rst:77 msgid "" "Return a list of three per-generation dictionaries containing collection " "statistics since interpreter start. The number of keys may change in the " "future, but currently each dictionary will contain the following items:" msgstr "" -#: ../../library/gc.rst:84 +#: ../../library/gc.rst:82 msgid "``collections`` is the number of times this generation was collected;" msgstr "" -#: ../../library/gc.rst:86 +#: ../../library/gc.rst:84 msgid "" "``collected`` is the total number of objects collected inside this " "generation;" msgstr "" -#: ../../library/gc.rst:89 +#: ../../library/gc.rst:87 msgid "" "``uncollectable`` is the total number of objects which were found to be " "uncollectable (and were therefore moved to the :data:`garbage` list) inside " "this generation." msgstr "" -#: ../../library/gc.rst:98 +#: ../../library/gc.rst:96 msgid "" "Set the garbage collection thresholds (the collection frequency). Setting " "*threshold0* to zero disables collection." msgstr "" -#: ../../library/gc.rst:101 +#: ../../library/gc.rst:99 msgid "" "The GC classifies objects into three generations depending on how many " "collection sweeps they have survived. New objects are placed in the " @@ -139,25 +133,23 @@ msgid "" "*threshold0*, collection starts. Initially only generation ``0`` is " "examined. If generation ``0`` has been examined more than *threshold1* " "times since generation ``1`` has been examined, then generation ``1`` is " -"examined as well. With the third generation, things are a bit more " -"complicated, see `Collecting the oldest generation `_ for more " -"information." +"examined as well. Similarly, *threshold2* controls the number of " +"collections of generation ``1`` before collecting generation ``2``." msgstr "" -#: ../../library/gc.rst:118 +#: ../../library/gc.rst:116 msgid "" "Return the current collection counts as a tuple of ``(count0, count1, " "count2)``." msgstr "" -#: ../../library/gc.rst:124 +#: ../../library/gc.rst:122 msgid "" "Return the current collection thresholds as a tuple of ``(threshold0, " "threshold1, threshold2)``." msgstr "" -#: ../../library/gc.rst:130 +#: ../../library/gc.rst:128 msgid "" "Return the list of objects that directly refer to any of objs. This function " "will only locate those containers which support garbage collection; " @@ -165,7 +157,7 @@ msgid "" "collection will not be found." msgstr "" -#: ../../library/gc.rst:135 +#: ../../library/gc.rst:133 msgid "" "Note that objects which have already been dereferenced, but which live in " "cycles and have not yet been collected by the garbage collector can be " @@ -173,7 +165,7 @@ msgid "" "call :func:`collect` before calling :func:`get_referrers`." msgstr "" -#: ../../library/gc.rst:141 +#: ../../library/gc.rst:138 msgid "" "Care must be taken when using objects returned by :func:`get_referrers` " "because some of them could still be under construction and hence in a " @@ -183,12 +175,6 @@ msgstr "" #: ../../library/gc.rst:146 msgid "" -"Raises an :ref:`auditing event ` ``gc.get_referrers`` with " -"argument ``objs``." -msgstr "" - -#: ../../library/gc.rst:151 -msgid "" "Return a list of objects directly referred to by any of the arguments. The " "referents returned are those objects visited by the arguments' C-level :c:" "member:`~PyTypeObject.tp_traverse` methods (if any), and may not be all " @@ -199,13 +185,7 @@ msgid "" "object may or may not appear in the result list." msgstr "" -#: ../../library/gc.rst:159 -msgid "" -"Raises an :ref:`auditing event ` ``gc.get_referents`` with " -"argument ``objs``." -msgstr "" - -#: ../../library/gc.rst:163 +#: ../../library/gc.rst:157 msgid "" "Returns ``True`` if the object is currently tracked by the garbage " "collector, ``False`` otherwise. As a general rule, instances of atomic " @@ -215,13 +195,13 @@ msgid "" "instances (e.g. dicts containing only atomic keys and values)::" msgstr "" -#: ../../library/gc.rst:188 +#: ../../library/gc.rst:182 msgid "" "Returns ``True`` if the given object has been finalized by the garbage " "collector, ``False`` otherwise. ::" msgstr "" -#: ../../library/gc.rst:209 +#: ../../library/gc.rst:203 msgid "" "Freeze all the objects tracked by gc - move them to a permanent generation " "and ignore all the future collections. This can be used before a POSIX " @@ -231,23 +211,23 @@ msgid "" "in parent process and freeze before fork and enable gc in child process." msgstr "" -#: ../../library/gc.rst:221 +#: ../../library/gc.rst:215 msgid "" "Unfreeze the objects in the permanent generation, put them back into the " "oldest generation." msgstr "" -#: ../../library/gc.rst:229 +#: ../../library/gc.rst:223 msgid "Return the number of objects in the permanent generation." msgstr "" -#: ../../library/gc.rst:234 +#: ../../library/gc.rst:228 msgid "" "The following variables are provided for read-only access (you can mutate " "the values but should not rebind them):" msgstr "" -#: ../../library/gc.rst:239 +#: ../../library/gc.rst:233 msgid "" "A list of objects which the collector found to be unreachable but could not " "be freed (uncollectable objects). Starting with Python 3.4, this list " @@ -255,13 +235,13 @@ msgid "" "types with a non-``NULL`` ``tp_del`` slot." msgstr "" -#: ../../library/gc.rst:244 +#: ../../library/gc.rst:238 msgid "" "If :const:`DEBUG_SAVEALL` is set, then all unreachable objects will be added " "to this list rather than freed." msgstr "" -#: ../../library/gc.rst:247 +#: ../../library/gc.rst:241 msgid "" "If this list is non-empty at :term:`interpreter shutdown`, a :exc:" "`ResourceWarning` is emitted, which is silent by default. If :const:" @@ -269,105 +249,105 @@ msgid "" "printed." msgstr "" -#: ../../library/gc.rst:253 +#: ../../library/gc.rst:247 msgid "" "Following :pep:`442`, objects with a :meth:`__del__` method don't end up in :" "attr:`gc.garbage` anymore." msgstr "" -#: ../../library/gc.rst:259 +#: ../../library/gc.rst:253 msgid "" "A list of callbacks that will be invoked by the garbage collector before and " "after collection. The callbacks will be called with two arguments, *phase* " "and *info*." msgstr "" -#: ../../library/gc.rst:263 +#: ../../library/gc.rst:257 msgid "*phase* can be one of two values:" msgstr "" -#: ../../library/gc.rst:265 +#: ../../library/gc.rst:259 msgid "\"start\": The garbage collection is about to start." msgstr "" -#: ../../library/gc.rst:267 +#: ../../library/gc.rst:261 msgid "\"stop\": The garbage collection has finished." msgstr "" -#: ../../library/gc.rst:269 +#: ../../library/gc.rst:263 msgid "" "*info* is a dict providing more information for the callback. The following " "keys are currently defined:" msgstr "" -#: ../../library/gc.rst:272 +#: ../../library/gc.rst:266 msgid "\"generation\": The oldest generation being collected." msgstr "" -#: ../../library/gc.rst:274 +#: ../../library/gc.rst:268 msgid "" "\"collected\": When *phase* is \"stop\", the number of objects successfully " "collected." msgstr "" -#: ../../library/gc.rst:277 +#: ../../library/gc.rst:271 msgid "" "\"uncollectable\": When *phase* is \"stop\", the number of objects that " "could not be collected and were put in :data:`garbage`." msgstr "" -#: ../../library/gc.rst:280 +#: ../../library/gc.rst:274 msgid "" "Applications can add their own callbacks to this list. The primary use " "cases are:" msgstr "" -#: ../../library/gc.rst:283 +#: ../../library/gc.rst:277 msgid "" "Gathering statistics about garbage collection, such as how often various " "generations are collected, and how long the collection takes." msgstr "" -#: ../../library/gc.rst:287 +#: ../../library/gc.rst:281 msgid "" "Allowing applications to identify and clear their own uncollectable types " "when they appear in :data:`garbage`." msgstr "" -#: ../../library/gc.rst:293 +#: ../../library/gc.rst:287 msgid "The following constants are provided for use with :func:`set_debug`:" msgstr "" -#: ../../library/gc.rst:298 +#: ../../library/gc.rst:292 msgid "" "Print statistics during collection. This information can be useful when " "tuning the collection frequency." msgstr "" -#: ../../library/gc.rst:304 +#: ../../library/gc.rst:298 msgid "Print information on collectable objects found." msgstr "" -#: ../../library/gc.rst:309 +#: ../../library/gc.rst:303 msgid "" "Print information of uncollectable objects found (objects which are not " "reachable but cannot be freed by the collector). These objects will be " "added to the ``garbage`` list." msgstr "" -#: ../../library/gc.rst:313 +#: ../../library/gc.rst:307 msgid "" "Also print the contents of the :data:`garbage` list at :term:`interpreter " "shutdown`, if it isn't empty." msgstr "" -#: ../../library/gc.rst:319 +#: ../../library/gc.rst:313 msgid "" "When set, all unreachable objects found will be appended to *garbage* rather " "than being freed. This can be useful for debugging a leaking program." msgstr "" -#: ../../library/gc.rst:325 +#: ../../library/gc.rst:319 msgid "" "The debugging flags necessary for the collector to print information about a " "leaking program (equal to ``DEBUG_COLLECTABLE | DEBUG_UNCOLLECTABLE | " diff --git a/library/glob.po b/library/glob.po index 3df6a54ed4..964f58462a 100644 --- a/library/glob.po +++ b/library/glob.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.7\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2021-09-07 06:52+0000\n" +"POT-Creation-Date: 2020-06-20 18:08+0800\n" "PO-Revision-Date: 2018-05-23 16:02+0000\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -56,12 +56,10 @@ msgid "" "absolute (like :file:`/usr/src/Python-1.5/Makefile`) or relative (like :file:" "`../../Tools/\\*/\\*.gif`), and can contain shell-style wildcards. Broken " "symlinks are included in the results (as in the shell). Whether or not the " -"results are sorted depends on the file system. If a file that satisfies " -"conditions is removed or added during the call of this function, whether a " -"path name for that file be included is unspecified." +"results are sorted depends on the file system." msgstr "" -#: ../../library/glob.rst:53 +#: ../../library/glob.rst:51 msgid "" "If *recursive* is true, the pattern \"``**``\" will match any files and zero " "or more directories, subdirectories and symbolic links to directories. If " @@ -69,29 +67,29 @@ msgid "" "will not match." msgstr "" -#: ../../library/glob.rst:58 ../../library/glob.rst:73 +#: ../../library/glob.rst:57 ../../library/glob.rst:71 msgid "" "Raises an :ref:`auditing event ` ``glob.glob`` with arguments " "``pathname``, ``recursive``." msgstr "" -#: ../../library/glob.rst:61 +#: ../../library/glob.rst:59 msgid "" "Using the \"``**``\" pattern in large directory trees may consume an " "inordinate amount of time." msgstr "" -#: ../../library/glob.rst:64 +#: ../../library/glob.rst:62 msgid "Support for recursive globs using \"``**``\"." msgstr "" -#: ../../library/glob.rst:70 +#: ../../library/glob.rst:68 msgid "" "Return an :term:`iterator` which yields the same values as :func:`glob` " "without actually storing them all simultaneously." msgstr "" -#: ../../library/glob.rst:78 +#: ../../library/glob.rst:76 msgid "" "Escape all special characters (``'?'``, ``'*'`` and ``'['``). This is useful " "if you want to match an arbitrary literal string that may have special " @@ -100,7 +98,7 @@ msgid "" "c:/Quo vadis[?].txt'``." msgstr "" -#: ../../library/glob.rst:87 +#: ../../library/glob.rst:85 msgid "" "For example, consider a directory containing the following files: :file:`1." "gif`, :file:`2.txt`, :file:`card.gif` and a subdirectory :file:`sub` which " @@ -109,17 +107,17 @@ msgid "" "preserved. ::" msgstr "" -#: ../../library/glob.rst:105 +#: ../../library/glob.rst:103 msgid "" "If the directory contains files starting with ``.`` they won't be matched by " "default. For example, consider a directory containing :file:`card.gif` and :" "file:`.card.gif`::" msgstr "" -#: ../../library/glob.rst:117 +#: ../../library/glob.rst:115 msgid "Module :mod:`fnmatch`" msgstr "" -#: ../../library/glob.rst:118 +#: ../../library/glob.rst:116 msgid "Shell-style filename (not path) expansion" msgstr "" diff --git a/library/graphlib.po b/library/graphlib.po index e0cdf47b2c..38d52399a9 100644 --- a/library/graphlib.po +++ b/library/graphlib.po @@ -8,11 +8,10 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.9\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2021-09-07 06:52+0000\n" +"POT-Creation-Date: 2020-06-20 18:08+0800\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" -"Language: \n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" @@ -142,7 +141,7 @@ msgid "" msgstr "" #: ../../library/graphlib.rst:124 -msgid "it is possible to simply do::" +msgid "if possible to simply do::" msgstr "" #: ../../library/graphlib.rst:129 ../../library/graphlib.rst:152 @@ -178,19 +177,18 @@ msgstr "" #: ../../library/graphlib.rst:157 msgid "" -"Returns an iterator object which will iterate over nodes in a topological " -"order. When using this method, :meth:`~TopologicalSorter.prepare` and :meth:" -"`~TopologicalSorter.done` should not be called. This method is equivalent " -"to::" +"Returns an iterable of nodes in a topological order. Using this method does " +"not require to call :meth:`TopologicalSorter.prepare` or :meth:" +"`TopologicalSorter.done`. This method is equivalent to::" msgstr "" -#: ../../library/graphlib.rst:169 +#: ../../library/graphlib.rst:168 msgid "" "The particular order that is returned may depend on the specific order in " "which the items were inserted in the graph. For example:" msgstr "" -#: ../../library/graphlib.rst:186 +#: ../../library/graphlib.rst:185 msgid "" "This is due to the fact that \"0\" and \"2\" are in the same level in the " "graph (they would have been returned in the same call to :meth:" @@ -198,26 +196,26 @@ msgid "" "the order of insertion." msgstr "" -#: ../../library/graphlib.rst:192 +#: ../../library/graphlib.rst:191 msgid "If any cycle is detected, :exc:`CycleError` will be raised." msgstr "" -#: ../../library/graphlib.rst:198 +#: ../../library/graphlib.rst:197 msgid "Exceptions" msgstr "" -#: ../../library/graphlib.rst:199 +#: ../../library/graphlib.rst:198 msgid "The :mod:`graphlib` module defines the following exception classes:" msgstr "" -#: ../../library/graphlib.rst:203 +#: ../../library/graphlib.rst:202 msgid "" "Subclass of :exc:`ValueError` raised by :meth:`TopologicalSorter.prepare` if " "cycles exist in the working graph. If multiple cycles exist, only one " "undefined choice among them will be reported and included in the exception." msgstr "" -#: ../../library/graphlib.rst:207 +#: ../../library/graphlib.rst:206 msgid "" "The detected cycle can be accessed via the second element in the :attr:" "`~CycleError.args` attribute of the exception instance and consists in a " diff --git a/library/hashlib.po b/library/hashlib.po index 2e40fa0cee..4c351a86cd 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-07 06:52+0000\n" +"POT-Creation-Date: 2020-06-20 18:08+0800\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-" @@ -98,7 +98,7 @@ msgstr "" msgid ":func:`blake2b` and :func:`blake2s` were added." msgstr "" -#: ../../library/hashlib.rst:85 +#: ../../library/hashlib.rst:83 msgid "" "All hashlib constructors take a keyword-only argument *usedforsecurity* with " "default value ``True``. A false value allows the use of insecure and blocked " @@ -107,21 +107,21 @@ msgid "" "cryptographic one-way compression function." msgstr "" -#: ../../library/hashlib.rst:92 +#: ../../library/hashlib.rst:90 msgid "Hashlib now uses SHA3 and SHAKE from OpenSSL 1.1.1 and newer." msgstr "" -#: ../../library/hashlib.rst:94 +#: ../../library/hashlib.rst:92 msgid "" "For example, to obtain the digest of the byte string ``b'Nobody inspects the " "spammish repetition'``::" msgstr "" -#: ../../library/hashlib.rst:108 +#: ../../library/hashlib.rst:106 msgid "More condensed:" msgstr "" -#: ../../library/hashlib.rst:115 +#: ../../library/hashlib.rst:113 msgid "" "Is a generic constructor that takes the string *name* of the desired " "algorithm as its first parameter. It also exists to allow access to the " @@ -130,15 +130,15 @@ msgid "" "and should be preferred." msgstr "" -#: ../../library/hashlib.rst:121 +#: ../../library/hashlib.rst:119 msgid "Using :func:`new` with an algorithm provided by OpenSSL:" msgstr "" -#: ../../library/hashlib.rst:128 +#: ../../library/hashlib.rst:126 msgid "Hashlib provides the following constant attributes:" msgstr "" -#: ../../library/hashlib.rst:132 +#: ../../library/hashlib.rst:130 msgid "" "A set containing the names of the hash algorithms guaranteed to be supported " "by this module on all platforms. Note that 'md5' is in this list despite " @@ -146,7 +146,7 @@ msgid "" "excludes it." msgstr "" -#: ../../library/hashlib.rst:141 +#: ../../library/hashlib.rst:139 msgid "" "A set containing the names of the hash algorithms that are available in the " "running Python interpreter. These names will be recognized when passed to :" @@ -155,80 +155,80 @@ msgid "" "(thanks to OpenSSL)." msgstr "" -#: ../../library/hashlib.rst:149 +#: ../../library/hashlib.rst:147 msgid "" "The following values are provided as constant attributes of the hash objects " "returned by the constructors:" msgstr "" -#: ../../library/hashlib.rst:155 +#: ../../library/hashlib.rst:153 msgid "The size of the resulting hash in bytes." msgstr "" -#: ../../library/hashlib.rst:159 +#: ../../library/hashlib.rst:157 msgid "The internal block size of the hash algorithm in bytes." msgstr "" -#: ../../library/hashlib.rst:161 +#: ../../library/hashlib.rst:159 msgid "A hash object has the following attributes:" msgstr "" -#: ../../library/hashlib.rst:165 +#: ../../library/hashlib.rst:163 msgid "" "The canonical name of this hash, always lowercase and always suitable as a " "parameter to :func:`new` to create another hash of this type." msgstr "" -#: ../../library/hashlib.rst:168 +#: ../../library/hashlib.rst:166 msgid "" "The name attribute has been present in CPython since its inception, but " "until Python 3.4 was not formally specified, so may not exist on some " "platforms." msgstr "" -#: ../../library/hashlib.rst:173 +#: ../../library/hashlib.rst:171 msgid "A hash object has the following methods:" msgstr "" -#: ../../library/hashlib.rst:178 +#: ../../library/hashlib.rst:176 msgid "" "Update the hash object with the :term:`bytes-like object`. Repeated calls " "are equivalent to a single call with the concatenation of all the arguments: " "``m.update(a); m.update(b)`` is equivalent to ``m.update(a+b)``." msgstr "" -#: ../../library/hashlib.rst:183 +#: ../../library/hashlib.rst:181 msgid "" "The Python GIL is released to allow other threads to run while hash updates " "on data larger than 2047 bytes is taking place when using hash algorithms " "supplied by OpenSSL." msgstr "" -#: ../../library/hashlib.rst:191 +#: ../../library/hashlib.rst:189 msgid "" "Return the digest of the data passed to the :meth:`update` method so far. " "This is a bytes object of size :attr:`digest_size` which may contain bytes " "in the whole range from 0 to 255." msgstr "" -#: ../../library/hashlib.rst:198 ../../library/hashlib.rst:226 +#: ../../library/hashlib.rst:196 ../../library/hashlib.rst:224 msgid "" "Like :meth:`digest` except the digest is returned as a string object of " "double length, containing only hexadecimal digits. This may be used to " "exchange the value safely in email or other non-binary environments." msgstr "" -#: ../../library/hashlib.rst:205 +#: ../../library/hashlib.rst:203 msgid "" "Return a copy (\"clone\") of the hash object. This can be used to " "efficiently compute the digests of data sharing a common initial substring." msgstr "" -#: ../../library/hashlib.rst:210 +#: ../../library/hashlib.rst:208 msgid "SHAKE variable length digests" msgstr "" -#: ../../library/hashlib.rst:212 +#: ../../library/hashlib.rst:210 msgid "" "The :func:`shake_128` and :func:`shake_256` algorithms provide variable " "length digests with length_in_bits//2 up to 128 or 256 bits of security. As " @@ -236,18 +236,18 @@ msgid "" "by the SHAKE algorithm." msgstr "" -#: ../../library/hashlib.rst:219 +#: ../../library/hashlib.rst:217 msgid "" "Return the digest of the data passed to the :meth:`update` method so far. " "This is a bytes object of size *length* which may contain bytes in the whole " "range from 0 to 255." msgstr "" -#: ../../library/hashlib.rst:232 +#: ../../library/hashlib.rst:230 msgid "Key derivation" msgstr "" -#: ../../library/hashlib.rst:234 +#: ../../library/hashlib.rst:232 msgid "" "Key derivation and key stretching algorithms are designed for secure " "password hashing. Naive algorithms such as ``sha1(password)`` are not " @@ -256,13 +256,13 @@ msgid "" "%28cryptography%29>`_." msgstr "" -#: ../../library/hashlib.rst:242 +#: ../../library/hashlib.rst:240 msgid "" "The function provides PKCS#5 password-based key derivation function 2. It " "uses HMAC as pseudorandom function." msgstr "" -#: ../../library/hashlib.rst:245 +#: ../../library/hashlib.rst:243 msgid "" "The string *hash_name* is the desired name of the hash digest algorithm for " "HMAC, e.g. 'sha1' or 'sha256'. *password* and *salt* are interpreted as " @@ -271,33 +271,33 @@ msgid "" "proper source, e.g. :func:`os.urandom`." msgstr "" -#: ../../library/hashlib.rst:251 +#: ../../library/hashlib.rst:249 msgid "" "The number of *iterations* should be chosen based on the hash algorithm and " "computing power. As of 2013, at least 100,000 iterations of SHA-256 are " "suggested." msgstr "" -#: ../../library/hashlib.rst:255 +#: ../../library/hashlib.rst:253 msgid "" "*dklen* is the length of the derived key. If *dklen* is ``None`` then the " "digest size of the hash algorithm *hash_name* is used, e.g. 64 for SHA-512." msgstr "" -#: ../../library/hashlib.rst:267 +#: ../../library/hashlib.rst:265 msgid "" "A fast implementation of *pbkdf2_hmac* is available with OpenSSL. The " "Python implementation uses an inline version of :mod:`hmac`. It is about " "three times slower and doesn't release the GIL." msgstr "" -#: ../../library/hashlib.rst:273 +#: ../../library/hashlib.rst:271 msgid "" "The function provides scrypt password-based key derivation function as " "defined in :rfc:`7914`." msgstr "" -#: ../../library/hashlib.rst:276 +#: ../../library/hashlib.rst:274 msgid "" "*password* and *salt* must be :term:`bytes-like objects `. Applications and libraries should limit *password* to a sensible " @@ -305,142 +305,142 @@ msgid "" "source, e.g. :func:`os.urandom`." msgstr "" -#: ../../library/hashlib.rst:281 +#: ../../library/hashlib.rst:279 msgid "" "*n* is the CPU/Memory cost factor, *r* the block size, *p* parallelization " "factor and *maxmem* limits memory (OpenSSL 1.1.0 defaults to 32 MiB). " "*dklen* is the length of the derived key." msgstr "" -#: ../../library/hashlib.rst:286 +#: ../../library/hashlib.rst:284 msgid ":ref:`Availability `: OpenSSL 1.1+." msgstr "" -#: ../../library/hashlib.rst:291 +#: ../../library/hashlib.rst:289 msgid "BLAKE2" msgstr "" -#: ../../library/hashlib.rst:298 +#: ../../library/hashlib.rst:296 msgid "" "BLAKE2_ is a cryptographic hash function defined in :rfc:`7693` that comes " "in two flavors:" msgstr "" -#: ../../library/hashlib.rst:301 +#: ../../library/hashlib.rst:299 msgid "" "**BLAKE2b**, optimized for 64-bit platforms and produces digests of any size " "between 1 and 64 bytes," msgstr "" -#: ../../library/hashlib.rst:304 +#: ../../library/hashlib.rst:302 msgid "" "**BLAKE2s**, optimized for 8- to 32-bit platforms and produces digests of " "any size between 1 and 32 bytes." msgstr "" -#: ../../library/hashlib.rst:307 +#: ../../library/hashlib.rst:305 msgid "" "BLAKE2 supports **keyed mode** (a faster and simpler replacement for HMAC_), " "**salted hashing**, **personalization**, and **tree hashing**." msgstr "" -#: ../../library/hashlib.rst:310 +#: ../../library/hashlib.rst:308 msgid "" "Hash objects from this module follow the API of standard library's :mod:" "`hashlib` objects." msgstr "" -#: ../../library/hashlib.rst:315 +#: ../../library/hashlib.rst:313 msgid "Creating hash objects" msgstr "" -#: ../../library/hashlib.rst:317 +#: ../../library/hashlib.rst:315 msgid "New hash objects are created by calling constructor functions:" msgstr "" -#: ../../library/hashlib.rst:331 +#: ../../library/hashlib.rst:329 msgid "" "These functions return the corresponding hash objects for calculating " "BLAKE2b or BLAKE2s. They optionally take these general parameters:" msgstr "" -#: ../../library/hashlib.rst:334 +#: ../../library/hashlib.rst:332 msgid "" "*data*: initial chunk of data to hash, which must be :term:`bytes-like " "object`. It can be passed only as positional argument." msgstr "" -#: ../../library/hashlib.rst:337 +#: ../../library/hashlib.rst:335 msgid "*digest_size*: size of output digest in bytes." msgstr "" -#: ../../library/hashlib.rst:339 +#: ../../library/hashlib.rst:337 msgid "" "*key*: key for keyed hashing (up to 64 bytes for BLAKE2b, up to 32 bytes for " "BLAKE2s)." msgstr "" -#: ../../library/hashlib.rst:342 +#: ../../library/hashlib.rst:340 msgid "" "*salt*: salt for randomized hashing (up to 16 bytes for BLAKE2b, up to 8 " "bytes for BLAKE2s)." msgstr "" -#: ../../library/hashlib.rst:345 +#: ../../library/hashlib.rst:343 msgid "" "*person*: personalization string (up to 16 bytes for BLAKE2b, up to 8 bytes " "for BLAKE2s)." msgstr "" -#: ../../library/hashlib.rst:348 +#: ../../library/hashlib.rst:346 msgid "The following table shows limits for general parameters (in bytes):" msgstr "" -#: ../../library/hashlib.rst:351 +#: ../../library/hashlib.rst:349 msgid "Hash" msgstr "" -#: ../../library/hashlib.rst:351 +#: ../../library/hashlib.rst:349 msgid "digest_size" msgstr "" -#: ../../library/hashlib.rst:351 +#: ../../library/hashlib.rst:349 msgid "len(key)" msgstr "" -#: ../../library/hashlib.rst:351 +#: ../../library/hashlib.rst:349 msgid "len(salt)" msgstr "" -#: ../../library/hashlib.rst:351 +#: ../../library/hashlib.rst:349 msgid "len(person)" msgstr "" -#: ../../library/hashlib.rst:353 +#: ../../library/hashlib.rst:351 msgid "BLAKE2b" msgstr "" -#: ../../library/hashlib.rst:353 +#: ../../library/hashlib.rst:351 msgid "64" msgstr "" -#: ../../library/hashlib.rst:353 +#: ../../library/hashlib.rst:351 msgid "16" msgstr "" -#: ../../library/hashlib.rst:354 +#: ../../library/hashlib.rst:352 msgid "BLAKE2s" msgstr "" -#: ../../library/hashlib.rst:354 +#: ../../library/hashlib.rst:352 msgid "32" msgstr "" -#: ../../library/hashlib.rst:354 +#: ../../library/hashlib.rst:352 msgid "8" msgstr "" -#: ../../library/hashlib.rst:359 +#: ../../library/hashlib.rst:357 msgid "" "BLAKE2 specification defines constant lengths for salt and personalization " "parameters, however, for convenience, this implementation accepts byte " @@ -450,94 +450,90 @@ msgid "" "the case for *key*.)" msgstr "" -#: ../../library/hashlib.rst:366 +#: ../../library/hashlib.rst:364 msgid "These sizes are available as module `constants`_ described below." msgstr "" -#: ../../library/hashlib.rst:368 +#: ../../library/hashlib.rst:366 msgid "" "Constructor functions also accept the following tree hashing parameters:" msgstr "" -#: ../../library/hashlib.rst:370 +#: ../../library/hashlib.rst:368 msgid "*fanout*: fanout (0 to 255, 0 if unlimited, 1 in sequential mode)." msgstr "" -#: ../../library/hashlib.rst:372 +#: ../../library/hashlib.rst:370 msgid "" "*depth*: maximal depth of tree (1 to 255, 255 if unlimited, 1 in sequential " "mode)." msgstr "" -#: ../../library/hashlib.rst:375 +#: ../../library/hashlib.rst:373 msgid "" "*leaf_size*: maximal byte length of leaf (0 to 2**32-1, 0 if unlimited or in " "sequential mode)." msgstr "" -#: ../../library/hashlib.rst:378 +#: ../../library/hashlib.rst:376 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)." msgstr "" -#: ../../library/hashlib.rst:381 +#: ../../library/hashlib.rst:379 msgid "" "*node_depth*: node depth (0 to 255, 0 for leaves, or in sequential mode)." msgstr "" -#: ../../library/hashlib.rst:383 +#: ../../library/hashlib.rst:381 msgid "" "*inner_size*: inner digest size (0 to 64 for BLAKE2b, 0 to 32 for BLAKE2s, 0 " "in sequential mode)." msgstr "" -#: ../../library/hashlib.rst:386 +#: ../../library/hashlib.rst:384 msgid "" "*last_node*: boolean indicating whether the processed node is the last one " "(`False` for sequential mode)." msgstr "" -#: ../../library/hashlib.rst:None -msgid "Explanation of tree mode parameters." -msgstr "" - -#: ../../library/hashlib.rst:392 +#: ../../library/hashlib.rst:390 msgid "" "See section 2.10 in `BLAKE2 specification `_ for comprehensive review of tree hashing." msgstr "" -#: ../../library/hashlib.rst:398 +#: ../../library/hashlib.rst:396 msgid "Constants" msgstr "" -#: ../../library/hashlib.rst:403 +#: ../../library/hashlib.rst:401 msgid "Salt length (maximum length accepted by constructors)." msgstr "" -#: ../../library/hashlib.rst:409 +#: ../../library/hashlib.rst:407 msgid "" "Personalization string length (maximum length accepted by constructors)." msgstr "" -#: ../../library/hashlib.rst:415 +#: ../../library/hashlib.rst:413 msgid "Maximum key size." msgstr "" -#: ../../library/hashlib.rst:421 +#: ../../library/hashlib.rst:419 msgid "Maximum digest size that the hash function can output." msgstr "" -#: ../../library/hashlib.rst:425 +#: ../../library/hashlib.rst:423 msgid "Examples" msgstr "" -#: ../../library/hashlib.rst:428 +#: ../../library/hashlib.rst:426 msgid "Simple hashing" msgstr "" -#: ../../library/hashlib.rst:430 +#: ../../library/hashlib.rst:428 msgid "" "To calculate hash of some data, you should first construct a hash object by " "calling the appropriate constructor function (:func:`blake2b` or :func:" @@ -546,41 +542,41 @@ msgid "" "`digest` (or :meth:`hexdigest` for hex-encoded string)." msgstr "" -#: ../../library/hashlib.rst:443 +#: ../../library/hashlib.rst:441 msgid "" "As a shortcut, you can pass the first chunk of data to update directly to " "the constructor as the positional argument:" msgstr "" -#: ../../library/hashlib.rst:450 +#: ../../library/hashlib.rst:448 msgid "" "You can call :meth:`hash.update` as many times as you need to iteratively " "update the hash:" msgstr "" -#: ../../library/hashlib.rst:463 +#: ../../library/hashlib.rst:461 msgid "Using different digest sizes" msgstr "" -#: ../../library/hashlib.rst:465 +#: ../../library/hashlib.rst:463 msgid "" "BLAKE2 has configurable size of digests up to 64 bytes for BLAKE2b and up to " "32 bytes for BLAKE2s. For example, to replace SHA-1 with BLAKE2b without " "changing the size of output, we can tell BLAKE2b to produce 20-byte digests:" msgstr "" -#: ../../library/hashlib.rst:479 +#: ../../library/hashlib.rst:477 msgid "" "Hash objects with different digest sizes have completely different outputs " "(shorter hashes are *not* prefixes of longer hashes); BLAKE2b and BLAKE2s " "produce different outputs even if the output length is the same:" msgstr "" -#: ../../library/hashlib.rst:495 +#: ../../library/hashlib.rst:493 msgid "Keyed hashing" msgstr "" -#: ../../library/hashlib.rst:497 +#: ../../library/hashlib.rst:495 msgid "" "Keyed hashing can be used for authentication as a faster and simpler " "replacement for `Hash-based message authentication code `_)" msgstr "" -#: ../../library/hashlib.rst:581 +#: ../../library/hashlib.rst:579 msgid "" "In BLAKE2 the salt is processed as a one-time input to the hash function " "during initialization, rather than as an input to each compression function." msgstr "" -#: ../../library/hashlib.rst:586 +#: ../../library/hashlib.rst:584 msgid "" "*Salted hashing* (or just hashing) with BLAKE2 or any other general-purpose " "cryptographic hash function, such as SHA-256, is not suitable for hashing " "passwords. See `BLAKE2 FAQ `_ for more information." msgstr "" -#: ../../library/hashlib.rst:609 +#: ../../library/hashlib.rst:607 msgid "Personalization" msgstr "" -#: ../../library/hashlib.rst:611 +#: ../../library/hashlib.rst:609 msgid "" "Sometimes it is useful to force hash function to produce different digests " "for the same input for different purposes. Quoting the authors of the Skein " "hash function:" msgstr "" -#: ../../library/hashlib.rst:615 +#: ../../library/hashlib.rst:613 msgid "" "We recommend that all application designers seriously consider doing this; " "we have seen many protocols where a hash that is computed in one part of the " @@ -679,41 +675,41 @@ msgid "" "hash function used in the protocol summarily stops this type of attack." msgstr "" -#: ../../library/hashlib.rst:622 +#: ../../library/hashlib.rst:620 msgid "" "(`The Skein Hash Function Family `_, p. 21)" msgstr "" -#: ../../library/hashlib.rst:626 +#: ../../library/hashlib.rst:624 msgid "BLAKE2 can be personalized by passing bytes to the *person* argument::" msgstr "" -#: ../../library/hashlib.rst:640 +#: ../../library/hashlib.rst:638 msgid "" "Personalization together with the keyed mode can also be used to derive " "different keys from a single one." msgstr "" -#: ../../library/hashlib.rst:654 +#: ../../library/hashlib.rst:652 msgid "Tree mode" msgstr "" -#: ../../library/hashlib.rst:656 +#: ../../library/hashlib.rst:654 msgid "Here's an example of hashing a minimal tree with two leaf nodes::" msgstr "" -#: ../../library/hashlib.rst:662 +#: ../../library/hashlib.rst:660 msgid "" "This example uses 64-byte internal digests, and returns the 32-byte final " "digest::" msgstr "" -#: ../../library/hashlib.rst:692 +#: ../../library/hashlib.rst:690 msgid "Credits" msgstr "" -#: ../../library/hashlib.rst:694 +#: ../../library/hashlib.rst:692 msgid "" "BLAKE2_ was designed by *Jean-Philippe Aumasson*, *Samuel Neves*, *Zooko " "Wilcox-O'Hearn*, and *Christian Winnerlein* based on SHA-3_ finalist BLAKE_ " @@ -721,104 +717,104 @@ msgid "" "*Raphael C.-W. Phan*." msgstr "" -#: ../../library/hashlib.rst:699 +#: ../../library/hashlib.rst:697 msgid "" "It uses core algorithm from ChaCha_ cipher designed by *Daniel J. " "Bernstein*." msgstr "" -#: ../../library/hashlib.rst:701 +#: ../../library/hashlib.rst:699 msgid "" "The stdlib implementation is based on pyblake2_ module. It was written by " "*Dmitry Chestnykh* based on C implementation written by *Samuel Neves*. The " "documentation was copied from pyblake2_ and written by *Dmitry Chestnykh*." msgstr "" -#: ../../library/hashlib.rst:705 +#: ../../library/hashlib.rst:703 msgid "The C code was partly rewritten for Python by *Christian Heimes*." msgstr "" -#: ../../library/hashlib.rst:707 +#: ../../library/hashlib.rst:705 msgid "" "The following public domain dedication applies for both C hash function " "implementation, extension code, and this documentation:" msgstr "" -#: ../../library/hashlib.rst:710 +#: ../../library/hashlib.rst:708 msgid "" "To the extent possible under law, the author(s) have dedicated all copyright " "and related and neighboring rights to this software to the public domain " "worldwide. This software is distributed without any warranty." msgstr "" -#: ../../library/hashlib.rst:714 +#: ../../library/hashlib.rst:712 msgid "" "You should have received a copy of the CC0 Public Domain Dedication along " "with this software. If not, see https://creativecommons.org/publicdomain/" "zero/1.0/." msgstr "" -#: ../../library/hashlib.rst:718 +#: ../../library/hashlib.rst:716 msgid "" "The following people have helped with development or contributed their " "changes to the project and the public domain according to the Creative " "Commons Public Domain Dedication 1.0 Universal:" msgstr "" -#: ../../library/hashlib.rst:722 +#: ../../library/hashlib.rst:720 msgid "*Alexandr Sokolovskiy*" msgstr "" -#: ../../library/hashlib.rst:736 +#: ../../library/hashlib.rst:734 msgid "Module :mod:`hmac`" msgstr "" -#: ../../library/hashlib.rst:736 +#: ../../library/hashlib.rst:734 msgid "A module to generate message authentication codes using hashes." msgstr "" -#: ../../library/hashlib.rst:739 +#: ../../library/hashlib.rst:737 msgid "Module :mod:`base64`" msgstr "" -#: ../../library/hashlib.rst:739 +#: ../../library/hashlib.rst:737 msgid "Another way to encode binary hashes for non-binary environments." msgstr "" -#: ../../library/hashlib.rst:742 +#: ../../library/hashlib.rst:740 msgid "https://blake2.net/" msgstr "" -#: ../../library/hashlib.rst:742 +#: ../../library/hashlib.rst:740 msgid "Official BLAKE2 website." msgstr "" -#: ../../library/hashlib.rst:745 +#: ../../library/hashlib.rst:743 msgid "" "https://csrc.nist.gov/csrc/media/publications/fips/180/2/archive/2002-08-01/" "documents/fips180-2.pdf" msgstr "" -#: ../../library/hashlib.rst:745 +#: ../../library/hashlib.rst:743 msgid "The FIPS 180-2 publication on Secure Hash Algorithms." msgstr "" -#: ../../library/hashlib.rst:749 +#: ../../library/hashlib.rst:747 msgid "" "https://en.wikipedia.org/wiki/" "Cryptographic_hash_function#Cryptographic_hash_algorithms" msgstr "" -#: ../../library/hashlib.rst:748 +#: ../../library/hashlib.rst:746 msgid "" "Wikipedia article with information on which algorithms have known issues and " "what that means regarding their use." msgstr "" -#: ../../library/hashlib.rst:751 +#: ../../library/hashlib.rst:749 msgid "https://www.ietf.org/rfc/rfc2898.txt" msgstr "" -#: ../../library/hashlib.rst:752 +#: ../../library/hashlib.rst:750 msgid "PKCS #5: Password-Based Cryptography Specification Version 2.0" msgstr "" diff --git a/library/http.server.po b/library/http.server.po index d005a6387c..8333d48aa1 100644 --- a/library/http.server.po +++ b/library/http.server.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.7\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2021-09-07 06:52+0000\n" +"POT-Creation-Date: 2020-06-20 18:08+0800\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-" @@ -120,18 +120,15 @@ msgid "Contains the command (request type). For example, ``'GET'``." msgstr "" #: ../../library/http.server.rst:101 -msgid "" -"Contains the request path. If query component of the URL is present, then " -"``path`` includes the query. Using the terminology of :rfc:`3986`, ``path`` " -"here includes ``hier-part`` and the ``query``." +msgid "Contains the request path." msgstr "" -#: ../../library/http.server.rst:107 +#: ../../library/http.server.rst:105 msgid "" "Contains the version string from the request. For example, ``'HTTP/1.0'``." msgstr "" -#: ../../library/http.server.rst:111 +#: ../../library/http.server.rst:109 msgid "" "Holds an instance of the class specified by the :attr:`MessageClass` class " "variable. This instance parses and manages the headers in the HTTP request. " @@ -140,42 +137,42 @@ msgid "" "valid :rfc:`2822` style header." msgstr "" -#: ../../library/http.server.rst:119 +#: ../../library/http.server.rst:117 msgid "" "An :class:`io.BufferedIOBase` input stream, ready to read from the start of " "the optional input data." msgstr "" -#: ../../library/http.server.rst:124 +#: ../../library/http.server.rst:122 msgid "" "Contains the output stream for writing a response back to the client. Proper " "adherence to the HTTP protocol must be used when writing to this stream in " "order to achieve successful interoperation with HTTP clients." msgstr "" -#: ../../library/http.server.rst:129 +#: ../../library/http.server.rst:127 msgid "This is an :class:`io.BufferedIOBase` stream." msgstr "" -#: ../../library/http.server.rst:132 +#: ../../library/http.server.rst:130 msgid ":class:`BaseHTTPRequestHandler` has the following attributes:" msgstr "" -#: ../../library/http.server.rst:136 +#: ../../library/http.server.rst:134 msgid "" "Specifies the server software version. You may want to override this. The " "format is multiple whitespace-separated strings, where each string is of the " "form name[/version]. For example, ``'BaseHTTP/0.2'``." msgstr "" -#: ../../library/http.server.rst:142 +#: ../../library/http.server.rst:140 msgid "" "Contains the Python system version, in a form usable by the :attr:" "`version_string` method and the :attr:`server_version` class variable. For " "example, ``'Python/1.4'``." msgstr "" -#: ../../library/http.server.rst:148 +#: ../../library/http.server.rst:146 msgid "" "Specifies a format string that should be used by :meth:`send_error` method " "for building an error response to the client. The string is filled by " @@ -183,13 +180,13 @@ msgid "" "passed to :meth:`send_error`." msgstr "" -#: ../../library/http.server.rst:155 +#: ../../library/http.server.rst:153 msgid "" "Specifies the Content-Type HTTP header of error responses sent to the " "client. The default value is ``'text/html'``." msgstr "" -#: ../../library/http.server.rst:160 +#: ../../library/http.server.rst:158 msgid "" "This specifies the HTTP protocol version used in responses. If set to " "``'HTTP/1.1'``, the server will permit HTTP persistent connections; however, " @@ -198,14 +195,14 @@ msgid "" "backwards compatibility, the setting defaults to ``'HTTP/1.0'``." msgstr "" -#: ../../library/http.server.rst:168 +#: ../../library/http.server.rst:166 msgid "" "Specifies an :class:`email.message.Message`\\ -like class to parse HTTP " "headers. Typically, this is not overridden, and it defaults to :class:`http." "client.HTTPMessage`." msgstr "" -#: ../../library/http.server.rst:174 +#: ../../library/http.server.rst:172 msgid "" "This attribute contains a mapping of error code integers to two-element " "tuples containing a short and long message. For example, ``{code: " @@ -214,33 +211,33 @@ msgid "" "It is used by :meth:`send_response_only` and :meth:`send_error` methods." msgstr "" -#: ../../library/http.server.rst:180 +#: ../../library/http.server.rst:178 msgid "A :class:`BaseHTTPRequestHandler` instance has the following methods:" msgstr "" -#: ../../library/http.server.rst:184 +#: ../../library/http.server.rst:182 msgid "" "Calls :meth:`handle_one_request` once (or, if persistent connections are " "enabled, multiple times) to handle incoming HTTP requests. You should never " "need to override it; instead, implement appropriate :meth:`do_\\*` methods." msgstr "" -#: ../../library/http.server.rst:191 +#: ../../library/http.server.rst:189 msgid "" "This method will parse and dispatch the request to the appropriate :meth:`do_" "\\*` method. You should never need to override it." msgstr "" -#: ../../library/http.server.rst:196 +#: ../../library/http.server.rst:194 msgid "" "When a HTTP/1.1 compliant server receives an ``Expect: 100-continue`` " "request header it responds back with a ``100 Continue`` followed by ``200 " "OK`` headers. This method can be overridden to raise an error if the server " -"does not want the client to continue. For e.g. server can choose to send " +"does not want the client to continue. For e.g. server can chose to send " "``417 Expectation Failed`` as a response header and ``return False``." msgstr "" -#: ../../library/http.server.rst:207 +#: ../../library/http.server.rst:205 msgid "" "Sends and logs a complete error reply to the client. The numeric *code* " "specifies the HTTP error code, with *message* as an optional, short, human " @@ -255,13 +252,13 @@ msgid "" "Reset Content``, ``304 Not Modified``." msgstr "" -#: ../../library/http.server.rst:219 +#: ../../library/http.server.rst:217 msgid "" "The error response includes a Content-Length header. Added the *explain* " "argument." msgstr "" -#: ../../library/http.server.rst:225 +#: ../../library/http.server.rst:223 msgid "" "Adds a response header to the headers buffer and logs the accepted request. " "The HTTP response line is written to the internal buffer, followed by " @@ -272,13 +269,13 @@ msgid "" "followed by an :meth:`end_headers` call." msgstr "" -#: ../../library/http.server.rst:234 +#: ../../library/http.server.rst:232 msgid "" "Headers are stored to an internal buffer and :meth:`end_headers` needs to be " "called explicitly." msgstr "" -#: ../../library/http.server.rst:240 +#: ../../library/http.server.rst:238 msgid "" "Adds the HTTP header to an internal buffer which will be written to the " "output stream when either :meth:`end_headers` or :meth:`flush_headers` is " @@ -287,11 +284,11 @@ msgid "" "`end_headers` MUST BE called in order to complete the operation." msgstr "" -#: ../../library/http.server.rst:246 +#: ../../library/http.server.rst:244 msgid "Headers are stored in an internal buffer." msgstr "" -#: ../../library/http.server.rst:251 +#: ../../library/http.server.rst:249 msgid "" "Sends the response header only, used for the purposes when ``100 Continue`` " "response is sent by the server to the client. The headers not buffered and " @@ -299,37 +296,37 @@ msgid "" "message corresponding the response *code* is sent." msgstr "" -#: ../../library/http.server.rst:260 +#: ../../library/http.server.rst:258 msgid "" "Adds a blank line (indicating the end of the HTTP headers in the response) " "to the headers buffer and calls :meth:`flush_headers()`." msgstr "" -#: ../../library/http.server.rst:264 +#: ../../library/http.server.rst:262 msgid "The buffered headers are written to the output stream." msgstr "" -#: ../../library/http.server.rst:269 +#: ../../library/http.server.rst:267 msgid "" "Finally send the headers to the output stream and flush the internal headers " "buffer." msgstr "" -#: ../../library/http.server.rst:276 +#: ../../library/http.server.rst:274 msgid "" "Logs an accepted (successful) request. *code* should specify the numeric " "HTTP code associated with the response. If a size of the response is " "available, then it should be passed as the *size* parameter." msgstr "" -#: ../../library/http.server.rst:282 +#: ../../library/http.server.rst:280 msgid "" "Logs an error when a request cannot be fulfilled. By default, it passes the " "message to :meth:`log_message`, so it takes the same arguments (*format* and " "additional values)." msgstr "" -#: ../../library/http.server.rst:289 +#: ../../library/http.server.rst:287 msgid "" "Logs an arbitrary message to ``sys.stderr``. This is typically overridden to " "create custom error logging mechanisms. The *format* argument is a standard " @@ -338,103 +335,103 @@ msgid "" "and current date and time are prefixed to every message logged." msgstr "" -#: ../../library/http.server.rst:297 +#: ../../library/http.server.rst:295 msgid "" "Returns the server software's version string. This is a combination of the :" "attr:`server_version` and :attr:`sys_version` attributes." msgstr "" -#: ../../library/http.server.rst:302 +#: ../../library/http.server.rst:300 msgid "" "Returns the date and time given by *timestamp* (which must be ``None`` or in " "the format returned by :func:`time.time`), formatted for a message header. " "If *timestamp* is omitted, it uses the current date and time." msgstr "" -#: ../../library/http.server.rst:306 +#: ../../library/http.server.rst:304 msgid "The result looks like ``'Sun, 06 Nov 1994 08:49:37 GMT'``." msgstr "" -#: ../../library/http.server.rst:310 +#: ../../library/http.server.rst:308 msgid "Returns the current date and time, formatted for logging." msgstr "" -#: ../../library/http.server.rst:314 +#: ../../library/http.server.rst:312 msgid "Returns the client address." msgstr "" -#: ../../library/http.server.rst:316 +#: ../../library/http.server.rst:314 msgid "" "Previously, a name lookup was performed. To avoid name resolution delays, it " "now always returns the IP address." msgstr "" -#: ../../library/http.server.rst:323 +#: ../../library/http.server.rst:321 msgid "" -"This class serves files from the directory *directory* and below, or the " -"current directory if *directory* is not provided, directly mapping the " -"directory structure to HTTP requests." -msgstr "" - -#: ../../library/http.server.rst:327 -msgid "The *directory* parameter." -msgstr "" - -#: ../../library/http.server.rst:330 -msgid "The *directory* parameter accepts a :term:`path-like object`." +"This class serves files from the current directory and below, directly " +"mapping the directory structure to HTTP requests." msgstr "" -#: ../../library/http.server.rst:333 +#: ../../library/http.server.rst:324 msgid "" "A lot of the work, such as parsing the request, is done by the base class :" "class:`BaseHTTPRequestHandler`. This class implements the :func:`do_GET` " "and :func:`do_HEAD` functions." msgstr "" -#: ../../library/http.server.rst:337 +#: ../../library/http.server.rst:328 msgid "" "The following are defined as class-level attributes of :class:" "`SimpleHTTPRequestHandler`:" msgstr "" -#: ../../library/http.server.rst:342 +#: ../../library/http.server.rst:333 msgid "" "This will be ``\"SimpleHTTP/\" + __version__``, where ``__version__`` is " "defined at the module level." msgstr "" -#: ../../library/http.server.rst:347 +#: ../../library/http.server.rst:338 msgid "" "A dictionary mapping suffixes into MIME types, contains custom overrides for " "the default system mappings. The mapping is used case-insensitively, and so " "should contain only lower-cased keys." msgstr "" -#: ../../library/http.server.rst:351 +#: ../../library/http.server.rst:342 msgid "" "This dictionary is no longer filled with the default system mappings, but " "only contains overrides." msgstr "" -#: ../../library/http.server.rst:355 +#: ../../library/http.server.rst:348 +msgid "" +"If not specified, the directory to serve is the current working directory." +msgstr "" + +#: ../../library/http.server.rst:350 +msgid "Accepts a :term:`path-like object`." +msgstr "" + +#: ../../library/http.server.rst:353 msgid "" "The :class:`SimpleHTTPRequestHandler` class defines the following methods:" msgstr "" -#: ../../library/http.server.rst:359 +#: ../../library/http.server.rst:357 msgid "" "This method serves the ``'HEAD'`` request type: it sends the headers it " "would send for the equivalent ``GET`` request. See the :meth:`do_GET` method " "for a more complete explanation of the possible headers." msgstr "" -#: ../../library/http.server.rst:365 +#: ../../library/http.server.rst:363 msgid "" "The request is mapped to a local file by interpreting the request as a path " "relative to the current working directory." msgstr "" -#: ../../library/http.server.rst:368 +#: ../../library/http.server.rst:366 msgid "" "If the request was mapped to a directory, the directory is checked for a " "file named ``index.html`` or ``index.htm`` (in that order). If found, the " @@ -444,7 +441,7 @@ msgid "" "func:`~os.listdir` fails." msgstr "" -#: ../../library/http.server.rst:375 +#: ../../library/http.server.rst:373 msgid "" "If the request was mapped to a file, it is opened. Any :exc:`OSError` " "exception in opening the requested file is mapped to a ``404``, ``'File not " @@ -455,45 +452,45 @@ msgid "" "*extensions_map* variable, and the file contents are returned." msgstr "" -#: ../../library/http.server.rst:383 +#: ../../library/http.server.rst:381 msgid "" "A ``'Content-type:'`` header with the guessed content type is output, " "followed by a ``'Content-Length:'`` header with the file's size and a " "``'Last-Modified:'`` header with the file's modification time." msgstr "" -#: ../../library/http.server.rst:387 +#: ../../library/http.server.rst:385 msgid "" "Then follows a blank line signifying the end of the headers, and then the " "contents of the file are output. If the file's MIME type starts with ``text/" "`` the file is opened in text mode; otherwise binary mode is used." msgstr "" -#: ../../library/http.server.rst:391 +#: ../../library/http.server.rst:389 msgid "" "For example usage, see the implementation of the :func:`test` function " "invocation in the :mod:`http.server` module." msgstr "" -#: ../../library/http.server.rst:394 +#: ../../library/http.server.rst:392 msgid "Support of the ``'If-Modified-Since'`` header." msgstr "" -#: ../../library/http.server.rst:397 +#: ../../library/http.server.rst:395 msgid "" "The :class:`SimpleHTTPRequestHandler` class can be used in the following " "manner in order to create a very basic webserver serving files relative to " "the current directory::" msgstr "" -#: ../../library/http.server.rst:414 +#: ../../library/http.server.rst:412 msgid "" ":mod:`http.server` can also be invoked directly using the :option:`-m` " "switch of the interpreter with a ``port number`` argument. Similar to the " "previous example, this serves files relative to the current directory::" msgstr "" -#: ../../library/http.server.rst:420 +#: ../../library/http.server.rst:418 msgid "" "By default, server binds itself to all interfaces. The option ``-b/--bind`` " "specifies a specific address to which it should bind. Both IPv4 and IPv6 " @@ -501,40 +498,40 @@ msgid "" "server to bind to localhost only::" msgstr "" -#: ../../library/http.server.rst:427 +#: ../../library/http.server.rst:425 msgid "``--bind`` argument was introduced." msgstr "" -#: ../../library/http.server.rst:430 +#: ../../library/http.server.rst:428 msgid "``--bind`` argument enhanced to support IPv6" msgstr "" -#: ../../library/http.server.rst:433 +#: ../../library/http.server.rst:431 msgid "" "By default, server uses the current directory. The option ``-d/--directory`` " "specifies a directory to which it should serve the files. For example, the " "following command uses a specific directory::" msgstr "" -#: ../../library/http.server.rst:439 +#: ../../library/http.server.rst:437 msgid "``--directory`` specify alternate directory" msgstr "" -#: ../../library/http.server.rst:444 +#: ../../library/http.server.rst:442 msgid "" "This class is used to serve either files or output of CGI scripts from the " "current directory and below. Note that mapping HTTP hierarchic structure to " "local directory structure is exactly as in :class:`SimpleHTTPRequestHandler`." msgstr "" -#: ../../library/http.server.rst:450 +#: ../../library/http.server.rst:448 msgid "" "CGI scripts run by the :class:`CGIHTTPRequestHandler` class cannot execute " "redirects (HTTP code 302), because code 200 (script output follows) is sent " "prior to execution of the CGI script. This pre-empts the status code." msgstr "" -#: ../../library/http.server.rst:455 +#: ../../library/http.server.rst:453 msgid "" "The class will however, run the CGI script, instead of serving it as a file, " "if it guesses it to be a CGI script. Only directory-based CGI are used --- " @@ -542,41 +539,41 @@ msgid "" "denoting CGI scripts." msgstr "" -#: ../../library/http.server.rst:460 +#: ../../library/http.server.rst:458 msgid "" "The :func:`do_GET` and :func:`do_HEAD` functions are modified to run CGI " "scripts and serve the output, instead of serving files, if the request leads " "to somewhere below the ``cgi_directories`` path." msgstr "" -#: ../../library/http.server.rst:464 +#: ../../library/http.server.rst:462 msgid "The :class:`CGIHTTPRequestHandler` defines the following data member:" msgstr "" -#: ../../library/http.server.rst:468 +#: ../../library/http.server.rst:466 msgid "" "This defaults to ``['/cgi-bin', '/htbin']`` and describes directories to " "treat as containing CGI scripts." msgstr "" -#: ../../library/http.server.rst:471 +#: ../../library/http.server.rst:469 msgid "The :class:`CGIHTTPRequestHandler` defines the following method:" msgstr "" -#: ../../library/http.server.rst:475 +#: ../../library/http.server.rst:473 msgid "" "This method serves the ``'POST'`` request type, only allowed for CGI " "scripts. Error 501, \"Can only POST to CGI scripts\", is output when trying " "to POST to a non-CGI url." msgstr "" -#: ../../library/http.server.rst:479 +#: ../../library/http.server.rst:477 msgid "" "Note that CGI scripts will be run with UID of user nobody, for security " "reasons. Problems with the CGI script will be translated to error 403." msgstr "" -#: ../../library/http.server.rst:482 +#: ../../library/http.server.rst:480 msgid "" ":class:`CGIHTTPRequestHandler` can be enabled in the command line by passing " "the ``--cgi`` option::" diff --git a/library/idle.po b/library/idle.po index 0878697d77..cfbe0939e9 100644 --- a/library/idle.po +++ b/library/idle.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.7\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2021-09-07 06:52+0000\n" +"POT-Creation-Date: 2020-06-20 18:08+0800\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-" @@ -324,8 +324,8 @@ msgstr "" #: ../../library/idle.rst:150 msgid "" -"Open a scrollable list allowing selection of existing names. See :ref:" -"`Completions ` in the Editing and navigation section below." +"Open a scrollable list allowing selection of keywords and attributes. See :" +"ref:`Completions ` in the Editing and navigation section below." msgstr "" #: ../../library/idle.rst:155 @@ -519,9 +519,7 @@ msgid "Restart Shell" msgstr "" #: ../../library/idle.rst:253 -msgid "" -"Restart the shell to clean the environment and reset display and exception " -"handling." +msgid "Restart the shell to clean the environment." msgstr "" #: ../../library/idle.rst:256 @@ -905,128 +903,125 @@ msgid "" "menu>`." msgstr "" -#: ../../library/idle.rst:475 +#: ../../library/idle.rst:476 msgid "Completions" msgstr "" -#: ../../library/idle.rst:477 +#: ../../library/idle.rst:478 msgid "" -"Completions are supplied, when requested and available, for module names, " -"attributes of classes or functions, or filenames. Each request method " -"displays a completion box with existing names. (See tab completions below " -"for an exception.) For any box, change the name being completed and the item " -"highlighted in the box by typing and deleting characters; by hitting :kbd:" -"`Up`, :kbd:`Down`, :kbd:`PageUp`, :kbd:`PageDown`, :kbd:`Home`, and :kbd:" -"`End` keys; and by a single click within the box. Close the box with :kbd:" -"`Escape`, :kbd:`Enter`, and double :kbd:`Tab` keys or clicks outside the " -"box. A double click within the box selects and closes." +"Completions are supplied for functions, classes, and attributes of classes, " +"both built-in and user-defined. Completions are also provided for filenames." msgstr "" -#: ../../library/idle.rst:488 +#: ../../library/idle.rst:482 msgid "" -"One way to open a box is to type a key character and wait for a predefined " -"interval. This defaults to 2 seconds; customize it in the settings dialog. " -"(To prevent auto popups, set the delay to a large number of milliseconds, " -"such as 100000000.) For imported module names or class or function " -"attributes, type '.'. For filenames in the root directory, type :data:`os." -"sep` or :data:`os.altsep` immediately after an opening quote. (On Windows, " -"one can specify a drive first.) Move into subdirectories by typing a " -"directory name and a separator." +"The AutoCompleteWindow (ACW) will open after a predefined delay (default is " +"two seconds) after a '.' or (in a string) an os.sep is typed. If after one " +"of those characters (plus zero or more other characters) a tab is typed the " +"ACW will open immediately if a possible continuation is found." msgstr "" -#: ../../library/idle.rst:498 +#: ../../library/idle.rst:487 msgid "" -"Instead of waiting, or after a box is closed, open a completion box " -"immediately with Show Completions on the Edit menu. The default hot key is :" -"kbd:`C-space`. If one types a prefix for the desired name before opening " -"the box, the first match or near miss is made visible. The result is the " -"same as if one enters a prefix after the box is displayed. Show Completions " -"after a quote completes filenames in the current directory instead of a root " -"directory." +"If there is only one possible completion for the characters entered, a :kbd:" +"`Tab` will supply that completion without opening the ACW." msgstr "" -#: ../../library/idle.rst:506 +#: ../../library/idle.rst:490 msgid "" -"Hitting :kbd:`Tab` after a prefix usually has the same effect as Show " -"Completions. (With no prefix, it indents.) However, if there is only one " -"match to the prefix, that match is immediately added to the editor text " -"without opening a box." +"'Show Completions' will force open a completions window, by default the :kbd:" +"`C-space` will open a completions window. In an empty string, this will " +"contain the files in the current directory. On a blank line, it will contain " +"the built-in and user-defined functions and classes in the current " +"namespaces, plus any modules imported. If some characters have been entered, " +"the ACW will attempt to be more specific." msgstr "" -#: ../../library/idle.rst:511 +#: ../../library/idle.rst:497 msgid "" -"Invoking 'Show Completions', or hitting :kbd:`Tab` after a prefix, outside " -"of a string and without a preceding '.' opens a box with keywords, builtin " -"names, and available module-level names." +"If a string of characters is typed, the ACW selection will jump to the entry " +"most closely matching those characters. Entering a :kbd:`tab` will cause " +"the longest non-ambiguous match to be entered in the Editor window or " +"Shell. Two :kbd:`tab` in a row will supply the current ACW selection, as " +"will return or a double click. Cursor keys, Page Up/Down, mouse selection, " +"and the scroll wheel all operate on the ACW." msgstr "" -#: ../../library/idle.rst:515 +#: ../../library/idle.rst:504 msgid "" -"When editing code in an editor (as oppose to Shell), increase the available " -"module-level names by running your code and not restarting the Shell " -"thereafter. This is especially useful after adding imports at the top of a " -"file. This also increases possible attribute completions." +"\"Hidden\" attributes can be accessed by typing the beginning of hidden name " +"after a '.', e.g. '_'. This allows access to modules with ``__all__`` set, " +"or to class-private attributes." msgstr "" -#: ../../library/idle.rst:521 +#: ../../library/idle.rst:508 +msgid "Completions and the 'Expand Word' facility can save a lot of typing!" +msgstr "" + +#: ../../library/idle.rst:510 msgid "" -"Completion boxes initially exclude names beginning with '_' or, for modules, " -"not included in '__all__'. The hidden names can be accessed by typing '_' " -"after '.', either before or after the box is opened." +"Completions are currently limited to those in the namespaces. Names in an " +"Editor window which are not via ``__main__`` and :data:`sys.modules` will " +"not be found. Run the module once with your imports to correct this " +"situation. Note that IDLE itself places quite a few modules in sys.modules, " +"so much can be found by default, e.g. the re module." msgstr "" -#: ../../library/idle.rst:528 +#: ../../library/idle.rst:516 +msgid "" +"If you don't like the ACW popping up unbidden, simply make the delay longer " +"or disable the extension." +msgstr "" + +#: ../../library/idle.rst:522 msgid "Calltips" msgstr "" -#: ../../library/idle.rst:530 +#: ../../library/idle.rst:524 msgid "" -"A calltip is shown automatically when one types :kbd:`(` after the name of " -"an *accessible* function. A function name expression may include dots and " -"subscripts. A calltip remains until it is clicked, the cursor is moved out " -"of the argument area, or :kbd:`)` is typed. Whenever the cursor is in the " -"argument part of a definition, select Edit and \"Show Call Tip\" on the menu " -"or enter its shortcut to display a calltip." +"A calltip is shown when one types :kbd:`(` after the name of an *accessible* " +"function. A name expression may include dots and subscripts. A calltip " +"remains until it is clicked, the cursor is moved out of the argument area, " +"or :kbd:`)` is typed. When the cursor is in the argument part of a " +"definition, the menu or shortcut display a calltip." msgstr "" -#: ../../library/idle.rst:537 +#: ../../library/idle.rst:530 msgid "" -"The calltip consists of the function's signature and docstring up to the " -"latter's first blank line or the fifth non-blank line. (Some builtin " -"functions lack an accessible signature.) A '/' or '*' in the signature " -"indicates that the preceding or following arguments are passed by position " -"or name (keyword) only. Details are subject to change." +"A calltip consists of the function signature and the first line of the " +"docstring. For builtins without an accessible signature, the calltip " +"consists of all lines up the fifth line or the first blank line. These " +"details may change." msgstr "" -#: ../../library/idle.rst:543 +#: ../../library/idle.rst:535 msgid "" -"In Shell, the accessible functions depends on what modules have been " -"imported into the user process, including those imported by Idle itself, and " -"which definitions have been run, all since the last restart." +"The set of *accessible* functions depends on what modules have been imported " +"into the user process, including those imported by Idle itself, and what " +"definitions have been run, all since the last restart." msgstr "" -#: ../../library/idle.rst:547 +#: ../../library/idle.rst:539 msgid "" "For example, restart the Shell and enter ``itertools.count(``. A calltip " "appears because Idle imports itertools into the user process for its own " -"use. (This could change.) Enter ``turtle.write(`` and nothing appears. " -"Idle does not itself import turtle. The menu entry and shortcut also do " -"nothing. Enter ``import turtle``. Thereafter, ``turtle.write(`` will " -"display a calltip." +"use. (This could change.) Enter ``turtle.write(`` and nothing appears. " +"Idle does not import turtle. The menu or shortcut do nothing either. Enter " +"``import turtle`` and then ``turtle.write(`` will work." msgstr "" -#: ../../library/idle.rst:554 +#: ../../library/idle.rst:545 msgid "" -"In an editor, import statements have no effect until one runs the file. One " -"might want to run a file after writing import statements, after adding " -"function definitions, or after opening an existing file." +"In an editor, import statements have no effect until one runs the file. One " +"might want to run a file after writing the import statements at the top, or " +"immediately run an existing file before editing." msgstr "" -#: ../../library/idle.rst:561 +#: ../../library/idle.rst:552 msgid "Code Context" msgstr "" -#: ../../library/idle.rst:563 +#: ../../library/idle.rst:554 msgid "" "Within an editor window containing Python code, code context can be toggled " "in order to show or hide a pane at the top of the window. When shown, this " @@ -1040,23 +1035,23 @@ msgid "" "the top of the editor." msgstr "" -#: ../../library/idle.rst:574 +#: ../../library/idle.rst:565 msgid "" "The text and background colors for the context pane can be configured under " "the Highlights tab in the Configure IDLE dialog." msgstr "" -#: ../../library/idle.rst:578 +#: ../../library/idle.rst:569 msgid "Python Shell window" msgstr "" -#: ../../library/idle.rst:580 +#: ../../library/idle.rst:571 msgid "" "With IDLE's Shell, one enters, edits, and recalls complete statements. Most " "consoles and terminals only work with a single physical line at a time." msgstr "" -#: ../../library/idle.rst:583 +#: ../../library/idle.rst:574 msgid "" "When one pastes code into Shell, it is not compiled and possibly executed " "until one hits :kbd:`Return`. One may edit pasted code first. If one pastes " @@ -1064,48 +1059,48 @@ msgid "" "when multiple statements are compiled as if they were one." msgstr "" -#: ../../library/idle.rst:588 +#: ../../library/idle.rst:579 msgid "" "The editing features described in previous subsections work when entering " "code interactively. IDLE's Shell window also responds to the following keys." msgstr "" -#: ../../library/idle.rst:591 +#: ../../library/idle.rst:582 msgid ":kbd:`C-c` interrupts executing command" msgstr "" -#: ../../library/idle.rst:593 +#: ../../library/idle.rst:584 msgid "" ":kbd:`C-d` sends end-of-file; closes window if typed at a ``>>>`` prompt" msgstr "" -#: ../../library/idle.rst:595 +#: ../../library/idle.rst:586 msgid ":kbd:`Alt-/` (Expand word) is also useful to reduce typing" msgstr "" -#: ../../library/idle.rst:597 +#: ../../library/idle.rst:588 msgid "Command history" msgstr "" -#: ../../library/idle.rst:599 +#: ../../library/idle.rst:590 msgid "" ":kbd:`Alt-p` retrieves previous command matching what you have typed. On " "macOS use :kbd:`C-p`." msgstr "" -#: ../../library/idle.rst:602 +#: ../../library/idle.rst:593 msgid ":kbd:`Alt-n` retrieves next. On macOS use :kbd:`C-n`." msgstr "" -#: ../../library/idle.rst:604 +#: ../../library/idle.rst:595 msgid ":kbd:`Return` while on any previous command retrieves that command" msgstr "" -#: ../../library/idle.rst:607 +#: ../../library/idle.rst:598 msgid "Text colors" msgstr "" -#: ../../library/idle.rst:609 +#: ../../library/idle.rst:600 msgid "" "Idle defaults to black on white text, but colors text with special meanings. " "For the shell, these are shell output, shell error, user output, and user " @@ -1115,7 +1110,7 @@ msgid "" "(when present), found text (when possible), and selected text." msgstr "" -#: ../../library/idle.rst:616 +#: ../../library/idle.rst:607 msgid "" "Text coloring is done in the background, so uncolorized text is occasionally " "visible. To change the color scheme, use the Configure IDLE dialog " @@ -1123,11 +1118,11 @@ msgid "" "and text in popups and dialogs is not user-configurable." msgstr "" -#: ../../library/idle.rst:623 +#: ../../library/idle.rst:614 msgid "Startup and code execution" msgstr "" -#: ../../library/idle.rst:625 +#: ../../library/idle.rst:616 msgid "" "Upon startup with the ``-s`` option, IDLE will execute the file referenced " "by the environment variables :envvar:`IDLESTARTUP` or :envvar:" @@ -1139,7 +1134,7 @@ msgid "" "modules." msgstr "" -#: ../../library/idle.rst:633 +#: ../../library/idle.rst:624 msgid "" "In addition, ``Tk`` also loads a startup file if it is present. Note that " "the Tk file is loaded unconditionally. This additional file is ``.Idle.py`` " @@ -1148,15 +1143,15 @@ msgid "" "importing functions to be used from IDLE's Python shell." msgstr "" -#: ../../library/idle.rst:640 +#: ../../library/idle.rst:631 msgid "Command line usage" msgstr "" -#: ../../library/idle.rst:656 +#: ../../library/idle.rst:647 msgid "If there are arguments:" msgstr "" -#: ../../library/idle.rst:658 +#: ../../library/idle.rst:649 msgid "" "If ``-``, ``-c``, or ``r`` is used, all arguments are placed in ``sys." "argv[1:...]`` and ``sys.argv[0]`` is set to ``''``, ``'-c'``, or ``'-r'``. " @@ -1164,37 +1159,27 @@ msgid "" "dialog." msgstr "" -#: ../../library/idle.rst:663 +#: ../../library/idle.rst:654 msgid "" "Otherwise, arguments are files opened for editing and ``sys.argv`` reflects " "the arguments passed to IDLE itself." msgstr "" -#: ../../library/idle.rst:667 +#: ../../library/idle.rst:658 msgid "Startup failure" msgstr "" -#: ../../library/idle.rst:669 +#: ../../library/idle.rst:660 msgid "" "IDLE uses a socket to communicate between the IDLE GUI process and the user " "code execution process. A connection must be established whenever the Shell " "starts or restarts. (The latter is indicated by a divider line that says " "'RESTART'). If the user process fails to connect to the GUI process, it " -"usually displays a ``Tk`` error box with a 'cannot connect' message that " -"directs the user here. It then exits." +"displays a ``Tk`` error box with a 'cannot connect' message that directs the " +"user here. It then exits." msgstr "" -#: ../../library/idle.rst:676 -msgid "" -"One specific connection failure on Unix systems results from misconfigured " -"masquerading rules somewhere in a system's network setup. When IDLE is " -"started from a terminal, one will see a message starting with ``** Invalid " -"host:``. The valid value is ``127.0.0.1 (idlelib.rpc.LOCALHOST)``. One can " -"diagnose with ``tcpconnect -irv 127.0.0.1 6543`` in one terminal window and " -"``tcplisten `` in another." -msgstr "" - -#: ../../library/idle.rst:684 +#: ../../library/idle.rst:667 msgid "" "A common cause of failure is a user-written file with the same name as a " "standard library module, such as *random.py* and *tkinter.py*. When such a " @@ -1203,7 +1188,7 @@ msgid "" "file." msgstr "" -#: ../../library/idle.rst:690 +#: ../../library/idle.rst:673 msgid "" "Though less common than in the past, an antivirus or firewall program may " "stop the connection. If the program cannot be taught to allow the " @@ -1213,7 +1198,7 @@ msgid "" "connections." msgstr "" -#: ../../library/idle.rst:697 +#: ../../library/idle.rst:680 msgid "" "Python installation issues occasionally stop IDLE: multiple versions can " "clash, or a single installation might need admin access. If one undo the " @@ -1221,7 +1206,7 @@ msgid "" "completely remove Python and start over." msgstr "" -#: ../../library/idle.rst:702 +#: ../../library/idle.rst:685 msgid "" "A zombie pythonw.exe process could be a problem. On Windows, use Task " "Manager to check for one and stop it if there is. Sometimes a restart " @@ -1230,7 +1215,7 @@ msgid "" "may fix a temporary problem." msgstr "" -#: ../../library/idle.rst:708 +#: ../../library/idle.rst:691 msgid "" "When IDLE first starts, it attempts to read user configuration files in ``~/." "idlerc/`` (~ is one's home directory). If there is a problem, an error " @@ -1241,37 +1226,28 @@ msgid "" "with the settings dialog." msgstr "" -#: ../../library/idle.rst:716 +#: ../../library/idle.rst:699 msgid "" "If IDLE quits with no message, and it was not started from a console, try " "starting it from a console or terminal (``python -m idlelib``) and see if " "this results in an error message." msgstr "" -#: ../../library/idle.rst:720 -msgid "" -"On Unix-based systems with tcl/tk older than ``8.6.11`` (see ``About IDLE``) " -"certain characters of certain fonts can cause a tk failure with a message to " -"the terminal. This can happen either if one starts IDLE to edit a file with " -"such a character or later when entering such a character. If one cannot " -"upgrade tcl/tk, then re-configure IDLE to use a font that works better." -msgstr "" - -#: ../../library/idle.rst:728 +#: ../../library/idle.rst:704 msgid "Running user code" msgstr "" -#: ../../library/idle.rst:730 +#: ../../library/idle.rst:706 msgid "" "With rare exceptions, the result of executing Python code with IDLE is " "intended to be the same as executing the same code by the default method, " "directly with Python in a text-mode system console or terminal window. " "However, the different interface and operation occasionally affect visible " "results. For instance, ``sys.modules`` starts with more entries, and " -"``threading.active_count()`` returns 2 instead of 1." +"``threading.activeCount()`` returns 2 instead of 1." msgstr "" -#: ../../library/idle.rst:737 +#: ../../library/idle.rst:713 msgid "" "By default, IDLE runs user code in a separate OS process rather than in the " "user interface process that runs the shell and editor. In the execution " @@ -1281,19 +1257,15 @@ msgid "" "__stderr__`` are not touched, but may be ``None``." msgstr "" -#: ../../library/idle.rst:744 +#: ../../library/idle.rst:720 msgid "" -"Sending print output from one process to a text widget in another is slower " -"than printing to a system terminal in the same process. This has the most " -"effect when printing multiple arguments, as the string for each argument, " -"each separator, the newline are sent separately. For development, this is " -"usually not a problem, but if one wants to print faster in IDLE, format and " -"join together everything one wants displayed together and then print a " -"single string. Both format strings and :meth:`str.join` can help combine " -"fields and lines." +"When Shell has the focus, it controls the keyboard and screen. This is " +"normally transparent, but functions that directly access the keyboard and " +"screen will not work. These include system-specific functions that " +"determine whether a key has been pressed and if so, which." msgstr "" -#: ../../library/idle.rst:753 +#: ../../library/idle.rst:725 msgid "" "IDLE's standard stream replacements are not inherited by subprocesses " "created in the execution process, whether directly by user code or by " @@ -1303,22 +1275,7 @@ msgid "" "attached to that window for input and output." msgstr "" -#: ../../library/idle.rst:760 -msgid "" -"If ``sys`` is reset by user code, such as with ``importlib.reload(sys)``, " -"IDLE's changes are lost and input from the keyboard and output to the screen " -"will not work correctly." -msgstr "" - -#: ../../library/idle.rst:764 -msgid "" -"When Shell has the focus, it controls the keyboard and screen. This is " -"normally transparent, but functions that directly access the keyboard and " -"screen will not work. These include system-specific functions that " -"determine whether a key has been pressed and if so, which." -msgstr "" - -#: ../../library/idle.rst:769 +#: ../../library/idle.rst:732 msgid "" "The IDLE code running in the execution process adds frames to the call stack " "that would not be there otherwise. IDLE wraps ``sys.getrecursionlimit`` and " @@ -1326,17 +1283,24 @@ msgid "" "frames." msgstr "" -#: ../../library/idle.rst:774 +#: ../../library/idle.rst:736 +msgid "" +"If ``sys`` is reset by user code, such as with ``importlib.reload(sys)``, " +"IDLE's changes are lost and input from the keyboard and output to the screen " +"will not work correctly." +msgstr "" + +#: ../../library/idle.rst:740 msgid "" "When user code raises SystemExit either directly or by calling sys.exit, " "IDLE returns to a Shell prompt instead of exiting." msgstr "" -#: ../../library/idle.rst:778 +#: ../../library/idle.rst:744 msgid "User output in Shell" msgstr "" -#: ../../library/idle.rst:780 +#: ../../library/idle.rst:746 msgid "" "When a program outputs text, the result is determined by the corresponding " "output device. When IDLE executes user code, ``sys.stdout`` and ``sys." @@ -1346,7 +1310,7 @@ msgid "" "rather than production runs." msgstr "" -#: ../../library/idle.rst:787 +#: ../../library/idle.rst:753 msgid "" "For instance, Shell never throws away output. A program that sends " "unlimited output to Shell will eventually fill memory, resulting in a memory " @@ -1355,7 +1319,7 @@ msgid "" "lines, with 300 the default." msgstr "" -#: ../../library/idle.rst:793 +#: ../../library/idle.rst:759 msgid "" "A Tk Text widget, and hence IDLE's Shell, displays characters (codepoints) " "in the BMP (Basic Multilingual Plane) subset of Unicode. Which characters " @@ -1369,7 +1333,7 @@ msgid "" "spacing behavior.) ::" msgstr "" -#: ../../library/idle.rst:811 +#: ../../library/idle.rst:777 msgid "" "The ``repr`` function is used for interactive echo of expression values. It " "returns an altered version of the input string in which control codes, some " @@ -1378,13 +1342,13 @@ msgid "" "regardless of how they are displayed." msgstr "" -#: ../../library/idle.rst:817 +#: ../../library/idle.rst:783 msgid "" "Normal and error output are generally kept separate (on separate lines) from " "code input and each other. They each get different highlight colors." msgstr "" -#: ../../library/idle.rst:820 +#: ../../library/idle.rst:786 msgid "" "For SyntaxError tracebacks, the normal '^' marking where the error was " "detected is replaced by coloring the text with an error highlight. When code " @@ -1393,7 +1357,7 @@ msgid "" "opened if necessary." msgstr "" -#: ../../library/idle.rst:826 +#: ../../library/idle.rst:792 msgid "" "Shell has a special facility for squeezing output lines down to a 'Squeezed " "text' label. This is done automatically for output over N lines (N = 50 by " @@ -1402,18 +1366,18 @@ msgid "" "on the output. This can be useful lines long enough to slow down scrolling." msgstr "" -#: ../../library/idle.rst:834 +#: ../../library/idle.rst:800 msgid "" "Squeezed output is expanded in place by double-clicking the label. It can " "also be sent to the clipboard or a separate view window by right-clicking " "the label." msgstr "" -#: ../../library/idle.rst:839 +#: ../../library/idle.rst:805 msgid "Developing tkinter applications" msgstr "" -#: ../../library/idle.rst:841 +#: ../../library/idle.rst:807 msgid "" "IDLE is intentionally different from standard Python in order to facilitate " "development of tkinter programs. Enter ``import tkinter as tk; root = tk." @@ -1425,7 +1389,7 @@ msgid "" "changes in standard Python until one enters ``root.update()``." msgstr "" -#: ../../library/idle.rst:850 +#: ../../library/idle.rst:816 msgid "" "Most tkinter programs run ``root.mainloop()``, which usually does not return " "until the tk app is destroyed. If the program is run with ``python -i`` or " @@ -1433,7 +1397,7 @@ msgid "" "``mainloop()`` returns, at which time there is nothing left to interact with." msgstr "" -#: ../../library/idle.rst:856 +#: ../../library/idle.rst:822 msgid "" "When running a tkinter program from an IDLE editor, one can comment out the " "mainloop call. One then gets a shell prompt immediately and can interact " @@ -1441,11 +1405,11 @@ msgid "" "mainloop call when running in standard Python." msgstr "" -#: ../../library/idle.rst:862 +#: ../../library/idle.rst:828 msgid "Running without a subprocess" msgstr "" -#: ../../library/idle.rst:864 +#: ../../library/idle.rst:830 msgid "" "By default, IDLE executes user code in a separate subprocess via a socket, " "which uses the internal loopback interface. This connection is not " @@ -1453,7 +1417,7 @@ msgid "" "firewall software complains anyway, you can ignore it." msgstr "" -#: ../../library/idle.rst:869 +#: ../../library/idle.rst:835 msgid "" "If the attempt to make the socket connection fails, Idle will notify you. " "Such failures are sometimes transient, but if persistent, the problem may be " @@ -1462,7 +1426,7 @@ msgid "" "command line switch." msgstr "" -#: ../../library/idle.rst:875 +#: ../../library/idle.rst:841 msgid "" "If IDLE is started with the -n command line switch it will run in a single " "process and will not create the subprocess which runs the RPC Python " @@ -1476,15 +1440,15 @@ msgid "" "at all possible." msgstr "" -#: ../../library/idle.rst:890 +#: ../../library/idle.rst:856 msgid "Help and preferences" msgstr "" -#: ../../library/idle.rst:895 +#: ../../library/idle.rst:861 msgid "Help sources" msgstr "" -#: ../../library/idle.rst:897 +#: ../../library/idle.rst:863 msgid "" "Help menu entry \"IDLE Help\" displays a formatted html version of the IDLE " "chapter of the Library Reference. The result, in a read-only tkinter text " @@ -1494,7 +1458,7 @@ msgid "" "the opened box." msgstr "" -#: ../../library/idle.rst:905 +#: ../../library/idle.rst:871 msgid "" "Help menu entry \"Python Docs\" opens the extensive sources of help, " "including tutorials, available at ``docs.python.org/x.y``, where 'x.y' is " @@ -1503,17 +1467,17 @@ msgid "" "instead." msgstr "" -#: ../../library/idle.rst:911 +#: ../../library/idle.rst:877 msgid "" "Selected URLs can be added or removed from the help menu at any time using " "the General tab of the Configure IDLE dialog." msgstr "" -#: ../../library/idle.rst:917 +#: ../../library/idle.rst:883 msgid "Setting preferences" msgstr "" -#: ../../library/idle.rst:919 +#: ../../library/idle.rst:885 msgid "" "The font preferences, highlighting, keys, and general preferences can be " "changed via Configure IDLE on the Option menu. Non-default user settings are " @@ -1522,7 +1486,7 @@ msgid "" "or more of the files in ``.idlerc``." msgstr "" -#: ../../library/idle.rst:925 +#: ../../library/idle.rst:891 msgid "" "On the Font tab, see the text sample for the effect of font face and size on " "multiple characters in multiple languages. Edit the sample to add other " @@ -1531,7 +1495,7 @@ msgid "" "them to the top of the sample and try changing first size and then font." msgstr "" -#: ../../library/idle.rst:932 +#: ../../library/idle.rst:898 msgid "" "On the Highlights and Keys tab, select a built-in or custom color theme and " "key set. To use a newer built-in color theme or key set with older IDLEs, " @@ -1539,22 +1503,22 @@ msgid "" "IDLEs." msgstr "" -#: ../../library/idle.rst:938 +#: ../../library/idle.rst:904 msgid "IDLE on macOS" msgstr "" -#: ../../library/idle.rst:940 +#: ../../library/idle.rst:906 msgid "" "Under System Preferences: Dock, one can set \"Prefer tabs when opening " "documents\" to \"Always\". This setting is not compatible with the tk/" "tkinter GUI framework used by IDLE, and it breaks a few IDLE features." msgstr "" -#: ../../library/idle.rst:945 +#: ../../library/idle.rst:911 msgid "Extensions" msgstr "" -#: ../../library/idle.rst:947 +#: ../../library/idle.rst:913 msgid "" "IDLE contains an extension facility. Preferences for extensions can be " "changed with the Extensions tab of the preferences dialog. See the beginning " diff --git a/library/imaplib.po b/library/imaplib.po index c04abe9860..cbe2765e26 100644 --- a/library/imaplib.po +++ b/library/imaplib.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.7\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2021-09-07 06:52+0000\n" +"POT-Creation-Date: 2020-06-20 18:08+0800\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-" @@ -165,7 +165,7 @@ msgstr "" #: ../../library/imaplib.rst:146 msgid "" -"Converts an integer into a bytes representation using characters from the " +"Converts an integer into a string representation using characters from the " "set [``A`` .. ``P``]." msgstr "" @@ -201,9 +201,9 @@ msgstr "" #: ../../library/imaplib.rst:177 msgid "" -"Documents describing the protocol, sources for servers implementing it, by " -"the University of Washington's IMAP Information Center can all be found at " -"(**Source Code**) https://github.com/uw-imap/imap (**Not Maintained**)." +"Documents describing the protocol, and sources and binaries for servers " +"implementing it, can all be found at the University of Washington's *IMAP " +"Information Center* (https://www.washington.edu/imap/)." msgstr "" #: ../../library/imaplib.rst:185 @@ -233,7 +233,7 @@ msgid "" "Each command returns a tuple: ``(type, [data, ...])`` where *type* is " "usually ``'OK'`` or ``'NO'``, and *data* is either the text from the command " "response, or mandated results from the command. Each *data* is either a " -"``bytes``, or a tuple. If a tuple, then the first part is the header of the " +"string, or a tuple. If a tuple, then the first part is the header of the " "response, and the second part contains the data (ie: 'literal' value)." msgstr "" @@ -418,7 +418,7 @@ msgid "" "method." msgstr "" -#: ../../library/imaplib.rst:379 +#: ../../library/imaplib.rst:380 msgid "" "Raises an :ref:`auditing event ` ``imaplib.open`` with arguments " "``self``, ``host``, ``port``." diff --git a/library/importlib.metadata.po b/library/importlib.metadata.po index 35bf7709b6..9c20c6b580 100644 --- a/library/importlib.metadata.po +++ b/library/importlib.metadata.po @@ -8,11 +8,10 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.9\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2021-09-07 06:52+0000\n" +"POT-Creation-Date: 2020-06-20 18:08+0800\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" -"Language: \n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" @@ -21,17 +20,13 @@ msgstr "" msgid "Using :mod:`!importlib.metadata`" msgstr "" -#: ../../library/importlib.metadata.rst:10 -msgid "**Source code:** :source:`Lib/importlib/metadata.py`" -msgstr "" - -#: ../../library/importlib.metadata.rst:15 +#: ../../library/importlib.metadata.rst:8 msgid "" "This functionality is provisional and may deviate from the usual version " "semantics of the standard library." msgstr "" -#: ../../library/importlib.metadata.rst:18 +#: ../../library/importlib.metadata.rst:11 msgid "" "``importlib.metadata`` is a library that provides for access to installed " "package metadata. Built in part on Python's import system, this library " @@ -42,7 +37,7 @@ msgid "" "efficient ``pkg_resources`` package." msgstr "" -#: ../../library/importlib.metadata.rst:27 +#: ../../library/importlib.metadata.rst:20 msgid "" "By \"installed package\" we generally mean a third-party package installed " "into Python's ``site-packages`` directory via tools such as `pip ` objects." msgstr "" -#: ../../library/importlib.metadata.rst:63 +#: ../../library/importlib.metadata.rst:56 msgid "You can get the :ref:`metadata for a distribution `::" msgstr "" -#: ../../library/importlib.metadata.rst:68 +#: ../../library/importlib.metadata.rst:61 msgid "" "You can also get a :ref:`distribution's version number `, list its :" "ref:`constituent files `, and get a list of the distribution's :ref:" "`requirements`." msgstr "" -#: ../../library/importlib.metadata.rst:74 +#: ../../library/importlib.metadata.rst:67 msgid "Functional API" msgstr "" -#: ../../library/importlib.metadata.rst:76 +#: ../../library/importlib.metadata.rst:69 msgid "This package provides the following functionality via its public API." msgstr "" -#: ../../library/importlib.metadata.rst:82 +#: ../../library/importlib.metadata.rst:75 msgid "Entry points" msgstr "" -#: ../../library/importlib.metadata.rst:84 +#: ../../library/importlib.metadata.rst:77 msgid "" "The ``entry_points()`` function returns a dictionary of all entry points, " "keyed by group. Entry points are represented by ``EntryPoint`` instances; " @@ -108,7 +103,7 @@ msgid "" "value`` attribute::" msgstr "" -#: ../../library/importlib.metadata.rst:108 +#: ../../library/importlib.metadata.rst:101 msgid "" "The ``group`` and ``name`` are arbitrary values defined by the package " "author and usually a client will wish to resolve all entry points for a " @@ -117,57 +112,51 @@ msgid "" "for more information on entry points, their definition, and usage." msgstr "" -#: ../../library/importlib.metadata.rst:118 +#: ../../library/importlib.metadata.rst:111 msgid "Distribution metadata" msgstr "" -#: ../../library/importlib.metadata.rst:120 +#: ../../library/importlib.metadata.rst:113 msgid "" "Every distribution includes some metadata, which you can extract using the " "``metadata()`` function::" msgstr "" -#: ../../library/importlib.metadata.rst:125 +#: ../../library/importlib.metadata.rst:118 msgid "" "The keys of the returned data structure [#f1]_ name the metadata keywords, " "and their values are returned unparsed from the distribution metadata::" msgstr "" -#: ../../library/importlib.metadata.rst:135 +#: ../../library/importlib.metadata.rst:128 msgid "Distribution versions" msgstr "" -#: ../../library/importlib.metadata.rst:137 +#: ../../library/importlib.metadata.rst:130 msgid "" "The ``version()`` function is the quickest way to get a distribution's " "version number, as a string::" msgstr "" -#: ../../library/importlib.metadata.rst:147 +#: ../../library/importlib.metadata.rst:140 msgid "Distribution files" msgstr "" -#: ../../library/importlib.metadata.rst:149 +#: ../../library/importlib.metadata.rst:142 msgid "" "You can also get the full set of files contained within a distribution. The " "``files()`` function takes a distribution package name and returns all of " "the files installed by this distribution. Each file object returned is a " -"``PackagePath``, a :class:`pathlib.PurePath` derived object with additional " +"``PackagePath``, a :class:`pathlib.Path` derived object with additional " "``dist``, ``size``, and ``hash`` properties as indicated by the metadata. " "For example::" msgstr "" -#: ../../library/importlib.metadata.rst:165 +#: ../../library/importlib.metadata.rst:158 msgid "Once you have the file, you can also read its contents::" msgstr "" -#: ../../library/importlib.metadata.rst:176 -msgid "" -"You can also use the ``locate`` method to get a the absolute path to the " -"file::" -msgstr "" - -#: ../../library/importlib.metadata.rst:182 +#: ../../library/importlib.metadata.rst:169 msgid "" "In the case where the metadata file listing files (RECORD or SOURCES.txt) is " "missing, ``files()`` will return ``None``. The caller may wish to wrap calls " @@ -177,21 +166,21 @@ msgid "" "present." msgstr "" -#: ../../library/importlib.metadata.rst:193 +#: ../../library/importlib.metadata.rst:180 msgid "Distribution requirements" msgstr "" -#: ../../library/importlib.metadata.rst:195 +#: ../../library/importlib.metadata.rst:182 msgid "" "To get the full set of requirements for a distribution, use the " "``requires()`` function::" msgstr "" -#: ../../library/importlib.metadata.rst:203 +#: ../../library/importlib.metadata.rst:190 msgid "Distributions" msgstr "" -#: ../../library/importlib.metadata.rst:205 +#: ../../library/importlib.metadata.rst:192 msgid "" "While the above API is the most common and convenient usage, you can get all " "of that information from the ``Distribution`` class. A ``Distribution`` is " @@ -199,29 +188,29 @@ msgid "" "can get the ``Distribution`` instance::" msgstr "" -#: ../../library/importlib.metadata.rst:213 +#: ../../library/importlib.metadata.rst:200 msgid "" "Thus, an alternative way to get the version number is through the " "``Distribution`` instance::" msgstr "" -#: ../../library/importlib.metadata.rst:219 +#: ../../library/importlib.metadata.rst:206 msgid "" "There are all kinds of additional metadata available on the ``Distribution`` " "instance::" msgstr "" -#: ../../library/importlib.metadata.rst:227 +#: ../../library/importlib.metadata.rst:214 msgid "" "The full set of available metadata is not described here. See :pep:`566` " "for additional details." msgstr "" -#: ../../library/importlib.metadata.rst:232 +#: ../../library/importlib.metadata.rst:219 msgid "Extending the search algorithm" msgstr "" -#: ../../library/importlib.metadata.rst:234 +#: ../../library/importlib.metadata.rst:221 msgid "" "Because package metadata is not available through :data:`sys.path` searches, " "or package loaders directly, the metadata for a package is found through " @@ -230,14 +219,14 @@ msgid "" "path finders ` on :data:`sys.meta_path`." msgstr "" -#: ../../library/importlib.metadata.rst:240 +#: ../../library/importlib.metadata.rst:227 msgid "" "The default ``PathFinder`` for Python includes a hook that calls into " "``importlib.metadata.MetadataPathFinder`` for finding distributions loaded " "from typical file-system-based paths." msgstr "" -#: ../../library/importlib.metadata.rst:244 +#: ../../library/importlib.metadata.rst:231 msgid "" "The abstract class :py:class:`importlib.abc.MetaPathFinder` defines the " "interface expected of finders by Python's import system. ``importlib." @@ -247,14 +236,14 @@ msgid "" "base class, which defines this abstract method::" msgstr "" -#: ../../library/importlib.metadata.rst:258 +#: ../../library/importlib.metadata.rst:245 msgid "" "The ``DistributionFinder.Context`` object provides ``.path`` and ``.name`` " "properties indicating the path to search and name to match and may supply " "other relevant context." msgstr "" -#: ../../library/importlib.metadata.rst:262 +#: ../../library/importlib.metadata.rst:249 msgid "" "What this means in practice is that to support finding distribution package " "metadata in locations other than the file system, subclass ``Distribution`` " @@ -263,11 +252,11 @@ msgid "" "method." msgstr "" -#: ../../library/importlib.metadata.rst:275 +#: ../../library/importlib.metadata.rst:262 msgid "Footnotes" msgstr "" -#: ../../library/importlib.metadata.rst:276 +#: ../../library/importlib.metadata.rst:263 msgid "" "Technically, the returned distribution metadata object is an :class:`email." "message.EmailMessage` instance, but this is an implementation detail, and " diff --git a/library/importlib.po b/library/importlib.po index 049d2ad40a..abff9db9b6 100644 --- a/library/importlib.po +++ b/library/importlib.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.7\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2021-09-07 06:52+0000\n" +"POT-Creation-Date: 2020-06-20 18:08+0800\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-" @@ -423,7 +423,7 @@ msgid "" msgstr "" #: ../../library/importlib.rst:298 ../../library/importlib.rst:352 -#: ../../library/importlib.rst:360 ../../library/importlib.rst:1136 +#: ../../library/importlib.rst:360 ../../library/importlib.rst:1119 msgid "Use :meth:`find_spec` instead." msgstr "" @@ -502,7 +502,7 @@ msgid "" "definition for a loader." msgstr "" -#: ../../library/importlib.rst:375 ../../library/importlib.rst:857 +#: ../../library/importlib.rst:375 ../../library/importlib.rst:856 msgid "" "Loaders that wish to support resource reading should implement a " "``get_resource_reader(fullname)`` method as specified by :class:`importlib." @@ -598,41 +598,40 @@ msgid "" "attribute is not set on modules." msgstr "" -#: ../../library/importlib.rst:445 +#: ../../library/importlib.rst:444 msgid ":attr:`__package__`" msgstr "" #: ../../library/importlib.rst:441 msgid "" -"The fully-qualified name of the package under which the module was loaded as " -"a submodule (or the empty string for top-level modules). For packages, it is " -"the same as :attr:`__name__`. The :func:`importlib.util.module_for_loader` " -"decorator can handle the details for :attr:`__package__`." +"The parent package for the module/package. If the module is top-level then " +"it has a value of the empty string. The :func:`importlib.util." +"module_for_loader` decorator can handle the details for :attr:`__package__`." msgstr "" -#: ../../library/importlib.rst:450 +#: ../../library/importlib.rst:449 msgid ":attr:`__loader__`" msgstr "" -#: ../../library/importlib.rst:448 +#: ../../library/importlib.rst:447 msgid "" "The loader used to load the module. The :func:`importlib.util." "module_for_loader` decorator can handle the details for :attr:`__package__`." msgstr "" -#: ../../library/importlib.rst:452 +#: ../../library/importlib.rst:451 msgid "" "When :meth:`exec_module` is available then backwards-compatible " "functionality is provided." msgstr "" -#: ../../library/importlib.rst:455 +#: ../../library/importlib.rst:454 msgid "" "Raise :exc:`ImportError` when called instead of :exc:`NotImplementedError`. " "Functionality provided when :meth:`exec_module` is available." msgstr "" -#: ../../library/importlib.rst:460 +#: ../../library/importlib.rst:459 msgid "" "The recommended API for loading a module is :meth:`exec_module` (and :meth:" "`create_module`). Loaders should implement it instead of load_module(). " @@ -640,31 +639,31 @@ msgid "" "load_module() when exec_module() is implemented." msgstr "" -#: ../../library/importlib.rst:469 +#: ../../library/importlib.rst:468 msgid "" "A legacy method which when implemented calculates and returns the given " "module's repr, as a string. The module type's default repr() will use the " "result of this method as appropriate." msgstr "" -#: ../../library/importlib.rst:475 +#: ../../library/importlib.rst:474 msgid "Made optional instead of an abstractmethod." msgstr "" -#: ../../library/importlib.rst:478 +#: ../../library/importlib.rst:477 msgid "The import machinery now takes care of this automatically." msgstr "" -#: ../../library/importlib.rst:484 -msgid "*Superseded by TraversableResources*" +#: ../../library/importlib.rst:483 +msgid "*Superseded by TraversableReader*" msgstr "" -#: ../../library/importlib.rst:486 +#: ../../library/importlib.rst:485 msgid "" "An :term:`abstract base class` to provide the ability to read *resources*." msgstr "" -#: ../../library/importlib.rst:489 +#: ../../library/importlib.rst:488 msgid "" "From the perspective of this ABC, a *resource* is a binary artifact that is " "shipped within a package. Typically this is something like a data file that " @@ -674,7 +673,7 @@ msgid "" "file versus on the file system." msgstr "" -#: ../../library/importlib.rst:497 +#: ../../library/importlib.rst:496 msgid "" "For any of methods of this class, a *resource* argument is expected to be a :" "term:`path-like object` which represents conceptually just a file name. This " @@ -686,7 +685,7 @@ msgid "" "potentially representing multiple packages or a module)." msgstr "" -#: ../../library/importlib.rst:508 +#: ../../library/importlib.rst:507 msgid "" "Loaders that wish to support resource reading are expected to provide a " "method called ``get_resource_reader(fullname)`` which returns an object " @@ -695,33 +694,33 @@ msgid "" "with this ABC should only be returned when the specified module is a package." msgstr "" -#: ../../library/importlib.rst:519 +#: ../../library/importlib.rst:518 msgid "" "Returns an opened, :term:`file-like object` for binary reading of the " "*resource*." msgstr "" -#: ../../library/importlib.rst:522 +#: ../../library/importlib.rst:521 msgid "If the resource cannot be found, :exc:`FileNotFoundError` is raised." msgstr "" -#: ../../library/importlib.rst:527 +#: ../../library/importlib.rst:526 msgid "Returns the file system path to the *resource*." msgstr "" -#: ../../library/importlib.rst:529 +#: ../../library/importlib.rst:528 msgid "" "If the resource does not concretely exist on the file system, raise :exc:" "`FileNotFoundError`." msgstr "" -#: ../../library/importlib.rst:534 +#: ../../library/importlib.rst:533 msgid "" "Returns ``True`` if the named *name* is considered a resource. :exc:" "`FileNotFoundError` is raised if *name* does not exist." msgstr "" -#: ../../library/importlib.rst:539 +#: ../../library/importlib.rst:538 msgid "" "Returns an :term:`iterable` of strings over the contents of the package. Do " "note that it is not required that all names returned by the iterator be " @@ -729,7 +728,7 @@ msgid "" "`is_resource` would be false." msgstr "" -#: ../../library/importlib.rst:545 +#: ../../library/importlib.rst:544 msgid "" "Allowing non-resource names to be returned is to allow for situations where " "how a package and its resources are stored are known a priori and the non-" @@ -738,23 +737,23 @@ msgid "" "stored on the file system then those subdirectory names can be used directly." msgstr "" -#: ../../library/importlib.rst:553 +#: ../../library/importlib.rst:552 msgid "The abstract method returns an iterable of no items." msgstr "" -#: ../../library/importlib.rst:558 +#: ../../library/importlib.rst:557 msgid "" "An abstract base class for a :term:`loader` which implements the optional :" "pep:`302` protocol for loading arbitrary resources from the storage back-end." msgstr "" -#: ../../library/importlib.rst:562 +#: ../../library/importlib.rst:561 msgid "" "This ABC is deprecated in favour of supporting resource loading through :" "class:`importlib.abc.ResourceReader`." msgstr "" -#: ../../library/importlib.rst:568 +#: ../../library/importlib.rst:567 msgid "" "An abstract method to return the bytes for the data located at *path*. " "Loaders that have a file-like storage back-end that allows storing arbitrary " @@ -764,34 +763,34 @@ msgid "" "attribute or an item from a package's :attr:`__path__`." msgstr "" -#: ../../library/importlib.rst:576 +#: ../../library/importlib.rst:575 msgid "Raises :exc:`OSError` instead of :exc:`NotImplementedError`." msgstr "" -#: ../../library/importlib.rst:582 +#: ../../library/importlib.rst:581 msgid "" "An abstract base class for a :term:`loader` which implements the optional :" "pep:`302` protocol for loaders that inspect modules." msgstr "" -#: ../../library/importlib.rst:587 +#: ../../library/importlib.rst:586 msgid "" "Return the code object for a module, or ``None`` if the module does not have " "a code object (as would be the case, for example, for a built-in module). " "Raise an :exc:`ImportError` if loader cannot find the requested module." msgstr "" -#: ../../library/importlib.rst:593 +#: ../../library/importlib.rst:592 msgid "" "While the method has a default implementation, it is suggested that it be " "overridden if possible for performance." msgstr "" -#: ../../library/importlib.rst:599 +#: ../../library/importlib.rst:598 msgid "No longer abstract and a concrete implementation is provided." msgstr "" -#: ../../library/importlib.rst:604 +#: ../../library/importlib.rst:603 msgid "" "An abstract method to return the source of a module. It is returned as a " "text string using :term:`universal newlines`, translating all recognized " @@ -800,23 +799,23 @@ msgid "" "cannot find the module specified." msgstr "" -#: ../../library/importlib.rst:610 ../../library/importlib.rst:619 -#: ../../library/importlib.rst:669 +#: ../../library/importlib.rst:609 ../../library/importlib.rst:618 +#: ../../library/importlib.rst:668 msgid "Raises :exc:`ImportError` instead of :exc:`NotImplementedError`." msgstr "" -#: ../../library/importlib.rst:615 +#: ../../library/importlib.rst:614 msgid "" -"An optional method to return a true value if the module is a package, a " +"An abstract method to return a true value if the module is a package, a " "false value otherwise. :exc:`ImportError` is raised if the :term:`loader` " "cannot find the module." msgstr "" -#: ../../library/importlib.rst:624 +#: ../../library/importlib.rst:623 msgid "Create a code object from Python source." msgstr "" -#: ../../library/importlib.rst:626 +#: ../../library/importlib.rst:625 msgid "" "The *data* argument can be whatever the :func:`compile` function supports (i." "e. string or bytes). The *path* argument should be the \"path\" to where the " @@ -824,106 +823,106 @@ msgid "" "in a zip file)." msgstr "" -#: ../../library/importlib.rst:631 +#: ../../library/importlib.rst:630 msgid "" "With the subsequent code object one can execute it in a module by running " "``exec(code, module.__dict__)``." msgstr "" -#: ../../library/importlib.rst:636 +#: ../../library/importlib.rst:635 msgid "Made the method static." msgstr "" -#: ../../library/importlib.rst:641 +#: ../../library/importlib.rst:640 msgid "Implementation of :meth:`Loader.exec_module`." msgstr "" -#: ../../library/importlib.rst:647 +#: ../../library/importlib.rst:646 msgid "Implementation of :meth:`Loader.load_module`." msgstr "" -#: ../../library/importlib.rst:649 +#: ../../library/importlib.rst:648 msgid "use :meth:`exec_module` instead." msgstr "" -#: ../../library/importlib.rst:655 +#: ../../library/importlib.rst:654 msgid "" "An abstract base class which inherits from :class:`InspectLoader` that, when " "implemented, helps a module to be executed as a script. The ABC represents " "an optional :pep:`302` protocol." msgstr "" -#: ../../library/importlib.rst:661 +#: ../../library/importlib.rst:660 msgid "" "An abstract method that is to return the value of :attr:`__file__` for the " "specified module. If no path is available, :exc:`ImportError` is raised." msgstr "" -#: ../../library/importlib.rst:665 +#: ../../library/importlib.rst:664 msgid "" "If source code is available, then the method should return the path to the " "source file, regardless of whether a bytecode was used to load the module." msgstr "" -#: ../../library/importlib.rst:675 +#: ../../library/importlib.rst:674 msgid "" "An abstract base class which inherits from :class:`ResourceLoader` and :" "class:`ExecutionLoader`, providing concrete implementations of :meth:" "`ResourceLoader.get_data` and :meth:`ExecutionLoader.get_filename`." msgstr "" -#: ../../library/importlib.rst:679 +#: ../../library/importlib.rst:678 msgid "" "The *fullname* argument is a fully resolved name of the module the loader is " "to handle. The *path* argument is the path to the file for the module." msgstr "" -#: ../../library/importlib.rst:686 +#: ../../library/importlib.rst:685 msgid "The name of the module the loader can handle." msgstr "" -#: ../../library/importlib.rst:690 +#: ../../library/importlib.rst:689 msgid "Path to the file of the module." msgstr "" -#: ../../library/importlib.rst:694 +#: ../../library/importlib.rst:693 msgid "Calls super's ``load_module()``." msgstr "" -#: ../../library/importlib.rst:696 +#: ../../library/importlib.rst:695 msgid "Use :meth:`Loader.exec_module` instead." msgstr "" -#: ../../library/importlib.rst:701 ../../library/importlib.rst:1335 +#: ../../library/importlib.rst:700 ../../library/importlib.rst:1318 msgid "Returns :attr:`path`." msgstr "" -#: ../../library/importlib.rst:705 +#: ../../library/importlib.rst:704 msgid "Reads *path* as a binary file and returns the bytes from it." msgstr "" -#: ../../library/importlib.rst:710 +#: ../../library/importlib.rst:709 msgid "" "An abstract base class for implementing source (and optionally bytecode) " "file loading. The class inherits from both :class:`ResourceLoader` and :" "class:`ExecutionLoader`, requiring the implementation of:" msgstr "" -#: ../../library/importlib.rst:714 +#: ../../library/importlib.rst:713 msgid ":meth:`ResourceLoader.get_data`" msgstr "" -#: ../../library/importlib.rst:717 +#: ../../library/importlib.rst:716 msgid ":meth:`ExecutionLoader.get_filename`" msgstr "" -#: ../../library/importlib.rst:716 +#: ../../library/importlib.rst:715 msgid "" "Should only return the path to the source file; sourceless loading is not " "supported." msgstr "" -#: ../../library/importlib.rst:719 +#: ../../library/importlib.rst:718 msgid "" "The abstract methods defined by this class are to add optional bytecode file " "support. Not implementing these optional methods (or causing them to raise :" @@ -935,83 +934,83 @@ msgid "" "bytecode-specific API is exposed." msgstr "" -#: ../../library/importlib.rst:730 +#: ../../library/importlib.rst:729 msgid "" "Optional abstract method which returns a :class:`dict` containing metadata " "about the specified path. Supported dictionary keys are:" msgstr "" -#: ../../library/importlib.rst:733 +#: ../../library/importlib.rst:732 msgid "" "``'mtime'`` (mandatory): an integer or floating-point number representing " "the modification time of the source code;" msgstr "" -#: ../../library/importlib.rst:735 +#: ../../library/importlib.rst:734 msgid "``'size'`` (optional): the size in bytes of the source code." msgstr "" -#: ../../library/importlib.rst:737 +#: ../../library/importlib.rst:736 msgid "" "Any other keys in the dictionary are ignored, to allow for future " "extensions. If the path cannot be handled, :exc:`OSError` is raised." msgstr "" -#: ../../library/importlib.rst:742 ../../library/importlib.rst:755 +#: ../../library/importlib.rst:741 ../../library/importlib.rst:754 msgid "Raise :exc:`OSError` instead of :exc:`NotImplementedError`." msgstr "" -#: ../../library/importlib.rst:747 +#: ../../library/importlib.rst:746 msgid "" "Optional abstract method which returns the modification time for the " "specified path." msgstr "" -#: ../../library/importlib.rst:750 +#: ../../library/importlib.rst:749 msgid "" "This method is deprecated in favour of :meth:`path_stats`. You don't have " "to implement it, but it is still available for compatibility purposes. " "Raise :exc:`OSError` if the path cannot be handled." msgstr "" -#: ../../library/importlib.rst:760 +#: ../../library/importlib.rst:759 msgid "" "Optional abstract method which writes the specified bytes to a file path. " "Any intermediate directories which do not exist are to be created " "automatically." msgstr "" -#: ../../library/importlib.rst:764 +#: ../../library/importlib.rst:763 msgid "" "When writing to the path fails because the path is read-only (:attr:`errno." "EACCES`/:exc:`PermissionError`), do not propagate the exception." msgstr "" -#: ../../library/importlib.rst:768 +#: ../../library/importlib.rst:767 msgid "No longer raises :exc:`NotImplementedError` when called." msgstr "" -#: ../../library/importlib.rst:773 +#: ../../library/importlib.rst:772 msgid "Concrete implementation of :meth:`InspectLoader.get_code`." msgstr "" -#: ../../library/importlib.rst:777 +#: ../../library/importlib.rst:776 msgid "Concrete implementation of :meth:`Loader.exec_module`." msgstr "" -#: ../../library/importlib.rst:783 +#: ../../library/importlib.rst:782 msgid "Concrete implementation of :meth:`Loader.load_module`." msgstr "" -#: ../../library/importlib.rst:785 +#: ../../library/importlib.rst:784 msgid "Use :meth:`exec_module` instead." msgstr "" -#: ../../library/importlib.rst:790 +#: ../../library/importlib.rst:789 msgid "Concrete implementation of :meth:`InspectLoader.get_source`." msgstr "" -#: ../../library/importlib.rst:794 +#: ../../library/importlib.rst:793 msgid "" "Concrete implementation of :meth:`InspectLoader.is_package`. A module is " "determined to be a package if its file path (as provided by :meth:" @@ -1020,13 +1019,13 @@ msgid "" "``__init__``." msgstr "" -#: ../../library/importlib.rst:803 +#: ../../library/importlib.rst:802 msgid "" "An object with a subset of pathlib.Path methods suitable for traversing " "directories and opening files." msgstr "" -#: ../../library/importlib.rst:811 +#: ../../library/importlib.rst:810 msgid "" "An abstract base class for resource readers capable of serving the ``files`` " "interface. Subclasses ResourceReader and provides concrete implementations " @@ -1034,15 +1033,15 @@ msgid "" "TraversableReader also supplies ResourceReader." msgstr "" -#: ../../library/importlib.rst:821 +#: ../../library/importlib.rst:820 msgid ":mod:`importlib.resources` -- Resources" msgstr "" -#: ../../library/importlib.rst:826 +#: ../../library/importlib.rst:825 msgid "**Source code:** :source:`Lib/importlib/resources.py`" msgstr "" -#: ../../library/importlib.rst:832 +#: ../../library/importlib.rst:831 msgid "" "This module leverages Python's import system to provide access to " "*resources* within *packages*. If you can import a package, you can access " @@ -1050,7 +1049,7 @@ msgid "" "binary or text mode." msgstr "" -#: ../../library/importlib.rst:837 +#: ../../library/importlib.rst:836 msgid "" "Resources are roughly akin to files inside directories, though it's " "important to keep in mind that this is just a metaphor. Resources and " @@ -1058,7 +1057,7 @@ msgid "" "file system." msgstr "" -#: ../../library/importlib.rst:843 +#: ../../library/importlib.rst:842 msgid "" "This module provides functionality similar to `pkg_resources `_ `Basic Resource " @@ -1068,7 +1067,7 @@ msgid "" "consistent semantics." msgstr "" -#: ../../library/importlib.rst:851 +#: ../../library/importlib.rst:850 msgid "" "The standalone backport of this module provides more information on `using " "importlib.resources `_." msgstr "" -#: ../../library/importlib.rst:861 +#: ../../library/importlib.rst:860 msgid "The following types are defined." msgstr "" -#: ../../library/importlib.rst:865 +#: ../../library/importlib.rst:864 msgid "" "The ``Package`` type is defined as ``Union[str, ModuleType]``. This means " "that where the function describes accepting a ``Package``, you can pass in " @@ -1088,17 +1087,17 @@ msgid "" "``__spec__.submodule_search_locations`` that is not ``None``." msgstr "" -#: ../../library/importlib.rst:872 +#: ../../library/importlib.rst:871 msgid "" "This type describes the resource names passed into the various functions in " "this package. This is defined as ``Union[str, os.PathLike]``." msgstr "" -#: ../../library/importlib.rst:876 +#: ../../library/importlib.rst:875 msgid "The following functions are available." msgstr "" -#: ../../library/importlib.rst:881 +#: ../../library/importlib.rst:880 msgid "" "Returns an :class:`importlib.resources.abc.Traversable` object representing " "the resource container for the package (think directory) and its resources " @@ -1106,37 +1105,17 @@ msgid "" "subdirectories)." msgstr "" -#: ../../library/importlib.rst:886 ../../library/importlib.rst:987 +#: ../../library/importlib.rst:885 ../../library/importlib.rst:970 msgid "" "*package* is either a name or a module object which conforms to the " "``Package`` requirements." msgstr "" -#: ../../library/importlib.rst:893 -msgid "" -"Given a :class:`importlib.resources.abc.Traversable` object representing a " -"file, typically from :func:`importlib.resources.files`, return a context " -"manager for use in a :keyword:`with` statement. The context manager provides " -"a :class:`pathlib.Path` object." -msgstr "" - -#: ../../library/importlib.rst:898 -msgid "" -"Exiting the context manager cleans up any temporary file created when the " -"resource was extracted from e.g. a zip file." -msgstr "" - -#: ../../library/importlib.rst:901 -msgid "" -"Use ``as_file`` when the Traversable methods (``read_text``, etc) are " -"insufficient and an actual file on the file system is required." -msgstr "" - -#: ../../library/importlib.rst:909 +#: ../../library/importlib.rst:892 msgid "Open for binary reading the *resource* within *package*." msgstr "" -#: ../../library/importlib.rst:911 +#: ../../library/importlib.rst:894 msgid "" "*package* is either a name or a module object which conforms to the " "``Package`` requirements. *resource* is the name of the resource to open " @@ -1145,13 +1124,13 @@ msgid "" "BinaryIO`` instance, a binary I/O stream open for reading." msgstr "" -#: ../../library/importlib.rst:920 +#: ../../library/importlib.rst:903 msgid "" "Open for text reading the *resource* within *package*. By default, the " "resource is opened for reading as UTF-8." msgstr "" -#: ../../library/importlib.rst:923 +#: ../../library/importlib.rst:906 msgid "" "*package* is either a name or a module object which conforms to the " "``Package`` requirements. *resource* is the name of the resource to open " @@ -1160,18 +1139,18 @@ msgid "" "same meaning as with built-in :func:`open`." msgstr "" -#: ../../library/importlib.rst:929 +#: ../../library/importlib.rst:912 msgid "" "This function returns a ``typing.TextIO`` instance, a text I/O stream open " "for reading." msgstr "" -#: ../../library/importlib.rst:935 +#: ../../library/importlib.rst:918 msgid "" "Read and return the contents of the *resource* within *package* as ``bytes``." msgstr "" -#: ../../library/importlib.rst:938 +#: ../../library/importlib.rst:921 msgid "" "*package* is either a name or a module object which conforms to the " "``Package`` requirements. *resource* is the name of the resource to open " @@ -1180,13 +1159,13 @@ msgid "" "contents of the resource as :class:`bytes`." msgstr "" -#: ../../library/importlib.rst:947 +#: ../../library/importlib.rst:930 msgid "" "Read and return the contents of *resource* within *package* as a ``str``. By " "default, the contents are read as strict UTF-8." msgstr "" -#: ../../library/importlib.rst:950 +#: ../../library/importlib.rst:933 msgid "" "*package* is either a name or a module object which conforms to the " "``Package`` requirements. *resource* is the name of the resource to open " @@ -1196,20 +1175,20 @@ msgid "" "contents of the resource as :class:`str`." msgstr "" -#: ../../library/importlib.rst:960 +#: ../../library/importlib.rst:943 msgid "" "Return the path to the *resource* as an actual file system path. This " "function returns a context manager for use in a :keyword:`with` statement. " "The context manager provides a :class:`pathlib.Path` object." msgstr "" -#: ../../library/importlib.rst:964 +#: ../../library/importlib.rst:947 msgid "" "Exiting the context manager cleans up any temporary file created when the " "resource needs to be extracted from e.g. a zip file." msgstr "" -#: ../../library/importlib.rst:967 +#: ../../library/importlib.rst:950 msgid "" "*package* is either a name or a module object which conforms to the " "``Package`` requirements. *resource* is the name of the resource to open " @@ -1217,7 +1196,7 @@ msgid "" "resources (i.e. it cannot be a directory)." msgstr "" -#: ../../library/importlib.rst:975 +#: ../../library/importlib.rst:958 msgid "" "Return ``True`` if there is a resource named *name* in the package, " "otherwise ``False``. Remember that directories are *not* resources! " @@ -1225,66 +1204,66 @@ msgid "" "``Package`` requirements." msgstr "" -#: ../../library/importlib.rst:983 +#: ../../library/importlib.rst:966 msgid "" "Return an iterable over the named items within the package. The iterable " "returns :class:`str` resources (e.g. files) and non-resources (e.g. " "directories). The iterable does not recurse into subdirectories." msgstr "" -#: ../../library/importlib.rst:992 +#: ../../library/importlib.rst:975 msgid ":mod:`importlib.machinery` -- Importers and path hooks" msgstr "" -#: ../../library/importlib.rst:997 +#: ../../library/importlib.rst:980 msgid "**Source code:** :source:`Lib/importlib/machinery.py`" msgstr "" -#: ../../library/importlib.rst:1001 +#: ../../library/importlib.rst:984 msgid "" "This module contains the various objects that help :keyword:`import` find " "and load modules." msgstr "" -#: ../../library/importlib.rst:1006 +#: ../../library/importlib.rst:989 msgid "" "A list of strings representing the recognized file suffixes for source " "modules." msgstr "" -#: ../../library/importlib.rst:1013 +#: ../../library/importlib.rst:996 msgid "" "A list of strings representing the file suffixes for non-optimized bytecode " "modules." msgstr "" -#: ../../library/importlib.rst:1018 ../../library/importlib.rst:1028 +#: ../../library/importlib.rst:1001 ../../library/importlib.rst:1011 msgid "Use :attr:`BYTECODE_SUFFIXES` instead." msgstr "" -#: ../../library/importlib.rst:1023 +#: ../../library/importlib.rst:1006 msgid "" "A list of strings representing the file suffixes for optimized bytecode " "modules." msgstr "" -#: ../../library/importlib.rst:1033 +#: ../../library/importlib.rst:1016 msgid "" "A list of strings representing the recognized file suffixes for bytecode " "modules (including the leading dot)." msgstr "" -#: ../../library/importlib.rst:1038 +#: ../../library/importlib.rst:1021 msgid "The value is no longer dependent on ``__debug__``." msgstr "" -#: ../../library/importlib.rst:1043 +#: ../../library/importlib.rst:1026 msgid "" "A list of strings representing the recognized file suffixes for extension " "modules." msgstr "" -#: ../../library/importlib.rst:1050 +#: ../../library/importlib.rst:1033 msgid "" "Returns a combined list of strings representing all file suffixes for " "modules recognized by the standard import machinery. This is a helper for " @@ -1293,57 +1272,56 @@ msgid "" "`inspect.getmodulename`)." msgstr "" -#: ../../library/importlib.rst:1061 +#: ../../library/importlib.rst:1044 msgid "" "An :term:`importer` for built-in modules. All known built-in modules are " "listed in :data:`sys.builtin_module_names`. This class implements the :class:" "`importlib.abc.MetaPathFinder` and :class:`importlib.abc.InspectLoader` ABCs." msgstr "" -#: ../../library/importlib.rst:1066 ../../library/importlib.rst:1080 -#: ../../library/importlib.rst:1093 ../../library/importlib.rst:1108 +#: ../../library/importlib.rst:1049 ../../library/importlib.rst:1063 +#: ../../library/importlib.rst:1076 ../../library/importlib.rst:1091 msgid "" "Only class methods are defined by this class to alleviate the need for " "instantiation." msgstr "" -#: ../../library/importlib.rst:1069 +#: ../../library/importlib.rst:1052 msgid "" "As part of :pep:`489`, the builtin importer now implements :meth:`Loader." "create_module` and :meth:`Loader.exec_module`" msgstr "" -#: ../../library/importlib.rst:1076 +#: ../../library/importlib.rst:1059 msgid "" "An :term:`importer` for frozen modules. This class implements the :class:" "`importlib.abc.MetaPathFinder` and :class:`importlib.abc.InspectLoader` ABCs." msgstr "" -#: ../../library/importlib.rst:1083 +#: ../../library/importlib.rst:1066 msgid "" "Gained :meth:`~Loader.create_module` and :meth:`~Loader.exec_module` methods." msgstr "" -#: ../../library/importlib.rst:1090 +#: ../../library/importlib.rst:1073 msgid "" -":term:`Finder ` for modules declared in the Windows registry. This " -"class implements the :class:`importlib.abc.MetaPathFinder` ABC." +":term:`Finder` for modules declared in the Windows registry. This class " +"implements the :class:`importlib.abc.MetaPathFinder` ABC." msgstr "" -#: ../../library/importlib.rst:1098 +#: ../../library/importlib.rst:1081 msgid "" "Use :mod:`site` configuration instead. Future versions of Python may not " "enable this finder by default." msgstr "" -#: ../../library/importlib.rst:1105 +#: ../../library/importlib.rst:1088 msgid "" -"A :term:`Finder ` for :data:`sys.path` and package ``__path__`` " -"attributes. This class implements the :class:`importlib.abc.MetaPathFinder` " -"ABC." +"A :term:`Finder` for :data:`sys.path` and package ``__path__`` attributes. " +"This class implements the :class:`importlib.abc.MetaPathFinder` ABC." msgstr "" -#: ../../library/importlib.rst:1113 +#: ../../library/importlib.rst:1096 msgid "" "Class method that attempts to find a :term:`spec ` for the " "module specified by *fullname* on :data:`sys.path` or, if defined, on " @@ -1357,47 +1335,47 @@ msgid "" "cache and returned." msgstr "" -#: ../../library/importlib.rst:1127 +#: ../../library/importlib.rst:1110 msgid "" "If the current working directory -- represented by an empty string -- is no " "longer valid then ``None`` is returned but no value is cached in :data:`sys." "path_importer_cache`." msgstr "" -#: ../../library/importlib.rst:1134 +#: ../../library/importlib.rst:1117 msgid "A legacy wrapper around :meth:`find_spec`." msgstr "" -#: ../../library/importlib.rst:1141 +#: ../../library/importlib.rst:1124 msgid "" "Calls :meth:`importlib.abc.PathEntryFinder.invalidate_caches` on all finders " "stored in :data:`sys.path_importer_cache` that define the method. Otherwise " "entries in :data:`sys.path_importer_cache` set to ``None`` are deleted." msgstr "" -#: ../../library/importlib.rst:1146 +#: ../../library/importlib.rst:1129 msgid "Entries of ``None`` in :data:`sys.path_importer_cache` are deleted." msgstr "" -#: ../../library/importlib.rst:1149 +#: ../../library/importlib.rst:1132 msgid "" "Calls objects in :data:`sys.path_hooks` with the current working directory " "for ``''`` (i.e. the empty string)." msgstr "" -#: ../../library/importlib.rst:1156 +#: ../../library/importlib.rst:1139 msgid "" "A concrete implementation of :class:`importlib.abc.PathEntryFinder` which " "caches results from the file system." msgstr "" -#: ../../library/importlib.rst:1159 +#: ../../library/importlib.rst:1142 msgid "" "The *path* argument is the directory for which the finder is in charge of " "searching." msgstr "" -#: ../../library/importlib.rst:1162 +#: ../../library/importlib.rst:1145 msgid "" "The *loader_details* argument is a variable number of 2-item tuples each " "containing a loader and a sequence of file suffixes the loader recognizes. " @@ -1405,7 +1383,7 @@ msgid "" "module's name and the path to the file found." msgstr "" -#: ../../library/importlib.rst:1167 +#: ../../library/importlib.rst:1150 msgid "" "The finder will cache the directory contents as necessary, making stat calls " "for each module search to verify the cache is not outdated. Because cache " @@ -1418,152 +1396,152 @@ msgid "" "to call :func:`importlib.invalidate_caches`." msgstr "" -#: ../../library/importlib.rst:1181 +#: ../../library/importlib.rst:1164 msgid "The path the finder will search in." msgstr "" -#: ../../library/importlib.rst:1185 +#: ../../library/importlib.rst:1168 msgid "Attempt to find the spec to handle *fullname* within :attr:`path`." msgstr "" -#: ../../library/importlib.rst:1191 +#: ../../library/importlib.rst:1174 msgid "Attempt to find the loader to handle *fullname* within :attr:`path`." msgstr "" -#: ../../library/importlib.rst:1195 +#: ../../library/importlib.rst:1178 msgid "Clear out the internal cache." msgstr "" -#: ../../library/importlib.rst:1199 +#: ../../library/importlib.rst:1182 msgid "" "A class method which returns a closure for use on :attr:`sys.path_hooks`. An " "instance of :class:`FileFinder` is returned by the closure using the path " "argument given to the closure directly and *loader_details* indirectly." msgstr "" -#: ../../library/importlib.rst:1204 +#: ../../library/importlib.rst:1187 msgid "" "If the argument to the closure is not an existing directory, :exc:" "`ImportError` is raised." msgstr "" -#: ../../library/importlib.rst:1210 +#: ../../library/importlib.rst:1193 msgid "" "A concrete implementation of :class:`importlib.abc.SourceLoader` by " "subclassing :class:`importlib.abc.FileLoader` and providing some concrete " "implementations of other methods." msgstr "" -#: ../../library/importlib.rst:1218 +#: ../../library/importlib.rst:1201 msgid "The name of the module that this loader will handle." msgstr "" -#: ../../library/importlib.rst:1222 +#: ../../library/importlib.rst:1205 msgid "The path to the source file." msgstr "" -#: ../../library/importlib.rst:1226 +#: ../../library/importlib.rst:1209 msgid "Return ``True`` if :attr:`path` appears to be for a package." msgstr "" -#: ../../library/importlib.rst:1230 +#: ../../library/importlib.rst:1213 msgid "" "Concrete implementation of :meth:`importlib.abc.SourceLoader.path_stats`." msgstr "" -#: ../../library/importlib.rst:1234 +#: ../../library/importlib.rst:1217 msgid "Concrete implementation of :meth:`importlib.abc.SourceLoader.set_data`." msgstr "" -#: ../../library/importlib.rst:1238 ../../library/importlib.rst:1281 +#: ../../library/importlib.rst:1221 ../../library/importlib.rst:1264 msgid "" "Concrete implementation of :meth:`importlib.abc.Loader.load_module` where " "specifying the name of the module to load is optional." msgstr "" -#: ../../library/importlib.rst:1243 ../../library/importlib.rst:1286 +#: ../../library/importlib.rst:1226 ../../library/importlib.rst:1269 msgid "Use :meth:`importlib.abc.Loader.exec_module` instead." msgstr "" -#: ../../library/importlib.rst:1248 +#: ../../library/importlib.rst:1231 msgid "" "A concrete implementation of :class:`importlib.abc.FileLoader` which can " "import bytecode files (i.e. no source code files exist)." msgstr "" -#: ../../library/importlib.rst:1251 +#: ../../library/importlib.rst:1234 msgid "" "Please note that direct use of bytecode files (and thus not source code " "files) inhibits your modules from being usable by all Python implementations " "or new versions of Python which change the bytecode format." msgstr "" -#: ../../library/importlib.rst:1260 +#: ../../library/importlib.rst:1243 msgid "The name of the module the loader will handle." msgstr "" -#: ../../library/importlib.rst:1264 +#: ../../library/importlib.rst:1247 msgid "The path to the bytecode file." msgstr "" -#: ../../library/importlib.rst:1268 +#: ../../library/importlib.rst:1251 msgid "Determines if the module is a package based on :attr:`path`." msgstr "" -#: ../../library/importlib.rst:1272 +#: ../../library/importlib.rst:1255 msgid "Returns the code object for :attr:`name` created from :attr:`path`." msgstr "" -#: ../../library/importlib.rst:1276 +#: ../../library/importlib.rst:1259 msgid "" "Returns ``None`` as bytecode files have no source when this loader is used." msgstr "" -#: ../../library/importlib.rst:1291 +#: ../../library/importlib.rst:1274 msgid "" "A concrete implementation of :class:`importlib.abc.ExecutionLoader` for " "extension modules." msgstr "" -#: ../../library/importlib.rst:1294 +#: ../../library/importlib.rst:1277 msgid "" "The *fullname* argument specifies the name of the module the loader is to " "support. The *path* argument is the path to the extension module's file." msgstr "" -#: ../../library/importlib.rst:1301 +#: ../../library/importlib.rst:1284 msgid "Name of the module the loader supports." msgstr "" -#: ../../library/importlib.rst:1305 +#: ../../library/importlib.rst:1288 msgid "Path to the extension module." msgstr "" -#: ../../library/importlib.rst:1309 +#: ../../library/importlib.rst:1292 msgid "" "Creates the module object from the given specification in accordance with :" "pep:`489`." msgstr "" -#: ../../library/importlib.rst:1316 +#: ../../library/importlib.rst:1299 msgid "Initializes the given module object in accordance with :pep:`489`." msgstr "" -#: ../../library/importlib.rst:1322 +#: ../../library/importlib.rst:1305 msgid "" "Returns ``True`` if the file path points to a package's ``__init__`` module " "based on :attr:`EXTENSION_SUFFIXES`." msgstr "" -#: ../../library/importlib.rst:1327 +#: ../../library/importlib.rst:1310 msgid "Returns ``None`` as extension modules lack a code object." msgstr "" -#: ../../library/importlib.rst:1331 +#: ../../library/importlib.rst:1314 msgid "Returns ``None`` as extension modules do not have source code." msgstr "" -#: ../../library/importlib.rst:1342 +#: ../../library/importlib.rst:1325 msgid "" "A specification for a module's import-system-related state. This is " "typically exposed as the module's ``__spec__`` attribute. In the " @@ -1576,29 +1554,29 @@ msgid "" "``__spec__.submodule_search_locations``." msgstr "" -#: ../../library/importlib.rst:1356 +#: ../../library/importlib.rst:1339 msgid "(``__name__``)" msgstr "" -#: ../../library/importlib.rst:1358 +#: ../../library/importlib.rst:1341 msgid "A string for the fully-qualified name of the module." msgstr "" -#: ../../library/importlib.rst:1362 +#: ../../library/importlib.rst:1345 msgid "(``__loader__``)" msgstr "" -#: ../../library/importlib.rst:1364 +#: ../../library/importlib.rst:1347 msgid "" -"The :term:`Loader ` that should be used when loading the module. :" -"term:`Finders ` should always set this." +"The loader to use for loading. For namespace packages this should be set to " +"``None``." msgstr "" -#: ../../library/importlib.rst:1369 +#: ../../library/importlib.rst:1352 msgid "(``__file__``)" msgstr "" -#: ../../library/importlib.rst:1371 +#: ../../library/importlib.rst:1354 msgid "" "Name of the place from which the module is loaded, e.g. \"builtin\" for " "built-in modules and the filename for modules loaded from source. Normally " @@ -1606,67 +1584,66 @@ msgid "" "indicates it is unspecified (e.g. for namespace packages)." msgstr "" -#: ../../library/importlib.rst:1378 +#: ../../library/importlib.rst:1361 msgid "(``__path__``)" msgstr "" -#: ../../library/importlib.rst:1380 +#: ../../library/importlib.rst:1363 msgid "" "List of strings for where to find submodules, if a package (``None`` " "otherwise)." msgstr "" -#: ../../library/importlib.rst:1385 +#: ../../library/importlib.rst:1368 msgid "" "Container of extra module-specific data for use during loading (or ``None``)." msgstr "" -#: ../../library/importlib.rst:1390 +#: ../../library/importlib.rst:1373 msgid "(``__cached__``)" msgstr "" -#: ../../library/importlib.rst:1392 +#: ../../library/importlib.rst:1375 msgid "String for where the compiled module should be stored (or ``None``)." msgstr "" -#: ../../library/importlib.rst:1396 +#: ../../library/importlib.rst:1379 msgid "(``__package__``)" msgstr "" -#: ../../library/importlib.rst:1398 +#: ../../library/importlib.rst:1381 msgid "" -"(Read-only) The fully-qualified name of the package under which the module " -"should be loaded as a submodule (or the empty string for top-level modules). " -"For packages, it is the same as :attr:`__name__`." +"(Read-only) Fully-qualified name of the package to which the module belongs " +"as a submodule (or ``None``)." msgstr "" -#: ../../library/importlib.rst:1404 +#: ../../library/importlib.rst:1386 msgid "" "Boolean indicating whether or not the module's \"origin\" attribute refers " "to a loadable location." msgstr "" -#: ../../library/importlib.rst:1408 +#: ../../library/importlib.rst:1390 msgid ":mod:`importlib.util` -- Utility code for importers" msgstr "" -#: ../../library/importlib.rst:1414 +#: ../../library/importlib.rst:1396 msgid "**Source code:** :source:`Lib/importlib/util.py`" msgstr "" -#: ../../library/importlib.rst:1418 +#: ../../library/importlib.rst:1400 msgid "" "This module contains the various objects that help in the construction of " "an :term:`importer`." msgstr "" -#: ../../library/importlib.rst:1423 +#: ../../library/importlib.rst:1405 msgid "" "The bytes which represent the bytecode version number. If you need help with " "loading/writing bytecode then consider :class:`importlib.abc.SourceLoader`." msgstr "" -#: ../../library/importlib.rst:1430 +#: ../../library/importlib.rst:1412 msgid "" "Return the :pep:`3147`/:pep:`488` path to the byte-compiled file associated " "with the source *path*. For example, if *path* is ``/foo/bar/baz.py`` the " @@ -1676,7 +1653,7 @@ msgid "" "`NotImplementedError` will be raised)." msgstr "" -#: ../../library/importlib.rst:1437 +#: ../../library/importlib.rst:1419 msgid "" "The *optimization* parameter is used to specify the optimization level of " "the bytecode file. An empty string represents no optimization, so ``/foo/bar/" @@ -1689,7 +1666,7 @@ msgid "" "be alphanumeric, else :exc:`ValueError` is raised." msgstr "" -#: ../../library/importlib.rst:1447 +#: ../../library/importlib.rst:1429 msgid "" "The *debug_override* parameter is deprecated and can be used to override the " "system's value for ``__debug__``. A ``True`` value is the equivalent of " @@ -1698,18 +1675,18 @@ msgid "" "are not ``None`` then :exc:`TypeError` is raised." msgstr "" -#: ../../library/importlib.rst:1455 +#: ../../library/importlib.rst:1437 msgid "" "The *optimization* parameter was added and the *debug_override* parameter " "was deprecated." msgstr "" -#: ../../library/importlib.rst:1459 ../../library/importlib.rst:1475 -#: ../../library/importlib.rst:1624 +#: ../../library/importlib.rst:1441 ../../library/importlib.rst:1457 +#: ../../library/importlib.rst:1606 msgid "Accepts a :term:`path-like object`." msgstr "" -#: ../../library/importlib.rst:1465 +#: ../../library/importlib.rst:1447 msgid "" "Given the *path* to a :pep:`3147` file name, return the associated source " "code file path. For example, if *path* is ``/foo/bar/__pycache__/baz." @@ -1719,25 +1696,25 @@ msgid "" "cache_tag` is not defined, :exc:`NotImplementedError` is raised." msgstr "" -#: ../../library/importlib.rst:1480 +#: ../../library/importlib.rst:1462 msgid "" "Decode the given bytes representing source code and return it as a string " "with universal newlines (as required by :meth:`importlib.abc.InspectLoader." "get_source`)." msgstr "" -#: ../../library/importlib.rst:1488 +#: ../../library/importlib.rst:1470 msgid "Resolve a relative module name to an absolute one." msgstr "" -#: ../../library/importlib.rst:1490 +#: ../../library/importlib.rst:1472 msgid "" "If **name** has no leading dots, then **name** is simply returned. This " -"allows for usage such as ``importlib.util.resolve_name('sys', __spec__." -"parent)`` without doing a check to see if the **package** argument is needed." +"allows for usage such as ``importlib.util.resolve_name('sys', __package__)`` " +"without doing a check to see if the **package** argument is needed." msgstr "" -#: ../../library/importlib.rst:1495 +#: ../../library/importlib.rst:1477 msgid "" ":exc:`ImportError` is raised if **name** is a relative module name but " "**package** is a false value (e.g. ``None`` or the empty string). :exc:" @@ -1745,13 +1722,13 @@ msgid "" "package (e.g. requesting ``..bacon`` from within the ``spam`` package)." msgstr "" -#: ../../library/importlib.rst:1502 +#: ../../library/importlib.rst:1484 msgid "" "To improve consistency with import statements, raise :exc:`ImportError` " "instead of :exc:`ValueError` for invalid relative import attempts." msgstr "" -#: ../../library/importlib.rst:1509 +#: ../../library/importlib.rst:1491 msgid "" "Find the :term:`spec ` for a module, optionally relative to the " "specified **package** name. If the module is in :attr:`sys.modules`, then " @@ -1761,30 +1738,30 @@ msgid "" "if no spec is found." msgstr "" -#: ../../library/importlib.rst:1516 +#: ../../library/importlib.rst:1498 msgid "" "If **name** is for a submodule (contains a dot), the parent module is " "automatically imported." msgstr "" -#: ../../library/importlib.rst:1519 +#: ../../library/importlib.rst:1501 msgid "**name** and **package** work the same as for :func:`import_module`." msgstr "" -#: ../../library/importlib.rst:1523 +#: ../../library/importlib.rst:1505 msgid "" "Raises :exc:`ModuleNotFoundError` instead of :exc:`AttributeError` if " "**package** is in fact not a package (i.e. lacks a :attr:`__path__` " "attribute)." msgstr "" -#: ../../library/importlib.rst:1530 +#: ../../library/importlib.rst:1512 msgid "" "Create a new module based on **spec** and :meth:`spec.loader.create_module " "`." msgstr "" -#: ../../library/importlib.rst:1533 +#: ../../library/importlib.rst:1515 msgid "" "If :meth:`spec.loader.create_module ` " "does not return ``None``, then any pre-existing attributes will not be " @@ -1792,14 +1769,14 @@ msgid "" "accessing **spec** or setting an attribute on the module." msgstr "" -#: ../../library/importlib.rst:1538 +#: ../../library/importlib.rst:1520 msgid "" "This function is preferred over using :class:`types.ModuleType` to create a " "new module as **spec** is used to set as many import-controlled attributes " "on the module as possible." msgstr "" -#: ../../library/importlib.rst:1546 +#: ../../library/importlib.rst:1528 msgid "" "A :term:`decorator` for :meth:`importlib.abc.Loader.load_module` to handle " "selecting the proper module object to load with. The decorated method is " @@ -1809,7 +1786,7 @@ msgid "" "work on static methods because of the assumption of two arguments." msgstr "" -#: ../../library/importlib.rst:1555 +#: ../../library/importlib.rst:1537 msgid "" "The decorated method will take in the **name** of the module to be loaded as " "expected for a :term:`loader`. If the module is not found in :data:`sys." @@ -1819,7 +1796,7 @@ msgid "" "available). These attributes are set unconditionally to support reloading." msgstr "" -#: ../../library/importlib.rst:1563 +#: ../../library/importlib.rst:1545 msgid "" "If an exception is raised by the decorated method and a module was added to :" "data:`sys.modules`, then the module will be removed to prevent a partially " @@ -1827,25 +1804,25 @@ msgid "" "was already in :data:`sys.modules` then it is left alone." msgstr "" -#: ../../library/importlib.rst:1568 +#: ../../library/importlib.rst:1550 msgid "" ":attr:`__loader__` and :attr:`__package__` are automatically set (when " "possible)." msgstr "" -#: ../../library/importlib.rst:1572 +#: ../../library/importlib.rst:1554 msgid "" "Set :attr:`__name__`, :attr:`__loader__` :attr:`__package__` unconditionally " "to support reloading." msgstr "" -#: ../../library/importlib.rst:1576 +#: ../../library/importlib.rst:1558 msgid "" "The import machinery now directly performs all the functionality provided by " "this function." msgstr "" -#: ../../library/importlib.rst:1582 +#: ../../library/importlib.rst:1564 msgid "" "A :term:`decorator` for :meth:`importlib.abc.Loader.load_module` to set the :" "attr:`__loader__` attribute on the returned module. If the attribute is " @@ -1854,23 +1831,23 @@ msgid "" "`__loader__` should be set to." msgstr "" -#: ../../library/importlib.rst:1589 +#: ../../library/importlib.rst:1571 msgid "" "Set ``__loader__`` if set to ``None``, as if the attribute does not exist." msgstr "" -#: ../../library/importlib.rst:1593 ../../library/importlib.rst:1602 +#: ../../library/importlib.rst:1575 ../../library/importlib.rst:1584 msgid "The import machinery takes care of this automatically." msgstr "" -#: ../../library/importlib.rst:1598 +#: ../../library/importlib.rst:1580 msgid "" "A :term:`decorator` for :meth:`importlib.abc.Loader.load_module` to set the :" "attr:`__package__` attribute on the returned module. If :attr:`__package__` " "is set and has a value other than ``None`` it will not be changed." msgstr "" -#: ../../library/importlib.rst:1607 +#: ../../library/importlib.rst:1589 msgid "" "A factory function for creating a :class:`ModuleSpec` instance based on a " "loader. The parameters have the same meaning as they do for ModuleSpec. " @@ -1878,27 +1855,27 @@ msgid "" "`InspectLoader.is_package`, to fill in any missing information on the spec." msgstr "" -#: ../../library/importlib.rst:1617 +#: ../../library/importlib.rst:1599 msgid "" "A factory function for creating a :class:`ModuleSpec` instance based on the " "path to a file. Missing information will be filled in on the spec by making " "use of loader APIs and by the implication that the module will be file-based." msgstr "" -#: ../../library/importlib.rst:1629 +#: ../../library/importlib.rst:1611 msgid "" "Return the hash of *source_bytes* as bytes. A hash-based ``.pyc`` file " "embeds the :func:`source_hash` of the corresponding source file's contents " "in its header." msgstr "" -#: ../../library/importlib.rst:1637 +#: ../../library/importlib.rst:1619 msgid "" "A class which postpones the execution of the loader of a module until the " "module has an attribute accessed." msgstr "" -#: ../../library/importlib.rst:1640 +#: ../../library/importlib.rst:1622 msgid "" "This class **only** works with loaders that define :meth:`~importlib.abc." "Loader.exec_module` as control over what module type is used for the module " @@ -1911,7 +1888,7 @@ msgid "" "raised if such a substitution is detected." msgstr "" -#: ../../library/importlib.rst:1651 +#: ../../library/importlib.rst:1633 msgid "" "For projects where startup time is critical, this class allows for " "potentially minimizing the cost of loading a module if it is never used. For " @@ -1920,58 +1897,58 @@ msgid "" "postponed and thus occurring out of context." msgstr "" -#: ../../library/importlib.rst:1659 +#: ../../library/importlib.rst:1641 msgid "" "Began calling :meth:`~importlib.abc.Loader.create_module`, removing the " "compatibility warning for :class:`importlib.machinery.BuiltinImporter` and :" "class:`importlib.machinery.ExtensionFileLoader`." msgstr "" -#: ../../library/importlib.rst:1666 +#: ../../library/importlib.rst:1648 msgid "" "A static method which returns a callable that creates a lazy loader. This is " "meant to be used in situations where the loader is passed by class instead " "of by instance. ::" msgstr "" -#: ../../library/importlib.rst:1679 +#: ../../library/importlib.rst:1661 msgid "Examples" msgstr "" -#: ../../library/importlib.rst:1682 +#: ../../library/importlib.rst:1664 msgid "Importing programmatically" msgstr "" -#: ../../library/importlib.rst:1684 +#: ../../library/importlib.rst:1666 msgid "" "To programmatically import a module, use :func:`importlib.import_module`. ::" msgstr "" -#: ../../library/importlib.rst:1693 +#: ../../library/importlib.rst:1675 msgid "Checking if a module can be imported" msgstr "" -#: ../../library/importlib.rst:1695 +#: ../../library/importlib.rst:1677 msgid "" "If you need to find out if a module can be imported without actually doing " "the import, then you should use :func:`importlib.util.find_spec`. ::" msgstr "" -#: ../../library/importlib.rst:1718 +#: ../../library/importlib.rst:1700 msgid "Importing a source file directly" msgstr "" -#: ../../library/importlib.rst:1720 +#: ../../library/importlib.rst:1702 msgid "" "To import a Python source file directly, use the following recipe (Python " "3.5 and newer only)::" msgstr "" -#: ../../library/importlib.rst:1739 +#: ../../library/importlib.rst:1721 msgid "Setting up an importer" msgstr "" -#: ../../library/importlib.rst:1741 +#: ../../library/importlib.rst:1723 msgid "" "For deep customizations of import, you typically want to implement an :term:" "`importer`. This means managing both the :term:`finder` and :term:`loader` " @@ -1985,11 +1962,11 @@ msgid "" "for the appropriate classes defined within this package)::" msgstr "" -#: ../../library/importlib.rst:1773 +#: ../../library/importlib.rst:1755 msgid "Approximating :func:`importlib.import_module`" msgstr "" -#: ../../library/importlib.rst:1775 +#: ../../library/importlib.rst:1757 msgid "" "Import itself is implemented in Python code, making it possible to expose " "most of the import machinery through importlib. The following helps " diff --git a/library/io.po b/library/io.po index fe5fd9b113..12c2b230eb 100644 --- a/library/io.po +++ b/library/io.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.7\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2021-09-07 06:52+0000\n" +"POT-Creation-Date: 2020-06-20 18:08+0800\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-" @@ -63,7 +63,7 @@ msgid "" "since :exc:`IOError` is now an alias of :exc:`OSError`." msgstr "" -#: ../../library/io.rst:51 ../../library/io.rst:774 ../../library/io.rst:1031 +#: ../../library/io.rst:51 ../../library/io.rst:781 ../../library/io.rst:1038 msgid "Text I/O" msgstr "" @@ -92,7 +92,7 @@ msgid "" "`TextIOBase`." msgstr "" -#: ../../library/io.rst:72 ../../library/io.rst:1019 +#: ../../library/io.rst:72 ../../library/io.rst:1026 msgid "Binary I/O" msgstr "" @@ -160,7 +160,7 @@ msgstr "" msgid "This is an alias for the builtin :func:`open` function." msgstr "" -#: ../../library/io.rst:123 +#: ../../library/io.rst:None msgid "" "Raises an :ref:`auditing event ` ``open`` with arguments ``path``, " "``mode``, ``flags``." @@ -204,21 +204,34 @@ msgid "" "when an unsupported operation is called on a stream." msgstr "" +#: ../../library/io.rst:159 +msgid "In-memory streams" +msgstr "" + #: ../../library/io.rst:161 +msgid "" +"It is also possible to use a :class:`str` or :term:`bytes-like object` as a " +"file for both reading and writing. For strings :class:`StringIO` can be " +"used like a file opened in text mode. :class:`BytesIO` can be used like a " +"file opened in binary mode. Both provide full read-write capabilities with " +"random access." +msgstr "" + +#: ../../library/io.rst:171 msgid ":mod:`sys`" msgstr "" -#: ../../library/io.rst:161 +#: ../../library/io.rst:171 msgid "" "contains the standard IO streams: :data:`sys.stdin`, :data:`sys.stdout`, " "and :data:`sys.stderr`." msgstr "" -#: ../../library/io.rst:166 +#: ../../library/io.rst:176 msgid "Class hierarchy" msgstr "" -#: ../../library/io.rst:168 +#: ../../library/io.rst:178 msgid "" "The implementation of I/O streams is organized as a hierarchy of classes. " "First :term:`abstract base classes ` (ABCs), which are " @@ -226,7 +239,7 @@ msgid "" "providing the standard stream implementations." msgstr "" -#: ../../library/io.rst:175 +#: ../../library/io.rst:185 msgid "" "The abstract base classes also provide default implementations of some " "methods in order to help implementation of concrete stream classes. For " @@ -234,7 +247,7 @@ msgid "" "meth:`~IOBase.readinto` and :meth:`~IOBase.readline`." msgstr "" -#: ../../library/io.rst:180 +#: ../../library/io.rst:190 msgid "" "At the top of the I/O hierarchy is the abstract base class :class:`IOBase`. " "It defines the basic interface to a stream. Note, however, that there is no " @@ -243,14 +256,14 @@ msgid "" "operation." msgstr "" -#: ../../library/io.rst:185 +#: ../../library/io.rst:195 msgid "" "The :class:`RawIOBase` ABC extends :class:`IOBase`. It deals with the " "reading and writing of bytes to a stream. :class:`FileIO` subclasses :class:" "`RawIOBase` to provide an interface to files in the machine's file system." msgstr "" -#: ../../library/io.rst:189 +#: ../../library/io.rst:199 msgid "" "The :class:`BufferedIOBase` ABC extends :class:`IOBase`. It deals with " "buffering on a raw binary stream (:class:`RawIOBase`). Its subclasses, :" @@ -261,7 +274,7 @@ msgid "" "class:`BytesIO`, is a stream of in-memory bytes." msgstr "" -#: ../../library/io.rst:197 +#: ../../library/io.rst:207 msgid "" "The :class:`TextIOBase` ABC extends :class:`IOBase`. It deals with streams " "whose bytes represent text, and handles encoding and decoding to and from " @@ -270,104 +283,104 @@ msgid "" "Finally, :class:`StringIO` is an in-memory stream for text." msgstr "" -#: ../../library/io.rst:203 +#: ../../library/io.rst:213 msgid "" "Argument names are not part of the specification, and only the arguments of :" "func:`open` are intended to be used as keyword arguments." msgstr "" -#: ../../library/io.rst:206 +#: ../../library/io.rst:216 msgid "" "The following table summarizes the ABCs provided by the :mod:`io` module:" msgstr "" -#: ../../library/io.rst:211 +#: ../../library/io.rst:221 msgid "ABC" msgstr "" -#: ../../library/io.rst:211 +#: ../../library/io.rst:221 msgid "Inherits" msgstr "" -#: ../../library/io.rst:211 +#: ../../library/io.rst:221 msgid "Stub Methods" msgstr "" -#: ../../library/io.rst:211 +#: ../../library/io.rst:221 msgid "Mixin Methods and Properties" msgstr "" -#: ../../library/io.rst:213 ../../library/io.rst:218 ../../library/io.rst:220 -#: ../../library/io.rst:222 +#: ../../library/io.rst:223 ../../library/io.rst:228 ../../library/io.rst:230 +#: ../../library/io.rst:232 msgid ":class:`IOBase`" msgstr "" -#: ../../library/io.rst:213 +#: ../../library/io.rst:223 msgid "``fileno``, ``seek``, and ``truncate``" msgstr "" -#: ../../library/io.rst:213 +#: ../../library/io.rst:223 msgid "" "``close``, ``closed``, ``__enter__``, ``__exit__``, ``flush``, ``isatty``, " "``__iter__``, ``__next__``, ``readable``, ``readline``, ``readlines``, " "``seekable``, ``tell``, ``writable``, and ``writelines``" msgstr "" -#: ../../library/io.rst:218 +#: ../../library/io.rst:228 msgid ":class:`RawIOBase`" msgstr "" -#: ../../library/io.rst:218 +#: ../../library/io.rst:228 msgid "``readinto`` and ``write``" msgstr "" -#: ../../library/io.rst:218 +#: ../../library/io.rst:228 msgid "Inherited :class:`IOBase` methods, ``read``, and ``readall``" msgstr "" -#: ../../library/io.rst:220 +#: ../../library/io.rst:230 msgid ":class:`BufferedIOBase`" msgstr "" -#: ../../library/io.rst:220 +#: ../../library/io.rst:230 msgid "``detach``, ``read``, ``read1``, and ``write``" msgstr "" -#: ../../library/io.rst:220 +#: ../../library/io.rst:230 msgid "Inherited :class:`IOBase` methods, ``readinto``, and ``readinto1``" msgstr "" -#: ../../library/io.rst:222 +#: ../../library/io.rst:232 msgid ":class:`TextIOBase`" msgstr "" -#: ../../library/io.rst:222 +#: ../../library/io.rst:232 msgid "``detach``, ``read``, ``readline``, and ``write``" msgstr "" -#: ../../library/io.rst:222 +#: ../../library/io.rst:232 msgid "" "Inherited :class:`IOBase` methods, ``encoding``, ``errors``, and ``newlines``" msgstr "" -#: ../../library/io.rst:229 +#: ../../library/io.rst:239 msgid "I/O Base Classes" msgstr "" -#: ../../library/io.rst:233 +#: ../../library/io.rst:243 msgid "" "The abstract base class for all I/O classes, acting on streams of bytes. " "There is no public constructor." msgstr "" -#: ../../library/io.rst:236 +#: ../../library/io.rst:246 msgid "" "This class provides empty abstract implementations for many methods that " "derived classes can override selectively; the default implementations " "represent a file that cannot be read, written or seeked." msgstr "" -#: ../../library/io.rst:241 +#: ../../library/io.rst:251 msgid "" "Even though :class:`IOBase` does not declare :meth:`read` or :meth:`write` " "because their signatures will vary, implementations and clients should " @@ -376,20 +389,20 @@ msgid "" "they do not support are called." msgstr "" -#: ../../library/io.rst:247 +#: ../../library/io.rst:257 msgid "" "The basic type used for binary data read from or written to a file is :class:" "`bytes`. Other :term:`bytes-like objects ` are accepted " "as method arguments too. Text I/O classes work with :class:`str` data." msgstr "" -#: ../../library/io.rst:251 +#: ../../library/io.rst:261 msgid "" "Note that calling any method (even inquiries) on a closed stream is " "undefined. Implementations may raise :exc:`ValueError` in this case." msgstr "" -#: ../../library/io.rst:254 +#: ../../library/io.rst:264 msgid "" ":class:`IOBase` (and its subclasses) supports the iterator protocol, meaning " "that an :class:`IOBase` object can be iterated over yielding the lines in a " @@ -398,140 +411,135 @@ msgid "" "character strings). See :meth:`~IOBase.readline` below." msgstr "" -#: ../../library/io.rst:260 +#: ../../library/io.rst:270 msgid "" ":class:`IOBase` is also a context manager and therefore supports the :" "keyword:`with` statement. In this example, *file* is closed after the :" "keyword:`!with` statement's suite is finished---even if an exception occurs::" msgstr "" -#: ../../library/io.rst:267 +#: ../../library/io.rst:277 msgid ":class:`IOBase` provides these data attributes and methods:" msgstr "" -#: ../../library/io.rst:271 +#: ../../library/io.rst:281 msgid "" "Flush and close this stream. This method has no effect if the file is " "already closed. Once the file is closed, any operation on the file (e.g. " "reading or writing) will raise a :exc:`ValueError`." msgstr "" -#: ../../library/io.rst:275 +#: ../../library/io.rst:285 msgid "" "As a convenience, it is allowed to call this method more than once; only the " "first call, however, will have an effect." msgstr "" -#: ../../library/io.rst:280 +#: ../../library/io.rst:290 msgid "``True`` if the stream is closed." msgstr "" -#: ../../library/io.rst:284 +#: ../../library/io.rst:294 msgid "" "Return the underlying file descriptor (an integer) of the stream if it " "exists. An :exc:`OSError` is raised if the IO object does not use a file " "descriptor." msgstr "" -#: ../../library/io.rst:290 +#: ../../library/io.rst:300 msgid "" "Flush the write buffers of the stream if applicable. This does nothing for " "read-only and non-blocking streams." msgstr "" -#: ../../library/io.rst:295 +#: ../../library/io.rst:305 msgid "" "Return ``True`` if the stream is interactive (i.e., connected to a terminal/" "tty device)." msgstr "" -#: ../../library/io.rst:300 +#: ../../library/io.rst:310 msgid "" "Return ``True`` if the stream can be read from. If ``False``, :meth:`read` " "will raise :exc:`OSError`." msgstr "" -#: ../../library/io.rst:305 +#: ../../library/io.rst:315 msgid "" "Read and return one line from the stream. If *size* is specified, at most " "*size* bytes will be read." msgstr "" -#: ../../library/io.rst:308 +#: ../../library/io.rst:318 msgid "" "The line terminator is always ``b'\\n'`` for binary files; for text files, " "the *newline* argument to :func:`open` can be used to select the line " "terminator(s) recognized." msgstr "" -#: ../../library/io.rst:314 +#: ../../library/io.rst:324 msgid "" "Read and return a list of lines from the stream. *hint* can be specified to " "control the number of lines read: no more lines will be read if the total " "size (in bytes/characters) of all lines so far exceeds *hint*." msgstr "" -#: ../../library/io.rst:318 -msgid "" -"*hint* values of ``0`` or less, as well as ``None``, are treated as no hint." -msgstr "" - -#: ../../library/io.rst:321 +#: ../../library/io.rst:328 msgid "" "Note that it's already possible to iterate on file objects using ``for line " "in file: ...`` without calling ``file.readlines()``." msgstr "" -#: ../../library/io.rst:326 +#: ../../library/io.rst:333 msgid "" "Change the stream position to the given byte *offset*. *offset* is " "interpreted relative to the position indicated by *whence*. The default " "value for *whence* is :data:`SEEK_SET`. Values for *whence* are:" msgstr "" -#: ../../library/io.rst:330 +#: ../../library/io.rst:337 msgid "" ":data:`SEEK_SET` or ``0`` -- start of the stream (the default); *offset* " "should be zero or positive" msgstr "" -#: ../../library/io.rst:332 +#: ../../library/io.rst:339 msgid "" ":data:`SEEK_CUR` or ``1`` -- current stream position; *offset* may be " "negative" msgstr "" -#: ../../library/io.rst:334 +#: ../../library/io.rst:341 msgid "" ":data:`SEEK_END` or ``2`` -- end of the stream; *offset* is usually negative" msgstr "" -#: ../../library/io.rst:337 +#: ../../library/io.rst:344 msgid "Return the new absolute position." msgstr "" -#: ../../library/io.rst:339 ../../library/io.rst:850 +#: ../../library/io.rst:346 ../../library/io.rst:857 msgid "The ``SEEK_*`` constants." msgstr "" -#: ../../library/io.rst:342 +#: ../../library/io.rst:349 msgid "" "Some operating systems could support additional values, like :data:`os." "SEEK_HOLE` or :data:`os.SEEK_DATA`. The valid values for a file could depend " "on it being open in text or binary mode." msgstr "" -#: ../../library/io.rst:349 +#: ../../library/io.rst:356 msgid "" "Return ``True`` if the stream supports random access. If ``False``, :meth:" "`seek`, :meth:`tell` and :meth:`truncate` will raise :exc:`OSError`." msgstr "" -#: ../../library/io.rst:354 +#: ../../library/io.rst:361 msgid "Return the current stream position." msgstr "" -#: ../../library/io.rst:358 +#: ../../library/io.rst:365 msgid "" "Resize the stream to the given *size* in bytes (or the current position if " "*size* is not specified). The current stream position isn't changed. This " @@ -540,36 +548,36 @@ msgid "" "additional bytes are zero-filled). The new file size is returned." msgstr "" -#: ../../library/io.rst:365 +#: ../../library/io.rst:372 msgid "Windows will now zero-fill files when extending." msgstr "" -#: ../../library/io.rst:370 +#: ../../library/io.rst:377 msgid "" "Return ``True`` if the stream supports writing. If ``False``, :meth:`write` " "and :meth:`truncate` will raise :exc:`OSError`." msgstr "" -#: ../../library/io.rst:375 +#: ../../library/io.rst:382 msgid "" "Write a list of lines to the stream. Line separators are not added, so it " "is usual for each of the lines provided to have a line separator at the end." msgstr "" -#: ../../library/io.rst:381 +#: ../../library/io.rst:388 msgid "" "Prepare for object destruction. :class:`IOBase` provides a default " "implementation of this method that calls the instance's :meth:`~IOBase." "close` method." msgstr "" -#: ../../library/io.rst:388 +#: ../../library/io.rst:395 msgid "" "Base class for raw binary streams. It inherits :class:`IOBase`. There is " "no public constructor." msgstr "" -#: ../../library/io.rst:391 +#: ../../library/io.rst:398 msgid "" "Raw binary streams typically provide low-level access to an underlying OS " "device or API, and do not try to encapsulate it in high-level primitives " @@ -577,13 +585,13 @@ msgid "" "text streams, described later in this page)." msgstr "" -#: ../../library/io.rst:396 +#: ../../library/io.rst:403 msgid "" ":class:`RawIOBase` provides these methods in addition to those from :class:" "`IOBase`:" msgstr "" -#: ../../library/io.rst:401 +#: ../../library/io.rst:408 msgid "" "Read up to *size* bytes from the object and return them. As a convenience, " "if *size* is unspecified or -1, all bytes until EOF are returned. Otherwise, " @@ -591,25 +599,25 @@ msgid "" "if the operating system call returns fewer than *size* bytes." msgstr "" -#: ../../library/io.rst:406 +#: ../../library/io.rst:413 msgid "" "If 0 bytes are returned, and *size* was not 0, this indicates end of file. " "If the object is in non-blocking mode and no bytes are available, ``None`` " "is returned." msgstr "" -#: ../../library/io.rst:410 +#: ../../library/io.rst:417 msgid "" "The default implementation defers to :meth:`readall` and :meth:`readinto`." msgstr "" -#: ../../library/io.rst:415 +#: ../../library/io.rst:422 msgid "" "Read and return all the bytes from the stream until EOF, using multiple " "calls to the stream if necessary." msgstr "" -#: ../../library/io.rst:420 +#: ../../library/io.rst:427 msgid "" "Read bytes into a pre-allocated, writable :term:`bytes-like object` *b*, and " "return the number of bytes read. For example, *b* might be a :class:" @@ -617,7 +625,7 @@ msgid "" "available, ``None`` is returned." msgstr "" -#: ../../library/io.rst:428 +#: ../../library/io.rst:435 msgid "" "Write the given :term:`bytes-like object`, *b*, to the underlying raw " "stream, and return the number of bytes written. This can be less than the " @@ -628,13 +636,13 @@ msgid "" "the implementation should only access *b* during the method call." msgstr "" -#: ../../library/io.rst:441 +#: ../../library/io.rst:448 msgid "" "Base class for binary streams that support some kind of buffering. It " "inherits :class:`IOBase`. There is no public constructor." msgstr "" -#: ../../library/io.rst:444 +#: ../../library/io.rst:451 msgid "" "The main difference with :class:`RawIOBase` is that methods :meth:`read`, :" "meth:`readinto` and :meth:`write` will try (respectively) to read as much " @@ -642,7 +650,7 @@ msgid "" "perhaps more than one system call." msgstr "" -#: ../../library/io.rst:449 +#: ../../library/io.rst:456 msgid "" "In addition, those methods can raise :exc:`BlockingIOError` if the " "underlying raw stream is in non-blocking mode and cannot take or give enough " @@ -650,55 +658,55 @@ msgid "" "``None``." msgstr "" -#: ../../library/io.rst:454 +#: ../../library/io.rst:461 msgid "" "Besides, the :meth:`read` method does not have a default implementation that " "defers to :meth:`readinto`." msgstr "" -#: ../../library/io.rst:457 +#: ../../library/io.rst:464 msgid "" "A typical :class:`BufferedIOBase` implementation should not inherit from a :" "class:`RawIOBase` implementation, but wrap one, like :class:`BufferedWriter` " "and :class:`BufferedReader` do." msgstr "" -#: ../../library/io.rst:461 +#: ../../library/io.rst:468 msgid "" ":class:`BufferedIOBase` provides or overrides these data attributes and " "methods in addition to those from :class:`IOBase`:" msgstr "" -#: ../../library/io.rst:466 +#: ../../library/io.rst:473 msgid "" "The underlying raw stream (a :class:`RawIOBase` instance) that :class:" "`BufferedIOBase` deals with. This is not part of the :class:" "`BufferedIOBase` API and may not exist on some implementations." msgstr "" -#: ../../library/io.rst:472 +#: ../../library/io.rst:479 msgid "Separate the underlying raw stream from the buffer and return it." msgstr "" -#: ../../library/io.rst:474 +#: ../../library/io.rst:481 msgid "" "After the raw stream has been detached, the buffer is in an unusable state." msgstr "" -#: ../../library/io.rst:477 +#: ../../library/io.rst:484 msgid "" "Some buffers, like :class:`BytesIO`, do not have the concept of a single raw " "stream to return from this method. They raise :exc:`UnsupportedOperation`." msgstr "" -#: ../../library/io.rst:485 +#: ../../library/io.rst:492 msgid "" "Read and return up to *size* bytes. If the argument is omitted, ``None``, " "or negative, data is read and returned until EOF is reached. An empty :" "class:`bytes` object is returned if the stream is already at EOF." msgstr "" -#: ../../library/io.rst:489 +#: ../../library/io.rst:496 msgid "" "If the argument is positive, and the underlying raw stream is not " "interactive, multiple raw reads may be issued to satisfy the byte count " @@ -707,13 +715,13 @@ msgid "" "imminent." msgstr "" -#: ../../library/io.rst:495 ../../library/io.rst:518 ../../library/io.rst:528 +#: ../../library/io.rst:502 ../../library/io.rst:525 ../../library/io.rst:535 msgid "" "A :exc:`BlockingIOError` is raised if the underlying raw stream is in non " "blocking-mode, and has no data available at the moment." msgstr "" -#: ../../library/io.rst:500 +#: ../../library/io.rst:507 msgid "" "Read and return up to *size* bytes, with at most one call to the underlying " "raw stream's :meth:`~RawIOBase.read` (or :meth:`~RawIOBase.readinto`) " @@ -721,26 +729,26 @@ msgid "" "top of a :class:`BufferedIOBase` object." msgstr "" -#: ../../library/io.rst:506 +#: ../../library/io.rst:513 msgid "" "If *size* is ``-1`` (the default), an arbitrary number of bytes are returned " "(more than zero unless EOF is reached)." msgstr "" -#: ../../library/io.rst:511 +#: ../../library/io.rst:518 msgid "" "Read bytes into a pre-allocated, writable :term:`bytes-like object` *b* and " "return the number of bytes read. For example, *b* might be a :class:" "`bytearray`." msgstr "" -#: ../../library/io.rst:515 +#: ../../library/io.rst:522 msgid "" "Like :meth:`read`, multiple reads may be issued to the underlying raw " "stream, unless the latter is interactive." msgstr "" -#: ../../library/io.rst:523 +#: ../../library/io.rst:530 msgid "" "Read bytes into a pre-allocated, writable :term:`bytes-like object` *b*, " "using at most one call to the underlying raw stream's :meth:`~RawIOBase." @@ -748,7 +756,7 @@ msgid "" "read." msgstr "" -#: ../../library/io.rst:535 +#: ../../library/io.rst:542 msgid "" "Write the given :term:`bytes-like object`, *b*, and return the number of " "bytes written (always equal to the length of *b* in bytes, since if the " @@ -757,41 +765,41 @@ msgid "" "or held in a buffer for performance and latency reasons." msgstr "" -#: ../../library/io.rst:542 +#: ../../library/io.rst:549 msgid "" "When in non-blocking mode, a :exc:`BlockingIOError` is raised if the data " "needed to be written to the raw stream but it couldn't accept all the data " "without blocking." msgstr "" -#: ../../library/io.rst:546 +#: ../../library/io.rst:553 msgid "" "The caller may release or mutate *b* after this method returns, so the " "implementation should only access *b* during the method call." msgstr "" -#: ../../library/io.rst:551 +#: ../../library/io.rst:558 msgid "Raw File I/O" msgstr "" -#: ../../library/io.rst:555 +#: ../../library/io.rst:562 msgid "" "A raw binary stream representing an OS-level file containing bytes data. It " "inherits :class:`RawIOBase`." msgstr "" -#: ../../library/io.rst:558 +#: ../../library/io.rst:565 msgid "The *name* can be one of two things:" msgstr "" -#: ../../library/io.rst:560 +#: ../../library/io.rst:567 msgid "" "a character string or :class:`bytes` object representing the path to the " "file which will be opened. In this case closefd must be ``True`` (the " "default) otherwise an error will be raised." msgstr "" -#: ../../library/io.rst:563 +#: ../../library/io.rst:570 msgid "" "an integer representing the number of an existing OS-level file descriptor " "to which the resulting :class:`FileIO` object will give access. When the " @@ -799,7 +807,7 @@ msgid "" "set to ``False``." msgstr "" -#: ../../library/io.rst:568 +#: ../../library/io.rst:575 msgid "" "The *mode* can be ``'r'``, ``'w'``, ``'x'`` or ``'a'`` for reading " "(default), writing, exclusive creation or appending. The file will be " @@ -810,13 +818,13 @@ msgid "" "``'+'`` to the mode to allow simultaneous reading and writing." msgstr "" -#: ../../library/io.rst:576 +#: ../../library/io.rst:583 msgid "" "The :meth:`read` (when called with a positive argument), :meth:`readinto` " "and :meth:`write` methods on this class will only make one system call." msgstr "" -#: ../../library/io.rst:579 +#: ../../library/io.rst:586 msgid "" "A custom opener can be used by passing a callable as *opener*. The " "underlying file descriptor for the file object is then obtained by calling " @@ -825,379 +833,379 @@ msgid "" "similar to passing ``None``)." msgstr "" -#: ../../library/io.rst:585 +#: ../../library/io.rst:592 msgid "The newly created file is :ref:`non-inheritable `." msgstr "" -#: ../../library/io.rst:587 +#: ../../library/io.rst:594 msgid "" "See the :func:`open` built-in function for examples on using the *opener* " "parameter." msgstr "" -#: ../../library/io.rst:590 +#: ../../library/io.rst:597 msgid "The *opener* parameter was added. The ``'x'`` mode was added." msgstr "" -#: ../../library/io.rst:594 +#: ../../library/io.rst:601 msgid "The file is now non-inheritable." msgstr "" -#: ../../library/io.rst:597 +#: ../../library/io.rst:604 msgid "" ":class:`FileIO` provides these data attributes in addition to those from :" "class:`RawIOBase` and :class:`IOBase`:" msgstr "" -#: ../../library/io.rst:602 +#: ../../library/io.rst:609 msgid "The mode as given in the constructor." msgstr "" -#: ../../library/io.rst:606 +#: ../../library/io.rst:613 msgid "" "The file name. This is the file descriptor of the file when no name is " "given in the constructor." msgstr "" -#: ../../library/io.rst:611 +#: ../../library/io.rst:618 msgid "Buffered Streams" msgstr "" -#: ../../library/io.rst:613 +#: ../../library/io.rst:620 msgid "" "Buffered I/O streams provide a higher-level interface to an I/O device than " "raw I/O does." msgstr "" -#: ../../library/io.rst:618 +#: ../../library/io.rst:625 msgid "" "A binary stream using an in-memory bytes buffer. It inherits :class:" "`BufferedIOBase`. The buffer is discarded when the :meth:`~IOBase.close` " "method is called." msgstr "" -#: ../../library/io.rst:622 +#: ../../library/io.rst:629 msgid "" "The optional argument *initial_bytes* is a :term:`bytes-like object` that " "contains initial data." msgstr "" -#: ../../library/io.rst:625 +#: ../../library/io.rst:632 msgid "" ":class:`BytesIO` provides or overrides these methods in addition to those " "from :class:`BufferedIOBase` and :class:`IOBase`:" msgstr "" -#: ../../library/io.rst:630 +#: ../../library/io.rst:637 msgid "" "Return a readable and writable view over the contents of the buffer without " "copying them. Also, mutating the view will transparently update the " "contents of the buffer::" msgstr "" -#: ../../library/io.rst:641 +#: ../../library/io.rst:648 msgid "" "As long as the view exists, the :class:`BytesIO` object cannot be resized or " "closed." msgstr "" -#: ../../library/io.rst:648 +#: ../../library/io.rst:655 msgid "Return :class:`bytes` containing the entire contents of the buffer." msgstr "" -#: ../../library/io.rst:653 +#: ../../library/io.rst:660 msgid "In :class:`BytesIO`, this is the same as :meth:`~BufferedIOBase.read`." msgstr "" -#: ../../library/io.rst:655 ../../library/io.rst:698 +#: ../../library/io.rst:662 ../../library/io.rst:705 msgid "The *size* argument is now optional." msgstr "" -#: ../../library/io.rst:660 +#: ../../library/io.rst:667 msgid "" "In :class:`BytesIO`, this is the same as :meth:`~BufferedIOBase.readinto`." msgstr "" -#: ../../library/io.rst:666 +#: ../../library/io.rst:673 msgid "" "A buffered binary stream providing higher-level access to a readable, non " "seekable :class:`RawIOBase` raw binary stream. It inherits :class:" "`BufferedIOBase`." msgstr "" -#: ../../library/io.rst:670 +#: ../../library/io.rst:677 msgid "" "When reading data from this object, a larger amount of data may be requested " "from the underlying raw stream, and kept in an internal buffer. The buffered " "data can then be returned directly on subsequent reads." msgstr "" -#: ../../library/io.rst:674 +#: ../../library/io.rst:681 msgid "" "The constructor creates a :class:`BufferedReader` for the given readable " "*raw* stream and *buffer_size*. If *buffer_size* is omitted, :data:" "`DEFAULT_BUFFER_SIZE` is used." msgstr "" -#: ../../library/io.rst:678 +#: ../../library/io.rst:685 msgid "" ":class:`BufferedReader` provides or overrides these methods in addition to " "those from :class:`BufferedIOBase` and :class:`IOBase`:" msgstr "" -#: ../../library/io.rst:683 +#: ../../library/io.rst:690 msgid "" "Return bytes from the stream without advancing the position. At most one " "single read on the raw stream is done to satisfy the call. The number of " "bytes returned may be less or more than requested." msgstr "" -#: ../../library/io.rst:689 +#: ../../library/io.rst:696 msgid "" "Read and return *size* bytes, or if *size* is not given or negative, until " "EOF or if the read call would block in non-blocking mode." msgstr "" -#: ../../library/io.rst:694 +#: ../../library/io.rst:701 msgid "" "Read and return up to *size* bytes with only one call on the raw stream. If " "at least one byte is buffered, only buffered bytes are returned. Otherwise, " "one raw stream read call is made." msgstr "" -#: ../../library/io.rst:704 +#: ../../library/io.rst:711 msgid "" "A buffered binary stream providing higher-level access to a writeable, non " "seekable :class:`RawIOBase` raw binary stream. It inherits :class:" "`BufferedIOBase`." msgstr "" -#: ../../library/io.rst:708 +#: ../../library/io.rst:715 msgid "" "When writing to this object, data is normally placed into an internal " "buffer. The buffer will be written out to the underlying :class:`RawIOBase` " "object under various conditions, including:" msgstr "" -#: ../../library/io.rst:712 +#: ../../library/io.rst:719 msgid "when the buffer gets too small for all pending data;" msgstr "" -#: ../../library/io.rst:713 +#: ../../library/io.rst:720 msgid "when :meth:`flush()` is called;" msgstr "" -#: ../../library/io.rst:714 +#: ../../library/io.rst:721 msgid "" "when a :meth:`seek()` is requested (for :class:`BufferedRandom` objects);" msgstr "" -#: ../../library/io.rst:715 +#: ../../library/io.rst:722 msgid "when the :class:`BufferedWriter` object is closed or destroyed." msgstr "" -#: ../../library/io.rst:717 +#: ../../library/io.rst:724 msgid "" "The constructor creates a :class:`BufferedWriter` for the given writeable " "*raw* stream. If the *buffer_size* is not given, it defaults to :data:" "`DEFAULT_BUFFER_SIZE`." msgstr "" -#: ../../library/io.rst:721 +#: ../../library/io.rst:728 msgid "" ":class:`BufferedWriter` provides or overrides these methods in addition to " "those from :class:`BufferedIOBase` and :class:`IOBase`:" msgstr "" -#: ../../library/io.rst:726 +#: ../../library/io.rst:733 msgid "" "Force bytes held in the buffer into the raw stream. A :exc:" "`BlockingIOError` should be raised if the raw stream blocks." msgstr "" -#: ../../library/io.rst:731 +#: ../../library/io.rst:738 msgid "" "Write the :term:`bytes-like object`, *b*, and return the number of bytes " "written. When in non-blocking mode, a :exc:`BlockingIOError` is raised if " "the buffer needs to be written out but the raw stream blocks." msgstr "" -#: ../../library/io.rst:739 +#: ../../library/io.rst:746 msgid "" "A buffered binary stream providing higher-level access to a seekable :class:" "`RawIOBase` raw binary stream. It inherits :class:`BufferedReader` and :" "class:`BufferedWriter`." msgstr "" -#: ../../library/io.rst:743 +#: ../../library/io.rst:750 msgid "" "The constructor creates a reader and writer for a seekable raw stream, given " "in the first argument. If the *buffer_size* is omitted it defaults to :data:" "`DEFAULT_BUFFER_SIZE`." msgstr "" -#: ../../library/io.rst:747 +#: ../../library/io.rst:754 msgid "" ":class:`BufferedRandom` is capable of anything :class:`BufferedReader` or :" "class:`BufferedWriter` can do. In addition, :meth:`seek` and :meth:`tell` " "are guaranteed to be implemented." msgstr "" -#: ../../library/io.rst:754 +#: ../../library/io.rst:761 msgid "" "A buffered binary stream providing higher-level access to two non seekable :" "class:`RawIOBase` raw binary streams---one readable, the other writeable. It " "inherits :class:`BufferedIOBase`." msgstr "" -#: ../../library/io.rst:758 +#: ../../library/io.rst:765 msgid "" "*reader* and *writer* are :class:`RawIOBase` objects that are readable and " "writeable respectively. If the *buffer_size* is omitted it defaults to :" "data:`DEFAULT_BUFFER_SIZE`." msgstr "" -#: ../../library/io.rst:762 +#: ../../library/io.rst:769 msgid "" ":class:`BufferedRWPair` implements all of :class:`BufferedIOBase`\\'s " "methods except for :meth:`~BufferedIOBase.detach`, which raises :exc:" "`UnsupportedOperation`." msgstr "" -#: ../../library/io.rst:768 +#: ../../library/io.rst:775 msgid "" ":class:`BufferedRWPair` does not attempt to synchronize accesses to its " "underlying raw streams. You should not pass it the same object as reader " "and writer; use :class:`BufferedRandom` instead." msgstr "" -#: ../../library/io.rst:778 +#: ../../library/io.rst:785 msgid "" "Base class for text streams. This class provides a character and line based " "interface to stream I/O. It inherits :class:`IOBase`. There is no public " "constructor." msgstr "" -#: ../../library/io.rst:782 +#: ../../library/io.rst:789 msgid "" ":class:`TextIOBase` provides or overrides these data attributes and methods " "in addition to those from :class:`IOBase`:" msgstr "" -#: ../../library/io.rst:787 +#: ../../library/io.rst:794 msgid "" "The name of the encoding used to decode the stream's bytes into strings, and " "to encode strings into bytes." msgstr "" -#: ../../library/io.rst:792 +#: ../../library/io.rst:799 msgid "The error setting of the decoder or encoder." msgstr "" -#: ../../library/io.rst:796 +#: ../../library/io.rst:803 msgid "" "A string, a tuple of strings, or ``None``, indicating the newlines " "translated so far. Depending on the implementation and the initial " "constructor flags, this may not be available." msgstr "" -#: ../../library/io.rst:802 +#: ../../library/io.rst:809 msgid "" "The underlying binary buffer (a :class:`BufferedIOBase` instance) that :" "class:`TextIOBase` deals with. This is not part of the :class:`TextIOBase` " "API and may not exist in some implementations." msgstr "" -#: ../../library/io.rst:808 +#: ../../library/io.rst:815 msgid "" "Separate the underlying binary buffer from the :class:`TextIOBase` and " "return it." msgstr "" -#: ../../library/io.rst:811 +#: ../../library/io.rst:818 msgid "" "After the underlying buffer has been detached, the :class:`TextIOBase` is in " "an unusable state." msgstr "" -#: ../../library/io.rst:814 +#: ../../library/io.rst:821 msgid "" "Some :class:`TextIOBase` implementations, like :class:`StringIO`, may not " "have the concept of an underlying buffer and calling this method will raise :" "exc:`UnsupportedOperation`." msgstr "" -#: ../../library/io.rst:822 +#: ../../library/io.rst:829 msgid "" "Read and return at most *size* characters from the stream as a single :class:" "`str`. If *size* is negative or ``None``, reads until EOF." msgstr "" -#: ../../library/io.rst:827 +#: ../../library/io.rst:834 msgid "" "Read until newline or EOF and return a single ``str``. If the stream is " "already at EOF, an empty string is returned." msgstr "" -#: ../../library/io.rst:830 +#: ../../library/io.rst:837 msgid "If *size* is specified, at most *size* characters will be read." msgstr "" -#: ../../library/io.rst:834 +#: ../../library/io.rst:841 msgid "" "Change the stream position to the given *offset*. Behaviour depends on the " "*whence* parameter. The default value for *whence* is :data:`SEEK_SET`." msgstr "" -#: ../../library/io.rst:838 +#: ../../library/io.rst:845 msgid "" ":data:`SEEK_SET` or ``0``: seek from the start of the stream (the default); " "*offset* must either be a number returned by :meth:`TextIOBase.tell`, or " "zero. Any other *offset* value produces undefined behaviour." msgstr "" -#: ../../library/io.rst:842 +#: ../../library/io.rst:849 msgid "" ":data:`SEEK_CUR` or ``1``: \"seek\" to the current position; *offset* must " "be zero, which is a no-operation (all other values are unsupported)." msgstr "" -#: ../../library/io.rst:845 +#: ../../library/io.rst:852 msgid "" ":data:`SEEK_END` or ``2``: seek to the end of the stream; *offset* must be " "zero (all other values are unsupported)." msgstr "" -#: ../../library/io.rst:848 +#: ../../library/io.rst:855 msgid "Return the new absolute position as an opaque number." msgstr "" -#: ../../library/io.rst:855 +#: ../../library/io.rst:862 msgid "" "Return the current stream position as an opaque number. The number does not " "usually represent a number of bytes in the underlying binary storage." msgstr "" -#: ../../library/io.rst:861 +#: ../../library/io.rst:868 msgid "" "Write the string *s* to the stream and return the number of characters " "written." msgstr "" -#: ../../library/io.rst:868 +#: ../../library/io.rst:875 msgid "" "A buffered text stream providing higher-level access to a :class:" "`BufferedIOBase` buffered binary stream. It inherits :class:`TextIOBase`." msgstr "" -#: ../../library/io.rst:872 +#: ../../library/io.rst:879 msgid "" "*encoding* gives the name of the encoding that the stream will be decoded or " "encoded with. It defaults to :func:`locale.getpreferredencoding(False) " "`." msgstr "" -#: ../../library/io.rst:876 +#: ../../library/io.rst:883 msgid "" "*errors* is an optional string that specifies how encoding and decoding " "errors are to be handled. Pass ``'strict'`` to raise a :exc:`ValueError` " @@ -1212,13 +1220,13 @@ msgid "" "that has been registered with :func:`codecs.register_error` is also valid." msgstr "" -#: ../../library/io.rst:892 +#: ../../library/io.rst:899 msgid "" "*newline* controls how line endings are handled. It can be ``None``, " "``''``, ``'\\n'``, ``'\\r'``, and ``'\\r\\n'``. It works as follows:" msgstr "" -#: ../../library/io.rst:895 +#: ../../library/io.rst:902 msgid "" "When reading input from the stream, if *newline* is ``None``, :term:" "`universal newlines` mode is enabled. Lines in the input can end in " @@ -1230,7 +1238,7 @@ msgid "" "returned to the caller untranslated." msgstr "" -#: ../../library/io.rst:904 +#: ../../library/io.rst:911 msgid "" "When writing output to the stream, if *newline* is ``None``, any ``'\\n'`` " "characters written are translated to the system default line separator, :" @@ -1239,24 +1247,24 @@ msgid "" "characters written are translated to the given string." msgstr "" -#: ../../library/io.rst:910 +#: ../../library/io.rst:917 msgid "" "If *line_buffering* is ``True``, :meth:`flush` is implied when a call to " "write contains a newline character or a carriage return." msgstr "" -#: ../../library/io.rst:913 +#: ../../library/io.rst:920 msgid "" "If *write_through* is ``True``, calls to :meth:`write` are guaranteed not to " "be buffered: any data written on the :class:`TextIOWrapper` object is " "immediately handled to its underlying binary *buffer*." msgstr "" -#: ../../library/io.rst:917 +#: ../../library/io.rst:924 msgid "The *write_through* argument has been added." msgstr "" -#: ../../library/io.rst:920 +#: ../../library/io.rst:927 msgid "" "The default *encoding* is now ``locale.getpreferredencoding(False)`` instead " "of ``locale.getpreferredencoding()``. Don't change temporary the locale " @@ -1264,103 +1272,103 @@ msgid "" "instead of the user preferred encoding." msgstr "" -#: ../../library/io.rst:926 +#: ../../library/io.rst:933 msgid "" ":class:`TextIOWrapper` provides these data attributes and methods in " "addition to those from :class:`TextIOBase` and :class:`IOBase`:" msgstr "" -#: ../../library/io.rst:931 +#: ../../library/io.rst:938 msgid "Whether line buffering is enabled." msgstr "" -#: ../../library/io.rst:935 +#: ../../library/io.rst:942 msgid "Whether writes are passed immediately to the underlying binary buffer." msgstr "" -#: ../../library/io.rst:943 +#: ../../library/io.rst:950 msgid "" "Reconfigure this text stream using new settings for *encoding*, *errors*, " "*newline*, *line_buffering* and *write_through*." msgstr "" -#: ../../library/io.rst:946 +#: ../../library/io.rst:953 msgid "" "Parameters not specified keep current settings, except ``errors='strict'`` " "is used when *encoding* is specified but *errors* is not specified." msgstr "" -#: ../../library/io.rst:950 +#: ../../library/io.rst:957 msgid "" "It is not possible to change the encoding or newline if some data has " "already been read from the stream. On the other hand, changing encoding " "after write is possible." msgstr "" -#: ../../library/io.rst:954 +#: ../../library/io.rst:961 msgid "" "This method does an implicit stream flush before setting the new parameters." msgstr "" -#: ../../library/io.rst:962 +#: ../../library/io.rst:969 msgid "" "A text stream using an in-memory text buffer. It inherits :class:" "`TextIOBase`." msgstr "" -#: ../../library/io.rst:965 +#: ../../library/io.rst:972 msgid "" "The text buffer is discarded when the :meth:`~IOBase.close` method is called." msgstr "" -#: ../../library/io.rst:968 +#: ../../library/io.rst:975 msgid "" "The initial value of the buffer can be set by providing *initial_value*. If " "newline translation is enabled, newlines will be encoded as if by :meth:" "`~TextIOBase.write`. The stream is positioned at the start of the buffer." msgstr "" -#: ../../library/io.rst:973 +#: ../../library/io.rst:980 msgid "" "The *newline* argument works like that of :class:`TextIOWrapper`, except " "that when writing output to the stream, if *newline* is ``None``, newlines " "are written as ``\\n`` on all platforms." msgstr "" -#: ../../library/io.rst:977 +#: ../../library/io.rst:984 msgid "" ":class:`StringIO` provides this method in addition to those from :class:" "`TextIOBase` and :class:`IOBase`:" msgstr "" -#: ../../library/io.rst:982 +#: ../../library/io.rst:989 msgid "" "Return a ``str`` containing the entire contents of the buffer. Newlines are " "decoded as if by :meth:`~TextIOBase.read`, although the stream position is " "not changed." msgstr "" -#: ../../library/io.rst:986 +#: ../../library/io.rst:993 msgid "Example usage::" msgstr "" -#: ../../library/io.rst:1008 +#: ../../library/io.rst:1015 msgid "" "A helper codec that decodes newlines for :term:`universal newlines` mode. It " "inherits :class:`codecs.IncrementalDecoder`." msgstr "" -#: ../../library/io.rst:1013 +#: ../../library/io.rst:1020 msgid "Performance" msgstr "" -#: ../../library/io.rst:1015 +#: ../../library/io.rst:1022 msgid "" "This section discusses the performance of the provided concrete I/O " "implementations." msgstr "" -#: ../../library/io.rst:1021 +#: ../../library/io.rst:1028 msgid "" "By reading and writing only large chunks of data even when the user asks for " "a single byte, buffered I/O hides any inefficiency in calling and executing " @@ -1373,7 +1381,7 @@ msgid "" "data." msgstr "" -#: ../../library/io.rst:1033 +#: ../../library/io.rst:1040 msgid "" "Text I/O over a binary storage (such as a file) is significantly slower than " "binary I/O over the same storage, because it requires conversions between " @@ -1383,23 +1391,23 @@ msgid "" "to the reconstruction algorithm used." msgstr "" -#: ../../library/io.rst:1040 +#: ../../library/io.rst:1047 msgid "" ":class:`StringIO`, however, is a native in-memory unicode container and will " "exhibit similar speed to :class:`BytesIO`." msgstr "" -#: ../../library/io.rst:1044 +#: ../../library/io.rst:1051 msgid "Multi-threading" msgstr "" -#: ../../library/io.rst:1046 +#: ../../library/io.rst:1053 msgid "" ":class:`FileIO` objects are thread-safe to the extent that the operating " "system calls (such as ``read(2)`` under Unix) they wrap are thread-safe too." msgstr "" -#: ../../library/io.rst:1049 +#: ../../library/io.rst:1056 msgid "" "Binary buffered objects (instances of :class:`BufferedReader`, :class:" "`BufferedWriter`, :class:`BufferedRandom` and :class:`BufferedRWPair`) " @@ -1407,15 +1415,15 @@ msgid "" "them from multiple threads at once." msgstr "" -#: ../../library/io.rst:1054 +#: ../../library/io.rst:1061 msgid ":class:`TextIOWrapper` objects are not thread-safe." msgstr "" -#: ../../library/io.rst:1057 +#: ../../library/io.rst:1064 msgid "Reentrancy" msgstr "" -#: ../../library/io.rst:1059 +#: ../../library/io.rst:1066 msgid "" "Binary buffered objects (instances of :class:`BufferedReader`, :class:" "`BufferedWriter`, :class:`BufferedRandom` and :class:`BufferedRWPair`) are " @@ -1426,7 +1434,7 @@ msgid "" "from entering the buffered object." msgstr "" -#: ../../library/io.rst:1067 +#: ../../library/io.rst:1074 msgid "" "The above implicitly extends to text files, since the :func:`open()` " "function will wrap a buffered object inside a :class:`TextIOWrapper`. This " diff --git a/library/ipaddress.po b/library/ipaddress.po index b63aec05ca..73e2a57adc 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-07 06:52+0000\n" +"POT-Creation-Date: 2020-06-20 18:08+0800\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-" @@ -128,66 +128,44 @@ msgstr "" msgid "" "A string in decimal-dot notation, consisting of four decimal integers in the " "inclusive range 0--255, separated by dots (e.g. ``192.168.0.1``). Each " -"integer represents an octet (byte) in the address. Leading zeroes are not " -"tolerated to prevent confusion with octal notation." +"integer represents an octet (byte) in the address. Leading zeroes are " +"tolerated only for values less than 8 (as there is no ambiguity between the " +"decimal and octal interpretations of such strings)." msgstr "" -#: ../../library/ipaddress.rst:108 +#: ../../library/ipaddress.rst:109 msgid "An integer that fits into 32 bits." msgstr "" -#: ../../library/ipaddress.rst:109 +#: ../../library/ipaddress.rst:110 msgid "" "An integer packed into a :class:`bytes` object of length 4 (most significant " "octet first)." msgstr "" -#: ../../library/ipaddress.rst:121 -msgid "" -"Leading zeros are tolerated, even in ambiguous cases that look like octal " -"notation." -msgstr "" - -#: ../../library/ipaddress.rst:126 -msgid "" -"Leading zeros are no longer tolerated and are treated as an error. IPv4 " -"address strings are now parsed as strict as glibc :func:`~socket.inet_pton`." -msgstr "" - -#: ../../library/ipaddress.rst:132 -msgid "" -"The above change was also included in Python 3.9 starting with version 3.9.5." -msgstr "" - -#: ../../library/ipaddress.rst:137 -msgid "" -"The above change was also included in Python 3.8 starting with version " -"3.8.12." -msgstr "" - -#: ../../library/ipaddress.rst:142 +#: ../../library/ipaddress.rst:122 msgid "The appropriate version number: ``4`` for IPv4, ``6`` for IPv6." msgstr "" -#: ../../library/ipaddress.rst:146 +#: ../../library/ipaddress.rst:126 msgid "" "The total number of bits in the address representation for this version: " "``32`` for IPv4, ``128`` for IPv6." msgstr "" -#: ../../library/ipaddress.rst:149 +#: ../../library/ipaddress.rst:129 msgid "" "The prefix defines the number of leading bits in an address that are " "compared to determine whether or not an address is part of a network." msgstr "" -#: ../../library/ipaddress.rst:156 +#: ../../library/ipaddress.rst:136 msgid "" "The string representation in dotted decimal notation. Leading zeroes are " "never included in the representation." msgstr "" -#: ../../library/ipaddress.rst:159 +#: ../../library/ipaddress.rst:139 msgid "" "As IPv4 does not define a shorthand notation for addresses with octets set " "to zero, these two attributes are always the same as ``str(addr)`` for IPv4 " @@ -195,85 +173,73 @@ msgid "" "that can handle both IPv4 and IPv6 addresses." msgstr "" -#: ../../library/ipaddress.rst:166 +#: ../../library/ipaddress.rst:146 msgid "" "The binary representation of this address - a :class:`bytes` object of the " "appropriate length (most significant octet first). This is 4 bytes for IPv4 " "and 16 bytes for IPv6." msgstr "" -#: ../../library/ipaddress.rst:172 +#: ../../library/ipaddress.rst:152 msgid "The name of the reverse DNS PTR record for the IP address, e.g.::" msgstr "" -#: ../../library/ipaddress.rst:179 +#: ../../library/ipaddress.rst:159 msgid "" "This is the name that could be used for performing a PTR lookup, not the " "resolved hostname itself." msgstr "" -#: ../../library/ipaddress.rst:186 +#: ../../library/ipaddress.rst:166 msgid "" "``True`` if the address is reserved for multicast use. See :RFC:`3171` (for " "IPv4) or :RFC:`2373` (for IPv6)." msgstr "" -#: ../../library/ipaddress.rst:191 +#: ../../library/ipaddress.rst:171 msgid "" "``True`` if the address is allocated for private networks. See iana-ipv4-" "special-registry_ (for IPv4) or iana-ipv6-special-registry_ (for IPv6)." msgstr "" -#: ../../library/ipaddress.rst:197 +#: ../../library/ipaddress.rst:177 msgid "" "``True`` if the address is allocated for public networks. See iana-ipv4-" "special-registry_ (for IPv4) or iana-ipv6-special-registry_ (for IPv6)." msgstr "" -#: ../../library/ipaddress.rst:205 +#: ../../library/ipaddress.rst:185 msgid "" "``True`` if the address is unspecified. See :RFC:`5735` (for IPv4) or :RFC:" "`2373` (for IPv6)." msgstr "" -#: ../../library/ipaddress.rst:210 +#: ../../library/ipaddress.rst:190 msgid "``True`` if the address is otherwise IETF reserved." msgstr "" -#: ../../library/ipaddress.rst:214 +#: ../../library/ipaddress.rst:194 msgid "" "``True`` if this is a loopback address. See :RFC:`3330` (for IPv4) or :RFC:" "`2373` (for IPv6)." msgstr "" -#: ../../library/ipaddress.rst:219 +#: ../../library/ipaddress.rst:199 msgid "" "``True`` if the address is reserved for link-local usage. See :RFC:`3927`." msgstr "" -#: ../../library/ipaddress.rst:227 -msgid "" -"Returns a string representation of the IP address, controlled by an explicit " -"format string. *fmt* can be one of the following: ``'s'``, the default " -"option, equivalent to :func:`str`, ``'b'`` for a zero-padded binary string, " -"``'X'`` or ``'x'`` for an uppercase or lowercase hexadecimal representation, " -"or ``'n'``, which is equivalent to ``'b'`` for IPv4 addresses and ``'x'`` " -"for IPv6. For binary and hexadecimal representations, the form specifier " -"``'#'`` and the grouping option ``'_'`` are available. ``__format__`` is " -"used by ``format``, ``str.format`` and f-strings." -msgstr "" - -#: ../../library/ipaddress.rst:254 +#: ../../library/ipaddress.rst:208 msgid "" "Construct an IPv6 address. An :exc:`AddressValueError` is raised if " "*address* is not a valid IPv6 address." msgstr "" -#: ../../library/ipaddress.rst:257 +#: ../../library/ipaddress.rst:211 msgid "The following constitutes a valid IPv6 address:" msgstr "" -#: ../../library/ipaddress.rst:259 +#: ../../library/ipaddress.rst:213 msgid "" "A string consisting of eight groups of four hexadecimal digits, each group " "representing 16 bits. The groups are separated by colons. This describes an " @@ -283,7 +249,7 @@ msgid "" "to ``\"::abc:7:def\"``." msgstr "" -#: ../../library/ipaddress.rst:267 +#: ../../library/ipaddress.rst:221 msgid "" "Optionally, the string may also have a scope zone ID, expressed with a " "suffix ``%scope_id``. If present, the scope ID must be non-empty, and may " @@ -292,43 +258,43 @@ msgid "" "the node." msgstr "" -#: ../../library/ipaddress.rst:272 +#: ../../library/ipaddress.rst:226 msgid "An integer that fits into 128 bits." msgstr "" -#: ../../library/ipaddress.rst:273 +#: ../../library/ipaddress.rst:227 msgid "" "An integer packed into a :class:`bytes` object of length 16, big-endian." msgstr "" -#: ../../library/ipaddress.rst:283 +#: ../../library/ipaddress.rst:237 msgid "" "The short form of the address representation, with leading zeroes in groups " "omitted and the longest sequence of groups consisting entirely of zeroes " "collapsed to a single empty group." msgstr "" -#: ../../library/ipaddress.rst:287 +#: ../../library/ipaddress.rst:241 msgid "This is also the value returned by ``str(addr)`` for IPv6 addresses." msgstr "" -#: ../../library/ipaddress.rst:291 +#: ../../library/ipaddress.rst:245 msgid "" "The long form of the address representation, with all leading zeroes and " "groups consisting entirely of zeroes included." msgstr "" -#: ../../library/ipaddress.rst:295 +#: ../../library/ipaddress.rst:249 msgid "" -"For the following attributes and methods, see the corresponding " -"documentation of the :class:`IPv4Address` class:" +"For the following attributes, see the corresponding documentation of the :" +"class:`IPv4Address` class:" msgstr "" -#: ../../library/ipaddress.rst:310 +#: ../../library/ipaddress.rst:264 msgid "is_global" msgstr "" -#: ../../library/ipaddress.rst:315 +#: ../../library/ipaddress.rst:269 msgid "" "``True`` if the address is reserved for site-local usage. Note that the " "site-local address space has been deprecated by :RFC:`3879`. Use :attr:" @@ -336,21 +302,21 @@ msgid "" "local addresses as defined by :RFC:`4193`." msgstr "" -#: ../../library/ipaddress.rst:322 +#: ../../library/ipaddress.rst:276 msgid "" "For addresses that appear to be IPv4 mapped addresses (starting with ``::" "FFFF/96``), this property will report the embedded IPv4 address. For any " "other address, this property will be ``None``." msgstr "" -#: ../../library/ipaddress.rst:328 +#: ../../library/ipaddress.rst:282 msgid "" "For scoped addresses as defined by :RFC:`4007`, this property identifies the " "particular zone of the address's scope that the address belongs to, as a " "string. When no scope zone is specified, this property will be ``None``." msgstr "" -#: ../../library/ipaddress.rst:334 +#: ../../library/ipaddress.rst:288 msgid "" "For addresses that appear to be 6to4 addresses (starting with " "``2002::/16``) as defined by :RFC:`3056`, this property will report the " @@ -358,7 +324,7 @@ msgid "" "``None``." msgstr "" -#: ../../library/ipaddress.rst:341 +#: ../../library/ipaddress.rst:295 msgid "" "For addresses that appear to be Teredo addresses (starting with " "``2001::/32``) as defined by :RFC:`4380`, this property will report the " @@ -366,65 +332,60 @@ msgid "" "property will be ``None``." msgstr "" -#: ../../library/ipaddress.rst:348 -msgid "" -"Refer to the corresponding method documentation in :class:`IPv4Address`." -msgstr "" - -#: ../../library/ipaddress.rst:354 +#: ../../library/ipaddress.rst:302 msgid "Conversion to Strings and Integers" msgstr "" -#: ../../library/ipaddress.rst:356 +#: ../../library/ipaddress.rst:304 msgid "" "To interoperate with networking interfaces such as the socket module, " "addresses must be converted to strings or integers. This is handled using " "the :func:`str` and :func:`int` builtin functions::" msgstr "" -#: ../../library/ipaddress.rst:369 +#: ../../library/ipaddress.rst:317 msgid "" "Note that IPv6 scoped addresses are converted to integers without scope zone " "ID." msgstr "" -#: ../../library/ipaddress.rst:373 ../../library/ipaddress.rst:757 -#: ../../library/ipaddress.rst:893 +#: ../../library/ipaddress.rst:321 ../../library/ipaddress.rst:705 +#: ../../library/ipaddress.rst:841 msgid "Operators" msgstr "" -#: ../../library/ipaddress.rst:375 +#: ../../library/ipaddress.rst:323 msgid "" "Address objects support some operators. Unless stated otherwise, operators " "can only be applied between compatible objects (i.e. IPv4 with IPv4, IPv6 " "with IPv6)." msgstr "" -#: ../../library/ipaddress.rst:381 +#: ../../library/ipaddress.rst:329 msgid "Comparison operators" msgstr "" -#: ../../library/ipaddress.rst:383 +#: ../../library/ipaddress.rst:331 msgid "" "Address objects can be compared with the usual set of comparison operators. " "Same IPv6 addresses with different scope zone IDs are not equal. Some " "examples::" msgstr "" -#: ../../library/ipaddress.rst:400 +#: ../../library/ipaddress.rst:348 msgid "Arithmetic operators" msgstr "" -#: ../../library/ipaddress.rst:402 +#: ../../library/ipaddress.rst:350 msgid "" "Integers can be added to or subtracted from address objects. Some examples::" msgstr "" -#: ../../library/ipaddress.rst:415 +#: ../../library/ipaddress.rst:363 msgid "IP Network definitions" msgstr "" -#: ../../library/ipaddress.rst:417 +#: ../../library/ipaddress.rst:365 msgid "" "The :class:`IPv4Network` and :class:`IPv6Network` objects provide a " "mechanism for defining and inspecting IP network definitions. A network " @@ -435,11 +396,11 @@ msgid "" "addresses in the inclusive range ``192.168.1.0`` to ``192.168.1.255``." msgstr "" -#: ../../library/ipaddress.rst:427 +#: ../../library/ipaddress.rst:375 msgid "Prefix, net mask and host mask" msgstr "" -#: ../../library/ipaddress.rst:429 +#: ../../library/ipaddress.rst:377 msgid "" "There are several equivalent ways to specify IP network masks. A *prefix* " "``/`` is a notation that denotes how many high-order bits are set in " @@ -451,11 +412,11 @@ msgid "" "mask equivalent to ``/24`` in IPv4 is ``0.0.0.255``." msgstr "" -#: ../../library/ipaddress.rst:440 +#: ../../library/ipaddress.rst:388 msgid "Network objects" msgstr "" -#: ../../library/ipaddress.rst:442 +#: ../../library/ipaddress.rst:390 msgid "" "All attributes implemented by address objects are implemented by network " "objects as well. In addition, network objects implement additional " @@ -465,12 +426,12 @@ msgid "" "keys in dictionaries." msgstr "" -#: ../../library/ipaddress.rst:451 +#: ../../library/ipaddress.rst:399 msgid "" "Construct an IPv4 network definition. *address* can be one of the following:" msgstr "" -#: ../../library/ipaddress.rst:453 +#: ../../library/ipaddress.rst:401 msgid "" "A string consisting of an IP address and an optional mask, separated by a " "slash (``/``). The IP address is the network address, and the mask can be " @@ -482,26 +443,26 @@ msgid "" "it's considered to be ``/32``." msgstr "" -#: ../../library/ipaddress.rst:462 +#: ../../library/ipaddress.rst:410 msgid "" "For example, the following *address* specifications are equivalent: " "``192.168.1.0/24``, ``192.168.1.0/255.255.255.0`` and " "``192.168.1.0/0.0.0.255``." msgstr "" -#: ../../library/ipaddress.rst:466 +#: ../../library/ipaddress.rst:414 msgid "" "An integer that fits into 32 bits. This is equivalent to a single-address " "network, with the network address being *address* and the mask being ``/32``." msgstr "" -#: ../../library/ipaddress.rst:470 +#: ../../library/ipaddress.rst:418 msgid "" "An integer packed into a :class:`bytes` object of length 4, big-endian. The " "interpretation is similar to an integer *address*." msgstr "" -#: ../../library/ipaddress.rst:473 +#: ../../library/ipaddress.rst:421 msgid "" "A two-tuple of an address description and a netmask, where the address " "description is either a string, a 32-bits integer, a 4-bytes packed integer, " @@ -510,92 +471,92 @@ msgid "" "prefix mask (e.g. ``255.255.255.0``)." msgstr "" -#: ../../library/ipaddress.rst:479 +#: ../../library/ipaddress.rst:427 msgid "" "An :exc:`AddressValueError` is raised if *address* is not a valid IPv4 " "address. A :exc:`NetmaskValueError` is raised if the mask is not valid for " "an IPv4 address." msgstr "" -#: ../../library/ipaddress.rst:483 ../../library/ipaddress.rst:703 +#: ../../library/ipaddress.rst:431 ../../library/ipaddress.rst:651 msgid "" "If *strict* is ``True`` and host bits are set in the supplied address, then :" "exc:`ValueError` is raised. Otherwise, the host bits are masked out to " "determine the appropriate network address." msgstr "" -#: ../../library/ipaddress.rst:487 +#: ../../library/ipaddress.rst:435 msgid "" "Unless stated otherwise, all network methods accepting other network/address " "objects will raise :exc:`TypeError` if the argument's IP version is " "incompatible to ``self``." msgstr "" -#: ../../library/ipaddress.rst:493 ../../library/ipaddress.rst:709 +#: ../../library/ipaddress.rst:441 ../../library/ipaddress.rst:657 msgid "Added the two-tuple form for the *address* constructor parameter." msgstr "" -#: ../../library/ipaddress.rst:498 +#: ../../library/ipaddress.rst:446 msgid "" "Refer to the corresponding attribute documentation in :class:`IPv4Address`." msgstr "" -#: ../../library/ipaddress.rst:508 +#: ../../library/ipaddress.rst:456 msgid "" "These attributes are true for the network as a whole if they are true for " "both the network address and the broadcast address." msgstr "" -#: ../../library/ipaddress.rst:513 +#: ../../library/ipaddress.rst:461 msgid "" "The network address for the network. The network address and the prefix " "length together uniquely define a network." msgstr "" -#: ../../library/ipaddress.rst:518 +#: ../../library/ipaddress.rst:466 msgid "" "The broadcast address for the network. Packets sent to the broadcast address " "should be received by every host on the network." msgstr "" -#: ../../library/ipaddress.rst:523 +#: ../../library/ipaddress.rst:471 msgid "The host mask, as an :class:`IPv4Address` object." msgstr "" -#: ../../library/ipaddress.rst:527 +#: ../../library/ipaddress.rst:475 msgid "The net mask, as an :class:`IPv4Address` object." msgstr "" -#: ../../library/ipaddress.rst:533 +#: ../../library/ipaddress.rst:481 msgid "" "A string representation of the network, with the mask in prefix notation." msgstr "" -#: ../../library/ipaddress.rst:536 +#: ../../library/ipaddress.rst:484 msgid "" "``with_prefixlen`` and ``compressed`` are always the same as " "``str(network)``. ``exploded`` uses the exploded form the network address." msgstr "" -#: ../../library/ipaddress.rst:542 +#: ../../library/ipaddress.rst:490 msgid "" "A string representation of the network, with the mask in net mask notation." msgstr "" -#: ../../library/ipaddress.rst:547 +#: ../../library/ipaddress.rst:495 msgid "" "A string representation of the network, with the mask in host mask notation." msgstr "" -#: ../../library/ipaddress.rst:552 +#: ../../library/ipaddress.rst:500 msgid "The total number of addresses in the network." msgstr "" -#: ../../library/ipaddress.rst:556 +#: ../../library/ipaddress.rst:504 msgid "Length of the network prefix, in bits." msgstr "" -#: ../../library/ipaddress.rst:560 +#: ../../library/ipaddress.rst:508 msgid "" "Returns an iterator over the usable hosts in the network. The usable hosts " "are all the IP addresses that belong to the network, except the network " @@ -605,20 +566,20 @@ msgid "" "containing the single host address." msgstr "" -#: ../../library/ipaddress.rst:578 +#: ../../library/ipaddress.rst:526 msgid "" "``True`` if this network is partly or wholly contained in *other* or *other* " "is wholly contained in this network." msgstr "" -#: ../../library/ipaddress.rst:583 +#: ../../library/ipaddress.rst:531 msgid "" "Computes the network definitions resulting from removing the given *network* " "from this one. Returns an iterator of network objects. Raises :exc:" "`ValueError` if *network* is not completely contained in this network." msgstr "" -#: ../../library/ipaddress.rst:596 +#: ../../library/ipaddress.rst:544 msgid "" "The subnets that join to make the current network definition, depending on " "the argument values. *prefixlen_diff* is the amount our prefix length " @@ -628,7 +589,7 @@ msgid "" "network objects." msgstr "" -#: ../../library/ipaddress.rst:621 +#: ../../library/ipaddress.rst:569 msgid "" "The supernet containing this network definition, depending on the argument " "values. *prefixlen_diff* is the amount our prefix length should be " @@ -637,33 +598,33 @@ msgid "" "*new_prefix* must be set. Returns a single network object." msgstr "" -#: ../../library/ipaddress.rst:637 +#: ../../library/ipaddress.rst:585 msgid "Return ``True`` if this network is a subnet of *other*." msgstr "" -#: ../../library/ipaddress.rst:648 +#: ../../library/ipaddress.rst:596 msgid "Return ``True`` if this network is a supernet of *other*." msgstr "" -#: ../../library/ipaddress.rst:659 +#: ../../library/ipaddress.rst:607 msgid "" "Compare this network to *other*. In this comparison only the network " "addresses are considered; host bits aren't. Returns either ``-1``, ``0`` or " "``1``." msgstr "" -#: ../../library/ipaddress.rst:670 +#: ../../library/ipaddress.rst:618 msgid "" "It uses the same ordering and comparison algorithm as \"<\", \"==\", and \">" "\"" msgstr "" -#: ../../library/ipaddress.rst:676 +#: ../../library/ipaddress.rst:624 msgid "" "Construct an IPv6 network definition. *address* can be one of the following:" msgstr "" -#: ../../library/ipaddress.rst:678 +#: ../../library/ipaddress.rst:626 msgid "" "A string consisting of an IP address and an optional prefix length, " "separated by a slash (``/``). The IP address is the network address, and " @@ -671,26 +632,26 @@ msgid "" "length is provided, it's considered to be ``/128``." msgstr "" -#: ../../library/ipaddress.rst:683 +#: ../../library/ipaddress.rst:631 msgid "" "Note that currently expanded netmasks are not supported. That means ``2001:" "db00::0/24`` is a valid argument while ``2001:db00::0/ffff:ff00::`` not." msgstr "" -#: ../../library/ipaddress.rst:687 +#: ../../library/ipaddress.rst:635 msgid "" "An integer that fits into 128 bits. This is equivalent to a single-address " "network, with the network address being *address* and the mask being " "``/128``." msgstr "" -#: ../../library/ipaddress.rst:691 +#: ../../library/ipaddress.rst:639 msgid "" "An integer packed into a :class:`bytes` object of length 16, big-endian. The " "interpretation is similar to an integer *address*." msgstr "" -#: ../../library/ipaddress.rst:694 +#: ../../library/ipaddress.rst:642 msgid "" "A two-tuple of an address description and a netmask, where the address " "description is either a string, a 128-bits integer, a 16-bytes packed " @@ -698,14 +659,14 @@ msgid "" "representing the prefix length." msgstr "" -#: ../../library/ipaddress.rst:699 +#: ../../library/ipaddress.rst:647 msgid "" "An :exc:`AddressValueError` is raised if *address* is not a valid IPv6 " "address. A :exc:`NetmaskValueError` is raised if the mask is not valid for " "an IPv6 address." msgstr "" -#: ../../library/ipaddress.rst:732 +#: ../../library/ipaddress.rst:680 msgid "" "Returns an iterator over the usable hosts in the network. The usable hosts " "are all the IP addresses that belong to the network, except the Subnet-" @@ -714,139 +675,139 @@ msgid "" "of 128 will return a list containing the single host address." msgstr "" -#: ../../library/ipaddress.rst:747 +#: ../../library/ipaddress.rst:695 msgid "" "Refer to the corresponding attribute documentation in :class:`IPv4Network`." msgstr "" -#: ../../library/ipaddress.rst:752 +#: ../../library/ipaddress.rst:700 msgid "" "These attribute is true for the network as a whole if it is true for both " "the network address and the broadcast address." msgstr "" -#: ../../library/ipaddress.rst:759 +#: ../../library/ipaddress.rst:707 msgid "" "Network objects support some operators. Unless stated otherwise, operators " "can only be applied between compatible objects (i.e. IPv4 with IPv4, IPv6 " "with IPv6)." msgstr "" -#: ../../library/ipaddress.rst:765 ../../library/ipaddress.rst:901 +#: ../../library/ipaddress.rst:713 ../../library/ipaddress.rst:849 msgid "Logical operators" msgstr "" -#: ../../library/ipaddress.rst:767 +#: ../../library/ipaddress.rst:715 msgid "" "Network objects can be compared with the usual set of logical operators. " "Network objects are ordered first by network address, then by net mask." msgstr "" -#: ../../library/ipaddress.rst:772 +#: ../../library/ipaddress.rst:720 msgid "Iteration" msgstr "" -#: ../../library/ipaddress.rst:774 +#: ../../library/ipaddress.rst:722 msgid "" "Network objects can be iterated to list all the addresses belonging to the " "network. For iteration, *all* hosts are returned, including unusable hosts " "(for usable hosts, use the :meth:`~IPv4Network.hosts` method). An example::" msgstr "" -#: ../../library/ipaddress.rst:801 +#: ../../library/ipaddress.rst:749 msgid "Networks as containers of addresses" msgstr "" -#: ../../library/ipaddress.rst:803 +#: ../../library/ipaddress.rst:751 msgid "Network objects can act as containers of addresses. Some examples::" msgstr "" -#: ../../library/ipaddress.rst:816 +#: ../../library/ipaddress.rst:764 msgid "Interface objects" msgstr "" -#: ../../library/ipaddress.rst:818 +#: ../../library/ipaddress.rst:766 msgid "" "Interface objects are :term:`hashable`, so they can be used as keys in " "dictionaries." msgstr "" -#: ../../library/ipaddress.rst:823 +#: ../../library/ipaddress.rst:771 msgid "" "Construct an IPv4 interface. The meaning of *address* is as in the " "constructor of :class:`IPv4Network`, except that arbitrary host addresses " "are always accepted." msgstr "" -#: ../../library/ipaddress.rst:827 +#: ../../library/ipaddress.rst:775 msgid "" ":class:`IPv4Interface` is a subclass of :class:`IPv4Address`, so it inherits " "all the attributes from that class. In addition, the following attributes " "are available:" msgstr "" -#: ../../library/ipaddress.rst:833 +#: ../../library/ipaddress.rst:781 msgid "The address (:class:`IPv4Address`) without network information." msgstr "" -#: ../../library/ipaddress.rst:841 +#: ../../library/ipaddress.rst:789 msgid "The network (:class:`IPv4Network`) this interface belongs to." msgstr "" -#: ../../library/ipaddress.rst:849 +#: ../../library/ipaddress.rst:797 msgid "" "A string representation of the interface with the mask in prefix notation." msgstr "" -#: ../../library/ipaddress.rst:857 +#: ../../library/ipaddress.rst:805 msgid "" "A string representation of the interface with the network as a net mask." msgstr "" -#: ../../library/ipaddress.rst:865 +#: ../../library/ipaddress.rst:813 msgid "" "A string representation of the interface with the network as a host mask." msgstr "" -#: ../../library/ipaddress.rst:874 +#: ../../library/ipaddress.rst:822 msgid "" "Construct an IPv6 interface. The meaning of *address* is as in the " "constructor of :class:`IPv6Network`, except that arbitrary host addresses " "are always accepted." msgstr "" -#: ../../library/ipaddress.rst:878 +#: ../../library/ipaddress.rst:826 msgid "" ":class:`IPv6Interface` is a subclass of :class:`IPv6Address`, so it inherits " "all the attributes from that class. In addition, the following attributes " "are available:" msgstr "" -#: ../../library/ipaddress.rst:888 +#: ../../library/ipaddress.rst:836 msgid "" "Refer to the corresponding attribute documentation in :class:`IPv4Interface`." msgstr "" -#: ../../library/ipaddress.rst:895 +#: ../../library/ipaddress.rst:843 msgid "" "Interface objects support some operators. Unless stated otherwise, " "operators can only be applied between compatible objects (i.e. IPv4 with " "IPv4, IPv6 with IPv6)." msgstr "" -#: ../../library/ipaddress.rst:903 +#: ../../library/ipaddress.rst:851 msgid "" "Interface objects can be compared with the usual set of logical operators." msgstr "" -#: ../../library/ipaddress.rst:905 +#: ../../library/ipaddress.rst:853 msgid "" "For equality comparison (``==`` and ``!=``), both the IP address and network " "must be the same for the objects to be equal. An interface will not compare " "equal to any address or network object." msgstr "" -#: ../../library/ipaddress.rst:909 +#: ../../library/ipaddress.rst:857 msgid "" "For ordering (``<``, ``>``, etc) the rules are different. Interface and " "address objects with the same IP version can be compared, and the address " @@ -855,15 +816,15 @@ msgid "" "then by their IP addresses." msgstr "" -#: ../../library/ipaddress.rst:917 +#: ../../library/ipaddress.rst:865 msgid "Other Module Level Functions" msgstr "" -#: ../../library/ipaddress.rst:919 +#: ../../library/ipaddress.rst:867 msgid "The module also provides the following module level functions:" msgstr "" -#: ../../library/ipaddress.rst:923 +#: ../../library/ipaddress.rst:871 msgid "" "Represent an address as 4 packed bytes in network (big-endian) order. " "*address* is an integer representation of an IPv4 IP address. A :exc:" @@ -871,7 +832,7 @@ msgid "" "IP address." msgstr "" -#: ../../library/ipaddress.rst:936 +#: ../../library/ipaddress.rst:884 msgid "" "Represent an address as 16 packed bytes in network (big-endian) order. " "*address* is an integer representation of an IPv6 IP address. A :exc:" @@ -879,7 +840,7 @@ msgid "" "IP address." msgstr "" -#: ../../library/ipaddress.rst:944 +#: ../../library/ipaddress.rst:892 msgid "" "Return an iterator of the summarized network range given the first and last " "IP addresses. *first* is the first :class:`IPv4Address` or :class:" @@ -890,7 +851,7 @@ msgid "" "address version is not 4 or 6." msgstr "" -#: ../../library/ipaddress.rst:960 +#: ../../library/ipaddress.rst:908 msgid "" "Return an iterator of the collapsed :class:`IPv4Network` or :class:" "`IPv6Network` objects. *addresses* is an iterator of :class:`IPv4Network` " @@ -898,38 +859,38 @@ msgid "" "*addresses* contains mixed version objects." msgstr "" -#: ../../library/ipaddress.rst:973 +#: ../../library/ipaddress.rst:921 msgid "" "Return a key suitable for sorting between networks and addresses. Address " "and Network objects are not sortable by default; they're fundamentally " "different, so the expression::" msgstr "" -#: ../../library/ipaddress.rst:979 +#: ../../library/ipaddress.rst:927 msgid "" "doesn't make sense. There are some times however, where you may wish to " "have :mod:`ipaddress` sort these anyway. If you need to do this, you can " "use this function as the *key* argument to :func:`sorted()`." msgstr "" -#: ../../library/ipaddress.rst:983 +#: ../../library/ipaddress.rst:931 msgid "*obj* is either a network or address object." msgstr "" -#: ../../library/ipaddress.rst:987 +#: ../../library/ipaddress.rst:935 msgid "Custom Exceptions" msgstr "" -#: ../../library/ipaddress.rst:989 +#: ../../library/ipaddress.rst:937 msgid "" "To support more specific error reporting from class constructors, the module " "defines the following exceptions:" msgstr "" -#: ../../library/ipaddress.rst:994 +#: ../../library/ipaddress.rst:942 msgid "Any value error related to the address." msgstr "" -#: ../../library/ipaddress.rst:999 +#: ../../library/ipaddress.rst:947 msgid "Any value error related to the net mask." msgstr "" diff --git a/library/itertools.po b/library/itertools.po index 665319c91d..cc9f0ffe0d 100644 --- a/library/itertools.po +++ b/library/itertools.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.7\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2021-09-07 06:52+0000\n" +"POT-Creation-Date: 2020-06-20 18:08+0800\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-" @@ -694,7 +694,7 @@ msgstr "" msgid "" "Before :func:`product` runs, it completely consumes the input iterables, " "keeping pools of values in memory to generate the products. Accordingly, it " -"is only useful with finite inputs." +"only useful with finite inputs." msgstr "" #: ../../library/itertools.rst:572 diff --git a/library/json.po b/library/json.po index ea8d857724..ee47c6acb0 100644 --- a/library/json.po +++ b/library/json.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.7\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2021-09-07 06:52+0000\n" +"POT-Creation-Date: 2020-06-20 18:08+0800\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-" @@ -122,7 +122,7 @@ msgid "" "`bytes` objects. Therefore, ``fp.write()`` must support :class:`str` input." msgstr "" -#: ../../library/json.rst:156 ../../library/json.rst:429 +#: ../../library/json.rst:156 ../../library/json.rst:430 msgid "" "If *ensure_ascii* is true (the default), the output is guaranteed to have " "all incoming non-ASCII characters escaped. If *ensure_ascii* is false, " @@ -145,7 +145,7 @@ msgid "" "Infinity``) will be used." msgstr "" -#: ../../library/json.rst:170 ../../library/json.rst:448 +#: ../../library/json.rst:170 ../../library/json.rst:449 msgid "" "If *indent* is a non-negative integer or string, then JSON array elements " "and object members will be pretty-printed with that indent level. An indent " @@ -155,11 +155,11 @@ msgid "" "``\"\\t\"``), that string is used to indent each level." msgstr "" -#: ../../library/json.rst:177 ../../library/json.rst:455 +#: ../../library/json.rst:177 ../../library/json.rst:456 msgid "Allow strings for *indent* in addition to integers." msgstr "" -#: ../../library/json.rst:180 ../../library/json.rst:458 +#: ../../library/json.rst:180 ../../library/json.rst:459 msgid "" "If specified, *separators* should be an ``(item_separator, key_separator)`` " "tuple. The default is ``(', ', ': ')`` if *indent* is ``None`` and ``(',', " @@ -167,11 +167,11 @@ msgid "" "specify ``(',', ':')`` to eliminate whitespace." msgstr "" -#: ../../library/json.rst:185 ../../library/json.rst:463 +#: ../../library/json.rst:185 ../../library/json.rst:464 msgid "Use ``(',', ': ')`` as default if *indent* is not ``None``." msgstr "" -#: ../../library/json.rst:188 ../../library/json.rst:466 +#: ../../library/json.rst:188 ../../library/json.rst:467 msgid "" "If specified, *default* should be a function that gets called for objects " "that can't otherwise be serialized. It should return a JSON encodable " @@ -412,7 +412,7 @@ msgid "" "*object_hook*, if specified, will be called with the result of every JSON " "object decoded and its return value will be used in place of the given :" "class:`dict`. This can be used to provide custom deserializations (e.g. to " -"support `JSON-RPC `_ class hinting)." +"support JSON-RPC class hinting)." msgstr "" #: ../../library/json.rst:338 @@ -432,7 +432,7 @@ msgid "" "``'\\n'``, ``'\\r'`` and ``'\\0'``." msgstr "" -#: ../../library/json.rst:370 ../../library/json.rst:471 +#: ../../library/json.rst:370 ../../library/json.rst:472 msgid "All parameters are now :ref:`keyword-only `." msgstr "" @@ -495,12 +495,12 @@ msgstr "" #: ../../library/json.rst:425 msgid "" -"If *skipkeys* is false (the default), a :exc:`TypeError` will be raised when " -"trying to encode keys that are not :class:`str`, :class:`int`, :class:" +"If *skipkeys* is false (the default), then it is a :exc:`TypeError` to " +"attempt encoding of keys that are not :class:`str`, :class:`int`, :class:" "`float` or ``None``. If *skipkeys* is true, such items are simply skipped." msgstr "" -#: ../../library/json.rst:433 +#: ../../library/json.rst:434 msgid "" "If *check_circular* is true (the default), then lists, dicts, and custom " "encoded objects will be checked for circular references during encoding to " @@ -508,7 +508,7 @@ msgid "" "Otherwise, no such check takes place." msgstr "" -#: ../../library/json.rst:438 +#: ../../library/json.rst:439 msgid "" "If *allow_nan* is true (the default), then ``NaN``, ``Infinity``, and ``-" "Infinity`` will be encoded as such. This behavior is not JSON specification " @@ -516,71 +516,71 @@ msgid "" "decoders. Otherwise, it will be a :exc:`ValueError` to encode such floats." msgstr "" -#: ../../library/json.rst:444 +#: ../../library/json.rst:445 msgid "" "If *sort_keys* is true (default: ``False``), then the output of dictionaries " "will be sorted by key; this is useful for regression tests to ensure that " "JSON serializations can be compared on a day-to-day basis." msgstr "" -#: ../../library/json.rst:477 +#: ../../library/json.rst:478 msgid "" "Implement this method in a subclass such that it returns a serializable " "object for *o*, or calls the base implementation (to raise a :exc:" "`TypeError`)." msgstr "" -#: ../../library/json.rst:481 +#: ../../library/json.rst:482 msgid "" -"For example, to support arbitrary iterators, you could implement :meth:" -"`default` like this::" +"For example, to support arbitrary iterators, you could implement default " +"like this::" msgstr "" -#: ../../library/json.rst:497 +#: ../../library/json.rst:498 msgid "" "Return a JSON string representation of a Python data structure, *o*. For " "example::" msgstr "" -#: ../../library/json.rst:506 +#: ../../library/json.rst:507 msgid "" "Encode the given object, *o*, and yield each string representation as " "available. For example::" msgstr "" -#: ../../library/json.rst:514 +#: ../../library/json.rst:515 msgid "Exceptions" msgstr "例外" -#: ../../library/json.rst:518 +#: ../../library/json.rst:519 msgid "Subclass of :exc:`ValueError` with the following additional attributes:" msgstr "" -#: ../../library/json.rst:522 +#: ../../library/json.rst:523 msgid "The unformatted error message." msgstr "" -#: ../../library/json.rst:526 +#: ../../library/json.rst:527 msgid "The JSON document being parsed." msgstr "" -#: ../../library/json.rst:530 +#: ../../library/json.rst:531 msgid "The start index of *doc* where parsing failed." msgstr "" -#: ../../library/json.rst:534 +#: ../../library/json.rst:535 msgid "The line corresponding to *pos*." msgstr "" -#: ../../library/json.rst:538 +#: ../../library/json.rst:539 msgid "The column corresponding to *pos*." msgstr "" -#: ../../library/json.rst:544 +#: ../../library/json.rst:545 msgid "Standard Compliance and Interoperability" msgstr "" -#: ../../library/json.rst:546 +#: ../../library/json.rst:547 msgid "" "The JSON format is specified by :rfc:`7159` and by `ECMA-404 `_. This section " @@ -589,48 +589,48 @@ msgid "" "other than those explicitly mentioned, are not considered." msgstr "" -#: ../../library/json.rst:552 +#: ../../library/json.rst:553 msgid "" "This module does not comply with the RFC in a strict fashion, implementing " "some extensions that are valid JavaScript but not valid JSON. In particular:" msgstr "" -#: ../../library/json.rst:555 +#: ../../library/json.rst:556 msgid "Infinite and NaN number values are accepted and output;" msgstr "" -#: ../../library/json.rst:556 +#: ../../library/json.rst:557 msgid "" "Repeated names within an object are accepted, and only the value of the last " "name-value pair is used." msgstr "" -#: ../../library/json.rst:559 +#: ../../library/json.rst:560 msgid "" "Since the RFC permits RFC-compliant parsers to accept input texts that are " "not RFC-compliant, this module's deserializer is technically RFC-compliant " "under default settings." msgstr "" -#: ../../library/json.rst:564 +#: ../../library/json.rst:565 msgid "Character Encodings" msgstr "" -#: ../../library/json.rst:566 +#: ../../library/json.rst:567 msgid "" "The RFC requires that JSON be represented using either UTF-8, UTF-16, or " "UTF-32, with UTF-8 being the recommended default for maximum " "interoperability." msgstr "" -#: ../../library/json.rst:569 +#: ../../library/json.rst:570 msgid "" "As permitted, though not required, by the RFC, this module's serializer sets " "*ensure_ascii=True* by default, thus escaping the output so that the " "resulting strings only contain ASCII characters." msgstr "" -#: ../../library/json.rst:573 +#: ../../library/json.rst:574 msgid "" "Other than the *ensure_ascii* parameter, this module is defined strictly in " "terms of conversion between Python objects and :class:`Unicode strings " @@ -638,7 +638,7 @@ msgid "" "encodings." msgstr "" -#: ../../library/json.rst:578 +#: ../../library/json.rst:579 msgid "" "The RFC prohibits adding a byte order mark (BOM) to the start of a JSON " "text, and this module's serializer does not add a BOM to its output. The RFC " @@ -647,7 +647,7 @@ msgid "" "an initial BOM is present." msgstr "" -#: ../../library/json.rst:584 +#: ../../library/json.rst:585 msgid "" "The RFC does not explicitly forbid JSON strings which contain byte sequences " "that don't correspond to valid Unicode characters (e.g. unpaired UTF-16 " @@ -656,29 +656,29 @@ msgid "" "class:`str`) code points for such sequences." msgstr "" -#: ../../library/json.rst:592 +#: ../../library/json.rst:593 msgid "Infinite and NaN Number Values" msgstr "" -#: ../../library/json.rst:594 +#: ../../library/json.rst:595 msgid "" "The RFC does not permit the representation of infinite or NaN number values. " "Despite that, by default, this module accepts and outputs ``Infinity``, ``-" "Infinity``, and ``NaN`` as if they were valid JSON number literal values::" msgstr "" -#: ../../library/json.rst:609 +#: ../../library/json.rst:610 msgid "" "In the serializer, the *allow_nan* parameter can be used to alter this " "behavior. In the deserializer, the *parse_constant* parameter can be used " "to alter this behavior." msgstr "" -#: ../../library/json.rst:615 +#: ../../library/json.rst:616 msgid "Repeated Names Within an Object" msgstr "" -#: ../../library/json.rst:617 +#: ../../library/json.rst:618 msgid "" "The RFC specifies that the names within a JSON object should be unique, but " "does not mandate how repeated names in JSON objects should be handled. By " @@ -686,15 +686,15 @@ msgid "" "but the last name-value pair for a given name::" msgstr "" -#: ../../library/json.rst:626 +#: ../../library/json.rst:627 msgid "The *object_pairs_hook* parameter can be used to alter this behavior." msgstr "" -#: ../../library/json.rst:630 +#: ../../library/json.rst:631 msgid "Top-level Non-Object, Non-Array Values" msgstr "" -#: ../../library/json.rst:632 +#: ../../library/json.rst:633 msgid "" "The old version of JSON specified by the obsolete :rfc:`4627` required that " "the top-level value of a JSON text must be either a JSON object or array " @@ -704,43 +704,43 @@ msgid "" "its serializer or its deserializer." msgstr "" -#: ../../library/json.rst:639 +#: ../../library/json.rst:640 msgid "" "Regardless, for maximum interoperability, you may wish to voluntarily adhere " "to the restriction yourself." msgstr "" -#: ../../library/json.rst:644 +#: ../../library/json.rst:645 msgid "Implementation Limitations" msgstr "" -#: ../../library/json.rst:646 +#: ../../library/json.rst:647 msgid "Some JSON deserializer implementations may set limits on:" msgstr "" -#: ../../library/json.rst:648 +#: ../../library/json.rst:649 msgid "the size of accepted JSON texts" msgstr "" -#: ../../library/json.rst:649 +#: ../../library/json.rst:650 msgid "the maximum level of nesting of JSON objects and arrays" msgstr "" -#: ../../library/json.rst:650 +#: ../../library/json.rst:651 msgid "the range and precision of JSON numbers" msgstr "" -#: ../../library/json.rst:651 +#: ../../library/json.rst:652 msgid "the content and maximum length of JSON strings" msgstr "" -#: ../../library/json.rst:653 +#: ../../library/json.rst:654 msgid "" "This module does not impose any such limits beyond those of the relevant " "Python datatypes themselves or the Python interpreter itself." msgstr "" -#: ../../library/json.rst:656 +#: ../../library/json.rst:657 msgid "" "When serializing to JSON, beware any such limitations in applications that " "may consume your JSON. In particular, it is common for JSON numbers to be " @@ -751,77 +751,77 @@ msgid "" "as :class:`decimal.Decimal`." msgstr "" -#: ../../library/json.rst:669 +#: ../../library/json.rst:670 msgid "Command Line Interface" msgstr "" -#: ../../library/json.rst:674 +#: ../../library/json.rst:675 msgid "**Source code:** :source:`Lib/json/tool.py`" msgstr "" -#: ../../library/json.rst:678 +#: ../../library/json.rst:679 msgid "" "The :mod:`json.tool` module provides a simple command line interface to " "validate and pretty-print JSON objects." msgstr "" -#: ../../library/json.rst:681 +#: ../../library/json.rst:682 msgid "" "If the optional ``infile`` and ``outfile`` arguments are not specified, :" "attr:`sys.stdin` and :attr:`sys.stdout` will be used respectively:" msgstr "" -#: ../../library/json.rst:693 +#: ../../library/json.rst:694 msgid "" "The output is now in the same order as the input. Use the :option:`--sort-" "keys` option to sort the output of dictionaries alphabetically by key." msgstr "" -#: ../../library/json.rst:700 +#: ../../library/json.rst:701 msgid "Command line options" msgstr "" -#: ../../library/json.rst:704 +#: ../../library/json.rst:705 msgid "The JSON file to be validated or pretty-printed:" msgstr "" -#: ../../library/json.rst:720 +#: ../../library/json.rst:721 msgid "If *infile* is not specified, read from :attr:`sys.stdin`." msgstr "" -#: ../../library/json.rst:724 +#: ../../library/json.rst:725 msgid "" "Write the output of the *infile* to the given *outfile*. Otherwise, write it " "to :attr:`sys.stdout`." msgstr "" -#: ../../library/json.rst:729 +#: ../../library/json.rst:730 msgid "Sort the output of dictionaries alphabetically by key." msgstr "" -#: ../../library/json.rst:735 +#: ../../library/json.rst:736 msgid "" "Disable escaping of non-ascii characters, see :func:`json.dumps` for more " "information." msgstr "" -#: ../../library/json.rst:741 +#: ../../library/json.rst:742 msgid "Parse every input line as separate JSON object." msgstr "" -#: ../../library/json.rst:747 -msgid "Mutually exclusive options for whitespace control." +#: ../../library/json.rst:748 +msgid "Mutually exclusive options for whitespace control" msgstr "" -#: ../../library/json.rst:753 +#: ../../library/json.rst:754 msgid "Show the help message." msgstr "" -#: ../../library/json.rst:757 +#: ../../library/json.rst:758 msgid "Footnotes" msgstr "註解" -#: ../../library/json.rst:758 +#: ../../library/json.rst:759 msgid "" "As noted in `the errata for RFC 7159 `_, JSON permits literal U+2028 (LINE SEPARATOR) " diff --git a/library/keyword.po b/library/keyword.po index 696095a4aa..ee44985174 100644 --- a/library/keyword.po +++ b/library/keyword.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.7\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2021-09-07 06:52+0000\n" +"POT-Creation-Date: 2020-06-20 18:08+0800\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-" @@ -42,15 +42,3 @@ msgid "" "interpreter. If any keywords are defined to only be active when particular :" "mod:`__future__` statements are in effect, these will be included as well." msgstr "" - -#: ../../library/keyword.rst:29 -msgid "Return ``True`` if *s* is a Python soft :ref:`keyword `." -msgstr "" - -#: ../../library/keyword.rst:36 -msgid "" -"Sequence containing all the soft :ref:`keywords ` defined for the " -"interpreter. If any soft keywords are defined to only be active when " -"particular :mod:`__future__` statements are in effect, these will be " -"included as well." -msgstr "" diff --git a/library/logging.config.po b/library/logging.config.po index 650ac3bfa5..03abe9ee09 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-07 06:52+0000\n" +"POT-Creation-Date: 2020-06-20 18:08+0800\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-" @@ -219,7 +219,7 @@ msgid "" "string packed in binary using ``struct.pack('>L', n)``." msgstr "" -#: ../../library/logging.config.rst:154 +#: ../../library/logging.config.rst:152 msgid "" "Because portions of the configuration are passed through :func:`eval`, use " "of this function may open its users to a security risk. While the function " @@ -237,11 +237,11 @@ msgid "" "from being applied." msgstr "" -#: ../../library/logging.config.rst:170 +#: ../../library/logging.config.rst:168 msgid "The ``verify`` argument was added." msgstr "" -#: ../../library/logging.config.rst:175 +#: ../../library/logging.config.rst:173 msgid "" "If you want to send configurations to the listener which don't disable " "existing loggers, you will need to use a JSON format for the configuration, " @@ -250,18 +250,18 @@ msgid "" "you send." msgstr "" -#: ../../library/logging.config.rst:184 +#: ../../library/logging.config.rst:182 msgid "" "Stops the listening server which was created with a call to :func:`listen`. " "This is typically called before calling :meth:`join` on the return value " "from :func:`listen`." msgstr "" -#: ../../library/logging.config.rst:192 +#: ../../library/logging.config.rst:190 msgid "Configuration dictionary schema" msgstr "" -#: ../../library/logging.config.rst:194 +#: ../../library/logging.config.rst:192 msgid "" "Describing a logging configuration requires listing the various objects to " "create and the connections between them; for example, you may create a " @@ -274,23 +274,23 @@ msgid "" "connections` below." msgstr "" -#: ../../library/logging.config.rst:206 +#: ../../library/logging.config.rst:204 msgid "Dictionary Schema Details" msgstr "" -#: ../../library/logging.config.rst:208 +#: ../../library/logging.config.rst:206 msgid "" "The dictionary passed to :func:`dictConfig` must contain the following keys:" msgstr "" -#: ../../library/logging.config.rst:211 +#: ../../library/logging.config.rst:209 msgid "" "*version* - to be set to an integer value representing the schema version. " "The only valid value at present is 1, but having this key allows the schema " "to evolve while still preserving backwards compatibility." msgstr "" -#: ../../library/logging.config.rst:216 +#: ../../library/logging.config.rst:214 msgid "" "All other keys are optional, but if present they will be interpreted as " "described below. In all cases below where a 'configuring dict' is " @@ -300,77 +300,77 @@ msgid "" "otherwise, the context is used to determine what to instantiate." msgstr "" -#: ../../library/logging.config.rst:223 +#: ../../library/logging.config.rst:221 msgid "" "*formatters* - the corresponding value will be a dict in which each key is a " "formatter id and each value is a dict describing how to configure the " "corresponding :class:`~logging.Formatter` instance." msgstr "" -#: ../../library/logging.config.rst:227 +#: ../../library/logging.config.rst:225 msgid "" "The configuring dict is searched for keys ``format`` and ``datefmt`` (with " "defaults of ``None``) and these are used to construct a :class:`~logging." "Formatter` instance." msgstr "" -#: ../../library/logging.config.rst:231 +#: ../../library/logging.config.rst:229 msgid "" "a ``validate`` key (with default of ``True``) can be added into the " "``formatters`` section of the configuring dict, this is to validate the " "format." msgstr "" -#: ../../library/logging.config.rst:236 +#: ../../library/logging.config.rst:234 msgid "" "*filters* - the corresponding value will be a dict in which each key is a " "filter id and each value is a dict describing how to configure the " "corresponding Filter instance." msgstr "" -#: ../../library/logging.config.rst:240 +#: ../../library/logging.config.rst:238 msgid "" "The configuring dict is searched for the key ``name`` (defaulting to the " "empty string) and this is used to construct a :class:`logging.Filter` " "instance." msgstr "" -#: ../../library/logging.config.rst:244 +#: ../../library/logging.config.rst:242 msgid "" "*handlers* - the corresponding value will be a dict in which each key is a " "handler id and each value is a dict describing how to configure the " "corresponding Handler instance." msgstr "" -#: ../../library/logging.config.rst:248 ../../library/logging.config.rst:290 +#: ../../library/logging.config.rst:246 ../../library/logging.config.rst:288 msgid "The configuring dict is searched for the following keys:" msgstr "" -#: ../../library/logging.config.rst:250 +#: ../../library/logging.config.rst:248 msgid "" "``class`` (mandatory). This is the fully qualified name of the handler " "class." msgstr "" -#: ../../library/logging.config.rst:253 +#: ../../library/logging.config.rst:251 msgid "``level`` (optional). The level of the handler." msgstr "" -#: ../../library/logging.config.rst:255 +#: ../../library/logging.config.rst:253 msgid "``formatter`` (optional). The id of the formatter for this handler." msgstr "" -#: ../../library/logging.config.rst:258 +#: ../../library/logging.config.rst:256 msgid "``filters`` (optional). A list of ids of the filters for this handler." msgstr "" -#: ../../library/logging.config.rst:261 +#: ../../library/logging.config.rst:259 msgid "" "All *other* keys are passed through as keyword arguments to the handler's " "constructor. For example, given the snippet:" msgstr "" -#: ../../library/logging.config.rst:280 +#: ../../library/logging.config.rst:278 msgid "" "the handler with id ``console`` is instantiated as a :class:`logging." "StreamHandler`, using ``sys.stdout`` as the underlying stream. The handler " @@ -379,44 +379,44 @@ msgid "" "maxBytes=1024, backupCount=3``." msgstr "" -#: ../../library/logging.config.rst:286 +#: ../../library/logging.config.rst:284 msgid "" "*loggers* - the corresponding value will be a dict in which each key is a " "logger name and each value is a dict describing how to configure the " "corresponding Logger instance." msgstr "" -#: ../../library/logging.config.rst:292 +#: ../../library/logging.config.rst:290 msgid "``level`` (optional). The level of the logger." msgstr "" -#: ../../library/logging.config.rst:294 +#: ../../library/logging.config.rst:292 msgid "``propagate`` (optional). The propagation setting of the logger." msgstr "" -#: ../../library/logging.config.rst:296 +#: ../../library/logging.config.rst:294 msgid "``filters`` (optional). A list of ids of the filters for this logger." msgstr "" -#: ../../library/logging.config.rst:299 +#: ../../library/logging.config.rst:297 msgid "" "``handlers`` (optional). A list of ids of the handlers for this logger." msgstr "" -#: ../../library/logging.config.rst:302 +#: ../../library/logging.config.rst:300 msgid "" "The specified loggers will be configured according to the level, " "propagation, filters and handlers specified." msgstr "" -#: ../../library/logging.config.rst:305 +#: ../../library/logging.config.rst:303 msgid "" "*root* - this will be the configuration for the root logger. Processing of " "the configuration will be as for any logger, except that the ``propagate`` " "setting will not be applicable." msgstr "" -#: ../../library/logging.config.rst:309 +#: ../../library/logging.config.rst:307 msgid "" "*incremental* - whether the configuration is to be interpreted as " "incremental to the existing configuration. This value defaults to " @@ -425,13 +425,13 @@ msgid "" "`fileConfig` API." msgstr "" -#: ../../library/logging.config.rst:315 +#: ../../library/logging.config.rst:313 msgid "" "If the specified value is ``True``, the configuration is processed as " "described in the section on :ref:`logging-config-dict-incremental`." msgstr "" -#: ../../library/logging.config.rst:318 +#: ../../library/logging.config.rst:316 msgid "" "*disable_existing_loggers* - whether any existing non-root loggers are to be " "disabled. This setting mirrors the parameter of the same name in :func:" @@ -439,11 +439,11 @@ msgid "" "ignored if *incremental* is ``True``." msgstr "" -#: ../../library/logging.config.rst:326 +#: ../../library/logging.config.rst:324 msgid "Incremental Configuration" msgstr "" -#: ../../library/logging.config.rst:328 +#: ../../library/logging.config.rst:326 msgid "" "It is difficult to provide complete flexibility for incremental " "configuration. For example, because objects such as filters and formatters " @@ -451,7 +451,7 @@ msgid "" "to such anonymous objects when augmenting a configuration." msgstr "" -#: ../../library/logging.config.rst:334 +#: ../../library/logging.config.rst:332 msgid "" "Furthermore, there is not a compelling case for arbitrarily altering the " "object graph of loggers, handlers, filters, formatters at run-time, once a " @@ -462,7 +462,7 @@ msgid "" "worth the complexity it adds to the implementation." msgstr "" -#: ../../library/logging.config.rst:343 +#: ../../library/logging.config.rst:341 msgid "" "Thus, when the ``incremental`` key of a configuration dict is present and is " "``True``, the system will completely ignore any ``formatters`` and " @@ -471,7 +471,7 @@ msgid "" "``loggers`` and ``root`` entries." msgstr "" -#: ../../library/logging.config.rst:349 +#: ../../library/logging.config.rst:347 msgid "" "Using a value in the configuration dict lets configurations to be sent over " "the wire as pickled dicts to a socket listener. Thus, the logging verbosity " @@ -479,11 +479,11 @@ msgid "" "and restart the application." msgstr "" -#: ../../library/logging.config.rst:357 +#: ../../library/logging.config.rst:355 msgid "Object connections" msgstr "" -#: ../../library/logging.config.rst:359 +#: ../../library/logging.config.rst:357 msgid "" "The schema describes a set of logging objects - loggers, handlers, " "formatters, filters - which are connected to each other in an object graph. " @@ -499,17 +499,17 @@ msgid "" "source and the destination object with that id." msgstr "" -#: ../../library/logging.config.rst:373 +#: ../../library/logging.config.rst:371 msgid "So, for example, consider the following YAML snippet:" msgstr "" -#: ../../library/logging.config.rst:394 +#: ../../library/logging.config.rst:392 msgid "" "(Note: YAML used here because it's a little more readable than the " "equivalent Python source form for the dictionary.)" msgstr "" -#: ../../library/logging.config.rst:397 +#: ../../library/logging.config.rst:395 msgid "" "The ids for loggers are the logger names which would be used " "programmatically to obtain a reference to those loggers, e.g. ``foo.bar." @@ -520,7 +520,7 @@ msgid "" "configuration call is complete." msgstr "" -#: ../../library/logging.config.rst:405 +#: ../../library/logging.config.rst:403 msgid "" "The above snippet indicates that logger named ``foo.bar.baz`` should have " "two handlers attached to it, which are described by the handler ids ``h1`` " @@ -528,11 +528,11 @@ msgid "" "the formatter for ``h2`` is that described by id ``precise``." msgstr "" -#: ../../library/logging.config.rst:415 +#: ../../library/logging.config.rst:413 msgid "User-defined objects" msgstr "" -#: ../../library/logging.config.rst:417 +#: ../../library/logging.config.rst:415 msgid "" "The schema supports user-defined objects for handlers, filters and " "formatters. (Loggers do not need to have different types for different " @@ -540,7 +540,7 @@ msgid "" "defined logger classes.)" msgstr "" -#: ../../library/logging.config.rst:422 +#: ../../library/logging.config.rst:420 msgid "" "Objects to be configured are described by dictionaries which detail their " "configuration. In some places, the logging system will be able to infer " @@ -553,7 +553,7 @@ msgid "" "made available under the special key ``'()'``. Here's a concrete example:" msgstr "" -#: ../../library/logging.config.rst:448 +#: ../../library/logging.config.rst:446 msgid "" "The above YAML snippet defines three formatters. The first, with id " "``brief``, is a standard :class:`logging.Formatter` instance with the " @@ -564,11 +564,11 @@ msgid "" "configuration sub-dictionaries::" msgstr "" -#: ../../library/logging.config.rst:460 +#: ../../library/logging.config.rst:458 msgid "and::" msgstr "" -#: ../../library/logging.config.rst:467 +#: ../../library/logging.config.rst:465 msgid "" "respectively, and as these dictionaries do not contain the special key " "``'()'``, the instantiation is inferred from the context: as a result, " @@ -577,7 +577,7 @@ msgid "" "is::" msgstr "" -#: ../../library/logging.config.rst:480 +#: ../../library/logging.config.rst:478 msgid "" "and this contains the special key ``'()'``, which means that user-defined " "instantiation is wanted. In this case, the specified factory callable will " @@ -589,7 +589,7 @@ msgid "" "assumed to be returned by the call::" msgstr "" -#: ../../library/logging.config.rst:492 +#: ../../library/logging.config.rst:490 msgid "" "The key ``'()'`` has been used as the special key because it is not a valid " "keyword parameter name, and so will not clash with the names of the keyword " @@ -597,11 +597,11 @@ msgid "" "corresponding value is a callable." msgstr "" -#: ../../library/logging.config.rst:501 +#: ../../library/logging.config.rst:499 msgid "Access to external objects" msgstr "" -#: ../../library/logging.config.rst:503 +#: ../../library/logging.config.rst:501 msgid "" "There are times where a configuration needs to refer to objects external to " "the configuration, for example ``sys.stderr``. If the configuration dict is " @@ -616,7 +616,7 @@ msgid "" "import mechanisms." msgstr "" -#: ../../library/logging.config.rst:516 +#: ../../library/logging.config.rst:514 msgid "" "The handling of such prefixes is done in a way analogous to protocol " "handling: there is a generic mechanism to look for prefixes which match the " @@ -626,11 +626,11 @@ msgid "" "prefix is not recognised, then the string value will be left as-is." msgstr "" -#: ../../library/logging.config.rst:528 +#: ../../library/logging.config.rst:526 msgid "Access to internal objects" msgstr "" -#: ../../library/logging.config.rst:530 +#: ../../library/logging.config.rst:528 msgid "" "As well as external objects, there is sometimes also a need to refer to " "objects in the configuration. This will be done implicitly by the " @@ -641,7 +641,7 @@ msgid "" "and resolve to the appropriate destination object." msgstr "" -#: ../../library/logging.config.rst:538 +#: ../../library/logging.config.rst:536 msgid "" "However, a more generic mechanism is needed for user-defined objects which " "are not known to the :mod:`logging` module. For example, consider :class:" @@ -655,7 +655,7 @@ msgid "" "resolution system allows the user to specify:" msgstr "" -#: ../../library/logging.config.rst:560 +#: ../../library/logging.config.rst:558 msgid "" "The literal string ``'cfg://handlers.file'`` will be resolved in an " "analogous way to strings with the ``ext://`` prefix, but looking in the " @@ -664,7 +664,7 @@ msgid "" "format``. Thus, given the following snippet:" msgstr "" -#: ../../library/logging.config.rst:578 +#: ../../library/logging.config.rst:576 msgid "" "in the configuration, the string ``'cfg://handlers'`` would resolve to the " "dict with key ``handlers``, the string ``'cfg://handlers.email`` would " @@ -680,7 +680,7 @@ msgid "" "needed." msgstr "" -#: ../../library/logging.config.rst:592 +#: ../../library/logging.config.rst:590 msgid "" "Given a string ``cfg://handlers.myhandler.mykey.123``, this will resolve to " "``config_dict['handlers']['myhandler']['mykey']['123']``. If the string is " @@ -690,11 +690,11 @@ msgid "" "['mykey']['123']`` if that fails." msgstr "" -#: ../../library/logging.config.rst:604 +#: ../../library/logging.config.rst:602 msgid "Import resolution and custom importers" msgstr "" -#: ../../library/logging.config.rst:606 +#: ../../library/logging.config.rst:604 msgid "" "Import resolution, by default, uses the builtin :func:`__import__` function " "to do its importing. You may want to replace this with your own importing " @@ -706,17 +706,17 @@ msgid "" "instance level, you need to wrap it with :func:`staticmethod`. For example::" msgstr "" -#: ../../library/logging.config.rst:621 +#: ../../library/logging.config.rst:619 msgid "" "You don't need to wrap with :func:`staticmethod` if you're setting the " "import callable on a configurator *instance*." msgstr "" -#: ../../library/logging.config.rst:628 +#: ../../library/logging.config.rst:626 msgid "Configuration file format" msgstr "" -#: ../../library/logging.config.rst:630 +#: ../../library/logging.config.rst:628 msgid "" "The configuration file format understood by :func:`fileConfig` is based on :" "mod:`configparser` functionality. The file must contain sections called " @@ -733,7 +733,7 @@ msgid "" "specified in a section called ``[logger_root]``." msgstr "" -#: ../../library/logging.config.rst:645 +#: ../../library/logging.config.rst:643 msgid "" "The :func:`fileConfig` API is older than the :func:`dictConfig` API and does " "not provide functionality to cover certain aspects of logging. For example, " @@ -746,17 +746,17 @@ msgid "" "when it's convenient to do so." msgstr "" -#: ../../library/logging.config.rst:655 +#: ../../library/logging.config.rst:653 msgid "Examples of these sections in the file are given below." msgstr "" -#: ../../library/logging.config.rst:668 +#: ../../library/logging.config.rst:666 msgid "" "The root logger must specify a level and a list of handlers. An example of a " "root logger section is given below." msgstr "" -#: ../../library/logging.config.rst:677 +#: ../../library/logging.config.rst:675 msgid "" "The ``level`` entry can be one of ``DEBUG, INFO, WARNING, ERROR, CRITICAL`` " "or ``NOTSET``. For the root logger only, ``NOTSET`` means that all messages " @@ -764,7 +764,7 @@ msgid "" "``logging`` package's namespace." msgstr "" -#: ../../library/logging.config.rst:682 +#: ../../library/logging.config.rst:680 msgid "" "The ``handlers`` entry is a comma-separated list of handler names, which " "must appear in the ``[handlers]`` section. These names must appear in the " @@ -772,13 +772,13 @@ msgid "" "file." msgstr "" -#: ../../library/logging.config.rst:687 +#: ../../library/logging.config.rst:685 msgid "" "For loggers other than the root logger, some additional information is " "required. This is illustrated by the following example." msgstr "" -#: ../../library/logging.config.rst:698 +#: ../../library/logging.config.rst:696 msgid "" "The ``level`` and ``handlers`` entries are interpreted as for the root " "logger, except that if a non-root logger's level is specified as ``NOTSET``, " @@ -791,20 +791,20 @@ msgid "" "application to get the logger." msgstr "" -#: ../../library/logging.config.rst:707 +#: ../../library/logging.config.rst:705 msgid "" "Sections which specify handler configuration are exemplified by the " "following." msgstr "" -#: ../../library/logging.config.rst:717 +#: ../../library/logging.config.rst:715 msgid "" "The ``class`` entry indicates the handler's class (as determined by :func:" "`eval` in the ``logging`` package's namespace). The ``level`` is interpreted " "as for loggers, and ``NOTSET`` is taken to mean 'log everything'." msgstr "" -#: ../../library/logging.config.rst:721 +#: ../../library/logging.config.rst:719 msgid "" "The ``formatter`` entry indicates the key name of the formatter for this " "handler. If blank, a default formatter (``logging._defaultFormatter``) is " @@ -812,7 +812,7 @@ msgid "" "and have a corresponding section in the configuration file." msgstr "" -#: ../../library/logging.config.rst:726 +#: ../../library/logging.config.rst:724 msgid "" "The ``args`` entry, when :func:`eval`\\ uated in the context of the " "``logging`` package's namespace, is the list of arguments to the constructor " @@ -821,19 +821,19 @@ msgid "" "provided, it defaults to ``()``." msgstr "" -#: ../../library/logging.config.rst:732 +#: ../../library/logging.config.rst:730 msgid "" "The optional ``kwargs`` entry, when :func:`eval`\\ uated in the context of " "the ``logging`` package's namespace, is the keyword argument dict to the " "constructor for the handler class. If not provided, it defaults to ``{}``." msgstr "" -#: ../../library/logging.config.rst:789 +#: ../../library/logging.config.rst:787 msgid "" "Sections which specify formatter configuration are typified by the following." msgstr "" -#: ../../library/logging.config.rst:798 +#: ../../library/logging.config.rst:796 msgid "" "The ``format`` entry is the overall format string, and the ``datefmt`` entry " "is the :func:`strftime`\\ -compatible date/time format string. If empty, " @@ -844,7 +844,7 @@ msgid "" "``2003-01-23 00:29:50,411``." msgstr "" -#: ../../library/logging.config.rst:805 +#: ../../library/logging.config.rst:803 msgid "" "The ``class`` entry is optional. It indicates the name of the formatter's " "class (as a dotted module and class name.) This option is useful for " @@ -853,7 +853,7 @@ msgid "" "condensed format." msgstr "" -#: ../../library/logging.config.rst:813 +#: ../../library/logging.config.rst:811 msgid "" "Due to the use of :func:`eval` as described above, there are potential " "security risks which result from using the :func:`listen` to send and " @@ -862,18 +862,18 @@ msgid "" "`listen` documentation for more information." msgstr "" -#: ../../library/logging.config.rst:822 +#: ../../library/logging.config.rst:820 msgid "Module :mod:`logging`" msgstr "" -#: ../../library/logging.config.rst:822 +#: ../../library/logging.config.rst:820 msgid "API reference for the logging module." msgstr "" -#: ../../library/logging.config.rst:824 +#: ../../library/logging.config.rst:822 msgid "Module :mod:`logging.handlers`" msgstr "" -#: ../../library/logging.config.rst:825 +#: ../../library/logging.config.rst:823 msgid "Useful handlers included with the logging module." msgstr "" diff --git a/library/logging.po b/library/logging.po index 53f05efb5a..160b41a989 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-07 06:52+0000\n" +"POT-Creation-Date: 2020-06-20 18:08+0800\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-" @@ -251,7 +251,7 @@ msgid "" "information." msgstr "" -#: ../../library/logging.rst:172 ../../library/logging.rst:970 +#: ../../library/logging.rst:172 ../../library/logging.rst:966 msgid "" "The second optional keyword argument is *stack_info*, which defaults to " "``False``. If true, stack information is added to the logging message, " @@ -263,14 +263,14 @@ msgid "" "handlers." msgstr "" -#: ../../library/logging.rst:181 ../../library/logging.rst:979 +#: ../../library/logging.rst:181 ../../library/logging.rst:975 msgid "" "You can specify *stack_info* independently of *exc_info*, e.g. to just show " "how you got to a certain point in your code, even when no exceptions were " "raised. The stack frames are printed following a header line which says:" msgstr "" -#: ../../library/logging.rst:189 ../../library/logging.rst:987 +#: ../../library/logging.rst:189 ../../library/logging.rst:983 msgid "" "This mimics the ``Traceback (most recent call last):`` which is used when " "displaying exception frames." @@ -301,7 +301,7 @@ msgstr "" msgid "would print something like" msgstr "" -#: ../../library/logging.rst:218 ../../library/logging.rst:1007 +#: ../../library/logging.rst:218 ../../library/logging.rst:1003 msgid "" "The keys in the dictionary passed in *extra* should not clash with the keys " "used by the logging system. (See the :class:`Formatter` documentation for " @@ -319,7 +319,7 @@ msgid "" "dictionary with these keys." msgstr "" -#: ../../library/logging.rst:229 ../../library/logging.rst:1018 +#: ../../library/logging.rst:229 ../../library/logging.rst:1014 msgid "" "While this might be annoying, this feature is intended for use in " "specialized circumstances, such as multi-threaded servers where the same " @@ -330,7 +330,7 @@ msgid "" "particular :class:`Handler`\\ s." msgstr "" -#: ../../library/logging.rst:236 ../../library/logging.rst:1025 +#: ../../library/logging.rst:236 ../../library/logging.rst:1021 msgid "The *stack_info* parameter was added." msgstr "" @@ -998,11 +998,11 @@ msgstr "" msgid "Attribute name" msgstr "" -#: ../../library/logging.rst:783 ../../library/logging.rst:1172 +#: ../../library/logging.rst:783 ../../library/logging.rst:1159 msgid "Format" msgstr "" -#: ../../library/logging.rst:783 ../../library/logging.rst:1172 +#: ../../library/logging.rst:783 ../../library/logging.rst:1159 msgid "Description" msgstr "描述" @@ -1323,17 +1323,11 @@ msgid "" "class:`LoggerAdapter`. These methods delegate to the underlying logger." msgstr "" -#: ../../library/logging.rst:896 -msgid "" -"Attribute :attr:`manager` and method :meth:`_log` were added, which delegate " -"to the underlying logger and allow adapters to be nested." -msgstr "" - -#: ../../library/logging.rst:902 +#: ../../library/logging.rst:898 msgid "Thread Safety" msgstr "" -#: ../../library/logging.rst:904 +#: ../../library/logging.rst:900 msgid "" "The logging module is intended to be thread-safe without any special work " "needing to be done by its clients. It achieves this though using threading " @@ -1342,7 +1336,7 @@ msgid "" "O." msgstr "" -#: ../../library/logging.rst:909 +#: ../../library/logging.rst:905 msgid "" "If you are implementing asynchronous signal handlers using the :mod:`signal` " "module, you may not be able to use logging from within such handlers. This " @@ -1350,17 +1344,17 @@ msgid "" "always re-entrant, and so cannot be invoked from such signal handlers." msgstr "" -#: ../../library/logging.rst:916 +#: ../../library/logging.rst:912 msgid "Module-Level Functions" msgstr "" -#: ../../library/logging.rst:918 +#: ../../library/logging.rst:914 msgid "" "In addition to the classes described above, there are a number of module-" "level functions." msgstr "" -#: ../../library/logging.rst:924 +#: ../../library/logging.rst:920 msgid "" "Return a logger with the specified name or, if name is ``None``, return a " "logger which is the root logger of the hierarchy. If specified, the name is " @@ -1369,14 +1363,14 @@ msgid "" "logging." msgstr "" -#: ../../library/logging.rst:929 +#: ../../library/logging.rst:925 msgid "" "All calls to this function with a given name return the same logger " "instance. This means that logger instances never need to be passed between " "different parts of an application." msgstr "" -#: ../../library/logging.rst:936 +#: ../../library/logging.rst:932 msgid "" "Return either the standard :class:`Logger` class, or the last class passed " "to :func:`setLoggerClass`. This function may be called from within a new " @@ -1385,24 +1379,24 @@ msgid "" "example::" msgstr "" -#: ../../library/logging.rst:947 +#: ../../library/logging.rst:943 msgid "Return a callable which is used to create a :class:`LogRecord`." msgstr "" -#: ../../library/logging.rst:949 +#: ../../library/logging.rst:945 msgid "" "This function has been provided, along with :func:`setLogRecordFactory`, to " "allow developers more control over how the :class:`LogRecord` representing a " "logging event is constructed." msgstr "" -#: ../../library/logging.rst:954 +#: ../../library/logging.rst:950 msgid "" "See :func:`setLogRecordFactory` for more information about the how the " "factory is called." msgstr "" -#: ../../library/logging.rst:959 +#: ../../library/logging.rst:955 msgid "" "Logs a message with level :const:`DEBUG` on the root logger. The *msg* is " "the message format string, and the *args* are the arguments which are merged " @@ -1411,7 +1405,7 @@ msgid "" "argument.)" msgstr "" -#: ../../library/logging.rst:964 +#: ../../library/logging.rst:960 msgid "" "There are three keyword arguments in *kwargs* which are inspected: " "*exc_info* which, if it does not evaluate as false, causes exception " @@ -1421,7 +1415,7 @@ msgid "" "exception information." msgstr "" -#: ../../library/logging.rst:990 +#: ../../library/logging.rst:986 msgid "" "The third optional keyword argument is *extra* which can be used to pass a " "dictionary which is used to populate the __dict__ of the LogRecord created " @@ -1430,11 +1424,11 @@ msgid "" "logged messages. For example::" msgstr "" -#: ../../library/logging.rst:1001 +#: ../../library/logging.rst:997 msgid "would print something like:" msgstr "" -#: ../../library/logging.rst:1011 +#: ../../library/logging.rst:1007 msgid "" "If you choose to use these attributes in logged messages, you need to " "exercise some care. In the above example, for instance, the :class:" @@ -1445,51 +1439,51 @@ msgid "" "dictionary with these keys." msgstr "" -#: ../../library/logging.rst:1030 +#: ../../library/logging.rst:1026 msgid "" "Logs a message with level :const:`INFO` on the root logger. The arguments " "are interpreted as for :func:`debug`." msgstr "" -#: ../../library/logging.rst:1036 +#: ../../library/logging.rst:1032 msgid "" "Logs a message with level :const:`WARNING` on the root logger. The arguments " "are interpreted as for :func:`debug`." msgstr "" -#: ../../library/logging.rst:1039 +#: ../../library/logging.rst:1035 msgid "" "There is an obsolete function ``warn`` which is functionally identical to " "``warning``. As ``warn`` is deprecated, please do not use it - use " "``warning`` instead." msgstr "" -#: ../../library/logging.rst:1046 +#: ../../library/logging.rst:1042 msgid "" "Logs a message with level :const:`ERROR` on the root logger. The arguments " "are interpreted as for :func:`debug`." msgstr "" -#: ../../library/logging.rst:1052 +#: ../../library/logging.rst:1048 msgid "" "Logs a message with level :const:`CRITICAL` on the root logger. The " "arguments are interpreted as for :func:`debug`." msgstr "" -#: ../../library/logging.rst:1058 +#: ../../library/logging.rst:1054 msgid "" "Logs a message with level :const:`ERROR` on the root logger. The arguments " "are interpreted as for :func:`debug`. Exception info is added to the logging " "message. This function should only be called from an exception handler." msgstr "" -#: ../../library/logging.rst:1064 +#: ../../library/logging.rst:1060 msgid "" "Logs a message with level *level* on the root logger. The other arguments " "are interpreted as for :func:`debug`." msgstr "" -#: ../../library/logging.rst:1067 +#: ../../library/logging.rst:1063 msgid "" "The above module-level convenience functions, which delegate to the root " "logger, call :func:`basicConfig` to ensure that at least one handler is " @@ -1502,7 +1496,7 @@ msgid "" "messages for the same event." msgstr "" -#: ../../library/logging.rst:1079 +#: ../../library/logging.rst:1075 msgid "" "Provides an overriding level *level* for all loggers which takes precedence " "over the logger's own level. When the need arises to temporarily throttle " @@ -1516,7 +1510,7 @@ msgid "" "individual loggers." msgstr "" -#: ../../library/logging.rst:1090 +#: ../../library/logging.rst:1086 msgid "" "Note that if you have defined any custom logging level higher than " "``CRITICAL`` (this is not recommended), you won't be able to rely on the " @@ -1524,13 +1518,13 @@ msgid "" "a suitable value." msgstr "" -#: ../../library/logging.rst:1095 +#: ../../library/logging.rst:1091 msgid "" -"The *level* parameter was defaulted to level ``CRITICAL``. See :issue:" -"`28524` for more information about this change." +"The *level* parameter was defaulted to level ``CRITICAL``. See Issue #28524 " +"for more information about this change." msgstr "" -#: ../../library/logging.rst:1101 +#: ../../library/logging.rst:1097 msgid "" "Associates level *level* with text *levelName* in an internal dictionary, " "which is used to map numeric levels to a textual representation, for example " @@ -1540,49 +1534,33 @@ msgid "" "and they should increase in increasing order of severity." msgstr "" -#: ../../library/logging.rst:1108 +#: ../../library/logging.rst:1104 msgid "" "If you are thinking of defining your own levels, please see the section on :" "ref:`custom-levels`." msgstr "" -#: ../../library/logging.rst:1113 -msgid "Returns the textual or numeric representation of logging level *level*." -msgstr "" - -#: ../../library/logging.rst:1115 +#: ../../library/logging.rst:1109 msgid "" -"If *level* is one of the predefined levels :const:`CRITICAL`, :const:" -"`ERROR`, :const:`WARNING`, :const:`INFO` or :const:`DEBUG` then you get the " -"corresponding string. If you have associated levels with names using :func:" -"`addLevelName` then the name you have associated with *level* is returned. " -"If a numeric value corresponding to one of the defined levels is passed in, " -"the corresponding string representation is returned." +"Returns the textual representation of logging level *level*. If the level is " +"one of the predefined levels :const:`CRITICAL`, :const:`ERROR`, :const:" +"`WARNING`, :const:`INFO` or :const:`DEBUG` then you get the corresponding " +"string. If you have associated levels with names using :func:`addLevelName` " +"then the name you have associated with *level* is returned. If a numeric " +"value corresponding to one of the defined levels is passed in, the " +"corresponding string representation is returned. Otherwise, the string " +"'Level %s' % level is returned." msgstr "" -#: ../../library/logging.rst:1122 -msgid "" -"The *level* parameter also accepts a string representation of the level such " -"as 'INFO'. In such cases, this functions returns the corresponding numeric " -"value of the level." -msgstr "" - -#: ../../library/logging.rst:1126 -msgid "" -"If no matching numeric or string value is passed in, the string 'Level %s' % " -"level is returned." -msgstr "" - -#: ../../library/logging.rst:1129 +#: ../../library/logging.rst:1117 msgid "" "Levels are internally integers (as they need to be compared in the logging " "logic). This function is used to convert between an integer level and the " "level name displayed in the formatted log output by means of the ``" -"%(levelname)s`` format specifier (see :ref:`logrecord-attributes`), and vice " -"versa." +"%(levelname)s`` format specifier (see :ref:`logrecord-attributes`)." msgstr "" -#: ../../library/logging.rst:1135 +#: ../../library/logging.rst:1122 msgid "" "In Python versions earlier than 3.4, this function could also be passed a " "text level, and would return the corresponding numeric value of the level. " @@ -1590,7 +1568,7 @@ msgid "" "Python 3.4, but reinstated in 3.4.2 due to retain backward compatibility." msgstr "" -#: ../../library/logging.rst:1143 +#: ../../library/logging.rst:1130 msgid "" "Creates and returns a new :class:`LogRecord` instance whose attributes are " "defined by *attrdict*. This function is useful for taking a pickled :class:" @@ -1598,7 +1576,7 @@ msgid "" "as a :class:`LogRecord` instance at the receiving end." msgstr "" -#: ../../library/logging.rst:1151 +#: ../../library/logging.rst:1138 msgid "" "Does basic configuration for the logging system by creating a :class:" "`StreamHandler` with a default :class:`Formatter` and adding it to the root " @@ -1607,13 +1585,13 @@ msgid "" "no handlers are defined for the root logger." msgstr "" -#: ../../library/logging.rst:1157 +#: ../../library/logging.rst:1144 msgid "" "This function does nothing if the root logger already has handlers " "configured, unless the keyword argument *force* is set to ``True``." msgstr "" -#: ../../library/logging.rst:1160 +#: ../../library/logging.rst:1147 msgid "" "This function should be called from the main thread before other threads are " "started. In versions of Python prior to 2.7.1 and 3.2, if this function is " @@ -1622,54 +1600,52 @@ msgid "" "unexpected results such as messages being duplicated in the log." msgstr "" -#: ../../library/logging.rst:1167 +#: ../../library/logging.rst:1154 msgid "The following keyword arguments are supported." msgstr "" -#: ../../library/logging.rst:1174 +#: ../../library/logging.rst:1161 msgid "*filename*" msgstr "" -#: ../../library/logging.rst:1174 +#: ../../library/logging.rst:1161 msgid "" "Specifies that a FileHandler be created, using the specified filename, " "rather than a StreamHandler." msgstr "" -#: ../../library/logging.rst:1178 +#: ../../library/logging.rst:1165 msgid "*filemode*" msgstr "" -#: ../../library/logging.rst:1178 +#: ../../library/logging.rst:1165 msgid "" "If *filename* is specified, open the file in this :ref:`mode `. " "Defaults to ``'a'``." msgstr "" -#: ../../library/logging.rst:1182 +#: ../../library/logging.rst:1169 msgid "*format*" msgstr "" -#: ../../library/logging.rst:1182 -msgid "" -"Use the specified format string for the handler. Defaults to attributes " -"``levelname``, ``name`` and ``message`` separated by colons." +#: ../../library/logging.rst:1169 +msgid "Use the specified format string for the handler." msgstr "" -#: ../../library/logging.rst:1187 +#: ../../library/logging.rst:1172 msgid "*datefmt*" msgstr "" -#: ../../library/logging.rst:1187 +#: ../../library/logging.rst:1172 msgid "" "Use the specified date/time format, as accepted by :func:`time.strftime`." msgstr "" -#: ../../library/logging.rst:1190 +#: ../../library/logging.rst:1175 msgid "*style*" msgstr "" -#: ../../library/logging.rst:1190 +#: ../../library/logging.rst:1175 msgid "" "If *format* is specified, use this style for the format string. One of " "``'%'``, ``'{'`` or ``'$'`` for :ref:`printf-style `." msgstr "" -#: ../../library/logging.rst:1201 +#: ../../library/logging.rst:1186 msgid "*stream*" msgstr "" -#: ../../library/logging.rst:1201 +#: ../../library/logging.rst:1186 msgid "" "Use the specified stream to initialize the StreamHandler. Note that this " "argument is incompatible with *filename* - if both are present, a " "``ValueError`` is raised." msgstr "" -#: ../../library/logging.rst:1206 +#: ../../library/logging.rst:1191 msgid "*handlers*" msgstr "" -#: ../../library/logging.rst:1206 +#: ../../library/logging.rst:1191 msgid "" "If specified, this should be an iterable of already created handlers to add " "to the root logger. Any handlers which don't already have a formatter set " @@ -1709,33 +1685,33 @@ msgid "" "present, a ``ValueError`` is raised." msgstr "" -#: ../../library/logging.rst:1215 +#: ../../library/logging.rst:1200 msgid "*force*" msgstr "" -#: ../../library/logging.rst:1215 +#: ../../library/logging.rst:1200 msgid "" "If this keyword argument is specified as true, any existing handlers " "attached to the root logger are removed and closed, before carrying out the " "configuration as specified by the other arguments." msgstr "" -#: ../../library/logging.rst:1221 +#: ../../library/logging.rst:1206 msgid "*encoding*" msgstr "" -#: ../../library/logging.rst:1221 +#: ../../library/logging.rst:1206 msgid "" "If this keyword argument is specified along with *filename*, its value is " "used when the FileHandler is created, and thus used when opening the output " "file." msgstr "" -#: ../../library/logging.rst:1226 +#: ../../library/logging.rst:1211 msgid "*errors*" msgstr "" -#: ../../library/logging.rst:1226 +#: ../../library/logging.rst:1211 msgid "" "If this keyword argument is specified along with *filename*, its value is " "used when the FileHandler is created, and thus used when opening the output " @@ -1744,39 +1720,39 @@ msgid "" "that it will be treated the same as passing 'errors'." msgstr "" -#: ../../library/logging.rst:1237 +#: ../../library/logging.rst:1222 msgid "The *style* argument was added." msgstr "" -#: ../../library/logging.rst:1240 +#: ../../library/logging.rst:1225 msgid "" "The *handlers* argument was added. Additional checks were added to catch " "situations where incompatible arguments are specified (e.g. *handlers* " "together with *stream* or *filename*, or *stream* together with *filename*)." msgstr "" -#: ../../library/logging.rst:1246 +#: ../../library/logging.rst:1231 msgid "The *force* argument was added." msgstr "" -#: ../../library/logging.rst:1249 +#: ../../library/logging.rst:1234 msgid "The *encoding* and *errors* arguments were added." msgstr "" -#: ../../library/logging.rst:1254 +#: ../../library/logging.rst:1239 msgid "" "Informs the logging system to perform an orderly shutdown by flushing and " "closing all handlers. This should be called at application exit and no " "further use of the logging system should be made after this call." msgstr "" -#: ../../library/logging.rst:1258 +#: ../../library/logging.rst:1243 msgid "" "When the logging module is imported, it registers this function as an exit " "handler (see :mod:`atexit`), so normally there's no need to do that manually." msgstr "" -#: ../../library/logging.rst:1265 +#: ../../library/logging.rst:1250 msgid "" "Tells the logging system to use the class *klass* when instantiating a " "logger. The class should define :meth:`__init__` such that only a name " @@ -1788,32 +1764,32 @@ msgid "" "loggers." msgstr "" -#: ../../library/logging.rst:1276 +#: ../../library/logging.rst:1261 msgid "Set a callable which is used to create a :class:`LogRecord`." msgstr "" -#: ../../library/logging.rst:1278 +#: ../../library/logging.rst:1263 msgid "The factory callable to be used to instantiate a log record." msgstr "" -#: ../../library/logging.rst:1280 +#: ../../library/logging.rst:1265 msgid "" "This function has been provided, along with :func:`getLogRecordFactory`, to " "allow developers more control over how the :class:`LogRecord` representing a " "logging event is constructed." msgstr "" -#: ../../library/logging.rst:1285 +#: ../../library/logging.rst:1270 msgid "The factory has the following signature:" msgstr "" -#: ../../library/logging.rst:1287 +#: ../../library/logging.rst:1272 msgid "" "``factory(name, level, fn, lno, msg, args, exc_info, func=None, sinfo=None, " "**kwargs)``" msgstr "" -#: ../../library/logging.rst:1289 +#: ../../library/logging.rst:1274 msgid "The logger name." msgstr "" @@ -1821,7 +1797,7 @@ msgstr "" msgid "level" msgstr "" -#: ../../library/logging.rst:1290 +#: ../../library/logging.rst:1275 msgid "The logging level (numeric)." msgstr "" @@ -1829,7 +1805,7 @@ msgstr "" msgid "fn" msgstr "" -#: ../../library/logging.rst:1291 +#: ../../library/logging.rst:1276 msgid "The full pathname of the file where the logging call was made." msgstr "" @@ -1837,19 +1813,19 @@ msgstr "" msgid "lno" msgstr "" -#: ../../library/logging.rst:1292 +#: ../../library/logging.rst:1277 msgid "The line number in the file where the logging call was made." msgstr "" -#: ../../library/logging.rst:1293 +#: ../../library/logging.rst:1278 msgid "The logging message." msgstr "" -#: ../../library/logging.rst:1294 +#: ../../library/logging.rst:1279 msgid "The arguments for the logging message." msgstr "" -#: ../../library/logging.rst:1295 +#: ../../library/logging.rst:1280 msgid "An exception tuple, or ``None``." msgstr "" @@ -1857,7 +1833,7 @@ msgstr "" msgid "func" msgstr "" -#: ../../library/logging.rst:1296 +#: ../../library/logging.rst:1281 msgid "The name of the function or method which invoked the logging call." msgstr "" @@ -1865,7 +1841,7 @@ msgstr "" msgid "sinfo" msgstr "" -#: ../../library/logging.rst:1298 +#: ../../library/logging.rst:1283 msgid "" "A stack traceback such as is provided by :func:`traceback.print_stack`, " "showing the call hierarchy." @@ -1875,15 +1851,15 @@ msgstr "" msgid "kwargs" msgstr "" -#: ../../library/logging.rst:1300 +#: ../../library/logging.rst:1285 msgid "Additional keyword arguments." msgstr "" -#: ../../library/logging.rst:1304 +#: ../../library/logging.rst:1289 msgid "Module-Level Attributes" msgstr "" -#: ../../library/logging.rst:1308 +#: ../../library/logging.rst:1293 msgid "" "A \"handler of last resort\" is available through this attribute. This is a :" "class:`StreamHandler` writing to ``sys.stderr`` with a level of ``WARNING``, " @@ -1894,22 +1870,22 @@ msgid "" "reason, ``lastResort`` can be set to ``None``." msgstr "" -#: ../../library/logging.rst:1319 +#: ../../library/logging.rst:1304 msgid "Integration with the warnings module" msgstr "" -#: ../../library/logging.rst:1321 +#: ../../library/logging.rst:1306 msgid "" "The :func:`captureWarnings` function can be used to integrate :mod:`logging` " "with the :mod:`warnings` module." msgstr "" -#: ../../library/logging.rst:1326 +#: ../../library/logging.rst:1311 msgid "" "This function is used to turn the capture of warnings by logging on and off." msgstr "" -#: ../../library/logging.rst:1329 +#: ../../library/logging.rst:1314 msgid "" "If *capture* is ``True``, warnings issued by the :mod:`warnings` module will " "be redirected to the logging system. Specifically, a warning will be " @@ -1918,46 +1894,46 @@ msgid "" "`WARNING`." msgstr "" -#: ../../library/logging.rst:1334 +#: ../../library/logging.rst:1319 msgid "" "If *capture* is ``False``, the redirection of warnings to the logging system " "will stop, and warnings will be redirected to their original destinations (i." "e. those in effect before ``captureWarnings(True)`` was called)." msgstr "" -#: ../../library/logging.rst:1342 +#: ../../library/logging.rst:1327 msgid "Module :mod:`logging.config`" msgstr "" -#: ../../library/logging.rst:1342 +#: ../../library/logging.rst:1327 msgid "Configuration API for the logging module." msgstr "" -#: ../../library/logging.rst:1345 +#: ../../library/logging.rst:1330 msgid "Module :mod:`logging.handlers`" msgstr "" -#: ../../library/logging.rst:1345 +#: ../../library/logging.rst:1330 msgid "Useful handlers included with the logging module." msgstr "" -#: ../../library/logging.rst:1349 +#: ../../library/logging.rst:1334 msgid ":pep:`282` - A Logging System" msgstr "" -#: ../../library/logging.rst:1348 +#: ../../library/logging.rst:1333 msgid "" "The proposal which described this feature for inclusion in the Python " "standard library." msgstr "" -#: ../../library/logging.rst:1354 +#: ../../library/logging.rst:1339 msgid "" "`Original Python logging package `_" msgstr "" -#: ../../library/logging.rst:1352 +#: ../../library/logging.rst:1337 msgid "" "This is the original source for the :mod:`logging` package. The version of " "the package available from this site is suitable for use with Python 1.5.2, " diff --git a/library/mailbox.po b/library/mailbox.po index 54547d7c87..b79b3a1fc4 100644 --- a/library/mailbox.po +++ b/library/mailbox.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.7\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2021-09-07 06:52+0000\n" +"POT-Creation-Date: 2020-06-20 18:08+0800\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-" @@ -400,7 +400,7 @@ msgid "" "addition to the following:" msgstr "" -#: ../../library/mailbox.rst:357 ../../library/mailbox.rst:529 +#: ../../library/mailbox.rst:357 ../../library/mailbox.rst:535 msgid "Return a list of the names of all folders." msgstr "" @@ -417,7 +417,7 @@ msgid "" "instance representing it." msgstr "" -#: ../../library/mailbox.rst:375 ../../library/mailbox.rst:547 +#: ../../library/mailbox.rst:375 ../../library/mailbox.rst:553 msgid "" "Delete the folder whose name is *folder*. If the folder contains any " "messages, a :exc:`NotEmptyError` exception will be raised and the folder " @@ -469,32 +469,41 @@ msgid "" "the underlying message while the returned file remains open." msgstr "" -#: ../../library/mailbox.rst:431 +#: ../../library/mailbox.rst:430 msgid "" -"`maildir man page from Courier `_" +"`maildir man page from qmail `_" msgstr "" #: ../../library/mailbox.rst:430 -msgid "" -"A specification of the format. Describes a common extension for supporting " -"folders." +msgid "The original specification of the format." msgstr "" #: ../../library/mailbox.rst:434 msgid "`Using maildir format `_" msgstr "" -#: ../../library/mailbox.rst:434 +#: ../../library/mailbox.rst:433 msgid "" "Notes on Maildir by its inventor. Includes an updated name-creation scheme " "and details on \"info\" semantics." msgstr "" -#: ../../library/mailbox.rst:441 +#: ../../library/mailbox.rst:437 +msgid "" +"`maildir man page from Courier `_" +msgstr "" + +#: ../../library/mailbox.rst:437 +msgid "" +"Another specification of the format. Describes a common extension for " +"supporting folders." +msgstr "" + +#: ../../library/mailbox.rst:444 msgid ":class:`mbox`" msgstr "" -#: ../../library/mailbox.rst:446 +#: ../../library/mailbox.rst:449 msgid "" "A subclass of :class:`Mailbox` for mailboxes in mbox format. Parameter " "*factory* is a callable object that accepts a file-like message " @@ -504,7 +513,7 @@ msgid "" "mailbox is created if it does not exist." msgstr "" -#: ../../library/mailbox.rst:453 +#: ../../library/mailbox.rst:456 msgid "" "The mbox format is the classic format for storing mail on Unix systems. All " "messages in an mbox mailbox are stored in a single file with the beginning " @@ -512,7 +521,7 @@ msgid "" "\"." msgstr "" -#: ../../library/mailbox.rst:457 +#: ../../library/mailbox.rst:460 msgid "" "Several variations of the mbox format exist to address perceived " "shortcomings in the original. In the interest of compatibility, :class:" @@ -524,60 +533,68 @@ msgid "" "when reading the message." msgstr "" -#: ../../library/mailbox.rst:465 +#: ../../library/mailbox.rst:468 msgid "" "Some :class:`Mailbox` methods implemented by :class:`mbox` deserve special " "remarks:" msgstr "" -#: ../../library/mailbox.rst:471 +#: ../../library/mailbox.rst:474 msgid "" "Using the file after calling :meth:`flush` or :meth:`close` on the :class:" "`mbox` instance may yield unpredictable results or raise an exception." msgstr "" -#: ../../library/mailbox.rst:479 ../../library/mailbox.rst:688 -#: ../../library/mailbox.rst:739 +#: ../../library/mailbox.rst:482 ../../library/mailbox.rst:694 +#: ../../library/mailbox.rst:745 msgid "" "Three locking mechanisms are used---dot locking and, if available, the :c:" "func:`flock` and :c:func:`lockf` system calls." msgstr "" -#: ../../library/mailbox.rst:486 +#: ../../library/mailbox.rst:489 +msgid "`mbox man page from qmail `_" +msgstr "" + +#: ../../library/mailbox.rst:489 +msgid "A specification of the format and its variations." +msgstr "" + +#: ../../library/mailbox.rst:492 msgid "" "`mbox man page from tin `_" msgstr "" -#: ../../library/mailbox.rst:486 -msgid "A specification of the format, with details on locking." +#: ../../library/mailbox.rst:492 +msgid "Another specification of the format, with details on locking." msgstr "" -#: ../../library/mailbox.rst:489 +#: ../../library/mailbox.rst:495 msgid "" "`Configuring Netscape Mail on Unix: Why The Content-Length Format is Bad " "`_" msgstr "" -#: ../../library/mailbox.rst:489 +#: ../../library/mailbox.rst:495 msgid "An argument for using the original mbox format rather than a variation." msgstr "" -#: ../../library/mailbox.rst:491 +#: ../../library/mailbox.rst:497 msgid "" "`\"mbox\" is a family of several mutually incompatible mailbox formats " "`_" msgstr "" -#: ../../library/mailbox.rst:492 +#: ../../library/mailbox.rst:498 msgid "A history of mbox variations." msgstr "" -#: ../../library/mailbox.rst:498 +#: ../../library/mailbox.rst:504 msgid ":class:`MH`" msgstr "" -#: ../../library/mailbox.rst:503 +#: ../../library/mailbox.rst:509 msgid "" "A subclass of :class:`Mailbox` for mailboxes in MH format. Parameter " "*factory* is a callable object that accepts a file-like message " @@ -587,7 +604,7 @@ msgid "" "is created if it does not exist." msgstr "" -#: ../../library/mailbox.rst:510 +#: ../../library/mailbox.rst:516 msgid "" "MH is a directory-based mailbox format invented for the MH Message Handling " "System, a mail user agent. Each message in an MH mailbox resides in its own " @@ -598,7 +615,7 @@ msgid "" "called :file:`.mh_sequences` in each folder." msgstr "" -#: ../../library/mailbox.rst:518 +#: ../../library/mailbox.rst:524 msgid "" "The :class:`MH` class manipulates MH mailboxes, but it does not attempt to " "emulate all of :program:`mh`'s behaviors. In particular, it does not modify " @@ -606,63 +623,63 @@ msgid "" "are used by :program:`mh` to store its state and configuration." msgstr "" -#: ../../library/mailbox.rst:523 +#: ../../library/mailbox.rst:529 msgid "" ":class:`MH` instances have all of the methods of :class:`Mailbox` in " "addition to the following:" msgstr "" -#: ../../library/mailbox.rst:534 +#: ../../library/mailbox.rst:540 msgid "" "Return an :class:`MH` instance representing the folder whose name is " "*folder*. A :exc:`NoSuchMailboxError` exception is raised if the folder does " "not exist." msgstr "" -#: ../../library/mailbox.rst:541 +#: ../../library/mailbox.rst:547 msgid "" "Create a folder whose name is *folder* and return an :class:`MH` instance " "representing it." msgstr "" -#: ../../library/mailbox.rst:554 +#: ../../library/mailbox.rst:560 msgid "" "Return a dictionary of sequence names mapped to key lists. If there are no " "sequences, the empty dictionary is returned." msgstr "" -#: ../../library/mailbox.rst:560 +#: ../../library/mailbox.rst:566 msgid "" "Re-define the sequences that exist in the mailbox based upon *sequences*, a " "dictionary of names mapped to key lists, like returned by :meth:" "`get_sequences`." msgstr "" -#: ../../library/mailbox.rst:567 +#: ../../library/mailbox.rst:573 msgid "" "Rename messages in the mailbox as necessary to eliminate gaps in numbering. " "Entries in the sequences list are updated correspondingly." msgstr "" -#: ../../library/mailbox.rst:572 +#: ../../library/mailbox.rst:578 msgid "" "Already-issued keys are invalidated by this operation and should not be " "subsequently used." msgstr "" -#: ../../library/mailbox.rst:575 +#: ../../library/mailbox.rst:581 msgid "" "Some :class:`Mailbox` methods implemented by :class:`MH` deserve special " "remarks:" msgstr "" -#: ../../library/mailbox.rst:583 +#: ../../library/mailbox.rst:589 msgid "" "These methods immediately delete the message. The MH convention of marking a " "message for deletion by prepending a comma to its name is not used." msgstr "" -#: ../../library/mailbox.rst:590 +#: ../../library/mailbox.rst:596 msgid "" "Three locking mechanisms are used---dot locking and, if available, the :c:" "func:`flock` and :c:func:`lockf` system calls. For MH mailboxes, locking the " @@ -671,51 +688,51 @@ msgid "" "files." msgstr "" -#: ../../library/mailbox.rst:599 +#: ../../library/mailbox.rst:605 msgid "" "Depending upon the host platform, it may not be possible to remove the " "underlying message while the returned file remains open." msgstr "" -#: ../../library/mailbox.rst:605 +#: ../../library/mailbox.rst:611 msgid "" "All changes to MH mailboxes are immediately applied, so this method does " "nothing." msgstr "" -#: ../../library/mailbox.rst:611 +#: ../../library/mailbox.rst:617 msgid "" ":class:`MH` instances do not keep any open files, so this method is " "equivalent to :meth:`unlock`." msgstr "" -#: ../../library/mailbox.rst:618 +#: ../../library/mailbox.rst:624 msgid "`nmh - Message Handling System `_" msgstr "" -#: ../../library/mailbox.rst:618 +#: ../../library/mailbox.rst:624 msgid "" "Home page of :program:`nmh`, an updated version of the original :program:" "`mh`." msgstr "" -#: ../../library/mailbox.rst:621 +#: ../../library/mailbox.rst:627 msgid "" "`MH & nmh: Email for Users & Programmers `_" msgstr "" -#: ../../library/mailbox.rst:621 +#: ../../library/mailbox.rst:627 msgid "" "A GPL-licensed book on :program:`mh` and :program:`nmh`, with some " "information on the mailbox format." msgstr "" -#: ../../library/mailbox.rst:628 +#: ../../library/mailbox.rst:634 msgid ":class:`Babyl`" msgstr "" -#: ../../library/mailbox.rst:633 +#: ../../library/mailbox.rst:639 msgid "" "A subclass of :class:`Mailbox` for mailboxes in Babyl format. Parameter " "*factory* is a callable object that accepts a file-like message " @@ -725,7 +742,7 @@ msgid "" "mailbox is created if it does not exist." msgstr "" -#: ../../library/mailbox.rst:640 +#: ../../library/mailbox.rst:646 msgid "" "Babyl is a single-file mailbox format used by the Rmail mail user agent " "included with Emacs. The beginning of a message is indicated by a line " @@ -735,7 +752,7 @@ msgid "" "Underscore (``'\\037'``) character." msgstr "" -#: ../../library/mailbox.rst:647 +#: ../../library/mailbox.rst:653 msgid "" "Messages in a Babyl mailbox have two sets of headers, original headers and " "so-called visible headers. Visible headers are typically a subset of the " @@ -746,31 +763,31 @@ msgid "" "in the Babyl options section." msgstr "" -#: ../../library/mailbox.rst:655 +#: ../../library/mailbox.rst:661 msgid "" ":class:`Babyl` instances have all of the methods of :class:`Mailbox` in " "addition to the following:" msgstr "" -#: ../../library/mailbox.rst:661 +#: ../../library/mailbox.rst:667 msgid "" "Return a list of the names of all user-defined labels used in the mailbox." msgstr "" -#: ../../library/mailbox.rst:665 +#: ../../library/mailbox.rst:671 msgid "" "The actual messages are inspected to determine which labels exist in the " "mailbox rather than consulting the list of labels in the Babyl options " "section, but the Babyl section is updated whenever the mailbox is modified." msgstr "" -#: ../../library/mailbox.rst:670 +#: ../../library/mailbox.rst:676 msgid "" "Some :class:`Mailbox` methods implemented by :class:`Babyl` deserve special " "remarks:" msgstr "" -#: ../../library/mailbox.rst:676 +#: ../../library/mailbox.rst:682 msgid "" "In Babyl mailboxes, the headers of a message are not stored contiguously " "with the body of the message. To generate a file-like representation, the " @@ -780,30 +797,30 @@ msgid "" "memory compared to a string representation." msgstr "" -#: ../../library/mailbox.rst:695 +#: ../../library/mailbox.rst:701 msgid "" "`Format of Version 5 Babyl Files `_" msgstr "" -#: ../../library/mailbox.rst:695 +#: ../../library/mailbox.rst:701 msgid "A specification of the Babyl format." msgstr "" -#: ../../library/mailbox.rst:697 +#: ../../library/mailbox.rst:703 msgid "" "`Reading Mail with Rmail `_" msgstr "" -#: ../../library/mailbox.rst:698 +#: ../../library/mailbox.rst:704 msgid "The Rmail manual, with some information on Babyl semantics." msgstr "" -#: ../../library/mailbox.rst:704 +#: ../../library/mailbox.rst:710 msgid ":class:`MMDF`" msgstr "" -#: ../../library/mailbox.rst:709 +#: ../../library/mailbox.rst:715 msgid "" "A subclass of :class:`Mailbox` for mailboxes in MMDF format. Parameter " "*factory* is a callable object that accepts a file-like message " @@ -813,7 +830,7 @@ msgid "" "mailbox is created if it does not exist." msgstr "" -#: ../../library/mailbox.rst:716 +#: ../../library/mailbox.rst:722 msgid "" "MMDF is a single-file mailbox format invented for the Multichannel " "Memorandum Distribution Facility, a mail transfer agent. Each message is in " @@ -826,51 +843,51 @@ msgid "" "subsequent messages." msgstr "" -#: ../../library/mailbox.rst:725 +#: ../../library/mailbox.rst:731 msgid "" "Some :class:`Mailbox` methods implemented by :class:`MMDF` deserve special " "remarks:" msgstr "" -#: ../../library/mailbox.rst:731 +#: ../../library/mailbox.rst:737 msgid "" "Using the file after calling :meth:`flush` or :meth:`close` on the :class:" "`MMDF` instance may yield unpredictable results or raise an exception." msgstr "" -#: ../../library/mailbox.rst:746 +#: ../../library/mailbox.rst:752 msgid "" "`mmdf man page from tin `_" msgstr "" -#: ../../library/mailbox.rst:746 +#: ../../library/mailbox.rst:752 msgid "" "A specification of MMDF format from the documentation of tin, a newsreader." msgstr "" -#: ../../library/mailbox.rst:749 +#: ../../library/mailbox.rst:755 msgid "`MMDF `_" msgstr "" -#: ../../library/mailbox.rst:749 +#: ../../library/mailbox.rst:755 msgid "" "A Wikipedia article describing the Multichannel Memorandum Distribution " "Facility." msgstr "" -#: ../../library/mailbox.rst:756 +#: ../../library/mailbox.rst:762 msgid ":class:`Message` objects" msgstr "" -#: ../../library/mailbox.rst:761 +#: ../../library/mailbox.rst:767 msgid "" "A subclass of the :mod:`email.message` module's :class:`~email.message." "Message`. Subclasses of :class:`mailbox.Message` add mailbox-format-specific " "state and behavior." msgstr "" -#: ../../library/mailbox.rst:765 +#: ../../library/mailbox.rst:771 msgid "" "If *message* is omitted, the new instance is created in a default, empty " "state. If *message* is an :class:`email.message.Message` instance, its " @@ -882,7 +899,7 @@ msgid "" "compatibility." msgstr "" -#: ../../library/mailbox.rst:774 +#: ../../library/mailbox.rst:780 msgid "" "The format-specific state and behaviors offered by subclasses vary, but in " "general it is only the properties that are not specific to a particular " @@ -894,7 +911,7 @@ msgid "" "important is retained, because it applies to the message itself." msgstr "" -#: ../../library/mailbox.rst:783 +#: ../../library/mailbox.rst:789 msgid "" "There is no requirement that :class:`Message` instances be used to represent " "messages retrieved using :class:`Mailbox` instances. In some situations, the " @@ -904,17 +921,17 @@ msgid "" "be specified when a :class:`Mailbox` instance is initialized." msgstr "" -#: ../../library/mailbox.rst:794 +#: ../../library/mailbox.rst:800 msgid ":class:`MaildirMessage`" msgstr "" -#: ../../library/mailbox.rst:799 +#: ../../library/mailbox.rst:805 msgid "" "A message with Maildir-specific behaviors. Parameter *message* has the same " "meaning as with the :class:`Message` constructor." msgstr "" -#: ../../library/mailbox.rst:802 +#: ../../library/mailbox.rst:808 msgid "" "Typically, a mail user agent application moves all of the messages in the :" "file:`new` subdirectory to the :file:`cur` subdirectory after the first time " @@ -928,128 +945,128 @@ msgid "" "flags for Maildir messages are as follows:" msgstr "" -#: ../../library/mailbox.rst:814 ../../library/mailbox.rst:981 -#: ../../library/mailbox.rst:1351 +#: ../../library/mailbox.rst:820 ../../library/mailbox.rst:987 +#: ../../library/mailbox.rst:1357 msgid "Flag" msgstr "" -#: ../../library/mailbox.rst:814 ../../library/mailbox.rst:981 -#: ../../library/mailbox.rst:1351 +#: ../../library/mailbox.rst:820 ../../library/mailbox.rst:987 +#: ../../library/mailbox.rst:1357 msgid "Meaning" msgstr "" -#: ../../library/mailbox.rst:814 ../../library/mailbox.rst:981 -#: ../../library/mailbox.rst:1131 ../../library/mailbox.rst:1218 -#: ../../library/mailbox.rst:1351 +#: ../../library/mailbox.rst:820 ../../library/mailbox.rst:987 +#: ../../library/mailbox.rst:1137 ../../library/mailbox.rst:1224 +#: ../../library/mailbox.rst:1357 msgid "Explanation" msgstr "" -#: ../../library/mailbox.rst:816 ../../library/mailbox.rst:987 -#: ../../library/mailbox.rst:1357 +#: ../../library/mailbox.rst:822 ../../library/mailbox.rst:993 +#: ../../library/mailbox.rst:1363 msgid "D" msgstr "" -#: ../../library/mailbox.rst:816 +#: ../../library/mailbox.rst:822 msgid "Draft" msgstr "" -#: ../../library/mailbox.rst:816 +#: ../../library/mailbox.rst:822 msgid "Under composition" msgstr "" -#: ../../library/mailbox.rst:818 ../../library/mailbox.rst:989 -#: ../../library/mailbox.rst:1359 +#: ../../library/mailbox.rst:824 ../../library/mailbox.rst:995 +#: ../../library/mailbox.rst:1365 msgid "F" msgstr "" -#: ../../library/mailbox.rst:818 ../../library/mailbox.rst:989 -#: ../../library/mailbox.rst:1359 +#: ../../library/mailbox.rst:824 ../../library/mailbox.rst:995 +#: ../../library/mailbox.rst:1365 msgid "Flagged" msgstr "" -#: ../../library/mailbox.rst:818 ../../library/mailbox.rst:989 -#: ../../library/mailbox.rst:1137 ../../library/mailbox.rst:1359 +#: ../../library/mailbox.rst:824 ../../library/mailbox.rst:995 +#: ../../library/mailbox.rst:1143 ../../library/mailbox.rst:1365 msgid "Marked as important" msgstr "" -#: ../../library/mailbox.rst:820 +#: ../../library/mailbox.rst:826 msgid "P" msgstr "" -#: ../../library/mailbox.rst:820 +#: ../../library/mailbox.rst:826 msgid "Passed" msgstr "" -#: ../../library/mailbox.rst:820 +#: ../../library/mailbox.rst:826 msgid "Forwarded, resent, or bounced" msgstr "" -#: ../../library/mailbox.rst:822 ../../library/mailbox.rst:983 -#: ../../library/mailbox.rst:1353 +#: ../../library/mailbox.rst:828 ../../library/mailbox.rst:989 +#: ../../library/mailbox.rst:1359 msgid "R" msgstr "" -#: ../../library/mailbox.rst:822 +#: ../../library/mailbox.rst:828 msgid "Replied" msgstr "" -#: ../../library/mailbox.rst:822 ../../library/mailbox.rst:991 -#: ../../library/mailbox.rst:1135 ../../library/mailbox.rst:1226 -#: ../../library/mailbox.rst:1361 +#: ../../library/mailbox.rst:828 ../../library/mailbox.rst:997 +#: ../../library/mailbox.rst:1141 ../../library/mailbox.rst:1232 +#: ../../library/mailbox.rst:1367 msgid "Replied to" msgstr "" -#: ../../library/mailbox.rst:824 +#: ../../library/mailbox.rst:830 msgid "S" msgstr "" -#: ../../library/mailbox.rst:824 +#: ../../library/mailbox.rst:830 msgid "Seen" msgstr "" -#: ../../library/mailbox.rst:824 ../../library/mailbox.rst:983 -#: ../../library/mailbox.rst:1353 +#: ../../library/mailbox.rst:830 ../../library/mailbox.rst:989 +#: ../../library/mailbox.rst:1359 msgid "Read" msgstr "" -#: ../../library/mailbox.rst:826 +#: ../../library/mailbox.rst:832 msgid "T" msgstr "" -#: ../../library/mailbox.rst:826 +#: ../../library/mailbox.rst:832 msgid "Trashed" msgstr "" -#: ../../library/mailbox.rst:826 ../../library/mailbox.rst:987 -#: ../../library/mailbox.rst:1222 ../../library/mailbox.rst:1357 +#: ../../library/mailbox.rst:832 ../../library/mailbox.rst:993 +#: ../../library/mailbox.rst:1228 ../../library/mailbox.rst:1363 msgid "Marked for subsequent deletion" msgstr "" -#: ../../library/mailbox.rst:829 +#: ../../library/mailbox.rst:835 msgid ":class:`MaildirMessage` instances offer the following methods:" msgstr "" -#: ../../library/mailbox.rst:834 +#: ../../library/mailbox.rst:840 msgid "" "Return either \"new\" (if the message should be stored in the :file:`new` " "subdirectory) or \"cur\" (if the message should be stored in the :file:`cur` " "subdirectory)." msgstr "" -#: ../../library/mailbox.rst:840 +#: ../../library/mailbox.rst:846 msgid "" "A message is typically moved from :file:`new` to :file:`cur` after its " "mailbox has been accessed, whether or not the message is has been read. A " "message ``msg`` has been read if ``\"S\" in msg.get_flags()`` is ``True``." msgstr "" -#: ../../library/mailbox.rst:848 +#: ../../library/mailbox.rst:854 msgid "" "Set the subdirectory the message should be stored in. Parameter *subdir* " "must be either \"new\" or \"cur\"." msgstr "" -#: ../../library/mailbox.rst:854 +#: ../../library/mailbox.rst:860 msgid "" "Return a string specifying the flags that are currently set. If the message " "complies with the standard Maildir format, the result is the concatenation " @@ -1058,11 +1075,11 @@ msgid "" "flags are set or if \"info\" contains experimental semantics." msgstr "" -#: ../../library/mailbox.rst:864 +#: ../../library/mailbox.rst:870 msgid "Set the flags specified by *flags* and unset all others." msgstr "" -#: ../../library/mailbox.rst:869 +#: ../../library/mailbox.rst:875 msgid "" "Set the flag(s) specified by *flag* without changing other flags. To add " "more than one flag at a time, *flag* may be a string of more than one " @@ -1070,7 +1087,7 @@ msgid "" "experimental information rather than flags." msgstr "" -#: ../../library/mailbox.rst:877 +#: ../../library/mailbox.rst:883 msgid "" "Unset the flag(s) specified by *flag* without changing other flags. To " "remove more than one flag at a time, *flag* maybe a string of more than one " @@ -1078,30 +1095,30 @@ msgid "" "the current \"info\" is not modified." msgstr "" -#: ../../library/mailbox.rst:885 +#: ../../library/mailbox.rst:891 msgid "" "Return the delivery date of the message as a floating-point number " "representing seconds since the epoch." msgstr "" -#: ../../library/mailbox.rst:891 +#: ../../library/mailbox.rst:897 msgid "" "Set the delivery date of the message to *date*, a floating-point number " "representing seconds since the epoch." msgstr "" -#: ../../library/mailbox.rst:897 +#: ../../library/mailbox.rst:903 msgid "" "Return a string containing the \"info\" for a message. This is useful for " "accessing and modifying \"info\" that is experimental (i.e., not a list of " "flags)." msgstr "" -#: ../../library/mailbox.rst:904 +#: ../../library/mailbox.rst:910 msgid "Set \"info\" to *info*, which should be a string." msgstr "" -#: ../../library/mailbox.rst:906 +#: ../../library/mailbox.rst:912 msgid "" "When a :class:`MaildirMessage` instance is created based upon an :class:" "`mboxMessage` or :class:`MMDFMessage` instance, the :mailheader:`Status` " @@ -1109,176 +1126,176 @@ msgid "" "take place:" msgstr "" -#: ../../library/mailbox.rst:912 ../../library/mailbox.rst:930 -#: ../../library/mailbox.rst:945 ../../library/mailbox.rst:1052 -#: ../../library/mailbox.rst:1069 ../../library/mailbox.rst:1084 -#: ../../library/mailbox.rst:1099 ../../library/mailbox.rst:1166 -#: ../../library/mailbox.rst:1181 ../../library/mailbox.rst:1195 -#: ../../library/mailbox.rst:1292 ../../library/mailbox.rst:1309 -#: ../../library/mailbox.rst:1323 ../../library/mailbox.rst:1423 -#: ../../library/mailbox.rst:1440 ../../library/mailbox.rst:1455 -#: ../../library/mailbox.rst:1471 +#: ../../library/mailbox.rst:918 ../../library/mailbox.rst:936 +#: ../../library/mailbox.rst:951 ../../library/mailbox.rst:1058 +#: ../../library/mailbox.rst:1075 ../../library/mailbox.rst:1090 +#: ../../library/mailbox.rst:1105 ../../library/mailbox.rst:1172 +#: ../../library/mailbox.rst:1187 ../../library/mailbox.rst:1201 +#: ../../library/mailbox.rst:1298 ../../library/mailbox.rst:1315 +#: ../../library/mailbox.rst:1329 ../../library/mailbox.rst:1429 +#: ../../library/mailbox.rst:1446 ../../library/mailbox.rst:1461 +#: ../../library/mailbox.rst:1477 msgid "Resulting state" msgstr "" -#: ../../library/mailbox.rst:912 ../../library/mailbox.rst:1181 -#: ../../library/mailbox.rst:1309 +#: ../../library/mailbox.rst:918 ../../library/mailbox.rst:1187 +#: ../../library/mailbox.rst:1315 msgid ":class:`mboxMessage` or :class:`MMDFMessage` state" msgstr "" -#: ../../library/mailbox.rst:915 ../../library/mailbox.rst:932 -#: ../../library/mailbox.rst:947 ../../library/mailbox.rst:1056 -#: ../../library/mailbox.rst:1427 +#: ../../library/mailbox.rst:921 ../../library/mailbox.rst:938 +#: ../../library/mailbox.rst:953 ../../library/mailbox.rst:1062 +#: ../../library/mailbox.rst:1433 msgid "\"cur\" subdirectory" msgstr "" -#: ../../library/mailbox.rst:915 ../../library/mailbox.rst:1056 -#: ../../library/mailbox.rst:1073 ../../library/mailbox.rst:1088 -#: ../../library/mailbox.rst:1103 ../../library/mailbox.rst:1427 -#: ../../library/mailbox.rst:1444 ../../library/mailbox.rst:1459 -#: ../../library/mailbox.rst:1475 +#: ../../library/mailbox.rst:921 ../../library/mailbox.rst:1062 +#: ../../library/mailbox.rst:1079 ../../library/mailbox.rst:1094 +#: ../../library/mailbox.rst:1109 ../../library/mailbox.rst:1433 +#: ../../library/mailbox.rst:1450 ../../library/mailbox.rst:1465 +#: ../../library/mailbox.rst:1481 msgid "O flag" msgstr "" -#: ../../library/mailbox.rst:917 ../../library/mailbox.rst:936 -#: ../../library/mailbox.rst:1060 ../../library/mailbox.rst:1075 -#: ../../library/mailbox.rst:1107 ../../library/mailbox.rst:1172 -#: ../../library/mailbox.rst:1188 ../../library/mailbox.rst:1431 -#: ../../library/mailbox.rst:1446 ../../library/mailbox.rst:1479 +#: ../../library/mailbox.rst:923 ../../library/mailbox.rst:942 +#: ../../library/mailbox.rst:1066 ../../library/mailbox.rst:1081 +#: ../../library/mailbox.rst:1113 ../../library/mailbox.rst:1178 +#: ../../library/mailbox.rst:1194 ../../library/mailbox.rst:1437 +#: ../../library/mailbox.rst:1452 ../../library/mailbox.rst:1485 msgid "F flag" msgstr "" -#: ../../library/mailbox.rst:919 ../../library/mailbox.rst:921 -#: ../../library/mailbox.rst:938 ../../library/mailbox.rst:953 -#: ../../library/mailbox.rst:1054 ../../library/mailbox.rst:1062 -#: ../../library/mailbox.rst:1101 ../../library/mailbox.rst:1170 -#: ../../library/mailbox.rst:1298 ../../library/mailbox.rst:1425 -#: ../../library/mailbox.rst:1433 ../../library/mailbox.rst:1473 +#: ../../library/mailbox.rst:925 ../../library/mailbox.rst:927 +#: ../../library/mailbox.rst:944 ../../library/mailbox.rst:959 +#: ../../library/mailbox.rst:1060 ../../library/mailbox.rst:1068 +#: ../../library/mailbox.rst:1107 ../../library/mailbox.rst:1176 +#: ../../library/mailbox.rst:1304 ../../library/mailbox.rst:1431 +#: ../../library/mailbox.rst:1439 ../../library/mailbox.rst:1479 msgid "R flag" msgstr "" -#: ../../library/mailbox.rst:919 ../../library/mailbox.rst:1062 -#: ../../library/mailbox.rst:1077 ../../library/mailbox.rst:1092 -#: ../../library/mailbox.rst:1109 ../../library/mailbox.rst:1186 -#: ../../library/mailbox.rst:1316 ../../library/mailbox.rst:1433 -#: ../../library/mailbox.rst:1448 ../../library/mailbox.rst:1463 -#: ../../library/mailbox.rst:1481 +#: ../../library/mailbox.rst:925 ../../library/mailbox.rst:1068 +#: ../../library/mailbox.rst:1083 ../../library/mailbox.rst:1098 +#: ../../library/mailbox.rst:1115 ../../library/mailbox.rst:1192 +#: ../../library/mailbox.rst:1322 ../../library/mailbox.rst:1439 +#: ../../library/mailbox.rst:1454 ../../library/mailbox.rst:1469 +#: ../../library/mailbox.rst:1487 msgid "A flag" msgstr "" -#: ../../library/mailbox.rst:921 ../../library/mailbox.rst:1054 -#: ../../library/mailbox.rst:1425 +#: ../../library/mailbox.rst:927 ../../library/mailbox.rst:1060 +#: ../../library/mailbox.rst:1431 msgid "S flag" msgstr "" -#: ../../library/mailbox.rst:923 ../../library/mailbox.rst:955 -#: ../../library/mailbox.rst:1058 ../../library/mailbox.rst:1296 -#: ../../library/mailbox.rst:1429 +#: ../../library/mailbox.rst:929 ../../library/mailbox.rst:961 +#: ../../library/mailbox.rst:1064 ../../library/mailbox.rst:1302 +#: ../../library/mailbox.rst:1435 msgid "T flag" msgstr "" -#: ../../library/mailbox.rst:923 ../../library/mailbox.rst:1058 -#: ../../library/mailbox.rst:1090 ../../library/mailbox.rst:1105 -#: ../../library/mailbox.rst:1314 ../../library/mailbox.rst:1429 -#: ../../library/mailbox.rst:1461 ../../library/mailbox.rst:1477 +#: ../../library/mailbox.rst:929 ../../library/mailbox.rst:1064 +#: ../../library/mailbox.rst:1096 ../../library/mailbox.rst:1111 +#: ../../library/mailbox.rst:1320 ../../library/mailbox.rst:1435 +#: ../../library/mailbox.rst:1467 ../../library/mailbox.rst:1483 msgid "D flag" msgstr "" -#: ../../library/mailbox.rst:926 +#: ../../library/mailbox.rst:932 msgid "" "When a :class:`MaildirMessage` instance is created based upon an :class:" "`MHMessage` instance, the following conversions take place:" msgstr "" -#: ../../library/mailbox.rst:930 ../../library/mailbox.rst:1069 -#: ../../library/mailbox.rst:1323 ../../library/mailbox.rst:1440 +#: ../../library/mailbox.rst:936 ../../library/mailbox.rst:1075 +#: ../../library/mailbox.rst:1329 ../../library/mailbox.rst:1446 msgid ":class:`MHMessage` state" msgstr "" -#: ../../library/mailbox.rst:932 ../../library/mailbox.rst:1073 -#: ../../library/mailbox.rst:1168 ../../library/mailbox.rst:1184 -#: ../../library/mailbox.rst:1197 ../../library/mailbox.rst:1325 -#: ../../library/mailbox.rst:1444 +#: ../../library/mailbox.rst:938 ../../library/mailbox.rst:1079 +#: ../../library/mailbox.rst:1174 ../../library/mailbox.rst:1190 +#: ../../library/mailbox.rst:1203 ../../library/mailbox.rst:1331 +#: ../../library/mailbox.rst:1450 msgid "\"unseen\" sequence" msgstr "" -#: ../../library/mailbox.rst:934 ../../library/mailbox.rst:949 +#: ../../library/mailbox.rst:940 ../../library/mailbox.rst:955 msgid "\"cur\" subdirectory and S flag" msgstr "" -#: ../../library/mailbox.rst:934 ../../library/mailbox.rst:1071 -#: ../../library/mailbox.rst:1442 +#: ../../library/mailbox.rst:940 ../../library/mailbox.rst:1077 +#: ../../library/mailbox.rst:1448 msgid "no \"unseen\" sequence" msgstr "" -#: ../../library/mailbox.rst:936 ../../library/mailbox.rst:1075 -#: ../../library/mailbox.rst:1172 ../../library/mailbox.rst:1188 -#: ../../library/mailbox.rst:1446 +#: ../../library/mailbox.rst:942 ../../library/mailbox.rst:1081 +#: ../../library/mailbox.rst:1178 ../../library/mailbox.rst:1194 +#: ../../library/mailbox.rst:1452 msgid "\"flagged\" sequence" msgstr "" -#: ../../library/mailbox.rst:938 ../../library/mailbox.rst:1077 -#: ../../library/mailbox.rst:1170 ../../library/mailbox.rst:1186 -#: ../../library/mailbox.rst:1199 ../../library/mailbox.rst:1327 -#: ../../library/mailbox.rst:1448 +#: ../../library/mailbox.rst:944 ../../library/mailbox.rst:1083 +#: ../../library/mailbox.rst:1176 ../../library/mailbox.rst:1192 +#: ../../library/mailbox.rst:1205 ../../library/mailbox.rst:1333 +#: ../../library/mailbox.rst:1454 msgid "\"replied\" sequence" msgstr "" -#: ../../library/mailbox.rst:941 +#: ../../library/mailbox.rst:947 msgid "" "When a :class:`MaildirMessage` instance is created based upon a :class:" "`BabylMessage` instance, the following conversions take place:" msgstr "" -#: ../../library/mailbox.rst:945 ../../library/mailbox.rst:1084 -#: ../../library/mailbox.rst:1195 ../../library/mailbox.rst:1455 +#: ../../library/mailbox.rst:951 ../../library/mailbox.rst:1090 +#: ../../library/mailbox.rst:1201 ../../library/mailbox.rst:1461 msgid ":class:`BabylMessage` state" msgstr "" -#: ../../library/mailbox.rst:947 ../../library/mailbox.rst:1088 -#: ../../library/mailbox.rst:1197 ../../library/mailbox.rst:1294 -#: ../../library/mailbox.rst:1312 ../../library/mailbox.rst:1325 -#: ../../library/mailbox.rst:1459 +#: ../../library/mailbox.rst:953 ../../library/mailbox.rst:1094 +#: ../../library/mailbox.rst:1203 ../../library/mailbox.rst:1300 +#: ../../library/mailbox.rst:1318 ../../library/mailbox.rst:1331 +#: ../../library/mailbox.rst:1465 msgid "\"unseen\" label" msgstr "" -#: ../../library/mailbox.rst:949 ../../library/mailbox.rst:1086 -#: ../../library/mailbox.rst:1457 +#: ../../library/mailbox.rst:955 ../../library/mailbox.rst:1092 +#: ../../library/mailbox.rst:1463 msgid "no \"unseen\" label" msgstr "" -#: ../../library/mailbox.rst:951 ../../library/mailbox.rst:1300 +#: ../../library/mailbox.rst:957 ../../library/mailbox.rst:1306 msgid "P flag" msgstr "" -#: ../../library/mailbox.rst:951 +#: ../../library/mailbox.rst:957 msgid "\"forwarded\" or \"resent\" label" msgstr "" -#: ../../library/mailbox.rst:953 ../../library/mailbox.rst:1092 -#: ../../library/mailbox.rst:1199 ../../library/mailbox.rst:1298 -#: ../../library/mailbox.rst:1316 ../../library/mailbox.rst:1327 -#: ../../library/mailbox.rst:1463 +#: ../../library/mailbox.rst:959 ../../library/mailbox.rst:1098 +#: ../../library/mailbox.rst:1205 ../../library/mailbox.rst:1304 +#: ../../library/mailbox.rst:1322 ../../library/mailbox.rst:1333 +#: ../../library/mailbox.rst:1469 msgid "\"answered\" label" msgstr "" -#: ../../library/mailbox.rst:955 ../../library/mailbox.rst:1090 -#: ../../library/mailbox.rst:1296 ../../library/mailbox.rst:1314 -#: ../../library/mailbox.rst:1461 +#: ../../library/mailbox.rst:961 ../../library/mailbox.rst:1096 +#: ../../library/mailbox.rst:1302 ../../library/mailbox.rst:1320 +#: ../../library/mailbox.rst:1467 msgid "\"deleted\" label" msgstr "" -#: ../../library/mailbox.rst:962 +#: ../../library/mailbox.rst:968 msgid ":class:`mboxMessage`" msgstr "" -#: ../../library/mailbox.rst:967 +#: ../../library/mailbox.rst:973 msgid "" "A message with mbox-specific behaviors. Parameter *message* has the same " "meaning as with the :class:`Message` constructor." msgstr "" -#: ../../library/mailbox.rst:970 +#: ../../library/mailbox.rst:976 msgid "" "Messages in an mbox mailbox are stored together in a single file. The " "sender's envelope address and the time of delivery are typically stored in a " @@ -1289,53 +1306,53 @@ msgid "" "typically stored in :mailheader:`Status` and :mailheader:`X-Status` headers." msgstr "" -#: ../../library/mailbox.rst:978 +#: ../../library/mailbox.rst:984 msgid "Conventional flags for mbox messages are as follows:" msgstr "" -#: ../../library/mailbox.rst:985 ../../library/mailbox.rst:1355 +#: ../../library/mailbox.rst:991 ../../library/mailbox.rst:1361 msgid "O" msgstr "" -#: ../../library/mailbox.rst:985 ../../library/mailbox.rst:1355 +#: ../../library/mailbox.rst:991 ../../library/mailbox.rst:1361 msgid "Old" msgstr "" -#: ../../library/mailbox.rst:985 ../../library/mailbox.rst:1355 +#: ../../library/mailbox.rst:991 ../../library/mailbox.rst:1361 msgid "Previously detected by MUA" msgstr "" -#: ../../library/mailbox.rst:987 ../../library/mailbox.rst:1357 +#: ../../library/mailbox.rst:993 ../../library/mailbox.rst:1363 msgid "Deleted" msgstr "" -#: ../../library/mailbox.rst:991 ../../library/mailbox.rst:1361 +#: ../../library/mailbox.rst:997 ../../library/mailbox.rst:1367 msgid "A" msgstr "" -#: ../../library/mailbox.rst:991 ../../library/mailbox.rst:1361 +#: ../../library/mailbox.rst:997 ../../library/mailbox.rst:1367 msgid "Answered" msgstr "" -#: ../../library/mailbox.rst:994 ../../library/mailbox.rst:1364 +#: ../../library/mailbox.rst:1000 ../../library/mailbox.rst:1370 msgid "" "The \"R\" and \"O\" flags are stored in the :mailheader:`Status` header, and " "the \"D\", \"F\", and \"A\" flags are stored in the :mailheader:`X-Status` " "header. The flags and headers typically appear in the order mentioned." msgstr "" -#: ../../library/mailbox.rst:998 +#: ../../library/mailbox.rst:1004 msgid ":class:`mboxMessage` instances offer the following methods:" msgstr "" -#: ../../library/mailbox.rst:1003 ../../library/mailbox.rst:1374 +#: ../../library/mailbox.rst:1009 ../../library/mailbox.rst:1380 msgid "" "Return a string representing the \"From \" line that marks the start of the " "message in an mbox mailbox. The leading \"From \" and the trailing newline " "are excluded." msgstr "" -#: ../../library/mailbox.rst:1010 ../../library/mailbox.rst:1381 +#: ../../library/mailbox.rst:1016 ../../library/mailbox.rst:1387 msgid "" "Set the \"From \" line to *from_*, which should be specified without a " "leading \"From \" or trailing newline. For convenience, *time_* may be " @@ -1345,7 +1362,7 @@ msgid "" "meth:`time.gmtime`)." msgstr "" -#: ../../library/mailbox.rst:1020 ../../library/mailbox.rst:1391 +#: ../../library/mailbox.rst:1026 ../../library/mailbox.rst:1397 msgid "" "Return a string specifying the flags that are currently set. If the message " "complies with the conventional format, the result is the concatenation in " @@ -1353,28 +1370,28 @@ msgid "" "``'D'``, ``'F'``, and ``'A'``." msgstr "" -#: ../../library/mailbox.rst:1028 ../../library/mailbox.rst:1399 +#: ../../library/mailbox.rst:1034 ../../library/mailbox.rst:1405 msgid "" "Set the flags specified by *flags* and unset all others. Parameter *flags* " "should be the concatenation in any order of zero or more occurrences of each " "of ``'R'``, ``'O'``, ``'D'``, ``'F'``, and ``'A'``." msgstr "" -#: ../../library/mailbox.rst:1035 ../../library/mailbox.rst:1406 +#: ../../library/mailbox.rst:1041 ../../library/mailbox.rst:1412 msgid "" "Set the flag(s) specified by *flag* without changing other flags. To add " "more than one flag at a time, *flag* may be a string of more than one " "character." msgstr "" -#: ../../library/mailbox.rst:1042 ../../library/mailbox.rst:1413 +#: ../../library/mailbox.rst:1048 ../../library/mailbox.rst:1419 msgid "" "Unset the flag(s) specified by *flag* without changing other flags. To " "remove more than one flag at a time, *flag* maybe a string of more than one " "character." msgstr "" -#: ../../library/mailbox.rst:1046 +#: ../../library/mailbox.rst:1052 msgid "" "When an :class:`mboxMessage` instance is created based upon a :class:" "`MaildirMessage` instance, a \"From \" line is generated based upon the :" @@ -1382,50 +1399,50 @@ msgid "" "conversions take place:" msgstr "" -#: ../../library/mailbox.rst:1052 ../../library/mailbox.rst:1166 -#: ../../library/mailbox.rst:1292 ../../library/mailbox.rst:1423 +#: ../../library/mailbox.rst:1058 ../../library/mailbox.rst:1172 +#: ../../library/mailbox.rst:1298 ../../library/mailbox.rst:1429 msgid ":class:`MaildirMessage` state" msgstr "" -#: ../../library/mailbox.rst:1065 +#: ../../library/mailbox.rst:1071 msgid "" "When an :class:`mboxMessage` instance is created based upon an :class:" "`MHMessage` instance, the following conversions take place:" msgstr "" -#: ../../library/mailbox.rst:1071 ../../library/mailbox.rst:1086 -#: ../../library/mailbox.rst:1442 ../../library/mailbox.rst:1457 +#: ../../library/mailbox.rst:1077 ../../library/mailbox.rst:1092 +#: ../../library/mailbox.rst:1448 ../../library/mailbox.rst:1463 msgid "R flag and O flag" msgstr "" -#: ../../library/mailbox.rst:1080 +#: ../../library/mailbox.rst:1086 msgid "" "When an :class:`mboxMessage` instance is created based upon a :class:" "`BabylMessage` instance, the following conversions take place:" msgstr "" -#: ../../library/mailbox.rst:1095 +#: ../../library/mailbox.rst:1101 msgid "" "When a :class:`Message` instance is created based upon an :class:" "`MMDFMessage` instance, the \"From \" line is copied and all flags directly " "correspond:" msgstr "" -#: ../../library/mailbox.rst:1099 +#: ../../library/mailbox.rst:1105 msgid ":class:`MMDFMessage` state" msgstr "" -#: ../../library/mailbox.rst:1116 +#: ../../library/mailbox.rst:1122 msgid ":class:`MHMessage`" msgstr "" -#: ../../library/mailbox.rst:1121 +#: ../../library/mailbox.rst:1127 msgid "" "A message with MH-specific behaviors. Parameter *message* has the same " "meaning as with the :class:`Message` constructor." msgstr "" -#: ../../library/mailbox.rst:1124 +#: ../../library/mailbox.rst:1130 msgid "" "MH messages do not support marks or flags in the traditional sense, but they " "do support sequences, which are logical groupings of arbitrary messages. " @@ -1434,57 +1451,57 @@ msgid "" "formats, as follows:" msgstr "" -#: ../../library/mailbox.rst:1131 +#: ../../library/mailbox.rst:1137 msgid "Sequence" msgstr "" -#: ../../library/mailbox.rst:1133 ../../library/mailbox.rst:1220 +#: ../../library/mailbox.rst:1139 ../../library/mailbox.rst:1226 msgid "unseen" msgstr "" -#: ../../library/mailbox.rst:1133 ../../library/mailbox.rst:1220 +#: ../../library/mailbox.rst:1139 ../../library/mailbox.rst:1226 msgid "Not read, but previously detected by MUA" msgstr "" -#: ../../library/mailbox.rst:1135 +#: ../../library/mailbox.rst:1141 msgid "replied" msgstr "" -#: ../../library/mailbox.rst:1137 +#: ../../library/mailbox.rst:1143 msgid "flagged" msgstr "" -#: ../../library/mailbox.rst:1140 +#: ../../library/mailbox.rst:1146 msgid ":class:`MHMessage` instances offer the following methods:" msgstr "" -#: ../../library/mailbox.rst:1145 +#: ../../library/mailbox.rst:1151 msgid "Return a list of the names of sequences that include this message." msgstr "" -#: ../../library/mailbox.rst:1150 +#: ../../library/mailbox.rst:1156 msgid "Set the list of sequences that include this message." msgstr "" -#: ../../library/mailbox.rst:1155 +#: ../../library/mailbox.rst:1161 msgid "Add *sequence* to the list of sequences that include this message." msgstr "" -#: ../../library/mailbox.rst:1160 +#: ../../library/mailbox.rst:1166 msgid "Remove *sequence* from the list of sequences that include this message." msgstr "" -#: ../../library/mailbox.rst:1162 +#: ../../library/mailbox.rst:1168 msgid "" "When an :class:`MHMessage` instance is created based upon a :class:" "`MaildirMessage` instance, the following conversions take place:" msgstr "" -#: ../../library/mailbox.rst:1168 ../../library/mailbox.rst:1294 +#: ../../library/mailbox.rst:1174 ../../library/mailbox.rst:1300 msgid "no S flag" msgstr "" -#: ../../library/mailbox.rst:1175 +#: ../../library/mailbox.rst:1181 msgid "" "When an :class:`MHMessage` instance is created based upon an :class:" "`mboxMessage` or :class:`MMDFMessage` instance, the :mailheader:`Status` " @@ -1492,110 +1509,110 @@ msgid "" "take place:" msgstr "" -#: ../../library/mailbox.rst:1184 ../../library/mailbox.rst:1312 +#: ../../library/mailbox.rst:1190 ../../library/mailbox.rst:1318 msgid "no R flag" msgstr "" -#: ../../library/mailbox.rst:1191 +#: ../../library/mailbox.rst:1197 msgid "" "When an :class:`MHMessage` instance is created based upon a :class:" "`BabylMessage` instance, the following conversions take place:" msgstr "" -#: ../../library/mailbox.rst:1206 +#: ../../library/mailbox.rst:1212 msgid ":class:`BabylMessage`" msgstr "" -#: ../../library/mailbox.rst:1211 +#: ../../library/mailbox.rst:1217 msgid "" "A message with Babyl-specific behaviors. Parameter *message* has the same " "meaning as with the :class:`Message` constructor." msgstr "" -#: ../../library/mailbox.rst:1214 +#: ../../library/mailbox.rst:1220 msgid "" "Certain message labels, called :dfn:`attributes`, are defined by convention " "to have special meanings. The attributes are as follows:" msgstr "" -#: ../../library/mailbox.rst:1218 +#: ../../library/mailbox.rst:1224 msgid "Label" msgstr "" -#: ../../library/mailbox.rst:1222 +#: ../../library/mailbox.rst:1228 msgid "deleted" msgstr "" -#: ../../library/mailbox.rst:1224 +#: ../../library/mailbox.rst:1230 msgid "filed" msgstr "" -#: ../../library/mailbox.rst:1224 +#: ../../library/mailbox.rst:1230 msgid "Copied to another file or mailbox" msgstr "" -#: ../../library/mailbox.rst:1226 +#: ../../library/mailbox.rst:1232 msgid "answered" msgstr "" -#: ../../library/mailbox.rst:1228 +#: ../../library/mailbox.rst:1234 msgid "forwarded" msgstr "" -#: ../../library/mailbox.rst:1228 +#: ../../library/mailbox.rst:1234 msgid "Forwarded" msgstr "" -#: ../../library/mailbox.rst:1230 +#: ../../library/mailbox.rst:1236 msgid "edited" msgstr "" -#: ../../library/mailbox.rst:1230 +#: ../../library/mailbox.rst:1236 msgid "Modified by the user" msgstr "" -#: ../../library/mailbox.rst:1232 +#: ../../library/mailbox.rst:1238 msgid "resent" msgstr "" -#: ../../library/mailbox.rst:1232 +#: ../../library/mailbox.rst:1238 msgid "Resent" msgstr "" -#: ../../library/mailbox.rst:1235 +#: ../../library/mailbox.rst:1241 msgid "" "By default, Rmail displays only visible headers. The :class:`BabylMessage` " "class, though, uses the original headers because they are more complete. " "Visible headers may be accessed explicitly if desired." msgstr "" -#: ../../library/mailbox.rst:1239 +#: ../../library/mailbox.rst:1245 msgid ":class:`BabylMessage` instances offer the following methods:" msgstr "" -#: ../../library/mailbox.rst:1244 +#: ../../library/mailbox.rst:1250 msgid "Return a list of labels on the message." msgstr "" -#: ../../library/mailbox.rst:1249 +#: ../../library/mailbox.rst:1255 msgid "Set the list of labels on the message to *labels*." msgstr "" -#: ../../library/mailbox.rst:1254 +#: ../../library/mailbox.rst:1260 msgid "Add *label* to the list of labels on the message." msgstr "" -#: ../../library/mailbox.rst:1259 +#: ../../library/mailbox.rst:1265 msgid "Remove *label* from the list of labels on the message." msgstr "" -#: ../../library/mailbox.rst:1264 +#: ../../library/mailbox.rst:1270 msgid "" "Return an :class:`Message` instance whose headers are the message's visible " "headers and whose body is empty." msgstr "" -#: ../../library/mailbox.rst:1270 +#: ../../library/mailbox.rst:1276 msgid "" "Set the message's visible headers to be the same as the headers in " "*message*. Parameter *visible* should be a :class:`Message` instance, an :" @@ -1603,7 +1620,7 @@ msgid "" "(which should be open in text mode)." msgstr "" -#: ../../library/mailbox.rst:1278 +#: ../../library/mailbox.rst:1284 msgid "" "When a :class:`BabylMessage` instance's original headers are modified, the " "visible headers are not automatically modified to correspond. This method " @@ -1616,17 +1633,17 @@ msgid "" "visible headers." msgstr "" -#: ../../library/mailbox.rst:1288 +#: ../../library/mailbox.rst:1294 msgid "" "When a :class:`BabylMessage` instance is created based upon a :class:" "`MaildirMessage` instance, the following conversions take place:" msgstr "" -#: ../../library/mailbox.rst:1300 +#: ../../library/mailbox.rst:1306 msgid "\"forwarded\" label" msgstr "" -#: ../../library/mailbox.rst:1303 +#: ../../library/mailbox.rst:1309 msgid "" "When a :class:`BabylMessage` instance is created based upon an :class:" "`mboxMessage` or :class:`MMDFMessage` instance, the :mailheader:`Status` " @@ -1634,23 +1651,23 @@ msgid "" "take place:" msgstr "" -#: ../../library/mailbox.rst:1319 +#: ../../library/mailbox.rst:1325 msgid "" "When a :class:`BabylMessage` instance is created based upon an :class:" "`MHMessage` instance, the following conversions take place:" msgstr "" -#: ../../library/mailbox.rst:1334 +#: ../../library/mailbox.rst:1340 msgid ":class:`MMDFMessage`" msgstr "" -#: ../../library/mailbox.rst:1339 +#: ../../library/mailbox.rst:1345 msgid "" "A message with MMDF-specific behaviors. Parameter *message* has the same " "meaning as with the :class:`Message` constructor." msgstr "" -#: ../../library/mailbox.rst:1342 +#: ../../library/mailbox.rst:1348 msgid "" "As with message in an mbox mailbox, MMDF messages are stored with the " "sender's address and the delivery date in an initial line beginning with " @@ -1658,19 +1675,19 @@ msgid "" "typically stored in :mailheader:`Status` and :mailheader:`X-Status` headers." msgstr "" -#: ../../library/mailbox.rst:1347 +#: ../../library/mailbox.rst:1353 msgid "" "Conventional flags for MMDF messages are identical to those of mbox message " "and are as follows:" msgstr "" -#: ../../library/mailbox.rst:1368 +#: ../../library/mailbox.rst:1374 msgid "" ":class:`MMDFMessage` instances offer the following methods, which are " "identical to those offered by :class:`mboxMessage`:" msgstr "" -#: ../../library/mailbox.rst:1417 +#: ../../library/mailbox.rst:1423 msgid "" "When an :class:`MMDFMessage` instance is created based upon a :class:" "`MaildirMessage` instance, a \"From \" line is generated based upon the :" @@ -1678,43 +1695,43 @@ msgid "" "conversions take place:" msgstr "" -#: ../../library/mailbox.rst:1436 +#: ../../library/mailbox.rst:1442 msgid "" "When an :class:`MMDFMessage` instance is created based upon an :class:" "`MHMessage` instance, the following conversions take place:" msgstr "" -#: ../../library/mailbox.rst:1451 +#: ../../library/mailbox.rst:1457 msgid "" "When an :class:`MMDFMessage` instance is created based upon a :class:" "`BabylMessage` instance, the following conversions take place:" msgstr "" -#: ../../library/mailbox.rst:1466 +#: ../../library/mailbox.rst:1472 msgid "" "When an :class:`MMDFMessage` instance is created based upon an :class:" "`mboxMessage` instance, the \"From \" line is copied and all flags directly " "correspond:" msgstr "" -#: ../../library/mailbox.rst:1471 +#: ../../library/mailbox.rst:1477 msgid ":class:`mboxMessage` state" msgstr "" -#: ../../library/mailbox.rst:1486 +#: ../../library/mailbox.rst:1492 msgid "Exceptions" msgstr "" -#: ../../library/mailbox.rst:1488 +#: ../../library/mailbox.rst:1494 msgid "" "The following exception classes are defined in the :mod:`mailbox` module:" msgstr "" -#: ../../library/mailbox.rst:1493 +#: ../../library/mailbox.rst:1499 msgid "The based class for all other module-specific exceptions." msgstr "" -#: ../../library/mailbox.rst:1498 +#: ../../library/mailbox.rst:1504 msgid "" "Raised when a mailbox is expected but is not found, such as when " "instantiating a :class:`Mailbox` subclass with a path that does not exist " @@ -1722,13 +1739,13 @@ msgid "" "that does not exist." msgstr "" -#: ../../library/mailbox.rst:1505 +#: ../../library/mailbox.rst:1511 msgid "" "Raised when a mailbox is not empty but is expected to be, such as when " "deleting a folder that contains messages." msgstr "" -#: ../../library/mailbox.rst:1511 +#: ../../library/mailbox.rst:1517 msgid "" "Raised when some mailbox-related condition beyond the control of the program " "causes it to be unable to proceed, such as when failing to acquire a lock " @@ -1736,29 +1753,29 @@ msgid "" "name already exists." msgstr "" -#: ../../library/mailbox.rst:1519 +#: ../../library/mailbox.rst:1525 msgid "" "Raised when the data in a file cannot be parsed, such as when an :class:`MH` " "instance attempts to read a corrupted :file:`.mh_sequences` file." msgstr "" -#: ../../library/mailbox.rst:1526 +#: ../../library/mailbox.rst:1532 msgid "Examples" msgstr "" -#: ../../library/mailbox.rst:1528 +#: ../../library/mailbox.rst:1534 msgid "" "A simple example of printing the subjects of all messages in a mailbox that " "seem interesting::" msgstr "" -#: ../../library/mailbox.rst:1537 +#: ../../library/mailbox.rst:1543 msgid "" "To copy all mail from a Babyl mailbox to an MH mailbox, converting all of " "the format-specific information that can be converted::" msgstr "" -#: ../../library/mailbox.rst:1548 +#: ../../library/mailbox.rst:1554 msgid "" "This example sorts mail from several mailing lists into different mailboxes, " "being careful to avoid mail corruption due to concurrent modification by " diff --git a/library/marshal.po b/library/marshal.po index 19ce1dc8d5..50ffdcc7df 100644 --- a/library/marshal.po +++ b/library/marshal.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.7\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2021-09-07 06:52+0000\n" +"POT-Creation-Date: 2018-06-26 18:54+0800\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-" @@ -98,13 +98,7 @@ msgid "" "(see below)." msgstr "" -#: ../../library/marshal.rst:69 ../../library/marshal.rst:101 -msgid "" -"Raises an :ref:`auditing event ` ``marshal.dumps`` with arguments " -"``value``, ``version``." -msgstr "" - -#: ../../library/marshal.rst:74 +#: ../../library/marshal.rst:72 msgid "" "Read one value from the open file and return it. If no valid value is read " "(e.g. because the data has a different Python version's incompatible marshal " @@ -114,59 +108,35 @@ msgstr "" #: ../../library/marshal.rst:79 msgid "" -"Raises an :ref:`auditing event ` ``marshal.load`` with no " -"arguments." -msgstr "" - -#: ../../library/marshal.rst:83 -msgid "" "If an object containing an unsupported type was marshalled with :func:" "`dump`, :func:`load` will substitute ``None`` for the unmarshallable type." msgstr "" -#: ../../library/marshal.rst:88 -msgid "" -"This call used to raise a ``code.__new__`` audit event for each code object. " -"Now it raises a single ``marshal.load`` event for the entire load operation." -msgstr "" - -#: ../../library/marshal.rst:94 +#: ../../library/marshal.rst:85 msgid "" "Return the bytes object that would be written to a file by ``dump(value, " "file)``. The value must be a supported type. Raise a :exc:`ValueError` " "exception if value has (or contains an object that has) an unsupported type." msgstr "" -#: ../../library/marshal.rst:98 +#: ../../library/marshal.rst:89 msgid "" "The *version* argument indicates the data format that ``dumps`` should use " "(see below)." msgstr "" -#: ../../library/marshal.rst:106 +#: ../../library/marshal.rst:95 msgid "" "Convert the :term:`bytes-like object` to a value. If no valid value is " "found, raise :exc:`EOFError`, :exc:`ValueError` or :exc:`TypeError`. Extra " "bytes in the input are ignored." msgstr "" -#: ../../library/marshal.rst:110 -msgid "" -"Raises an :ref:`auditing event ` ``marshal.loads`` with argument " -"``bytes``." -msgstr "" - -#: ../../library/marshal.rst:114 -msgid "" -"This call used to raise a ``code.__new__`` audit event for each code object. " -"Now it raises a single ``marshal.loads`` event for the entire load operation." -msgstr "" - -#: ../../library/marshal.rst:118 +#: ../../library/marshal.rst:100 msgid "In addition, the following constants are defined:" msgstr "" -#: ../../library/marshal.rst:122 +#: ../../library/marshal.rst:104 msgid "" "Indicates the format that the module uses. Version 0 is the historical " "format, version 1 shares interned strings and version 2 uses a binary format " @@ -174,11 +144,11 @@ msgid "" "recursion. The current version is 4." msgstr "" -#: ../../library/marshal.rst:130 +#: ../../library/marshal.rst:112 msgid "Footnotes" msgstr "註解" -#: ../../library/marshal.rst:131 +#: ../../library/marshal.rst:113 msgid "" "The name of this module stems from a bit of terminology used by the " "designers of Modula-3 (amongst others), who use the term \"marshalling\" for " diff --git a/library/math.po b/library/math.po index 5bcf8b29e3..272db4f489 100644 --- a/library/math.po +++ b/library/math.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.7\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2021-09-07 06:52+0000\n" +"POT-Creation-Date: 2020-06-20 18:08+0800\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-" @@ -160,7 +160,7 @@ msgstr "" msgid "" "Return the greatest common divisor of the specified integer arguments. If " "any of the arguments is nonzero, then the returned value is the largest " -"positive integer that is a divisor of all arguments. If all arguments are " +"positive integer that is a divisor af all arguments. If all arguments are " "zero, then the returned value is ``0``. ``gcd()`` without arguments returns " "``0``." msgstr "" diff --git a/library/mmap.po b/library/mmap.po index 31d787e865..e12d95316a 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-07 06:52+0000\n" +"POT-Creation-Date: 2020-06-20 18:08+0800\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-" @@ -108,7 +108,7 @@ msgid "" "`ALLOCATIONGRANULARITY`." msgstr "" -#: ../../library/mmap.rst:70 ../../library/mmap.rst:159 +#: ../../library/mmap.rst:70 ../../library/mmap.rst:160 msgid "" "Raises an :ref:`auditing event ` ``mmap.__new__`` with arguments " "``fileno``, ``length``, ``access``, ``offset``." diff --git a/library/multiprocessing.po b/library/multiprocessing.po index 625469d2b4..2eb8f36f0f 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-07 06:52+0000\n" +"POT-Creation-Date: 2020-06-20 18:08+0800\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-" @@ -35,13 +35,13 @@ msgid "" ":mod:`multiprocessing` is a package that supports spawning processes using " "an API similar to the :mod:`threading` module. The :mod:`multiprocessing` " "package offers both local and remote concurrency, effectively side-stepping " -"the :term:`Global Interpreter Lock ` by using " -"subprocesses instead of threads. Due to this, the :mod:`multiprocessing` " -"module allows the programmer to fully leverage multiple processors on a " -"given machine. It runs on both Unix and Windows." +"the :term:`Global Interpreter Lock` by using subprocesses instead of " +"threads. Due to this, the :mod:`multiprocessing` module allows the " +"programmer to fully leverage multiple processors on a given machine. It " +"runs on both Unix and Windows." msgstr "" -#: ../../library/multiprocessing.rst:23 +#: ../../library/multiprocessing.rst:22 msgid "" "The :mod:`multiprocessing` module also introduces APIs which do not have " "analogs in the :mod:`threading` module. A prime example of this is the :" @@ -54,15 +54,15 @@ msgid "" "`~multiprocessing.pool.Pool`, ::" msgstr "" -#: ../../library/multiprocessing.rst:41 +#: ../../library/multiprocessing.rst:40 msgid "will print to standard output ::" msgstr "" -#: ../../library/multiprocessing.rst:47 +#: ../../library/multiprocessing.rst:46 msgid "The :class:`Process` class" msgstr "" -#: ../../library/multiprocessing.rst:49 +#: ../../library/multiprocessing.rst:48 msgid "" "In :mod:`multiprocessing`, processes are spawned by creating a :class:" "`Process` object and then calling its :meth:`~Process.start` method. :class:" @@ -70,50 +70,50 @@ msgid "" "of a multiprocess program is ::" msgstr "" -#: ../../library/multiprocessing.rst:64 +#: ../../library/multiprocessing.rst:63 msgid "" "To show the individual process IDs involved, here is an expanded example::" msgstr "" -#: ../../library/multiprocessing.rst:85 +#: ../../library/multiprocessing.rst:84 msgid "" "For an explanation of why the ``if __name__ == '__main__'`` part is " "necessary, see :ref:`multiprocessing-programming`." msgstr "" -#: ../../library/multiprocessing.rst:91 +#: ../../library/multiprocessing.rst:90 msgid "Contexts and start methods" msgstr "" -#: ../../library/multiprocessing.rst:95 +#: ../../library/multiprocessing.rst:94 msgid "" "Depending on the platform, :mod:`multiprocessing` supports three ways to " "start a process. These *start methods* are" msgstr "" -#: ../../library/multiprocessing.rst:106 +#: ../../library/multiprocessing.rst:105 msgid "*spawn*" msgstr "" -#: ../../library/multiprocessing.rst:99 +#: ../../library/multiprocessing.rst:98 msgid "" "The parent process starts a fresh python interpreter process. The child " "process will only inherit those resources necessary to run the process " -"object's :meth:`~Process.run` method. In particular, unnecessary file " +"objects :meth:`~Process.run` method. In particular, unnecessary file " "descriptors and handles from the parent process will not be inherited. " "Starting a process using this method is rather slow compared to using *fork* " "or *forkserver*." msgstr "" -#: ../../library/multiprocessing.rst:106 +#: ../../library/multiprocessing.rst:105 msgid "Available on Unix and Windows. The default on Windows and macOS." msgstr "" -#: ../../library/multiprocessing.rst:115 +#: ../../library/multiprocessing.rst:114 msgid "*fork*" msgstr "" -#: ../../library/multiprocessing.rst:109 +#: ../../library/multiprocessing.rst:108 msgid "" "The parent process uses :func:`os.fork` to fork the Python interpreter. The " "child process, when it begins, is effectively identical to the parent " @@ -121,15 +121,15 @@ msgid "" "Note that safely forking a multithreaded process is problematic." msgstr "" -#: ../../library/multiprocessing.rst:115 +#: ../../library/multiprocessing.rst:114 msgid "Available on Unix only. The default on Unix." msgstr "" -#: ../../library/multiprocessing.rst:126 +#: ../../library/multiprocessing.rst:125 msgid "*forkserver*" msgstr "" -#: ../../library/multiprocessing.rst:118 +#: ../../library/multiprocessing.rst:117 msgid "" "When the program starts and selects the *forkserver* start method, a server " "process is started. From then on, whenever a new process is needed, the " @@ -138,27 +138,27 @@ msgid "" "use :func:`os.fork`. No unnecessary resources are inherited." msgstr "" -#: ../../library/multiprocessing.rst:125 +#: ../../library/multiprocessing.rst:124 msgid "" "Available on Unix platforms which support passing file descriptors over Unix " "pipes." msgstr "" -#: ../../library/multiprocessing.rst:130 +#: ../../library/multiprocessing.rst:129 msgid "" "On macOS, the *spawn* start method is now the default. The *fork* start " "method should be considered unsafe as it can lead to crashes of the " "subprocess. See :issue:`33725`." msgstr "" -#: ../../library/multiprocessing.rst:134 +#: ../../library/multiprocessing.rst:133 msgid "" "*spawn* added on all unix platforms, and *forkserver* added for some unix " "platforms. Child processes no longer inherit all of the parents inheritable " "handles on Windows." msgstr "" -#: ../../library/multiprocessing.rst:140 +#: ../../library/multiprocessing.rst:139 msgid "" "On Unix using the *spawn* or *forkserver* start methods will also start a " "*resource tracker* process which tracks the unlinked named system resources " @@ -173,25 +173,25 @@ msgid "" "space in the main memory.)" msgstr "" -#: ../../library/multiprocessing.rst:153 +#: ../../library/multiprocessing.rst:152 msgid "" "To select a start method you use the :func:`set_start_method` in the ``if " "__name__ == '__main__'`` clause of the main module. For example::" msgstr "" -#: ../../library/multiprocessing.rst:170 +#: ../../library/multiprocessing.rst:169 msgid "" ":func:`set_start_method` should not be used more than once in the program." msgstr "" -#: ../../library/multiprocessing.rst:173 +#: ../../library/multiprocessing.rst:172 msgid "" "Alternatively, you can use :func:`get_context` to obtain a context object. " "Context objects have the same API as the multiprocessing module, and allow " "one to use multiple start methods in the same program. ::" msgstr "" -#: ../../library/multiprocessing.rst:191 +#: ../../library/multiprocessing.rst:190 msgid "" "Note that objects related to one context may not be compatible with " "processes for a different context. In particular, locks created using the " @@ -199,13 +199,13 @@ msgid "" "*forkserver* start methods." msgstr "" -#: ../../library/multiprocessing.rst:196 +#: ../../library/multiprocessing.rst:195 msgid "" "A library which wants to use a particular start method should probably use :" "func:`get_context` to avoid interfering with the choice of the library user." msgstr "" -#: ../../library/multiprocessing.rst:202 +#: ../../library/multiprocessing.rst:201 msgid "" "The ``'spawn'`` and ``'forkserver'`` start methods cannot currently be used " "with \"frozen\" executables (i.e., binaries produced by packages like " @@ -213,41 +213,41 @@ msgid "" "work." msgstr "" -#: ../../library/multiprocessing.rst:209 +#: ../../library/multiprocessing.rst:208 msgid "Exchanging objects between processes" msgstr "" -#: ../../library/multiprocessing.rst:211 +#: ../../library/multiprocessing.rst:210 msgid "" ":mod:`multiprocessing` supports two types of communication channel between " "processes:" msgstr "" -#: ../../library/multiprocessing.rst:214 +#: ../../library/multiprocessing.rst:213 msgid "**Queues**" msgstr "" -#: ../../library/multiprocessing.rst:216 +#: ../../library/multiprocessing.rst:215 msgid "" "The :class:`Queue` class is a near clone of :class:`queue.Queue`. For " "example::" msgstr "" -#: ../../library/multiprocessing.rst:231 +#: ../../library/multiprocessing.rst:230 msgid "Queues are thread and process safe." msgstr "" -#: ../../library/multiprocessing.rst:233 +#: ../../library/multiprocessing.rst:232 msgid "**Pipes**" msgstr "" -#: ../../library/multiprocessing.rst:235 +#: ../../library/multiprocessing.rst:234 msgid "" "The :func:`Pipe` function returns a pair of connection objects connected by " "a pipe which by default is duplex (two-way). For example::" msgstr "" -#: ../../library/multiprocessing.rst:251 +#: ../../library/multiprocessing.rst:250 msgid "" "The two connection objects returned by :func:`Pipe` represent the two ends " "of the pipe. Each connection object has :meth:`~Connection.send` and :meth:" @@ -257,55 +257,55 @@ msgid "" "corruption from processes using different ends of the pipe at the same time." msgstr "" -#: ../../library/multiprocessing.rst:261 +#: ../../library/multiprocessing.rst:260 msgid "Synchronization between processes" msgstr "" -#: ../../library/multiprocessing.rst:263 +#: ../../library/multiprocessing.rst:262 msgid "" ":mod:`multiprocessing` contains equivalents of all the synchronization " "primitives from :mod:`threading`. For instance one can use a lock to ensure " "that only one process prints to standard output at a time::" msgstr "" -#: ../../library/multiprocessing.rst:282 +#: ../../library/multiprocessing.rst:281 msgid "" "Without using the lock output from the different processes is liable to get " "all mixed up." msgstr "" -#: ../../library/multiprocessing.rst:287 +#: ../../library/multiprocessing.rst:286 msgid "Sharing state between processes" msgstr "" -#: ../../library/multiprocessing.rst:289 +#: ../../library/multiprocessing.rst:288 msgid "" "As mentioned above, when doing concurrent programming it is usually best to " "avoid using shared state as far as possible. This is particularly true when " "using multiple processes." msgstr "" -#: ../../library/multiprocessing.rst:293 +#: ../../library/multiprocessing.rst:292 msgid "" "However, if you really do need to use some shared data then :mod:" "`multiprocessing` provides a couple of ways of doing so." msgstr "" -#: ../../library/multiprocessing.rst:296 +#: ../../library/multiprocessing.rst:295 msgid "**Shared memory**" msgstr "" -#: ../../library/multiprocessing.rst:298 +#: ../../library/multiprocessing.rst:297 msgid "" "Data can be stored in a shared memory map using :class:`Value` or :class:" "`Array`. For example, the following code ::" msgstr "" -#: ../../library/multiprocessing.rst:319 ../../library/multiprocessing.rst:365 +#: ../../library/multiprocessing.rst:318 ../../library/multiprocessing.rst:364 msgid "will print ::" msgstr "" -#: ../../library/multiprocessing.rst:324 +#: ../../library/multiprocessing.rst:323 msgid "" "The ``'d'`` and ``'i'`` arguments used when creating ``num`` and ``arr`` are " "typecodes of the kind used by the :mod:`array` module: ``'d'`` indicates a " @@ -313,25 +313,25 @@ msgid "" "objects will be process and thread-safe." msgstr "" -#: ../../library/multiprocessing.rst:329 +#: ../../library/multiprocessing.rst:328 msgid "" "For more flexibility in using shared memory one can use the :mod:" "`multiprocessing.sharedctypes` module which supports the creation of " "arbitrary ctypes objects allocated from shared memory." msgstr "" -#: ../../library/multiprocessing.rst:333 +#: ../../library/multiprocessing.rst:332 msgid "**Server process**" msgstr "" -#: ../../library/multiprocessing.rst:335 +#: ../../library/multiprocessing.rst:334 msgid "" "A manager object returned by :func:`Manager` controls a server process which " "holds Python objects and allows other processes to manipulate them using " "proxies." msgstr "" -#: ../../library/multiprocessing.rst:339 +#: ../../library/multiprocessing.rst:338 msgid "" "A manager returned by :func:`Manager` will support types :class:`list`, :" "class:`dict`, :class:`~managers.Namespace`, :class:`Lock`, :class:`RLock`, :" @@ -340,7 +340,7 @@ msgid "" "`Array`. For example, ::" msgstr "" -#: ../../library/multiprocessing.rst:370 +#: ../../library/multiprocessing.rst:369 msgid "" "Server process managers are more flexible than using shared memory objects " "because they can be made to support arbitrary object types. Also, a single " @@ -348,28 +348,28 @@ msgid "" "They are, however, slower than using shared memory." msgstr "" -#: ../../library/multiprocessing.rst:377 +#: ../../library/multiprocessing.rst:376 msgid "Using a pool of workers" msgstr "" -#: ../../library/multiprocessing.rst:379 +#: ../../library/multiprocessing.rst:378 msgid "" "The :class:`~multiprocessing.pool.Pool` class represents a pool of worker " "processes. It has methods which allows tasks to be offloaded to the worker " "processes in a few different ways." msgstr "" -#: ../../library/multiprocessing.rst:383 +#: ../../library/multiprocessing.rst:382 msgid "For example::" msgstr "" -#: ../../library/multiprocessing.rst:427 +#: ../../library/multiprocessing.rst:426 msgid "" "Note that the methods of a pool should only ever be used by the process " "which created it." msgstr "" -#: ../../library/multiprocessing.rst:432 +#: ../../library/multiprocessing.rst:431 msgid "" "Functionality within this package requires that the ``__main__`` module be " "importable by the children. This is covered in :ref:`multiprocessing-" @@ -378,35 +378,35 @@ msgid "" "work in the interactive interpreter. For example::" msgstr "" -#: ../../library/multiprocessing.rst:455 +#: ../../library/multiprocessing.rst:454 msgid "" "(If you try this it will actually output three full tracebacks interleaved " "in a semi-random fashion, and then you may have to stop the parent process " "somehow.)" msgstr "" -#: ../../library/multiprocessing.rst:461 +#: ../../library/multiprocessing.rst:460 msgid "Reference" msgstr "" -#: ../../library/multiprocessing.rst:463 +#: ../../library/multiprocessing.rst:462 msgid "" "The :mod:`multiprocessing` package mostly replicates the API of the :mod:" "`threading` module." msgstr "" -#: ../../library/multiprocessing.rst:468 +#: ../../library/multiprocessing.rst:467 msgid ":class:`Process` and exceptions" msgstr "" -#: ../../library/multiprocessing.rst:473 +#: ../../library/multiprocessing.rst:472 msgid "" "Process objects represent activity that is run in a separate process. The :" "class:`Process` class has equivalents of all the methods of :class:" "`threading.Thread`." msgstr "" -#: ../../library/multiprocessing.rst:477 +#: ../../library/multiprocessing.rst:476 msgid "" "The constructor should always be called with keyword arguments. *group* " "should always be ``None``; it exists solely for compatibility with :class:" @@ -420,26 +420,26 @@ msgid "" "creating process." msgstr "" -#: ../../library/multiprocessing.rst:488 +#: ../../library/multiprocessing.rst:487 msgid "By default, no arguments are passed to *target*." msgstr "" -#: ../../library/multiprocessing.rst:490 +#: ../../library/multiprocessing.rst:489 msgid "" "If a subclass overrides the constructor, it must make sure it invokes the " "base class constructor (:meth:`Process.__init__`) before doing anything else " "to the process." msgstr "" -#: ../../library/multiprocessing.rst:494 +#: ../../library/multiprocessing.rst:493 msgid "Added the *daemon* argument." msgstr "" -#: ../../library/multiprocessing.rst:499 +#: ../../library/multiprocessing.rst:498 msgid "Method representing the process's activity." msgstr "" -#: ../../library/multiprocessing.rst:501 +#: ../../library/multiprocessing.rst:500 msgid "" "You may override this method in a subclass. The standard :meth:`run` method " "invokes the callable object passed to the object's constructor as the target " @@ -447,17 +447,17 @@ msgid "" "*args* and *kwargs* arguments, respectively." msgstr "" -#: ../../library/multiprocessing.rst:508 +#: ../../library/multiprocessing.rst:507 msgid "Start the process's activity." msgstr "" -#: ../../library/multiprocessing.rst:510 +#: ../../library/multiprocessing.rst:509 msgid "" "This must be called at most once per process object. It arranges for the " "object's :meth:`run` method to be invoked in a separate process." msgstr "" -#: ../../library/multiprocessing.rst:515 +#: ../../library/multiprocessing.rst:514 msgid "" "If the optional argument *timeout* is ``None`` (the default), the method " "blocks until the process whose :meth:`join` method is called terminates. If " @@ -467,23 +467,23 @@ msgid "" "terminated." msgstr "" -#: ../../library/multiprocessing.rst:522 +#: ../../library/multiprocessing.rst:521 msgid "A process can be joined many times." msgstr "" -#: ../../library/multiprocessing.rst:524 +#: ../../library/multiprocessing.rst:523 msgid "" "A process cannot join itself because this would cause a deadlock. It is an " "error to attempt to join a process before it has been started." msgstr "" -#: ../../library/multiprocessing.rst:529 +#: ../../library/multiprocessing.rst:528 msgid "" "The process's name. The name is a string used for identification purposes " "only. It has no semantics. Multiple processes may be given the same name." msgstr "" -#: ../../library/multiprocessing.rst:533 +#: ../../library/multiprocessing.rst:532 msgid "" "The initial name is set by the constructor. If no explicit name is provided " "to the constructor, a name of the form 'Process-N\\ :sub:`1`:N\\ :sub:" @@ -491,33 +491,33 @@ msgid "" "child of its parent." msgstr "" -#: ../../library/multiprocessing.rst:540 +#: ../../library/multiprocessing.rst:539 msgid "Return whether the process is alive." msgstr "" -#: ../../library/multiprocessing.rst:542 +#: ../../library/multiprocessing.rst:541 msgid "" "Roughly, a process object is alive from the moment the :meth:`start` method " "returns until the child process terminates." msgstr "" -#: ../../library/multiprocessing.rst:547 +#: ../../library/multiprocessing.rst:546 msgid "" "The process's daemon flag, a Boolean value. This must be set before :meth:" "`start` is called." msgstr "" -#: ../../library/multiprocessing.rst:550 +#: ../../library/multiprocessing.rst:549 msgid "The initial value is inherited from the creating process." msgstr "" -#: ../../library/multiprocessing.rst:552 +#: ../../library/multiprocessing.rst:551 msgid "" "When a process exits, it attempts to terminate all of its daemonic child " "processes." msgstr "" -#: ../../library/multiprocessing.rst:555 +#: ../../library/multiprocessing.rst:554 msgid "" "Note that a daemonic process is not allowed to create child processes. " "Otherwise a daemonic process would leave its children orphaned if it gets " @@ -526,79 +526,79 @@ msgid "" "(and not joined) if non-daemonic processes have exited." msgstr "" -#: ../../library/multiprocessing.rst:561 +#: ../../library/multiprocessing.rst:560 msgid "" "In addition to the :class:`threading.Thread` API, :class:`Process` objects " "also support the following attributes and methods:" msgstr "" -#: ../../library/multiprocessing.rst:566 +#: ../../library/multiprocessing.rst:565 msgid "" "Return the process ID. Before the process is spawned, this will be ``None``." msgstr "" -#: ../../library/multiprocessing.rst:571 +#: ../../library/multiprocessing.rst:570 msgid "" "The child's exit code. This will be ``None`` if the process has not yet " "terminated. A negative value *-N* indicates that the child was terminated " "by signal *N*." msgstr "" -#: ../../library/multiprocessing.rst:577 +#: ../../library/multiprocessing.rst:576 msgid "The process's authentication key (a byte string)." msgstr "" -#: ../../library/multiprocessing.rst:579 +#: ../../library/multiprocessing.rst:578 msgid "" "When :mod:`multiprocessing` is initialized the main process is assigned a " "random string using :func:`os.urandom`." msgstr "" -#: ../../library/multiprocessing.rst:582 +#: ../../library/multiprocessing.rst:581 msgid "" "When a :class:`Process` object is created, it will inherit the " "authentication key of its parent process, although this may be changed by " "setting :attr:`authkey` to another byte string." msgstr "" -#: ../../library/multiprocessing.rst:586 +#: ../../library/multiprocessing.rst:585 msgid "See :ref:`multiprocessing-auth-keys`." msgstr "" -#: ../../library/multiprocessing.rst:590 +#: ../../library/multiprocessing.rst:589 msgid "" "A numeric handle of a system object which will become \"ready\" when the " "process ends." msgstr "" -#: ../../library/multiprocessing.rst:593 +#: ../../library/multiprocessing.rst:592 msgid "" "You can use this value if you want to wait on several events at once using :" "func:`multiprocessing.connection.wait`. Otherwise calling :meth:`join()` is " "simpler." msgstr "" -#: ../../library/multiprocessing.rst:597 +#: ../../library/multiprocessing.rst:596 msgid "" "On Windows, this is an OS handle usable with the ``WaitForSingleObject`` and " "``WaitForMultipleObjects`` family of API calls. On Unix, this is a file " "descriptor usable with primitives from the :mod:`select` module." msgstr "" -#: ../../library/multiprocessing.rst:605 +#: ../../library/multiprocessing.rst:604 msgid "" "Terminate the process. On Unix this is done using the ``SIGTERM`` signal; " "on Windows :c:func:`TerminateProcess` is used. Note that exit handlers and " "finally clauses, etc., will not be executed." msgstr "" -#: ../../library/multiprocessing.rst:609 +#: ../../library/multiprocessing.rst:608 msgid "" "Note that descendant processes of the process will *not* be terminated -- " "they will simply become orphaned." msgstr "" -#: ../../library/multiprocessing.rst:614 +#: ../../library/multiprocessing.rst:613 msgid "" "If this method is used when the associated process is using a pipe or queue " "then the pipe or queue is liable to become corrupted and may become unusable " @@ -607,11 +607,11 @@ msgid "" "deadlock." msgstr "" -#: ../../library/multiprocessing.rst:622 +#: ../../library/multiprocessing.rst:621 msgid "Same as :meth:`terminate()` but using the ``SIGKILL`` signal on Unix." msgstr "" -#: ../../library/multiprocessing.rst:628 +#: ../../library/multiprocessing.rst:627 msgid "" "Close the :class:`Process` object, releasing all resources associated with " "it. :exc:`ValueError` is raised if the underlying process is still " @@ -619,59 +619,59 @@ msgid "" "attributes of the :class:`Process` object will raise :exc:`ValueError`." msgstr "" -#: ../../library/multiprocessing.rst:636 +#: ../../library/multiprocessing.rst:635 msgid "" "Note that the :meth:`start`, :meth:`join`, :meth:`is_alive`, :meth:" "`terminate` and :attr:`exitcode` methods should only be called by the " "process that created the process object." msgstr "" -#: ../../library/multiprocessing.rst:640 +#: ../../library/multiprocessing.rst:639 msgid "Example usage of some of the methods of :class:`Process`:" msgstr "" -#: ../../library/multiprocessing.rst:661 +#: ../../library/multiprocessing.rst:660 msgid "The base class of all :mod:`multiprocessing` exceptions." msgstr "" -#: ../../library/multiprocessing.rst:665 +#: ../../library/multiprocessing.rst:664 msgid "" "Exception raised by :meth:`Connection.recv_bytes_into()` when the supplied " "buffer object is too small for the message read." msgstr "" -#: ../../library/multiprocessing.rst:668 +#: ../../library/multiprocessing.rst:667 msgid "" "If ``e`` is an instance of :exc:`BufferTooShort` then ``e.args[0]`` will " "give the message as a byte string." msgstr "" -#: ../../library/multiprocessing.rst:673 +#: ../../library/multiprocessing.rst:672 msgid "Raised when there is an authentication error." msgstr "" -#: ../../library/multiprocessing.rst:677 +#: ../../library/multiprocessing.rst:676 msgid "Raised by methods with a timeout when the timeout expires." msgstr "" -#: ../../library/multiprocessing.rst:680 +#: ../../library/multiprocessing.rst:679 msgid "Pipes and Queues" msgstr "" -#: ../../library/multiprocessing.rst:682 +#: ../../library/multiprocessing.rst:681 msgid "" "When using multiple processes, one generally uses message passing for " "communication between processes and avoids having to use any synchronization " "primitives like locks." msgstr "" -#: ../../library/multiprocessing.rst:686 +#: ../../library/multiprocessing.rst:685 msgid "" "For passing messages one can use :func:`Pipe` (for a connection between two " "processes) or a queue (which allows multiple producers and consumers)." msgstr "" -#: ../../library/multiprocessing.rst:689 +#: ../../library/multiprocessing.rst:688 msgid "" "The :class:`Queue`, :class:`SimpleQueue` and :class:`JoinableQueue` types " "are multi-producer, multi-consumer :abbr:`FIFO (first-in, first-out)` queues " @@ -681,7 +681,7 @@ msgid "" "Queue` class." msgstr "" -#: ../../library/multiprocessing.rst:696 +#: ../../library/multiprocessing.rst:695 msgid "" "If you use :class:`JoinableQueue` then you **must** call :meth:" "`JoinableQueue.task_done` for each task removed from the queue or else the " @@ -689,20 +689,20 @@ msgid "" "overflow, raising an exception." msgstr "" -#: ../../library/multiprocessing.rst:701 +#: ../../library/multiprocessing.rst:700 msgid "" "Note that one can also create a shared queue by using a manager object -- " "see :ref:`multiprocessing-managers`." msgstr "" -#: ../../library/multiprocessing.rst:706 +#: ../../library/multiprocessing.rst:705 msgid "" ":mod:`multiprocessing` uses the usual :exc:`queue.Empty` and :exc:`queue." "Full` exceptions to signal a timeout. They are not available in the :mod:" "`multiprocessing` namespace so you need to import them from :mod:`queue`." msgstr "" -#: ../../library/multiprocessing.rst:713 +#: ../../library/multiprocessing.rst:712 msgid "" "When an object is put on a queue, the object is pickled and a background " "thread later flushes the pickled data to an underlying pipe. This has some " @@ -711,14 +711,14 @@ msgid "" "a queue created with a :ref:`manager `." msgstr "" -#: ../../library/multiprocessing.rst:720 +#: ../../library/multiprocessing.rst:719 msgid "" "After putting an object on an empty queue there may be an infinitesimal " "delay before the queue's :meth:`~Queue.empty` method returns :const:`False` " "and :meth:`~Queue.get_nowait` can return without raising :exc:`queue.Empty`." msgstr "" -#: ../../library/multiprocessing.rst:725 +#: ../../library/multiprocessing.rst:724 msgid "" "If multiple processes are enqueuing objects, it is possible for the objects " "to be received at the other end out-of-order. However, objects enqueued by " @@ -726,7 +726,7 @@ msgid "" "other." msgstr "" -#: ../../library/multiprocessing.rst:732 +#: ../../library/multiprocessing.rst:731 msgid "" "If a process is killed using :meth:`Process.terminate` or :func:`os.kill` " "while it is trying to use a :class:`Queue`, then the data in the queue is " @@ -734,7 +734,7 @@ msgid "" "exception when it tries to use the queue later on." msgstr "" -#: ../../library/multiprocessing.rst:739 +#: ../../library/multiprocessing.rst:738 msgid "" "As mentioned above, if a child process has put items on a queue (and it has " "not used :meth:`JoinableQueue.cancel_join_thread ` -- see also :ref:`multiprocessing-listeners-clients`." msgstr "" -#: ../../library/multiprocessing.rst:1084 +#: ../../library/multiprocessing.rst:1083 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:1086 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:1091 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:1098 msgid "Return the file descriptor or handle used by the connection." msgstr "" -#: ../../library/multiprocessing.rst:1103 +#: ../../library/multiprocessing.rst:1102 msgid "Close the connection." msgstr "" -#: ../../library/multiprocessing.rst:1105 +#: ../../library/multiprocessing.rst:1104 msgid "This is called automatically when the connection is garbage collected." msgstr "" -#: ../../library/multiprocessing.rst:1109 +#: ../../library/multiprocessing.rst:1108 msgid "Return whether there is any data available to be read." msgstr "" -#: ../../library/multiprocessing.rst:1111 +#: ../../library/multiprocessing.rst:1110 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:1114 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:1119 msgid "Send byte data from a :term:`bytes-like object` as a complete message." msgstr "" -#: ../../library/multiprocessing.rst:1122 +#: ../../library/multiprocessing.rst:1121 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 +1210,7 @@ msgid "" "exc:`ValueError` exception" msgstr "" -#: ../../library/multiprocessing.rst:1129 +#: ../../library/multiprocessing.rst:1128 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 +1218,19 @@ msgid "" "closed." msgstr "" -#: ../../library/multiprocessing.rst:1134 +#: ../../library/multiprocessing.rst:1133 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:1137 msgid "" "This function used to raise :exc:`IOError`, which is now an alias of :exc:" "`OSError`." msgstr "" -#: ../../library/multiprocessing.rst:1145 +#: ../../library/multiprocessing.rst:1144 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 +1238,45 @@ msgid "" "nothing left to receive and the other end was closed." msgstr "" -#: ../../library/multiprocessing.rst:1151 +#: ../../library/multiprocessing.rst:1150 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:1155 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:1159 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:1163 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:1168 msgid "For example:" msgstr "" -#: ../../library/multiprocessing.rst:1194 +#: ../../library/multiprocessing.rst:1192 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:1196 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 +1284,73 @@ msgid "" "`multiprocessing-auth-keys`." msgstr "" -#: ../../library/multiprocessing.rst:1205 +#: ../../library/multiprocessing.rst:1203 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:1209 msgid "Synchronization primitives" msgstr "" -#: ../../library/multiprocessing.rst:1215 +#: ../../library/multiprocessing.rst:1213 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:1217 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:1222 msgid "A barrier object: a clone of :class:`threading.Barrier`." msgstr "" -#: ../../library/multiprocessing.rst:1230 +#: ../../library/multiprocessing.rst:1228 msgid "" "A bounded semaphore object: a close analog of :class:`threading." "BoundedSemaphore`." msgstr "" -#: ../../library/multiprocessing.rst:1233 -#: ../../library/multiprocessing.rst:1371 +#: ../../library/multiprocessing.rst:1231 +#: ../../library/multiprocessing.rst:1369 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:1235 msgid "" "On Mac OS X, this is indistinguishable from :class:`Semaphore` because " "``sem_getvalue()`` is not implemented on that platform." msgstr "" -#: ../../library/multiprocessing.rst:1242 +#: ../../library/multiprocessing.rst:1240 msgid "A condition variable: an alias for :class:`threading.Condition`." msgstr "" -#: ../../library/multiprocessing.rst:1244 +#: ../../library/multiprocessing.rst:1242 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:1245 +#: ../../library/multiprocessing.rst:1779 msgid "The :meth:`~threading.Condition.wait_for` method was added." msgstr "" -#: ../../library/multiprocessing.rst:1252 +#: ../../library/multiprocessing.rst:1250 msgid "A clone of :class:`threading.Event`." msgstr "" -#: ../../library/multiprocessing.rst:1257 +#: ../../library/multiprocessing.rst:1255 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 +1361,25 @@ msgid "" "as noted." msgstr "" -#: ../../library/multiprocessing.rst:1265 +#: ../../library/multiprocessing.rst:1263 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:1267 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:1272 +#: ../../library/multiprocessing.rst:1323 msgid "Acquire a lock, blocking or non-blocking." msgstr "" -#: ../../library/multiprocessing.rst:1276 +#: ../../library/multiprocessing.rst:1274 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 +1387,14 @@ msgid "" "that in :meth:`threading.Lock.acquire`." msgstr "" -#: ../../library/multiprocessing.rst:1281 +#: ../../library/multiprocessing.rst:1279 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:1283 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 +1408,19 @@ msgid "" "acquired or ``False`` if the timeout period has elapsed." msgstr "" -#: ../../library/multiprocessing.rst:1300 +#: ../../library/multiprocessing.rst:1298 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:1301 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:1307 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 +1429,20 @@ msgid "" "release it once for each time it has been acquired." msgstr "" -#: ../../library/multiprocessing.rst:1315 +#: ../../library/multiprocessing.rst:1313 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:1317 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:1325 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 +1455,7 @@ msgid "" "itself." msgstr "" -#: ../../library/multiprocessing.rst:1337 +#: ../../library/multiprocessing.rst:1335 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 +1466,14 @@ msgid "" "a return value of ``True``." msgstr "" -#: ../../library/multiprocessing.rst:1345 +#: ../../library/multiprocessing.rst:1343 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:1350 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 +1483,7 @@ msgid "" "locked and owned by the calling process or thread." msgstr "" -#: ../../library/multiprocessing.rst:1360 +#: ../../library/multiprocessing.rst:1358 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 +1492,17 @@ msgid "" "from the implemented behavior in :meth:`threading.RLock.release`." msgstr "" -#: ../../library/multiprocessing.rst:1369 +#: ../../library/multiprocessing.rst:1367 msgid "A semaphore object: a close analog of :class:`threading.Semaphore`." msgstr "" -#: ../../library/multiprocessing.rst:1376 +#: ../../library/multiprocessing.rst:1374 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." msgstr "" -#: ../../library/multiprocessing.rst:1381 +#: ../../library/multiprocessing.rst:1379 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 +1511,13 @@ msgid "" "interrupted and :exc:`KeyboardInterrupt` will be raised." msgstr "" -#: ../../library/multiprocessing.rst:1387 +#: ../../library/multiprocessing.rst:1385 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:1390 msgid "" "Some of this package's functionality requires a functioning shared semaphore " "implementation on the host operating system. Without one, the :mod:" @@ -1526,32 +1526,32 @@ msgid "" "additional information." msgstr "" -#: ../../library/multiprocessing.rst:1400 +#: ../../library/multiprocessing.rst:1398 msgid "Shared :mod:`ctypes` Objects" msgstr "" -#: ../../library/multiprocessing.rst:1402 +#: ../../library/multiprocessing.rst:1400 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:1405 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:1409 +#: ../../library/multiprocessing.rst:1496 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:1413 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 +1561,32 @@ msgid "" "\"process-safe\"." msgstr "" -#: ../../library/multiprocessing.rst:1422 +#: ../../library/multiprocessing.rst:1420 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:1426 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:1432 +#: ../../library/multiprocessing.rst:1522 +#: ../../library/multiprocessing.rst:1537 msgid "Note that *lock* is a keyword-only argument." msgstr "" -#: ../../library/multiprocessing.rst:1438 +#: ../../library/multiprocessing.rst:1436 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:1439 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 +1596,7 @@ msgid "" "initialize the array and whose length determines the length of the array." msgstr "" -#: ../../library/multiprocessing.rst:1448 +#: ../../library/multiprocessing.rst:1446 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 +1606,28 @@ msgid "" "safe\"." msgstr "" -#: ../../library/multiprocessing.rst:1455 +#: ../../library/multiprocessing.rst:1453 msgid "Note that *lock* is a keyword only argument." msgstr "" -#: ../../library/multiprocessing.rst:1457 +#: ../../library/multiprocessing.rst:1455 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:1460 msgid "The :mod:`multiprocessing.sharedctypes` module" msgstr "" -#: ../../library/multiprocessing.rst:1467 +#: ../../library/multiprocessing.rst:1465 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:1471 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 +1636,11 @@ msgid "" "may cause a crash." msgstr "" -#: ../../library/multiprocessing.rst:1481 +#: ../../library/multiprocessing.rst:1479 msgid "Return a ctypes array allocated from shared memory." msgstr "" -#: ../../library/multiprocessing.rst:1483 +#: ../../library/multiprocessing.rst:1481 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 +1650,40 @@ msgid "" "initialize the array and whose length determines the length of the array." msgstr "" -#: ../../library/multiprocessing.rst:1490 +#: ../../library/multiprocessing.rst:1488 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:1494 msgid "Return a ctypes object allocated from shared memory." msgstr "" -#: ../../library/multiprocessing.rst:1502 +#: ../../library/multiprocessing.rst:1500 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:1504 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:1510 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:1514 +#: ../../library/multiprocessing.rst:1530 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 +1693,121 @@ msgid "" "not necessarily be \"process-safe\"." msgstr "" -#: ../../library/multiprocessing.rst:1528 +#: ../../library/multiprocessing.rst:1526 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:1541 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:1546 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:1550 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:1554 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:1557 msgid "Synchronized objects support the :term:`context manager` protocol." msgstr "" -#: ../../library/multiprocessing.rst:1563 +#: ../../library/multiprocessing.rst:1561 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:1566 msgid "ctypes" msgstr "" -#: ../../library/multiprocessing.rst:1568 +#: ../../library/multiprocessing.rst:1566 msgid "sharedctypes using type" msgstr "" -#: ../../library/multiprocessing.rst:1568 +#: ../../library/multiprocessing.rst:1566 msgid "sharedctypes using typecode" msgstr "" -#: ../../library/multiprocessing.rst:1570 +#: ../../library/multiprocessing.rst:1568 msgid "c_double(2.4)" msgstr "" -#: ../../library/multiprocessing.rst:1570 +#: ../../library/multiprocessing.rst:1568 msgid "RawValue(c_double, 2.4)" msgstr "" -#: ../../library/multiprocessing.rst:1570 +#: ../../library/multiprocessing.rst:1568 msgid "RawValue('d', 2.4)" msgstr "" -#: ../../library/multiprocessing.rst:1571 +#: ../../library/multiprocessing.rst:1569 msgid "MyStruct(4, 6)" msgstr "" -#: ../../library/multiprocessing.rst:1571 +#: ../../library/multiprocessing.rst:1569 msgid "RawValue(MyStruct, 4, 6)" msgstr "" -#: ../../library/multiprocessing.rst:1572 +#: ../../library/multiprocessing.rst:1570 msgid "(c_short * 7)()" msgstr "" -#: ../../library/multiprocessing.rst:1572 +#: ../../library/multiprocessing.rst:1570 msgid "RawArray(c_short, 7)" msgstr "" -#: ../../library/multiprocessing.rst:1572 +#: ../../library/multiprocessing.rst:1570 msgid "RawArray('h', 7)" msgstr "" -#: ../../library/multiprocessing.rst:1573 +#: ../../library/multiprocessing.rst:1571 msgid "(c_int * 3)(9, 2, 8)" msgstr "" -#: ../../library/multiprocessing.rst:1573 +#: ../../library/multiprocessing.rst:1571 msgid "RawArray(c_int, (9, 2, 8))" msgstr "" -#: ../../library/multiprocessing.rst:1573 +#: ../../library/multiprocessing.rst:1571 msgid "RawArray('i', (9, 2, 8))" msgstr "" -#: ../../library/multiprocessing.rst:1577 +#: ../../library/multiprocessing.rst:1575 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:1613 msgid "The results printed are ::" msgstr "" -#: ../../library/multiprocessing.rst:1628 +#: ../../library/multiprocessing.rst:1626 msgid "Managers" msgstr "" -#: ../../library/multiprocessing.rst:1630 +#: ../../library/multiprocessing.rst:1628 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 +1816,7 @@ msgid "" "proxies." msgstr "" -#: ../../library/multiprocessing.rst:1638 +#: ../../library/multiprocessing.rst:1636 msgid "" "Returns a started :class:`~multiprocessing.managers.SyncManager` object " "which can be used for sharing objects between processes. The returned " @@ -1824,31 +1824,31 @@ msgid "" "will create shared objects and return corresponding proxies." msgstr "" -#: ../../library/multiprocessing.rst:1646 +#: ../../library/multiprocessing.rst:1644 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:1650 msgid "Create a BaseManager object." msgstr "" -#: ../../library/multiprocessing.rst:1654 +#: ../../library/multiprocessing.rst:1652 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:1655 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:1658 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 +1856,50 @@ msgid "" "it must be a byte string." msgstr "" -#: ../../library/multiprocessing.rst:1667 +#: ../../library/multiprocessing.rst:1665 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:1670 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:1679 msgid ":class:`Server` additionally has an :attr:`address` attribute." msgstr "" -#: ../../library/multiprocessing.rst:1685 +#: ../../library/multiprocessing.rst:1683 msgid "Connect a local manager object to a remote manager process::" msgstr "" -#: ../../library/multiprocessing.rst:1693 +#: ../../library/multiprocessing.rst:1691 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:1694 msgid "This can be called multiple times." msgstr "" -#: ../../library/multiprocessing.rst:1700 +#: ../../library/multiprocessing.rst:1698 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:1701 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:1704 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 +1907,14 @@ msgid "" "then this can be left as ``None``." msgstr "" -#: ../../library/multiprocessing.rst:1712 +#: ../../library/multiprocessing.rst:1710 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:1714 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 +1925,7 @@ msgid "" "method and whose name does not begin with ``'_'``.)" msgstr "" -#: ../../library/multiprocessing.rst:1725 +#: ../../library/multiprocessing.rst:1723 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 +1935,22 @@ msgid "" "returned by the method will be copied by value." msgstr "" -#: ../../library/multiprocessing.rst:1732 +#: ../../library/multiprocessing.rst:1730 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:1734 msgid ":class:`BaseManager` instances also have one read-only property:" msgstr "" -#: ../../library/multiprocessing.rst:1740 +#: ../../library/multiprocessing.rst:1738 msgid "The address used by the manager." msgstr "" -#: ../../library/multiprocessing.rst:1742 +#: ../../library/multiprocessing.rst:1740 msgid "" "Manager objects support the context management protocol -- see :ref:" "`typecontextmanager`. :meth:`~contextmanager.__enter__` starts the server " @@ -1958,173 +1958,173 @@ msgid "" "object. :meth:`~contextmanager.__exit__` calls :meth:`shutdown`." msgstr "" -#: ../../library/multiprocessing.rst:1748 +#: ../../library/multiprocessing.rst:1746 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:1751 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:1755 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:1761 msgid "" "Create a shared :class:`threading.Barrier` object and return a proxy for it." msgstr "" -#: ../../library/multiprocessing.rst:1770 +#: ../../library/multiprocessing.rst:1768 msgid "" "Create a shared :class:`threading.BoundedSemaphore` object and return a " "proxy for it." msgstr "" -#: ../../library/multiprocessing.rst:1775 +#: ../../library/multiprocessing.rst:1773 msgid "" "Create a shared :class:`threading.Condition` object and return a proxy for " "it." msgstr "" -#: ../../library/multiprocessing.rst:1778 +#: ../../library/multiprocessing.rst:1776 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:1784 msgid "" "Create a shared :class:`threading.Event` object and return a proxy for it." msgstr "" -#: ../../library/multiprocessing.rst:1790 +#: ../../library/multiprocessing.rst:1788 msgid "" "Create a shared :class:`threading.Lock` object and return a proxy for it." msgstr "" -#: ../../library/multiprocessing.rst:1794 +#: ../../library/multiprocessing.rst:1792 msgid "Create a shared :class:`Namespace` object and return a proxy for it." msgstr "" -#: ../../library/multiprocessing.rst:1798 +#: ../../library/multiprocessing.rst:1796 msgid "Create a shared :class:`queue.Queue` object and return a proxy for it." msgstr "" -#: ../../library/multiprocessing.rst:1802 +#: ../../library/multiprocessing.rst:1800 msgid "" "Create a shared :class:`threading.RLock` object and return a proxy for it." msgstr "" -#: ../../library/multiprocessing.rst:1806 +#: ../../library/multiprocessing.rst:1804 msgid "" "Create a shared :class:`threading.Semaphore` object and return a proxy for " "it." msgstr "" -#: ../../library/multiprocessing.rst:1811 +#: ../../library/multiprocessing.rst:1809 msgid "Create an array and return a proxy for it." msgstr "" -#: ../../library/multiprocessing.rst:1815 +#: ../../library/multiprocessing.rst:1813 msgid "" "Create an object with a writable ``value`` attribute and return a proxy for " "it." msgstr "" -#: ../../library/multiprocessing.rst:1822 +#: ../../library/multiprocessing.rst:1820 msgid "Create a shared :class:`dict` object and return a proxy for it." msgstr "" -#: ../../library/multiprocessing.rst:1827 +#: ../../library/multiprocessing.rst:1825 msgid "Create a shared :class:`list` object and return a proxy for it." msgstr "" -#: ../../library/multiprocessing.rst:1829 +#: ../../library/multiprocessing.rst:1827 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:1834 msgid "A type that can register with :class:`SyncManager`." msgstr "" -#: ../../library/multiprocessing.rst:1838 +#: ../../library/multiprocessing.rst:1836 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:1839 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:1855 msgid "Customized managers" msgstr "" -#: ../../library/multiprocessing.rst:1859 +#: ../../library/multiprocessing.rst:1857 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:1882 msgid "Using a remote manager" msgstr "" -#: ../../library/multiprocessing.rst:1886 +#: ../../library/multiprocessing.rst:1884 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:1887 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:1899 msgid "One client can access the server as follows::" msgstr "" -#: ../../library/multiprocessing.rst:1911 +#: ../../library/multiprocessing.rst:1909 msgid "Another client can also use it::" msgstr "" -#: ../../library/multiprocessing.rst:1922 +#: ../../library/multiprocessing.rst:1920 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:1945 msgid "Proxy Objects" msgstr "" -#: ../../library/multiprocessing.rst:1949 +#: ../../library/multiprocessing.rst:1947 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:1951 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 +2132,14 @@ msgid "" "its referent can:" msgstr "" -#: ../../library/multiprocessing.rst:1971 +#: ../../library/multiprocessing.rst:1969 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:1973 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 +2147,11 @@ msgid "" "lists, dicts, and other :ref:`multiprocessing-proxy_objects`:" msgstr "" -#: ../../library/multiprocessing.rst:1991 +#: ../../library/multiprocessing.rst:1989 msgid "Similarly, dict and list proxies may be nested inside one another::" msgstr "" -#: ../../library/multiprocessing.rst:2004 +#: ../../library/multiprocessing.rst:2002 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 +2162,53 @@ msgid "" "assign the modified value to the container proxy::" msgstr "" -#: ../../library/multiprocessing.rst:2023 +#: ../../library/multiprocessing.rst:2021 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:2027 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:2035 msgid "" "One should just use a copy of the referent instead when making comparisons." msgstr "" -#: ../../library/multiprocessing.rst:2041 +#: ../../library/multiprocessing.rst:2039 msgid "Proxy objects are instances of subclasses of :class:`BaseProxy`." msgstr "" -#: ../../library/multiprocessing.rst:2045 +#: ../../library/multiprocessing.rst:2043 msgid "Call and return the result of a method of the proxy's referent." msgstr "" -#: ../../library/multiprocessing.rst:2047 +#: ../../library/multiprocessing.rst:2045 msgid "" "If ``proxy`` is a proxy whose referent is ``obj`` then the expression ::" msgstr "" -#: ../../library/multiprocessing.rst:2051 +#: ../../library/multiprocessing.rst:2049 msgid "will evaluate the expression ::" msgstr "" -#: ../../library/multiprocessing.rst:2055 +#: ../../library/multiprocessing.rst:2053 msgid "in the manager's process." msgstr "" -#: ../../library/multiprocessing.rst:2057 +#: ../../library/multiprocessing.rst:2055 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:2059 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 +2216,78 @@ msgid "" "meth:`_callmethod`." msgstr "" -#: ../../library/multiprocessing.rst:2066 +#: ../../library/multiprocessing.rst:2064 msgid "" "Note in particular that an exception will be raised if *methodname* has not " "been *exposed*." msgstr "" -#: ../../library/multiprocessing.rst:2069 +#: ../../library/multiprocessing.rst:2067 msgid "An example of the usage of :meth:`_callmethod`:" msgstr "" -#: ../../library/multiprocessing.rst:2085 +#: ../../library/multiprocessing.rst:2083 msgid "Return a copy of the referent." msgstr "" -#: ../../library/multiprocessing.rst:2087 +#: ../../library/multiprocessing.rst:2085 msgid "If the referent is unpicklable then this will raise an exception." msgstr "" -#: ../../library/multiprocessing.rst:2091 +#: ../../library/multiprocessing.rst:2089 msgid "Return a representation of the proxy object." msgstr "" -#: ../../library/multiprocessing.rst:2095 +#: ../../library/multiprocessing.rst:2093 msgid "Return the representation of the referent." msgstr "" -#: ../../library/multiprocessing.rst:2099 +#: ../../library/multiprocessing.rst:2097 msgid "Cleanup" msgstr "" -#: ../../library/multiprocessing.rst:2101 +#: ../../library/multiprocessing.rst:2099 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:2102 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:2107 msgid "Process Pools" msgstr "" -#: ../../library/multiprocessing.rst:2114 +#: ../../library/multiprocessing.rst:2112 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:2117 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:2121 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:2124 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:2127 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 +2295,7 @@ msgid "" "which means worker processes will live as long as the pool." msgstr "" -#: ../../library/multiprocessing.rst:2134 +#: ../../library/multiprocessing.rst:2132 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 +2303,13 @@ msgid "" "both cases *context* is set appropriately." msgstr "" -#: ../../library/multiprocessing.rst:2140 +#: ../../library/multiprocessing.rst:2138 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:2142 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 +2317,22 @@ msgid "" "to do this can lead to the process hanging on finalization." msgstr "" -#: ../../library/multiprocessing.rst:2149 +#: ../../library/multiprocessing.rst:2147 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:2151 msgid "*maxtasksperchild*" msgstr "" -#: ../../library/multiprocessing.rst:2156 +#: ../../library/multiprocessing.rst:2154 msgid "*context*" msgstr "" -#: ../../library/multiprocessing.rst:2161 +#: ../../library/multiprocessing.rst:2159 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 +2343,7 @@ msgid "" "ability to the end user." msgstr "" -#: ../../library/multiprocessing.rst:2171 +#: ../../library/multiprocessing.rst:2169 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 +2351,12 @@ msgid "" "executed in one of the workers of the pool." msgstr "" -#: ../../library/multiprocessing.rst:2178 -msgid "" -"A variant of the :meth:`apply` method which returns a :class:" -"`~multiprocessing.pool.AsyncResult` object." +#: ../../library/multiprocessing.rst:2176 +msgid "A variant of the :meth:`apply` method which returns a result object." msgstr "" -#: ../../library/multiprocessing.rst:2181 -#: ../../library/multiprocessing.rst:2212 +#: ../../library/multiprocessing.rst:2178 +#: ../../library/multiprocessing.rst:2208 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 +2364,58 @@ msgid "" "applied instead." msgstr "" -#: ../../library/multiprocessing.rst:2186 -#: ../../library/multiprocessing.rst:2217 +#: ../../library/multiprocessing.rst:2183 +#: ../../library/multiprocessing.rst:2213 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:2187 +#: ../../library/multiprocessing.rst:2217 msgid "" "Callbacks should complete immediately since otherwise the thread which " "handles the results will get blocked." msgstr "" -#: ../../library/multiprocessing.rst:2195 +#: ../../library/multiprocessing.rst:2192 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:2196 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:2200 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 -msgid "" -"A variant of the :meth:`.map` method which returns a :class:" -"`~multiprocessing.pool.AsyncResult` object." +#: ../../library/multiprocessing.rst:2206 +msgid "A variant of the :meth:`.map` method which returns a result object." msgstr "" -#: ../../library/multiprocessing.rst:2226 +#: ../../library/multiprocessing.rst:2222 msgid "A lazier version of :meth:`.map`." msgstr "" -#: ../../library/multiprocessing.rst:2228 +#: ../../library/multiprocessing.rst:2224 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:2229 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 +2423,65 @@ msgid "" "result cannot be returned within *timeout* seconds." msgstr "" -#: ../../library/multiprocessing.rst:2240 +#: ../../library/multiprocessing.rst:2236 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:2242 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:2245 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:2252 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:2260 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:2265 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:2271 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:2274 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:2282 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:2287 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 +2489,41 @@ msgid "" "exception will be reraised by :meth:`get`." msgstr "" -#: ../../library/multiprocessing.rst:2298 +#: ../../library/multiprocessing.rst:2294 msgid "Wait until the result is available or until *timeout* seconds pass." msgstr "" -#: ../../library/multiprocessing.rst:2302 +#: ../../library/multiprocessing.rst:2298 msgid "Return whether the call has completed." msgstr "" -#: ../../library/multiprocessing.rst:2306 +#: ../../library/multiprocessing.rst:2302 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:2305 msgid "" "If the result is not ready, :exc:`ValueError` is raised instead of :exc:" "`AssertionError`." msgstr "" -#: ../../library/multiprocessing.rst:2313 +#: ../../library/multiprocessing.rst:2309 msgid "The following example demonstrates the use of a pool::" msgstr "" -#: ../../library/multiprocessing.rst:2340 +#: ../../library/multiprocessing.rst:2336 msgid "Listeners and Clients" msgstr "" -#: ../../library/multiprocessing.rst:2345 +#: ../../library/multiprocessing.rst:2341 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:2345 msgid "" "However, the :mod:`multiprocessing.connection` module allows some extra " "flexibility. It basically gives a high level message oriented API for " @@ -2537,46 +2532,46 @@ msgid "" "multiple connections at the same time." msgstr "" -#: ../../library/multiprocessing.rst:2358 +#: ../../library/multiprocessing.rst:2354 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:2357 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:2363 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:2366 msgid "" "If a welcome message is not received, then :exc:`~multiprocessing." "AuthenticationError` is raised." msgstr "" -#: ../../library/multiprocessing.rst:2375 +#: ../../library/multiprocessing.rst:2371 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:2374 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:2378 +#: ../../library/multiprocessing.rst:2413 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 +2580,26 @@ msgid "" "`multiprocessing-auth-keys`." msgstr "" -#: ../../library/multiprocessing.rst:2390 +#: ../../library/multiprocessing.rst:2386 msgid "" "A wrapper for a bound socket or Windows named pipe which is 'listening' for " "connections." msgstr "" -#: ../../library/multiprocessing.rst:2393 +#: ../../library/multiprocessing.rst:2389 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:2394 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:2398 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 +2613,49 @@ msgid "" "using :func:`tempfile.mkstemp`." msgstr "" -#: ../../library/multiprocessing.rst:2413 +#: ../../library/multiprocessing.rst:2409 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:2421 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:2428 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:2432 msgid "Listener objects have the following read-only properties:" msgstr "" -#: ../../library/multiprocessing.rst:2440 +#: ../../library/multiprocessing.rst:2436 msgid "The address which is being used by the Listener object." msgstr "" -#: ../../library/multiprocessing.rst:2444 +#: ../../library/multiprocessing.rst:2440 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:2443 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:2450 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 +2664,32 @@ msgid "" "zero timeout." msgstr "" -#: ../../library/multiprocessing.rst:2460 +#: ../../library/multiprocessing.rst:2456 msgid "" "For both Unix and Windows, an object can appear in *object_list* if it is" msgstr "" -#: ../../library/multiprocessing.rst:2463 +#: ../../library/multiprocessing.rst:2459 msgid "a readable :class:`~multiprocessing.connection.Connection` object;" msgstr "" -#: ../../library/multiprocessing.rst:2464 +#: ../../library/multiprocessing.rst:2460 msgid "a connected and readable :class:`socket.socket` object; or" msgstr "" -#: ../../library/multiprocessing.rst:2465 +#: ../../library/multiprocessing.rst:2461 msgid "" "the :attr:`~multiprocessing.Process.sentinel` attribute of a :class:" "`~multiprocessing.Process` object." msgstr "" -#: ../../library/multiprocessing.rst:2468 +#: ../../library/multiprocessing.rst:2464 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:2467 msgid "" "**Unix**: ``wait(object_list, timeout)`` almost equivalent ``select." "select(object_list, [], [], timeout)``. The difference is that, if :func:" @@ -2702,7 +2697,7 @@ msgid "" "an error number of ``EINTR``, whereas :func:`wait` will not." msgstr "" -#: ../../library/multiprocessing.rst:2477 +#: ../../library/multiprocessing.rst:2473 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,64 +2706,68 @@ msgid "" "that pipe handles and socket handles are **not** waitable handles.)" msgstr "" -#: ../../library/multiprocessing.rst:2487 +#: ../../library/multiprocessing.rst:2483 msgid "**Examples**" msgstr "" -#: ../../library/multiprocessing.rst:2489 +#: ../../library/multiprocessing.rst:2485 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:2504 msgid "" "The following code connects to the server and receives some data from the " "server::" msgstr "" -#: ../../library/multiprocessing.rst:2525 +#: ../../library/multiprocessing.rst:2521 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:2560 msgid "Address Formats" msgstr "" -#: ../../library/multiprocessing.rst:2566 +#: ../../library/multiprocessing.rst:2562 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:2565 msgid "" "An ``'AF_UNIX'`` address is a string representing a filename on the " "filesystem." msgstr "" -#: ../../library/multiprocessing.rst:2572 +#: ../../library/multiprocessing.rst:2571 +msgid "An ``'AF_PIPE'`` address is a string of the form" +msgstr "" + +#: ../../library/multiprocessing.rst:2569 msgid "" -"An ``'AF_PIPE'`` address is a string of the form :samp:`r'\\\\\\\\.\\\\pipe\\" -"\\{PipeName}'`. To use :func:`Client` to connect to a named pipe on a " -"remote computer called *ServerName* one should use an address of the form :" -"samp:`r'\\\\\\\\{ServerName}\\\\pipe\\\\{PipeName}'` instead." +":samp:`r'\\\\\\\\.\\\\pipe\\\\{PipeName}'`. To use :func:`Client` to " +"connect to a named pipe on a remote computer called *ServerName* one should " +"use an address of the form :samp:`r'\\\\\\\\{ServerName}\\\\pipe\\" +"\\{PipeName}'` instead." msgstr "" -#: ../../library/multiprocessing.rst:2577 +#: ../../library/multiprocessing.rst:2573 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:2580 msgid "Authentication keys" msgstr "" -#: ../../library/multiprocessing.rst:2586 +#: ../../library/multiprocessing.rst:2582 msgid "" "When one uses :meth:`Connection.recv `, the data received " "is automatically unpickled. Unfortunately unpickling data from an untrusted " @@ -2776,7 +2775,7 @@ msgid "" "use the :mod:`hmac` module to provide digest authentication." msgstr "" -#: ../../library/multiprocessing.rst:2592 +#: ../../library/multiprocessing.rst:2588 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 +2783,7 @@ msgid "" "using the same key does **not** involve sending the key over the connection.)" msgstr "" -#: ../../library/multiprocessing.rst:2598 +#: ../../library/multiprocessing.rst:2594 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 +2794,17 @@ msgid "" "setting up connections between themselves." msgstr "" -#: ../../library/multiprocessing.rst:2606 +#: ../../library/multiprocessing.rst:2602 msgid "" "Suitable authentication keys can also be generated by using :func:`os." "urandom`." msgstr "" -#: ../../library/multiprocessing.rst:2610 +#: ../../library/multiprocessing.rst:2606 msgid "Logging" msgstr "" -#: ../../library/multiprocessing.rst:2612 +#: ../../library/multiprocessing.rst:2608 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 +2812,27 @@ msgid "" "mixed up." msgstr "" -#: ../../library/multiprocessing.rst:2619 +#: ../../library/multiprocessing.rst:2615 msgid "" "Returns the logger used by :mod:`multiprocessing`. If necessary, a new one " "will be created." msgstr "" -#: ../../library/multiprocessing.rst:2622 +#: ../../library/multiprocessing.rst:2618 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:2622 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:2629 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,135 +2840,87 @@ msgid "" "%(message)s'``." msgstr "" -#: ../../library/multiprocessing.rst:2638 +#: ../../library/multiprocessing.rst:2634 msgid "Below is an example session with logging turned on::" msgstr "" -#: ../../library/multiprocessing.rst:2653 +#: ../../library/multiprocessing.rst:2649 msgid "For a full table of logging levels, see the :mod:`logging` module." msgstr "" -#: ../../library/multiprocessing.rst:2657 +#: ../../library/multiprocessing.rst:2653 msgid "The :mod:`multiprocessing.dummy` module" msgstr "" -#: ../../library/multiprocessing.rst:2662 +#: ../../library/multiprocessing.rst:2658 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 -msgid "" -"In particular, the ``Pool`` function provided by :mod:`multiprocessing." -"dummy` returns an instance of :class:`ThreadPool`, which is a subclass of :" -"class:`Pool` that supports all the same method calls but uses a pool of " -"worker threads rather than worker processes." -msgstr "" - -#: ../../library/multiprocessing.rst:2675 -msgid "" -"A thread pool object which controls a pool of worker threads to which jobs " -"can be submitted. :class:`ThreadPool` instances are fully interface " -"compatible with :class:`Pool` instances, and their resources must also be " -"properly managed, either by using the pool as a context manager or by " -"calling :meth:`~multiprocessing.pool.Pool.close` and :meth:`~multiprocessing." -"pool.Pool.terminate` manually." -msgstr "" - -#: ../../library/multiprocessing.rst:2682 -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 -msgid "" -"Unlike :class:`Pool`, *maxtasksperchild* and *context* cannot be provided." -msgstr "" - -#: ../../library/multiprocessing.rst:2692 -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 :" -"class:`concurrent.futures` module. As such, it inherits some operations " -"that don't make sense for a pool backed by threads, and it has its own type " -"for representing the status of asynchronous jobs, :class:`AsyncResult`, that " -"is not understood by any other libraries." -msgstr "" - -#: ../../library/multiprocessing.rst:2699 -msgid "" -"Users should generally prefer to use :class:`concurrent.futures." -"ThreadPoolExecutor`, which has a simpler interface that was designed around " -"threads from the start, and which returns :class:`concurrent.futures.Future` " -"instances that are compatible with many other libraries, including :mod:" -"`asyncio`." -msgstr "" - -#: ../../library/multiprocessing.rst:2709 +#: ../../library/multiprocessing.rst:2665 msgid "Programming guidelines" msgstr "" -#: ../../library/multiprocessing.rst:2711 +#: ../../library/multiprocessing.rst:2667 msgid "" "There are certain guidelines and idioms which should be adhered to when " "using :mod:`multiprocessing`." msgstr "" -#: ../../library/multiprocessing.rst:2716 +#: ../../library/multiprocessing.rst:2672 msgid "All start methods" msgstr "" -#: ../../library/multiprocessing.rst:2718 +#: ../../library/multiprocessing.rst:2674 msgid "The following applies to all start methods." msgstr "" -#: ../../library/multiprocessing.rst:2720 +#: ../../library/multiprocessing.rst:2676 msgid "Avoid shared state" msgstr "" -#: ../../library/multiprocessing.rst:2722 +#: ../../library/multiprocessing.rst:2678 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:2681 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:2685 msgid "Picklability" msgstr "" -#: ../../library/multiprocessing.rst:2731 +#: ../../library/multiprocessing.rst:2687 msgid "Ensure that the arguments to the methods of proxies are picklable." msgstr "" -#: ../../library/multiprocessing.rst:2733 +#: ../../library/multiprocessing.rst:2689 msgid "Thread safety of proxies" msgstr "" -#: ../../library/multiprocessing.rst:2735 +#: ../../library/multiprocessing.rst:2691 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:2694 msgid "" "(There is never a problem with different processes using the *same* proxy.)" msgstr "" -#: ../../library/multiprocessing.rst:2740 +#: ../../library/multiprocessing.rst:2696 msgid "Joining zombie processes" msgstr "" -#: ../../library/multiprocessing.rst:2742 +#: ../../library/multiprocessing.rst:2698 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 +2931,11 @@ msgid "" "all the processes that you start." msgstr "" -#: ../../library/multiprocessing.rst:2750 +#: ../../library/multiprocessing.rst:2706 msgid "Better to inherit than pickle/unpickle" msgstr "" -#: ../../library/multiprocessing.rst:2752 +#: ../../library/multiprocessing.rst:2708 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 +2945,11 @@ msgid "" "inherit it from an ancestor process." msgstr "" -#: ../../library/multiprocessing.rst:2760 +#: ../../library/multiprocessing.rst:2716 msgid "Avoid terminating processes" msgstr "" -#: ../../library/multiprocessing.rst:2762 +#: ../../library/multiprocessing.rst:2718 msgid "" "Using the :meth:`Process.terminate ` " "method to stop a process is liable to cause any shared resources (such as " @@ -3006,18 +2957,18 @@ msgid "" "become broken or unavailable to other processes." msgstr "" -#: ../../library/multiprocessing.rst:2768 +#: ../../library/multiprocessing.rst:2724 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:2728 msgid "Joining processes that use queues" msgstr "" -#: ../../library/multiprocessing.rst:2774 +#: ../../library/multiprocessing.rst:2730 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 +2977,7 @@ msgid "" "queue to avoid this behaviour.)" msgstr "" -#: ../../library/multiprocessing.rst:2780 +#: ../../library/multiprocessing.rst:2736 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 +2986,21 @@ msgid "" "processes will be joined automatically." msgstr "" -#: ../../library/multiprocessing.rst:2786 +#: ../../library/multiprocessing.rst:2742 msgid "An example which will deadlock is the following::" msgstr "" -#: ../../library/multiprocessing.rst:2800 +#: ../../library/multiprocessing.rst:2756 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:2759 msgid "Explicitly pass resources to child processes" msgstr "" -#: ../../library/multiprocessing.rst:2805 +#: ../../library/multiprocessing.rst:2761 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 +3008,7 @@ msgid "" "for the child process." msgstr "" -#: ../../library/multiprocessing.rst:2810 +#: ../../library/multiprocessing.rst:2766 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 +3017,29 @@ msgid "" "collected in the parent process." msgstr "" -#: ../../library/multiprocessing.rst:2817 +#: ../../library/multiprocessing.rst:2773 msgid "So for instance ::" msgstr "" -#: ../../library/multiprocessing.rst:2829 +#: ../../library/multiprocessing.rst:2785 msgid "should be rewritten as ::" msgstr "" -#: ../../library/multiprocessing.rst:2841 +#: ../../library/multiprocessing.rst:2797 msgid "Beware of replacing :data:`sys.stdin` with a \"file like object\"" msgstr "" -#: ../../library/multiprocessing.rst:2843 +#: ../../library/multiprocessing.rst:2799 msgid ":mod:`multiprocessing` originally unconditionally called::" msgstr "" -#: ../../library/multiprocessing.rst:2847 +#: ../../library/multiprocessing.rst:2803 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:2809 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 +3049,33 @@ msgid "" "data being flushed to the object multiple times, resulting in corruption." msgstr "" -#: ../../library/multiprocessing.rst:2860 +#: ../../library/multiprocessing.rst:2816 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:2828 msgid "" "For more information, see :issue:`5155`, :issue:`5313` and :issue:`5331`" msgstr "" -#: ../../library/multiprocessing.rst:2875 +#: ../../library/multiprocessing.rst:2831 msgid "The *spawn* and *forkserver* start methods" msgstr "" -#: ../../library/multiprocessing.rst:2877 +#: ../../library/multiprocessing.rst:2833 msgid "" "There are a few extra restriction which don't apply to the *fork* start " "method." msgstr "" -#: ../../library/multiprocessing.rst:2880 +#: ../../library/multiprocessing.rst:2836 msgid "More picklability" msgstr "" -#: ../../library/multiprocessing.rst:2882 +#: ../../library/multiprocessing.rst:2838 msgid "" "Ensure that all arguments to :meth:`Process.__init__` are picklable. Also, " "if you subclass :class:`~multiprocessing.Process` then make sure that " @@ -3132,11 +3083,11 @@ msgid "" "Process.start>` method is called." msgstr "" -#: ../../library/multiprocessing.rst:2887 +#: ../../library/multiprocessing.rst:2843 msgid "Global variables" msgstr "" -#: ../../library/multiprocessing.rst:2889 +#: ../../library/multiprocessing.rst:2845 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 +3095,66 @@ msgid "" "Process.start>` was called." msgstr "" -#: ../../library/multiprocessing.rst:2894 +#: ../../library/multiprocessing.rst:2850 msgid "" "However, global variables which are just module level constants cause no " "problems." msgstr "" -#: ../../library/multiprocessing.rst:2897 +#: ../../library/multiprocessing.rst:2853 msgid "Safe importing of main module" msgstr "" -#: ../../library/multiprocessing.rst:2899 +#: ../../library/multiprocessing.rst:2855 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:2859 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:2871 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:2885 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:2888 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:2891 msgid "" "Similar restrictions apply if a pool or manager is created in the main " "module." msgstr "" -#: ../../library/multiprocessing.rst:2942 +#: ../../library/multiprocessing.rst:2898 msgid "Examples" msgstr "" -#: ../../library/multiprocessing.rst:2944 +#: ../../library/multiprocessing.rst:2900 msgid "Demonstration of how to create and use customized managers and proxies:" msgstr "" -#: ../../library/multiprocessing.rst:2950 +#: ../../library/multiprocessing.rst:2906 msgid "Using :class:`~multiprocessing.pool.Pool`:" msgstr "" -#: ../../library/multiprocessing.rst:2956 +#: ../../library/multiprocessing.rst:2912 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/multiprocessing.shared_memory.po b/library/multiprocessing.shared_memory.po index 5aca53e40d..cb9c9eaf4f 100644 --- a/library/multiprocessing.shared_memory.po +++ b/library/multiprocessing.shared_memory.po @@ -8,11 +8,10 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.9\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2021-09-07 06:52+0000\n" +"POT-Creation-Date: 2020-06-20 18:08+0800\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" -"Language: \n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" diff --git a/library/nntplib.po b/library/nntplib.po index 24ad9ffaad..3fa2fde166 100644 --- a/library/nntplib.po +++ b/library/nntplib.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.7\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2021-09-07 06:52+0000\n" +"POT-Creation-Date: 2020-06-20 18:08+0800\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-" @@ -68,13 +68,13 @@ msgid "" "close the NNTP connection when done, e.g.:" msgstr "" -#: ../../library/nntplib.rst:82 ../../library/nntplib.rst:114 +#: ../../library/nntplib.rst:83 ../../library/nntplib.rst:115 msgid "" "Raises an :ref:`auditing event ` ``nntplib.connect`` with " "arguments ``self``, ``host``, ``port``." msgstr "" -#: ../../library/nntplib.rst:84 ../../library/nntplib.rst:116 +#: ../../library/nntplib.rst:None msgid "" "Raises an :ref:`auditing event ` ``nntplib.putline`` with " "arguments ``self``, ``line``." diff --git a/library/numbers.po b/library/numbers.po index 8bd2bc4024..4bcd064fec 100644 --- a/library/numbers.po +++ b/library/numbers.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.7\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2021-09-07 06:52+0000\n" +"POT-Creation-Date: 2018-06-26 18:54+0800\n" "PO-Revision-Date: 2016-11-19 00:32+0000\n" "Last-Translator: Liang-Bo Wang \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -30,8 +30,8 @@ msgstr "" msgid "" "The :mod:`numbers` module (:pep:`3141`) defines a hierarchy of numeric :term:" "`abstract base classes ` which progressively define " -"more operations. None of the types defined in this module are intended to " -"be instantiated." +"more operations. None of the types defined in this module can be " +"instantiated." msgstr "" #: ../../library/numbers.rst:18 @@ -49,8 +49,8 @@ msgid "" "Subclasses of this type describe complex numbers and include the operations " "that work on the built-in :class:`complex` type. These are: conversions to :" "class:`complex` and :class:`bool`, :attr:`.real`, :attr:`.imag`, ``+``, ``-" -"``, ``*``, ``/``, ``**``, :func:`abs`, :meth:`conjugate`, ``==``, and ``!" -"=``. All except ``-`` and ``!=`` are abstract." +"``, ``*``, ``/``, :func:`abs`, :meth:`conjugate`, ``==``, and ``!=``. All " +"except ``-`` and ``!=`` are abstract." msgstr "" #: ../../library/numbers.rst:35 @@ -101,15 +101,15 @@ msgstr "" msgid "" "Subtypes :class:`Rational` and adds a conversion to :class:`int`. Provides " "defaults for :func:`float`, :attr:`~Rational.numerator`, and :attr:" -"`~Rational.denominator`. Adds abstract methods for :func:`pow` with modulus " -"and bit-string operations: ``<<``, ``>>``, ``&``, ``^``, ``|``, ``~``." +"`~Rational.denominator`. Adds abstract methods for ``**`` and bit-string " +"operations: ``<<``, ``>>``, ``&``, ``^``, ``|``, ``~``." msgstr "" -#: ../../library/numbers.rst:85 +#: ../../library/numbers.rst:84 msgid "Notes for type implementors" msgstr "" -#: ../../library/numbers.rst:87 +#: ../../library/numbers.rst:86 msgid "" "Implementors should be careful to make equal numbers equal and hash them to " "the same values. This may be subtle if there are two different extensions of " @@ -117,22 +117,22 @@ msgid "" "`hash` as follows::" msgstr "" -#: ../../library/numbers.rst:106 +#: ../../library/numbers.rst:105 msgid "Adding More Numeric ABCs" msgstr "" -#: ../../library/numbers.rst:108 +#: ../../library/numbers.rst:107 msgid "" "There are, of course, more possible ABCs for numbers, and this would be a " "poor hierarchy if it precluded the possibility of adding those. You can add " "``MyFoo`` between :class:`Complex` and :class:`Real` with::" msgstr "" -#: ../../library/numbers.rst:120 +#: ../../library/numbers.rst:119 msgid "Implementing the arithmetic operations" msgstr "" -#: ../../library/numbers.rst:122 +#: ../../library/numbers.rst:121 msgid "" "We want to implement the arithmetic operations so that mixed-mode operations " "either call an implementation whose author knew about the types of both " @@ -141,7 +141,7 @@ msgid "" "and :meth:`__radd__` should be defined as::" msgstr "" -#: ../../library/numbers.rst:153 +#: ../../library/numbers.rst:152 msgid "" "There are 5 different cases for a mixed-type operation on subclasses of :" "class:`Complex`. I'll refer to all of the above code that doesn't refer to " @@ -150,11 +150,11 @@ msgid "" "Complex``), and ``b : B <: Complex``. I'll consider ``a + b``:" msgstr "" -#: ../../library/numbers.rst:160 +#: ../../library/numbers.rst:159 msgid "If ``A`` defines an :meth:`__add__` which accepts ``b``, all is well." msgstr "" -#: ../../library/numbers.rst:162 +#: ../../library/numbers.rst:161 msgid "" "If ``A`` falls back to the boilerplate code, and it were to return a value " "from :meth:`__add__`, we'd miss the possibility that ``B`` defines a more " @@ -163,33 +163,33 @@ msgid "" "`__add__` at all.)" msgstr "" -#: ../../library/numbers.rst:168 +#: ../../library/numbers.rst:167 msgid "" "Then ``B``'s :meth:`__radd__` gets a chance. If it accepts ``a``, all is " "well." msgstr "" -#: ../../library/numbers.rst:170 +#: ../../library/numbers.rst:169 msgid "" "If it falls back to the boilerplate, there are no more possible methods to " "try, so this is where the default implementation should live." msgstr "" -#: ../../library/numbers.rst:173 +#: ../../library/numbers.rst:172 msgid "" "If ``B <: A``, Python tries ``B.__radd__`` before ``A.__add__``. This is ok, " "because it was implemented with knowledge of ``A``, so it can handle those " "instances before delegating to :class:`Complex`." msgstr "" -#: ../../library/numbers.rst:178 +#: ../../library/numbers.rst:177 msgid "" "If ``A <: Complex`` and ``B <: Real`` without sharing any other knowledge, " "then the appropriate shared operation is the one involving the built in :" "class:`complex`, and both :meth:`__radd__` s land there, so ``a+b == b+a``." msgstr "" -#: ../../library/numbers.rst:183 +#: ../../library/numbers.rst:182 msgid "" "Because most of the operations on any given type will be very similar, it " "can be useful to define a helper function which generates the forward and " diff --git a/library/operator.po b/library/operator.po index d0a8e2d0cb..a93fb817e4 100644 --- a/library/operator.po +++ b/library/operator.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.7\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2021-09-07 06:52+0000\n" +"POT-Creation-Date: 2020-06-20 18:08+0800\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-" @@ -241,7 +241,7 @@ msgid "" msgstr "" #: ../../library/operator.rst:270 ../../library/operator.rst:302 -#: ../../library/operator.rst:350 +#: ../../library/operator.rst:353 msgid "Equivalent to::" msgstr "" @@ -269,458 +269,458 @@ msgid "" "accept an index or a slice:" msgstr "" -#: ../../library/operator.rst:328 +#: ../../library/operator.rst:331 msgid "" "Example of using :func:`itemgetter` to retrieve specific fields from a tuple " "record:" msgstr "" -#: ../../library/operator.rst:341 +#: ../../library/operator.rst:344 msgid "" "Return a callable object that calls the method *name* on its operand. If " "additional arguments and/or keyword arguments are given, they will be given " "to the method as well. For example:" msgstr "" -#: ../../library/operator.rst:345 +#: ../../library/operator.rst:348 msgid "" "After ``f = methodcaller('name')``, the call ``f(b)`` returns ``b.name()``." msgstr "" -#: ../../library/operator.rst:347 +#: ../../library/operator.rst:350 msgid "" "After ``f = methodcaller('name', 'foo', bar=1)``, the call ``f(b)`` returns " "``b.name('foo', bar=1)``." msgstr "" -#: ../../library/operator.rst:361 +#: ../../library/operator.rst:364 msgid "Mapping Operators to Functions" msgstr "" -#: ../../library/operator.rst:363 +#: ../../library/operator.rst:366 msgid "" "This table shows how abstract operations correspond to operator symbols in " "the Python syntax and the functions in the :mod:`operator` module." msgstr "" -#: ../../library/operator.rst:367 +#: ../../library/operator.rst:370 msgid "Operation" msgstr "" -#: ../../library/operator.rst:367 +#: ../../library/operator.rst:370 msgid "Syntax" msgstr "" -#: ../../library/operator.rst:367 +#: ../../library/operator.rst:370 msgid "Function" msgstr "" -#: ../../library/operator.rst:369 +#: ../../library/operator.rst:372 msgid "Addition" msgstr "" -#: ../../library/operator.rst:369 +#: ../../library/operator.rst:372 msgid "``a + b``" msgstr "" -#: ../../library/operator.rst:369 +#: ../../library/operator.rst:372 msgid "``add(a, b)``" msgstr "" -#: ../../library/operator.rst:371 +#: ../../library/operator.rst:374 msgid "Concatenation" msgstr "" -#: ../../library/operator.rst:371 +#: ../../library/operator.rst:374 msgid "``seq1 + seq2``" msgstr "" -#: ../../library/operator.rst:371 +#: ../../library/operator.rst:374 msgid "``concat(seq1, seq2)``" msgstr "" -#: ../../library/operator.rst:373 +#: ../../library/operator.rst:376 msgid "Containment Test" msgstr "" -#: ../../library/operator.rst:373 +#: ../../library/operator.rst:376 msgid "``obj in seq``" msgstr "" -#: ../../library/operator.rst:373 +#: ../../library/operator.rst:376 msgid "``contains(seq, obj)``" msgstr "" -#: ../../library/operator.rst:375 ../../library/operator.rst:377 +#: ../../library/operator.rst:378 ../../library/operator.rst:380 msgid "Division" msgstr "" -#: ../../library/operator.rst:375 +#: ../../library/operator.rst:378 msgid "``a / b``" msgstr "" -#: ../../library/operator.rst:375 +#: ../../library/operator.rst:378 msgid "``truediv(a, b)``" msgstr "" -#: ../../library/operator.rst:377 +#: ../../library/operator.rst:380 msgid "``a // b``" msgstr "" -#: ../../library/operator.rst:377 +#: ../../library/operator.rst:380 msgid "``floordiv(a, b)``" msgstr "" -#: ../../library/operator.rst:379 +#: ../../library/operator.rst:382 msgid "Bitwise And" msgstr "" -#: ../../library/operator.rst:379 +#: ../../library/operator.rst:382 msgid "``a & b``" msgstr "" -#: ../../library/operator.rst:379 +#: ../../library/operator.rst:382 msgid "``and_(a, b)``" msgstr "" -#: ../../library/operator.rst:381 +#: ../../library/operator.rst:384 msgid "Bitwise Exclusive Or" msgstr "" -#: ../../library/operator.rst:381 +#: ../../library/operator.rst:384 msgid "``a ^ b``" msgstr "" -#: ../../library/operator.rst:381 +#: ../../library/operator.rst:384 msgid "``xor(a, b)``" msgstr "" -#: ../../library/operator.rst:383 +#: ../../library/operator.rst:386 msgid "Bitwise Inversion" msgstr "" -#: ../../library/operator.rst:383 +#: ../../library/operator.rst:386 msgid "``~ a``" msgstr "" -#: ../../library/operator.rst:383 +#: ../../library/operator.rst:386 msgid "``invert(a)``" msgstr "" -#: ../../library/operator.rst:385 +#: ../../library/operator.rst:388 msgid "Bitwise Or" msgstr "" -#: ../../library/operator.rst:385 +#: ../../library/operator.rst:388 msgid "``a | b``" msgstr "" -#: ../../library/operator.rst:385 +#: ../../library/operator.rst:388 msgid "``or_(a, b)``" msgstr "" -#: ../../library/operator.rst:387 +#: ../../library/operator.rst:390 msgid "Exponentiation" msgstr "" -#: ../../library/operator.rst:387 +#: ../../library/operator.rst:390 msgid "``a ** b``" msgstr "" -#: ../../library/operator.rst:387 +#: ../../library/operator.rst:390 msgid "``pow(a, b)``" msgstr "" -#: ../../library/operator.rst:389 ../../library/operator.rst:391 +#: ../../library/operator.rst:392 ../../library/operator.rst:394 msgid "Identity" msgstr "" -#: ../../library/operator.rst:389 +#: ../../library/operator.rst:392 msgid "``a is b``" msgstr "" -#: ../../library/operator.rst:389 +#: ../../library/operator.rst:392 msgid "``is_(a, b)``" msgstr "" -#: ../../library/operator.rst:391 +#: ../../library/operator.rst:394 msgid "``a is not b``" msgstr "" -#: ../../library/operator.rst:391 +#: ../../library/operator.rst:394 msgid "``is_not(a, b)``" msgstr "" -#: ../../library/operator.rst:393 +#: ../../library/operator.rst:396 msgid "Indexed Assignment" msgstr "" -#: ../../library/operator.rst:393 +#: ../../library/operator.rst:396 msgid "``obj[k] = v``" msgstr "" -#: ../../library/operator.rst:393 +#: ../../library/operator.rst:396 msgid "``setitem(obj, k, v)``" msgstr "" -#: ../../library/operator.rst:395 +#: ../../library/operator.rst:398 msgid "Indexed Deletion" msgstr "" -#: ../../library/operator.rst:395 +#: ../../library/operator.rst:398 msgid "``del obj[k]``" msgstr "" -#: ../../library/operator.rst:395 +#: ../../library/operator.rst:398 msgid "``delitem(obj, k)``" msgstr "" -#: ../../library/operator.rst:397 +#: ../../library/operator.rst:400 msgid "Indexing" msgstr "" -#: ../../library/operator.rst:397 +#: ../../library/operator.rst:400 msgid "``obj[k]``" msgstr "" -#: ../../library/operator.rst:397 +#: ../../library/operator.rst:400 msgid "``getitem(obj, k)``" msgstr "" -#: ../../library/operator.rst:399 +#: ../../library/operator.rst:402 msgid "Left Shift" msgstr "" -#: ../../library/operator.rst:399 +#: ../../library/operator.rst:402 msgid "``a << b``" msgstr "" -#: ../../library/operator.rst:399 +#: ../../library/operator.rst:402 msgid "``lshift(a, b)``" msgstr "" -#: ../../library/operator.rst:401 +#: ../../library/operator.rst:404 msgid "Modulo" msgstr "" -#: ../../library/operator.rst:401 +#: ../../library/operator.rst:404 msgid "``a % b``" msgstr "" -#: ../../library/operator.rst:401 +#: ../../library/operator.rst:404 msgid "``mod(a, b)``" msgstr "" -#: ../../library/operator.rst:403 +#: ../../library/operator.rst:406 msgid "Multiplication" msgstr "" -#: ../../library/operator.rst:403 +#: ../../library/operator.rst:406 msgid "``a * b``" msgstr "" -#: ../../library/operator.rst:403 +#: ../../library/operator.rst:406 msgid "``mul(a, b)``" msgstr "" -#: ../../library/operator.rst:405 +#: ../../library/operator.rst:408 msgid "Matrix Multiplication" msgstr "" -#: ../../library/operator.rst:405 +#: ../../library/operator.rst:408 msgid "``a @ b``" msgstr "" -#: ../../library/operator.rst:405 +#: ../../library/operator.rst:408 msgid "``matmul(a, b)``" msgstr "" -#: ../../library/operator.rst:407 +#: ../../library/operator.rst:410 msgid "Negation (Arithmetic)" msgstr "" -#: ../../library/operator.rst:407 +#: ../../library/operator.rst:410 msgid "``- a``" msgstr "" -#: ../../library/operator.rst:407 +#: ../../library/operator.rst:410 msgid "``neg(a)``" msgstr "" -#: ../../library/operator.rst:409 +#: ../../library/operator.rst:412 msgid "Negation (Logical)" msgstr "" -#: ../../library/operator.rst:409 +#: ../../library/operator.rst:412 msgid "``not a``" msgstr "" -#: ../../library/operator.rst:409 +#: ../../library/operator.rst:412 msgid "``not_(a)``" msgstr "" -#: ../../library/operator.rst:411 +#: ../../library/operator.rst:414 msgid "Positive" msgstr "" -#: ../../library/operator.rst:411 +#: ../../library/operator.rst:414 msgid "``+ a``" msgstr "" -#: ../../library/operator.rst:411 +#: ../../library/operator.rst:414 msgid "``pos(a)``" msgstr "" -#: ../../library/operator.rst:413 +#: ../../library/operator.rst:416 msgid "Right Shift" msgstr "" -#: ../../library/operator.rst:413 +#: ../../library/operator.rst:416 msgid "``a >> b``" msgstr "" -#: ../../library/operator.rst:413 +#: ../../library/operator.rst:416 msgid "``rshift(a, b)``" msgstr "" -#: ../../library/operator.rst:415 +#: ../../library/operator.rst:418 msgid "Slice Assignment" msgstr "" -#: ../../library/operator.rst:415 +#: ../../library/operator.rst:418 msgid "``seq[i:j] = values``" msgstr "" -#: ../../library/operator.rst:415 +#: ../../library/operator.rst:418 msgid "``setitem(seq, slice(i, j), values)``" msgstr "" -#: ../../library/operator.rst:417 +#: ../../library/operator.rst:420 msgid "Slice Deletion" msgstr "" -#: ../../library/operator.rst:417 +#: ../../library/operator.rst:420 msgid "``del seq[i:j]``" msgstr "" -#: ../../library/operator.rst:417 +#: ../../library/operator.rst:420 msgid "``delitem(seq, slice(i, j))``" msgstr "" -#: ../../library/operator.rst:419 +#: ../../library/operator.rst:422 msgid "Slicing" msgstr "" -#: ../../library/operator.rst:419 +#: ../../library/operator.rst:422 msgid "``seq[i:j]``" msgstr "" -#: ../../library/operator.rst:419 +#: ../../library/operator.rst:422 msgid "``getitem(seq, slice(i, j))``" msgstr "" -#: ../../library/operator.rst:421 +#: ../../library/operator.rst:424 msgid "String Formatting" msgstr "" -#: ../../library/operator.rst:421 +#: ../../library/operator.rst:424 msgid "``s % obj``" msgstr "" -#: ../../library/operator.rst:421 +#: ../../library/operator.rst:424 msgid "``mod(s, obj)``" msgstr "" -#: ../../library/operator.rst:423 +#: ../../library/operator.rst:426 msgid "Subtraction" msgstr "" -#: ../../library/operator.rst:423 +#: ../../library/operator.rst:426 msgid "``a - b``" msgstr "" -#: ../../library/operator.rst:423 +#: ../../library/operator.rst:426 msgid "``sub(a, b)``" msgstr "" -#: ../../library/operator.rst:425 +#: ../../library/operator.rst:428 msgid "Truth Test" msgstr "" -#: ../../library/operator.rst:425 +#: ../../library/operator.rst:428 msgid "``obj``" msgstr "" -#: ../../library/operator.rst:425 +#: ../../library/operator.rst:428 msgid "``truth(obj)``" msgstr "" -#: ../../library/operator.rst:427 ../../library/operator.rst:429 -#: ../../library/operator.rst:435 ../../library/operator.rst:437 +#: ../../library/operator.rst:430 ../../library/operator.rst:432 +#: ../../library/operator.rst:438 ../../library/operator.rst:440 msgid "Ordering" msgstr "" -#: ../../library/operator.rst:427 +#: ../../library/operator.rst:430 msgid "``a < b``" msgstr "" -#: ../../library/operator.rst:427 +#: ../../library/operator.rst:430 msgid "``lt(a, b)``" msgstr "" -#: ../../library/operator.rst:429 +#: ../../library/operator.rst:432 msgid "``a <= b``" msgstr "" -#: ../../library/operator.rst:429 +#: ../../library/operator.rst:432 msgid "``le(a, b)``" msgstr "" -#: ../../library/operator.rst:431 +#: ../../library/operator.rst:434 msgid "Equality" msgstr "" -#: ../../library/operator.rst:431 +#: ../../library/operator.rst:434 msgid "``a == b``" msgstr "" -#: ../../library/operator.rst:431 +#: ../../library/operator.rst:434 msgid "``eq(a, b)``" msgstr "" -#: ../../library/operator.rst:433 +#: ../../library/operator.rst:436 msgid "Difference" msgstr "" -#: ../../library/operator.rst:433 +#: ../../library/operator.rst:436 msgid "``a != b``" msgstr "" -#: ../../library/operator.rst:433 +#: ../../library/operator.rst:436 msgid "``ne(a, b)``" msgstr "" -#: ../../library/operator.rst:435 +#: ../../library/operator.rst:438 msgid "``a >= b``" msgstr "" -#: ../../library/operator.rst:435 +#: ../../library/operator.rst:438 msgid "``ge(a, b)``" msgstr "" -#: ../../library/operator.rst:437 +#: ../../library/operator.rst:440 msgid "``a > b``" msgstr "" -#: ../../library/operator.rst:437 +#: ../../library/operator.rst:440 msgid "``gt(a, b)``" msgstr "" -#: ../../library/operator.rst:441 +#: ../../library/operator.rst:444 msgid "In-place Operators" msgstr "" -#: ../../library/operator.rst:443 +#: ../../library/operator.rst:446 msgid "" "Many operations have an \"in-place\" version. Listed below are functions " "providing a more primitive access to in-place operators than the usual " @@ -730,7 +730,7 @@ msgid "" "y``." msgstr "" -#: ../../library/operator.rst:450 +#: ../../library/operator.rst:453 msgid "" "In those examples, note that when an in-place method is called, the " "computation and assignment are performed in two separate steps. The in-" @@ -738,71 +738,71 @@ msgid "" "method. The second step, assignment, is not handled." msgstr "" -#: ../../library/operator.rst:455 +#: ../../library/operator.rst:458 msgid "" "For immutable targets such as strings, numbers, and tuples, the updated " "value is computed, but not assigned back to the input variable:" msgstr "" -#: ../../library/operator.rst:464 +#: ../../library/operator.rst:467 msgid "" "For mutable targets such as lists and dictionaries, the in-place method will " "perform the update, so no subsequent assignment is necessary:" msgstr "" -#: ../../library/operator.rst:476 +#: ../../library/operator.rst:479 msgid "``a = iadd(a, b)`` is equivalent to ``a += b``." msgstr "" -#: ../../library/operator.rst:482 +#: ../../library/operator.rst:485 msgid "``a = iand(a, b)`` is equivalent to ``a &= b``." msgstr "" -#: ../../library/operator.rst:488 +#: ../../library/operator.rst:491 msgid "" "``a = iconcat(a, b)`` is equivalent to ``a += b`` for *a* and *b* sequences." msgstr "" -#: ../../library/operator.rst:494 +#: ../../library/operator.rst:497 msgid "``a = ifloordiv(a, b)`` is equivalent to ``a //= b``." msgstr "" -#: ../../library/operator.rst:500 +#: ../../library/operator.rst:503 msgid "``a = ilshift(a, b)`` is equivalent to ``a <<= b``." msgstr "" -#: ../../library/operator.rst:506 +#: ../../library/operator.rst:509 msgid "``a = imod(a, b)`` is equivalent to ``a %= b``." msgstr "" -#: ../../library/operator.rst:512 +#: ../../library/operator.rst:515 msgid "``a = imul(a, b)`` is equivalent to ``a *= b``." msgstr "" -#: ../../library/operator.rst:518 +#: ../../library/operator.rst:521 msgid "``a = imatmul(a, b)`` is equivalent to ``a @= b``." msgstr "" -#: ../../library/operator.rst:526 +#: ../../library/operator.rst:529 msgid "``a = ior(a, b)`` is equivalent to ``a |= b``." msgstr "" -#: ../../library/operator.rst:532 +#: ../../library/operator.rst:535 msgid "``a = ipow(a, b)`` is equivalent to ``a **= b``." msgstr "" -#: ../../library/operator.rst:538 +#: ../../library/operator.rst:541 msgid "``a = irshift(a, b)`` is equivalent to ``a >>= b``." msgstr "" -#: ../../library/operator.rst:544 +#: ../../library/operator.rst:547 msgid "``a = isub(a, b)`` is equivalent to ``a -= b``." msgstr "" -#: ../../library/operator.rst:550 +#: ../../library/operator.rst:553 msgid "``a = itruediv(a, b)`` is equivalent to ``a /= b``." msgstr "" -#: ../../library/operator.rst:556 +#: ../../library/operator.rst:559 msgid "``a = ixor(a, b)`` is equivalent to ``a ^= b``." msgstr "" diff --git a/library/optparse.po b/library/optparse.po index cdfec8e394..b22060efb5 100644 --- a/library/optparse.po +++ b/library/optparse.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.7\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2021-09-07 06:52+0000\n" +"POT-Creation-Date: 2020-06-20 18:08+0800\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-" @@ -66,7 +66,7 @@ msgid "" msgstr "" #: ../../library/optparse.rst:58 -msgid "Additionally, users can run one of the following ::" +msgid "Additionally, users can run one of ::" msgstr "" #: ../../library/optparse.rst:63 diff --git a/library/os.path.po b/library/os.path.po index c91b217cd5..93fbcb7094 100644 --- a/library/os.path.po +++ b/library/os.path.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.7\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2021-09-07 06:52+0000\n" +"POT-Creation-Date: 2020-06-20 18:08+0800\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-" @@ -103,11 +103,11 @@ msgstr "" #: ../../library/os.path.rst:242 ../../library/os.path.rst:252 #: ../../library/os.path.rst:262 ../../library/os.path.rst:272 #: ../../library/os.path.rst:282 ../../library/os.path.rst:301 -#: ../../library/os.path.rst:331 ../../library/os.path.rst:351 -#: ../../library/os.path.rst:365 ../../library/os.path.rst:384 -#: ../../library/os.path.rst:402 ../../library/os.path.rst:415 -#: ../../library/os.path.rst:431 ../../library/os.path.rst:447 -#: ../../library/os.path.rst:472 ../../library/os.path.rst:498 +#: ../../library/os.path.rst:332 ../../library/os.path.rst:344 +#: ../../library/os.path.rst:358 ../../library/os.path.rst:376 +#: ../../library/os.path.rst:394 ../../library/os.path.rst:407 +#: ../../library/os.path.rst:423 ../../library/os.path.rst:439 +#: ../../library/os.path.rst:460 ../../library/os.path.rst:471 msgid "Accepts a :term:`path-like object`." msgstr "" @@ -128,9 +128,9 @@ msgid "" "empty. Unlike :func:`commonprefix`, this returns a valid path." msgstr "" -#: ../../library/os.path.rst:96 ../../library/os.path.rst:383 -#: ../../library/os.path.rst:395 ../../library/os.path.rst:411 -#: ../../library/os.path.rst:427 +#: ../../library/os.path.rst:96 ../../library/os.path.rst:375 +#: ../../library/os.path.rst:387 ../../library/os.path.rst:403 +#: ../../library/os.path.rst:419 msgid ":ref:`Availability `: Unix, Windows." msgstr "" @@ -305,13 +305,13 @@ msgstr "" msgid "" "Join one or more path components intelligently. The return value is the " "concatenation of *path* and any members of *\\*paths* with exactly one " -"directory separator following each non-empty part except the last, meaning " -"that the result will only end in a separator if the last part is empty. If " -"a component is an absolute path, all previous components are thrown away and " -"joining continues from the absolute path component." +"directory separator (``os.sep``) following each non-empty part except the " +"last, meaning that the result will only end in a separator if the last part " +"is empty. If a component is an absolute path, all previous components are " +"thrown away and joining continues from the absolute path component." msgstr "" -#: ../../library/os.path.rst:314 +#: ../../library/os.path.rst:315 msgid "" "On Windows, the drive letter is not reset when an absolute path component (e." "g., ``r'\\foo'``) is encountered. If a component contains a drive letter, " @@ -321,18 +321,18 @@ msgid "" "file:`C:` (:file:`c:foo`), not :file:`c:\\\\foo`." msgstr "" -#: ../../library/os.path.rst:321 +#: ../../library/os.path.rst:322 msgid "Accepts a :term:`path-like object` for *path* and *paths*." msgstr "" -#: ../../library/os.path.rst:327 +#: ../../library/os.path.rst:328 msgid "" "Normalize the case of a pathname. On Windows, convert all characters in the " "pathname to lowercase, and also convert forward slashes to backward slashes. " "On other operating systems, return the path unchanged." msgstr "" -#: ../../library/os.path.rst:337 +#: ../../library/os.path.rst:338 msgid "" "Normalize a pathname by collapsing redundant separators and up-level " "references so that ``A//B``, ``A/B/``, ``A/./B`` and ``A/foo/../B`` all " @@ -341,69 +341,58 @@ msgid "" "backward slashes. To normalize case, use :func:`normcase`." msgstr "" -#: ../../library/os.path.rst:344 -msgid "" -"On POSIX systems, in accordance with `IEEE Std 1003.1 2013 Edition; 4.13 " -"Pathname Resolution `_, if a pathname begins with exactly two " -"slashes, the first component following the leading characters may be " -"interpreted in an implementation-defined manner, although more than two " -"leading characters shall be treated as a single character." -msgstr "" - -#: ../../library/os.path.rst:357 +#: ../../library/os.path.rst:350 msgid "" "Return the canonical path of the specified filename, eliminating any " "symbolic links encountered in the path (if they are supported by the " "operating system)." msgstr "" -#: ../../library/os.path.rst:362 +#: ../../library/os.path.rst:355 msgid "" "When symbolic link cycles occur, the returned path will be one member of the " "cycle, but no guarantee is made about which member that will be." msgstr "" -#: ../../library/os.path.rst:368 +#: ../../library/os.path.rst:361 msgid "Symbolic links and junctions are now resolved on Windows." msgstr "" -#: ../../library/os.path.rst:374 +#: ../../library/os.path.rst:367 msgid "" "Return a relative filepath to *path* either from the current directory or " "from an optional *start* directory. This is a path computation: the " "filesystem is not accessed to confirm the existence or nature of *path* or " -"*start*. On Windows, :exc:`ValueError` is raised when *path* and *start* " -"are on different drives." +"*start*." msgstr "" -#: ../../library/os.path.rst:380 +#: ../../library/os.path.rst:372 msgid "*start* defaults to :attr:`os.curdir`." msgstr "" -#: ../../library/os.path.rst:390 +#: ../../library/os.path.rst:382 msgid "" "Return ``True`` if both pathname arguments refer to the same file or " "directory. This is determined by the device number and i-node number and " "raises an exception if an :func:`os.stat` call on either pathname fails." msgstr "" -#: ../../library/os.path.rst:396 ../../library/os.path.rst:412 -#: ../../library/os.path.rst:428 +#: ../../library/os.path.rst:388 ../../library/os.path.rst:404 +#: ../../library/os.path.rst:420 msgid "Added Windows support." msgstr "" -#: ../../library/os.path.rst:399 +#: ../../library/os.path.rst:391 msgid "Windows now uses the same implementation as all other platforms." msgstr "" -#: ../../library/os.path.rst:408 +#: ../../library/os.path.rst:400 msgid "" "Return ``True`` if the file descriptors *fp1* and *fp2* refer to the same " "file." msgstr "" -#: ../../library/os.path.rst:421 +#: ../../library/os.path.rst:413 msgid "" "Return ``True`` if the stat tuples *stat1* and *stat2* refer to the same " "file. These structures may have been returned by :func:`os.fstat`, :func:`os." @@ -411,7 +400,7 @@ msgid "" "comparison used by :func:`samefile` and :func:`sameopenfile`." msgstr "" -#: ../../library/os.path.rst:437 +#: ../../library/os.path.rst:429 msgid "" "Split the pathname *path* into a pair, ``(head, tail)`` where *tail* is the " "last pathname component and *head* is everything leading up to that. The " @@ -424,7 +413,7 @@ msgid "" "and :func:`basename`." msgstr "" -#: ../../library/os.path.rst:453 +#: ../../library/os.path.rst:445 msgid "" "Split the pathname *path* into a pair ``(drive, tail)`` where *drive* is " "either a mount point or the empty string. On systems which do not use drive " @@ -432,45 +421,34 @@ msgid "" "``drive + tail`` will be the same as *path*." msgstr "" -#: ../../library/os.path.rst:458 +#: ../../library/os.path.rst:450 msgid "" "On Windows, splits a pathname into drive/UNC sharepoint and relative path." msgstr "" -#: ../../library/os.path.rst:460 +#: ../../library/os.path.rst:452 msgid "" "If the path contains a drive letter, drive will contain everything up to and " -"including the colon::" +"including the colon. e.g. ``splitdrive(\"c:/dir\")`` returns ``(\"c:\", \"/" +"dir\")``" msgstr "" -#: ../../library/os.path.rst:466 +#: ../../library/os.path.rst:456 msgid "" "If the path contains a UNC path, drive will contain the host name and share, " -"up to but not including the fourth separator::" +"up to but not including the fourth separator. e.g. ``splitdrive(\"//host/" +"computer/dir\")`` returns ``(\"//host/computer\", \"/dir\")``" msgstr "" -#: ../../library/os.path.rst:478 +#: ../../library/os.path.rst:466 msgid "" "Split the pathname *path* into a pair ``(root, ext)`` such that ``root + " -"ext == path``, and the extension, *ext*, is empty or begins with a period " -"and contains at most one period." -msgstr "" - -#: ../../library/os.path.rst:482 -msgid "If the path contains no extension, *ext* will be ``''``::" -msgstr "" - -#: ../../library/os.path.rst:487 -msgid "" -"If the path contains an extension, then *ext* will be set to this extension, " -"including the leading period. Note that previous periods will be ignored::" -msgstr "" - -#: ../../library/os.path.rst:493 -msgid "Leading periods on the basename are ignored::" +"ext == path``, and *ext* is empty or begins with a period and contains at " +"most one period. Leading periods on the basename are ignored; ``splitext('." +"cshrc')`` returns ``('.cshrc', '')``." msgstr "" -#: ../../library/os.path.rst:504 +#: ../../library/os.path.rst:477 msgid "" "``True`` if arbitrary Unicode strings can be used as file names (within " "limitations imposed by the file system)." diff --git a/library/os.po b/library/os.po index 52d2706d44..f870fb5292 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-07 06:52+0000\n" +"POT-Creation-Date: 2020-06-20 18:08+0800\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-" @@ -163,32 +163,32 @@ msgstr "" #: ../../library/os.rst:1726 ../../library/os.rst:1740 #: ../../library/os.rst:1753 ../../library/os.rst:1780 #: ../../library/os.rst:1795 ../../library/os.rst:1808 -#: ../../library/os.rst:1996 ../../library/os.rst:2018 -#: ../../library/os.rst:2062 ../../library/os.rst:2073 -#: ../../library/os.rst:2750 ../../library/os.rst:2904 -#: ../../library/os.rst:3136 ../../library/os.rst:3433 -#: ../../library/os.rst:3441 ../../library/os.rst:3448 -#: ../../library/os.rst:3455 ../../library/os.rst:3462 -#: ../../library/os.rst:3469 ../../library/os.rst:3476 -#: ../../library/os.rst:3483 ../../library/os.rst:3491 -#: ../../library/os.rst:3499 ../../library/os.rst:3506 -#: ../../library/os.rst:3513 ../../library/os.rst:3522 -#: ../../library/os.rst:3530 ../../library/os.rst:3538 -#: ../../library/os.rst:3545 ../../library/os.rst:3552 -#: ../../library/os.rst:3573 ../../library/os.rst:3628 -#: ../../library/os.rst:3635 ../../library/os.rst:3656 -#: ../../library/os.rst:3772 ../../library/os.rst:3820 -#: ../../library/os.rst:4034 ../../library/os.rst:4055 -#: ../../library/os.rst:4066 ../../library/os.rst:4086 -#: ../../library/os.rst:4101 ../../library/os.rst:4156 -#: ../../library/os.rst:4170 ../../library/os.rst:4208 -#: ../../library/os.rst:4224 ../../library/os.rst:4238 -#: ../../library/os.rst:4249 ../../library/os.rst:4261 -#: ../../library/os.rst:4268 ../../library/os.rst:4277 -#: ../../library/os.rst:4286 ../../library/os.rst:4295 -#: ../../library/os.rst:4304 ../../library/os.rst:4450 -#: ../../library/os.rst:4459 ../../library/os.rst:4480 -#: ../../library/os.rst:4490 ../../library/os.rst:4499 +#: ../../library/os.rst:1994 ../../library/os.rst:2016 +#: ../../library/os.rst:2060 ../../library/os.rst:2071 +#: ../../library/os.rst:2745 ../../library/os.rst:2899 +#: ../../library/os.rst:3128 ../../library/os.rst:3425 +#: ../../library/os.rst:3433 ../../library/os.rst:3440 +#: ../../library/os.rst:3447 ../../library/os.rst:3454 +#: ../../library/os.rst:3461 ../../library/os.rst:3468 +#: ../../library/os.rst:3475 ../../library/os.rst:3483 +#: ../../library/os.rst:3491 ../../library/os.rst:3498 +#: ../../library/os.rst:3505 ../../library/os.rst:3514 +#: ../../library/os.rst:3522 ../../library/os.rst:3530 +#: ../../library/os.rst:3537 ../../library/os.rst:3544 +#: ../../library/os.rst:3565 ../../library/os.rst:3620 +#: ../../library/os.rst:3627 ../../library/os.rst:3648 +#: ../../library/os.rst:3764 ../../library/os.rst:3812 +#: ../../library/os.rst:4026 ../../library/os.rst:4047 +#: ../../library/os.rst:4058 ../../library/os.rst:4078 +#: ../../library/os.rst:4093 ../../library/os.rst:4148 +#: ../../library/os.rst:4162 ../../library/os.rst:4200 +#: ../../library/os.rst:4216 ../../library/os.rst:4230 +#: ../../library/os.rst:4241 ../../library/os.rst:4253 +#: ../../library/os.rst:4260 ../../library/os.rst:4269 +#: ../../library/os.rst:4278 ../../library/os.rst:4287 +#: ../../library/os.rst:4296 ../../library/os.rst:4442 +#: ../../library/os.rst:4451 ../../library/os.rst:4472 +#: ../../library/os.rst:4482 ../../library/os.rst:4491 msgid ":ref:`Availability `: Unix." msgstr "" @@ -229,7 +229,7 @@ msgstr "" #: ../../library/os.rst:129 msgid "" -"On some platforms, including FreeBSD and macOS, setting ``environ`` may " +"On some platforms, including FreeBSD and Mac OS X, setting ``environ`` may " "cause memory leaks. Refer to the system documentation for :c:func:`putenv`." msgstr "" @@ -389,7 +389,7 @@ msgstr "" #: ../../library/os.rst:304 msgid "" -"On macOS, :func:`getgroups` behavior differs somewhat from other Unix " +"On Mac OS X, :func:`getgroups` behavior differs somewhat from other Unix " "platforms. If the Python interpreter was built with a deployment target of :" "const:`10.5` or earlier, :func:`getgroups` returns the list of effective " "group ids associated with the current user process; this list is limited to " @@ -415,11 +415,11 @@ msgstr "" #: ../../library/os.rst:328 ../../library/os.rst:363 ../../library/os.rst:857 #: ../../library/os.rst:869 ../../library/os.rst:1061 ../../library/os.rst:1435 -#: ../../library/os.rst:1824 ../../library/os.rst:2096 -#: ../../library/os.rst:2884 ../../library/os.rst:2918 -#: ../../library/os.rst:3400 ../../library/os.rst:3905 -#: ../../library/os.rst:3916 ../../library/os.rst:3992 -#: ../../library/os.rst:4016 +#: ../../library/os.rst:1824 ../../library/os.rst:2094 +#: ../../library/os.rst:2879 ../../library/os.rst:2913 +#: ../../library/os.rst:3392 ../../library/os.rst:3897 +#: ../../library/os.rst:3908 ../../library/os.rst:3984 +#: ../../library/os.rst:4008 msgid ":ref:`Availability `: Unix, Windows." msgstr "" @@ -504,11 +504,11 @@ msgstr "" #: ../../library/os.rst:451 msgid "" -"On some platforms, including FreeBSD and macOS, setting ``environ`` may " +"On some platforms, including FreeBSD and Mac OS X, setting ``environ`` may " "cause memory leaks. Refer to the system documentation for :c:func:`putenv`." msgstr "" -#: ../../library/os.rst:454 +#: ../../library/os.rst:455 msgid "" "Raises an :ref:`auditing event ` ``os.putenv`` with arguments " "``key``, ``value``." @@ -540,10 +540,10 @@ msgstr "" #: ../../library/os.rst:489 msgid "" -"On macOS, the length of *groups* may not exceed the system-defined maximum " -"number of effective group ids, typically 16. See the documentation for :func:" -"`getgroups` for cases where it may not return the same group list set by " -"calling setgroups()." +"On Mac OS X, the length of *groups* may not exceed the system-defined " +"maximum number of effective group ids, typically 16. See the documentation " +"for :func:`getgroups` for cases where it may not return the same group list " +"set by calling setgroups()." msgstr "" #: ../../library/os.rst:496 @@ -666,7 +666,7 @@ msgstr "" msgid ":ref:`Availability `: recent flavors of Unix." msgstr "" -#: ../../library/os.rst:633 ../../library/os.rst:4017 +#: ../../library/os.rst:633 ../../library/os.rst:4009 msgid "" "Return type changed from a tuple to a tuple-like object with named " "attributes." @@ -687,7 +687,7 @@ msgid "" "``os.environ``." msgstr "" -#: ../../library/os.rst:651 +#: ../../library/os.rst:652 msgid "" "Raises an :ref:`auditing event ` ``os.unsetenv`` with argument " "``key``." @@ -834,7 +834,7 @@ msgid "" "this is equivalent to ``os.chmod(fd, mode)``." msgstr "" -#: ../../library/os.rst:779 ../../library/os.rst:1701 ../../library/os.rst:1792 +#: ../../library/os.rst:780 ../../library/os.rst:1702 ../../library/os.rst:1793 msgid "" "Raises an :ref:`auditing event ` ``os.chmod`` with arguments " "``path``, ``mode``, ``dir_fd``." @@ -847,7 +847,7 @@ msgid "" "`chown`. As of Python 3.3, this is equivalent to ``os.chown(fd, uid, gid)``." msgstr "" -#: ../../library/os.rst:791 ../../library/os.rst:1723 ../../library/os.rst:1805 +#: ../../library/os.rst:792 ../../library/os.rst:1724 ../../library/os.rst:1806 msgid "" "Raises an :ref:`auditing event ` ``os.chown`` with arguments " "``path``, ``uid``, ``gid``, ``dir_fd``." @@ -874,7 +874,7 @@ msgid "" "included in that mapping, passing an integer for *name* is also accepted." msgstr "" -#: ../../library/os.rst:817 ../../library/os.rst:2053 +#: ../../library/os.rst:817 ../../library/os.rst:2051 msgid "" "If *name* is a string and is not known, :exc:`ValueError` is raised. If a " "specific value for *name* is not supported by the host system, even if it is " @@ -896,7 +896,7 @@ msgstr "" msgid "As of Python 3.3, this is equivalent to ``os.stat(fd)``." msgstr "" -#: ../../library/os.rst:836 ../../library/os.rst:1889 +#: ../../library/os.rst:836 ../../library/os.rst:1887 msgid "The :func:`.stat` function." msgstr "" @@ -928,13 +928,13 @@ msgid "" "truncate(fd, length)``." msgstr "" -#: ../../library/os.rst:866 +#: ../../library/os.rst:867 msgid "" "Raises an :ref:`auditing event ` ``os.truncate`` with arguments " "``fd``, ``length``." msgstr "" -#: ../../library/os.rst:870 ../../library/os.rst:2921 +#: ../../library/os.rst:870 ../../library/os.rst:2916 msgid "Added support for Windows" msgstr "" @@ -962,7 +962,7 @@ msgid "" "specifies the section of the file to lock." msgstr "" -#: ../../library/os.rst:900 +#: ../../library/os.rst:901 msgid "" "Raises an :ref:`auditing event ` ``os.lockf`` with arguments " "``fd``, ``cmd``, ``len``." @@ -1016,7 +1016,7 @@ msgid "" "` with the *dir_fd* parameter." msgstr "" -#: ../../library/os.rst:955 +#: ../../library/os.rst:956 msgid "" "Raises an :ref:`auditing event ` ``open`` with arguments ``path``, " "``mode``, ``flags``." @@ -1030,14 +1030,14 @@ msgid "" "a file descriptor in a file object, use :func:`fdopen`." msgstr "" -#: ../../library/os.rst:967 ../../library/os.rst:1929 ../../library/os.rst:1997 -#: ../../library/os.rst:2019 ../../library/os.rst:2100 -#: ../../library/os.rst:2131 +#: ../../library/os.rst:967 ../../library/os.rst:1927 ../../library/os.rst:1995 +#: ../../library/os.rst:2017 ../../library/os.rst:2098 +#: ../../library/os.rst:2128 msgid "The *dir_fd* argument." msgstr "" #: ../../library/os.rst:970 ../../library/os.rst:1264 ../../library/os.rst:1390 -#: ../../library/os.rst:4138 +#: ../../library/os.rst:4130 msgid "" "If the system call is interrupted and the signal handler does not raise an " "exception, the function now retries the system call instead of raising an :" @@ -1048,16 +1048,16 @@ msgstr "" #: ../../library/os.rst:1661 ../../library/os.rst:1707 #: ../../library/os.rst:1741 ../../library/os.rst:1781 #: ../../library/os.rst:1796 ../../library/os.rst:1809 -#: ../../library/os.rst:1868 ../../library/os.rst:1897 -#: ../../library/os.rst:1932 ../../library/os.rst:1973 -#: ../../library/os.rst:2000 ../../library/os.rst:2022 -#: ../../library/os.rst:2063 ../../library/os.rst:2134 -#: ../../library/os.rst:2153 ../../library/os.rst:2239 -#: ../../library/os.rst:2512 ../../library/os.rst:2763 -#: ../../library/os.rst:2924 ../../library/os.rst:2940 -#: ../../library/os.rst:2980 ../../library/os.rst:3078 -#: ../../library/os.rst:3139 ../../library/os.rst:3226 -#: ../../library/os.rst:3405 ../../library/os.rst:3893 +#: ../../library/os.rst:1866 ../../library/os.rst:1930 +#: ../../library/os.rst:1971 ../../library/os.rst:1998 +#: ../../library/os.rst:2020 ../../library/os.rst:2061 +#: ../../library/os.rst:2131 ../../library/os.rst:2150 +#: ../../library/os.rst:2236 ../../library/os.rst:2507 +#: ../../library/os.rst:2758 ../../library/os.rst:2919 +#: ../../library/os.rst:2935 ../../library/os.rst:2975 +#: ../../library/os.rst:3070 ../../library/os.rst:3131 +#: ../../library/os.rst:3218 ../../library/os.rst:3397 +#: ../../library/os.rst:3885 msgid "Accepts a :term:`path-like object`." msgstr "" @@ -1108,7 +1108,7 @@ msgid "" msgstr "" #: ../../library/os.rst:1049 ../../library/os.rst:1075 -#: ../../library/os.rst:3590 +#: ../../library/os.rst:3582 msgid ":ref:`Availability `: some flavors of Unix." msgstr "" @@ -1338,7 +1338,7 @@ msgstr "" #: ../../library/os.rst:1283 msgid "" -"The second case may be used on macOS and FreeBSD where *headers* and " +"The second case may be used on Mac OS X and FreeBSD where *headers* and " "*trailers* are arbitrary sequences of buffers that are written before and " "after the data from *in_fd* is written. It returns the same as the first " "case." @@ -1346,8 +1346,8 @@ msgstr "" #: ../../library/os.rst:1287 msgid "" -"On macOS and FreeBSD, a value of ``0`` for *count* specifies to send until " -"the end of *in_fd* is reached." +"On Mac OS X and FreeBSD, a value of ``0`` for *count* specifies to send " +"until the end of *in_fd* is reached." msgstr "" #: ../../library/os.rst:1290 @@ -1524,8 +1524,8 @@ msgid "Get the \"inheritable\" flag of the specified handle (a boolean)." msgstr "" #: ../../library/os.rst:1484 ../../library/os.rst:1490 -#: ../../library/os.rst:3332 ../../library/os.rst:3928 -#: ../../library/os.rst:3959 +#: ../../library/os.rst:3324 ../../library/os.rst:3920 +#: ../../library/os.rst:3951 msgid ":ref:`Availability `: Windows." msgstr "" @@ -1676,7 +1676,7 @@ msgid "" "`FileNotFoundError`, :exc:`PermissionError`, and :exc:`NotADirectoryError`." msgstr "" -#: ../../library/os.rst:1624 ../../library/os.rst:1751 +#: ../../library/os.rst:1625 ../../library/os.rst:1752 msgid "" "Raises an :ref:`auditing event ` ``os.chdir`` with argument " "``path``." @@ -1747,7 +1747,7 @@ msgid "" "This function can support :ref:`not following symlinks `." msgstr "" -#: ../../library/os.rst:1654 ../../library/os.rst:1777 +#: ../../library/os.rst:1655 ../../library/os.rst:1778 msgid "" "Raises an :ref:`auditing event ` ``os.chflags`` with arguments " "``path``, ``flags``." @@ -1841,7 +1841,7 @@ msgid ":data:`stat.S_IXOTH`" msgstr "" #: ../../library/os.rst:1691 ../../library/os.rst:1716 -#: ../../library/os.rst:2970 +#: ../../library/os.rst:2965 msgid "" "This function can support :ref:`specifying a file descriptor `, :" "ref:`paths relative to directory descriptors ` and :ref:`not " @@ -1936,7 +1936,7 @@ msgid "" "`not following symlinks `." msgstr "" -#: ../../library/os.rst:1821 +#: ../../library/os.rst:1822 msgid "" "Raises an :ref:`auditing event ` ``os.link`` with arguments " "``src``, ``dst``, ``src_dir_fd``, ``dst_dir_fd``." @@ -1950,8 +1950,9 @@ msgstr "" msgid "Added the *src_dir_fd*, *dst_dir_fd*, and *follow_symlinks* arguments." msgstr "" -#: ../../library/os.rst:1831 ../../library/os.rst:2183 -#: ../../library/os.rst:2220 ../../library/os.rst:2892 +#: ../../library/os.rst:1831 ../../library/os.rst:1895 +#: ../../library/os.rst:2180 ../../library/os.rst:2217 +#: ../../library/os.rst:2887 msgid "Accepts a :term:`path-like object` for *src* and *dst*." msgstr "" @@ -1959,12 +1960,10 @@ msgstr "" msgid "" "Return a list containing the names of the entries in the directory given by " "*path*. The list is in arbitrary order, and does not include the special " -"entries ``'.'`` and ``'..'`` even if they are present in the directory. If a " -"file is removed from or added to the directory during the call of this " -"function, whether a name for that file be included is unspecified." +"entries ``'.'`` and ``'..'`` even if they are present in the directory." msgstr "" -#: ../../library/os.rst:1843 +#: ../../library/os.rst:1841 msgid "" "*path* may be a :term:`path-like object`. If *path* is of type ``bytes`` " "(directly or indirectly through the :class:`PathLike` interface), the " @@ -1972,73 +1971,73 @@ msgid "" "circumstances, they will be of type ``str``." msgstr "" -#: ../../library/os.rst:1848 ../../library/os.rst:2268 +#: ../../library/os.rst:1846 ../../library/os.rst:2263 msgid "" "This function can also support :ref:`specifying a file descriptor " "`; the file descriptor must refer to a directory." msgstr "" -#: ../../library/os.rst:1851 +#: ../../library/os.rst:1850 msgid "" "Raises an :ref:`auditing event ` ``os.listdir`` with argument " "``path``." msgstr "" -#: ../../library/os.rst:1854 +#: ../../library/os.rst:1852 msgid "To encode ``str`` filenames to ``bytes``, use :func:`~os.fsencode`." msgstr "" -#: ../../library/os.rst:1858 +#: ../../library/os.rst:1856 msgid "" "The :func:`scandir` function returns directory entries along with file " "attribute information, giving better performance for many common use cases." msgstr "" -#: ../../library/os.rst:1862 +#: ../../library/os.rst:1860 msgid "The *path* parameter became optional." msgstr "" -#: ../../library/os.rst:1865 ../../library/os.rst:2754 +#: ../../library/os.rst:1863 ../../library/os.rst:2749 msgid "Added support for specifying *path* as an open file descriptor." msgstr "" -#: ../../library/os.rst:1874 +#: ../../library/os.rst:1872 msgid "" "Perform the equivalent of an :c:func:`lstat` system call on the given path. " "Similar to :func:`~os.stat`, but does not follow symbolic links. Return a :" "class:`stat_result` object." msgstr "" -#: ../../library/os.rst:1878 +#: ../../library/os.rst:1876 msgid "" "On platforms that do not support symbolic links, this is an alias for :func:" "`~os.stat`." msgstr "" -#: ../../library/os.rst:1881 +#: ../../library/os.rst:1879 msgid "" "As of Python 3.3, this is equivalent to ``os.stat(path, dir_fd=dir_fd, " "follow_symlinks=False)``." msgstr "" -#: ../../library/os.rst:1884 ../../library/os.rst:1921 -#: ../../library/os.rst:1986 ../../library/os.rst:2014 -#: ../../library/os.rst:2088 +#: ../../library/os.rst:1882 ../../library/os.rst:1919 +#: ../../library/os.rst:1984 ../../library/os.rst:2012 +#: ../../library/os.rst:2086 msgid "" "This function can also support :ref:`paths relative to directory descriptors " "`." msgstr "" -#: ../../library/os.rst:1891 ../../library/os.rst:2097 -#: ../../library/os.rst:2885 +#: ../../library/os.rst:1889 ../../library/os.rst:2095 +#: ../../library/os.rst:2880 msgid "Added support for Windows 6.0 (Vista) symbolic links." msgstr "" -#: ../../library/os.rst:1894 +#: ../../library/os.rst:1892 msgid "Added the *dir_fd* parameter." msgstr "" -#: ../../library/os.rst:1900 +#: ../../library/os.rst:1898 msgid "" "On Windows, now opens reparse points that represent another path (name " "surrogates), including symbolic links and directory junctions. Other kinds " @@ -2046,15 +2045,15 @@ msgid "" "stat`." msgstr "" -#: ../../library/os.rst:1909 +#: ../../library/os.rst:1907 msgid "Create a directory named *path* with numeric mode *mode*." msgstr "" -#: ../../library/os.rst:1911 +#: ../../library/os.rst:1909 msgid "If the directory already exists, :exc:`FileExistsError` is raised." msgstr "" -#: ../../library/os.rst:1915 +#: ../../library/os.rst:1913 msgid "" "On some systems, *mode* is ignored. Where it is used, the current umask " "value is first masked out. If bits other than the last 9 (i.e. the last 3 " @@ -2063,25 +2062,25 @@ msgid "" "call :func:`chmod` explicitly to set them." msgstr "" -#: ../../library/os.rst:1924 +#: ../../library/os.rst:1922 msgid "" "It is also possible to create temporary directories; see the :mod:`tempfile` " "module's :func:`tempfile.mkdtemp` function." msgstr "" -#: ../../library/os.rst:1927 ../../library/os.rst:1961 +#: ../../library/os.rst:1926 ../../library/os.rst:1960 msgid "" "Raises an :ref:`auditing event ` ``os.mkdir`` with arguments " "``path``, ``mode``, ``dir_fd``." msgstr "" -#: ../../library/os.rst:1942 +#: ../../library/os.rst:1940 msgid "" "Recursive directory creation function. Like :func:`mkdir`, but makes all " "intermediate-level directories needed to contain the leaf directory." msgstr "" -#: ../../library/os.rst:1945 +#: ../../library/os.rst:1943 msgid "" "The *mode* parameter is passed to :func:`mkdir` for creating the leaf " "directory; see :ref:`the mkdir() description ` for how it is " @@ -2090,27 +2089,27 @@ msgid "" "file permission bits of existing parent directories are not changed." msgstr "" -#: ../../library/os.rst:1951 +#: ../../library/os.rst:1949 msgid "" "If *exist_ok* is ``False`` (the default), an :exc:`FileExistsError` is " "raised if the target directory already exists." msgstr "" -#: ../../library/os.rst:1956 +#: ../../library/os.rst:1954 msgid "" ":func:`makedirs` will become confused if the path elements to create " "include :data:`pardir` (eg. \"..\" on UNIX systems)." msgstr "" -#: ../../library/os.rst:1959 +#: ../../library/os.rst:1957 msgid "This function handles UNC paths correctly." msgstr "" -#: ../../library/os.rst:1963 +#: ../../library/os.rst:1961 msgid "The *exist_ok* parameter." msgstr "" -#: ../../library/os.rst:1968 +#: ../../library/os.rst:1966 msgid "" "Before Python 3.4.1, if *exist_ok* was ``True`` and the directory existed, :" "func:`makedirs` would still raise an error if *mode* did not match the mode " @@ -2118,19 +2117,19 @@ msgid "" "safely, it was removed in Python 3.4.1. See :issue:`21082`." msgstr "" -#: ../../library/os.rst:1976 +#: ../../library/os.rst:1974 msgid "" "The *mode* argument no longer affects the file permission bits of newly-" "created intermediate-level directories." msgstr "" -#: ../../library/os.rst:1983 +#: ../../library/os.rst:1981 msgid "" "Create a FIFO (a named pipe) named *path* with numeric mode *mode*. The " "current umask value is first masked out from the mode." msgstr "" -#: ../../library/os.rst:1989 +#: ../../library/os.rst:1987 msgid "" "FIFOs are pipes that can be accessed like regular files. FIFOs exist until " "they are deleted (for example with :func:`os.unlink`). Generally, FIFOs are " @@ -2140,7 +2139,7 @@ msgid "" "rendezvous point." msgstr "" -#: ../../library/os.rst:2006 +#: ../../library/os.rst:2004 msgid "" "Create a filesystem node (file, device special file or named pipe) named " "*path*. *mode* specifies both the permissions to use and the type of node to " @@ -2151,23 +2150,23 @@ msgid "" "`os.makedev`), otherwise it is ignored." msgstr "" -#: ../../library/os.rst:2028 +#: ../../library/os.rst:2026 msgid "" "Extract the device major number from a raw device number (usually the :attr:" "`st_dev` or :attr:`st_rdev` field from :c:type:`stat`)." msgstr "" -#: ../../library/os.rst:2034 +#: ../../library/os.rst:2032 msgid "" "Extract the device minor number from a raw device number (usually the :attr:" "`st_dev` or :attr:`st_rdev` field from :c:type:`stat`)." msgstr "" -#: ../../library/os.rst:2040 +#: ../../library/os.rst:2038 msgid "Compose a raw device number from the major and minor device numbers." msgstr "" -#: ../../library/os.rst:2045 +#: ../../library/os.rst:2043 msgid "" "Return system configuration information relevant to a named file. *name* " "specifies the configuration value to retrieve; it may be a string which is " @@ -2178,20 +2177,20 @@ msgid "" "included in that mapping, passing an integer for *name* is also accepted." msgstr "" -#: ../../library/os.rst:2058 ../../library/os.rst:2747 -#: ../../library/os.rst:2913 +#: ../../library/os.rst:2056 ../../library/os.rst:2742 +#: ../../library/os.rst:2908 msgid "" "This function can support :ref:`specifying a file descriptor `." msgstr "" -#: ../../library/os.rst:2069 +#: ../../library/os.rst:2067 msgid "" "Dictionary mapping names accepted by :func:`pathconf` and :func:`fpathconf` " "to the integer values defined for those names by the host operating system. " "This can be used to determine the set of names known to the system." msgstr "" -#: ../../library/os.rst:2078 +#: ../../library/os.rst:2076 msgid "" "Return a string representing the path to which the symbolic link points. " "The result may be either an absolute or relative pathname; if it is " @@ -2199,7 +2198,7 @@ msgid "" "join(os.path.dirname(path), result)``." msgstr "" -#: ../../library/os.rst:2083 +#: ../../library/os.rst:2081 msgid "" "If the *path* is a string object (directly or indirectly through a :class:" "`PathLike` interface), the result will also be a string object, and the call " @@ -2207,42 +2206,41 @@ msgid "" "indirectly), the result will be a bytes object." msgstr "" -#: ../../library/os.rst:2091 +#: ../../library/os.rst:2089 msgid "" "When trying to resolve a path that may contain links, use :func:`~os.path." "realpath` to properly handle recursion and platform differences." msgstr "" -#: ../../library/os.rst:2103 +#: ../../library/os.rst:2101 msgid "Accepts a :term:`path-like object` on Unix." msgstr "" -#: ../../library/os.rst:2106 +#: ../../library/os.rst:2104 msgid "Accepts a :term:`path-like object` and a bytes object on Windows." msgstr "" -#: ../../library/os.rst:2109 +#: ../../library/os.rst:2107 msgid "" "Added support for directory junctions, and changed to return the " "substitution path (which typically includes ``\\\\?\\`` prefix) rather than " "the optional \"print name\" field that was previously returned." msgstr "" -#: ../../library/os.rst:2116 +#: ../../library/os.rst:2114 msgid "" "Remove (delete) the file *path*. If *path* is a directory, an :exc:" -"`IsADirectoryError` is raised. Use :func:`rmdir` to remove directories. If " -"the file does not exist, a :exc:`FileNotFoundError` is raised." +"`IsADirectoryError` is raised. Use :func:`rmdir` to remove directories." msgstr "" -#: ../../library/os.rst:2120 ../../library/os.rst:2231 -#: ../../library/os.rst:2867 +#: ../../library/os.rst:2117 ../../library/os.rst:2228 +#: ../../library/os.rst:2862 msgid "" "This function can support :ref:`paths relative to directory descriptors " "`." msgstr "" -#: ../../library/os.rst:2123 +#: ../../library/os.rst:2120 msgid "" "On Windows, attempting to remove a file that is in use causes an exception " "to be raised; on Unix, the directory entry is removed but the storage " @@ -2250,18 +2248,18 @@ msgid "" "longer in use." msgstr "" -#: ../../library/os.rst:2127 +#: ../../library/os.rst:2124 msgid "This function is semantically identical to :func:`unlink`." msgstr "" -#: ../../library/os.rst:2129 ../../library/os.rst:2151 -#: ../../library/os.rst:2935 +#: ../../library/os.rst:2127 ../../library/os.rst:2149 +#: ../../library/os.rst:2931 msgid "" "Raises an :ref:`auditing event ` ``os.remove`` with arguments " "``path``, ``dir_fd``." msgstr "" -#: ../../library/os.rst:2142 +#: ../../library/os.rst:2139 msgid "" "Remove directories recursively. Works like :func:`rmdir` except that, if " "the leaf directory is successfully removed, :func:`removedirs` tries to " @@ -2273,17 +2271,17 @@ msgid "" "could not be successfully removed." msgstr "" -#: ../../library/os.rst:2159 +#: ../../library/os.rst:2156 msgid "" "Rename the file or directory *src* to *dst*. If *dst* exists, the operation " "will fail with an :exc:`OSError` subclass in a number of cases:" msgstr "" -#: ../../library/os.rst:2162 +#: ../../library/os.rst:2159 msgid "On Windows, if *dst* exists a :exc:`FileExistsError` is always raised." msgstr "" -#: ../../library/os.rst:2164 +#: ../../library/os.rst:2161 msgid "" "On Unix, if *src* is a file and *dst* is a directory or vice-versa, an :exc:" "`IsADirectoryError` or a :exc:`NotADirectoryError` will be raised " @@ -2295,30 +2293,30 @@ msgid "" "atomic operation (this is a POSIX requirement)." msgstr "" -#: ../../library/os.rst:2173 ../../library/os.rst:2213 +#: ../../library/os.rst:2170 ../../library/os.rst:2210 msgid "" "This function can support specifying *src_dir_fd* and/or *dst_dir_fd* to " "supply :ref:`paths relative to directory descriptors `." msgstr "" -#: ../../library/os.rst:2176 +#: ../../library/os.rst:2173 msgid "" "If you want cross-platform overwriting of the destination, use :func:" "`replace`." msgstr "" -#: ../../library/os.rst:2178 ../../library/os.rst:2199 -#: ../../library/os.rst:2216 +#: ../../library/os.rst:2176 ../../library/os.rst:2197 +#: ../../library/os.rst:2214 msgid "" "Raises an :ref:`auditing event ` ``os.rename`` with arguments " "``src``, ``dst``, ``src_dir_fd``, ``dst_dir_fd``." msgstr "" -#: ../../library/os.rst:2180 +#: ../../library/os.rst:2177 msgid "The *src_dir_fd* and *dst_dir_fd* arguments." msgstr "" -#: ../../library/os.rst:2189 +#: ../../library/os.rst:2186 msgid "" "Recursive directory or file renaming function. Works like :func:`rename`, " "except creation of any intermediate directories needed to make the new " @@ -2327,17 +2325,17 @@ msgid "" "using :func:`removedirs`." msgstr "" -#: ../../library/os.rst:2196 +#: ../../library/os.rst:2193 msgid "" "This function can fail with the new directory structure made if you lack " "permissions needed to remove the leaf directory or file." msgstr "" -#: ../../library/os.rst:2201 +#: ../../library/os.rst:2198 msgid "Accepts a :term:`path-like object` for *old* and *new*." msgstr "" -#: ../../library/os.rst:2207 +#: ../../library/os.rst:2204 msgid "" "Rename the file or directory *src* to *dst*. If *dst* is a directory, :exc:" "`OSError` will be raised. If *dst* exists and is a file, it will be " @@ -2346,7 +2344,7 @@ msgid "" "will be an atomic operation (this is a POSIX requirement)." msgstr "" -#: ../../library/os.rst:2226 +#: ../../library/os.rst:2223 msgid "" "Remove (delete) the directory *path*. If the directory does not exist or is " "not empty, an :exc:`FileNotFoundError` or an :exc:`OSError` is raised " @@ -2354,27 +2352,25 @@ msgid "" "rmtree` can be used." msgstr "" -#: ../../library/os.rst:2234 +#: ../../library/os.rst:2232 msgid "" "Raises an :ref:`auditing event ` ``os.rmdir`` with arguments " "``path``, ``dir_fd``." msgstr "" -#: ../../library/os.rst:2236 ../../library/os.rst:2937 +#: ../../library/os.rst:2233 ../../library/os.rst:2932 msgid "The *dir_fd* parameter." msgstr "" -#: ../../library/os.rst:2245 +#: ../../library/os.rst:2242 msgid "" "Return an iterator of :class:`os.DirEntry` objects corresponding to the " "entries in the directory given by *path*. The entries are yielded in " "arbitrary order, and the special entries ``'.'`` and ``'..'`` are not " -"included. If a file is removed from or added to the directory after " -"creating the iterator, whether an entry for that file be included is " -"unspecified." +"included." msgstr "" -#: ../../library/os.rst:2252 +#: ../../library/os.rst:2247 msgid "" "Using :func:`scandir` instead of :func:`listdir` can significantly increase " "the performance of code that also needs file type or file attribute " @@ -2386,7 +2382,7 @@ msgid "" "Unix but only requires one for symbolic links on Windows." msgstr "" -#: ../../library/os.rst:2262 +#: ../../library/os.rst:2257 msgid "" "*path* may be a :term:`path-like object`. If *path* is of type ``bytes`` " "(directly or indirectly through the :class:`PathLike` interface), the type " @@ -2395,30 +2391,30 @@ msgid "" "they will be of type ``str``." msgstr "" -#: ../../library/os.rst:2271 +#: ../../library/os.rst:2267 msgid "" "Raises an :ref:`auditing event ` ``os.scandir`` with argument " "``path``." msgstr "" -#: ../../library/os.rst:2273 +#: ../../library/os.rst:2268 msgid "" "The :func:`scandir` iterator supports the :term:`context manager` protocol " "and has the following method:" msgstr "" -#: ../../library/os.rst:2278 +#: ../../library/os.rst:2273 msgid "Close the iterator and free acquired resources." msgstr "" -#: ../../library/os.rst:2280 +#: ../../library/os.rst:2275 msgid "" "This is called automatically when the iterator is exhausted or garbage " "collected, or when an error happens during iterating. However it is " "advisable to call it explicitly or use the :keyword:`with` statement." msgstr "" -#: ../../library/os.rst:2287 +#: ../../library/os.rst:2282 msgid "" "The following example shows a simple use of :func:`scandir` to display all " "the files (excluding directories) in the given *path* that don't start with " @@ -2426,7 +2422,7 @@ msgid "" "system call::" msgstr "" -#: ../../library/os.rst:2299 +#: ../../library/os.rst:2294 msgid "" "On Unix-based systems, :func:`scandir` uses the system's `opendir() `_ and " @@ -2437,7 +2433,7 @@ msgid "" "desktop/aa364428(v=vs.85).aspx>`_ functions." msgstr "" -#: ../../library/os.rst:2311 +#: ../../library/os.rst:2306 msgid "" "Added support for the :term:`context manager` protocol and the :func:" "`~scandir.close()` method. If a :func:`scandir` iterator is neither " @@ -2445,28 +2441,28 @@ msgid "" "its destructor." msgstr "" -#: ../../library/os.rst:2317 +#: ../../library/os.rst:2312 msgid "The function accepts a :term:`path-like object`." msgstr "" -#: ../../library/os.rst:2319 +#: ../../library/os.rst:2314 msgid "Added support for :ref:`file descriptors ` on Unix." msgstr "" -#: ../../library/os.rst:2325 +#: ../../library/os.rst:2320 msgid "" "Object yielded by :func:`scandir` to expose the file path and other file " "attributes of a directory entry." msgstr "" -#: ../../library/os.rst:2328 +#: ../../library/os.rst:2323 msgid "" ":func:`scandir` will provide as much of this information as possible without " "making additional system calls. When a ``stat()`` or ``lstat()`` system call " "is made, the ``os.DirEntry`` object will cache the result." msgstr "" -#: ../../library/os.rst:2332 +#: ../../library/os.rst:2327 msgid "" "``os.DirEntry`` instances are not intended to be stored in long-lived data " "structures; if you know the file metadata has changed or if a long time has " @@ -2474,7 +2470,7 @@ msgid "" "up-to-date information." msgstr "" -#: ../../library/os.rst:2337 +#: ../../library/os.rst:2332 msgid "" "Because the ``os.DirEntry`` methods can make operating system calls, they " "may also raise :exc:`OSError`. If you need very fine-grained control over " @@ -2482,29 +2478,29 @@ msgid "" "methods and handle as appropriate." msgstr "" -#: ../../library/os.rst:2342 +#: ../../library/os.rst:2337 msgid "" "To be directly usable as a :term:`path-like object`, ``os.DirEntry`` " "implements the :class:`PathLike` interface." msgstr "" -#: ../../library/os.rst:2345 +#: ../../library/os.rst:2340 msgid "Attributes and methods on a ``os.DirEntry`` instance are as follows:" msgstr "" -#: ../../library/os.rst:2349 +#: ../../library/os.rst:2344 msgid "" "The entry's base filename, relative to the :func:`scandir` *path* argument." msgstr "" -#: ../../library/os.rst:2352 +#: ../../library/os.rst:2347 msgid "" "The :attr:`name` attribute will be ``bytes`` if the :func:`scandir` *path* " "argument is of type ``bytes`` and ``str`` otherwise. Use :func:`~os." "fsdecode` to decode byte filenames." msgstr "" -#: ../../library/os.rst:2358 +#: ../../library/os.rst:2353 msgid "" "The entry's full path name: equivalent to ``os.path.join(scandir_path, entry." "name)`` where *scandir_path* is the :func:`scandir` *path* argument. The " @@ -2514,51 +2510,51 @@ msgid "" "attribute." msgstr "" -#: ../../library/os.rst:2365 +#: ../../library/os.rst:2360 msgid "" "The :attr:`path` attribute will be ``bytes`` if the :func:`scandir` *path* " "argument is of type ``bytes`` and ``str`` otherwise. Use :func:`~os." "fsdecode` to decode byte filenames." msgstr "" -#: ../../library/os.rst:2371 +#: ../../library/os.rst:2366 msgid "Return the inode number of the entry." msgstr "" -#: ../../library/os.rst:2373 +#: ../../library/os.rst:2368 msgid "" "The result is cached on the ``os.DirEntry`` object. Use ``os.stat(entry." "path, follow_symlinks=False).st_ino`` to fetch up-to-date information." msgstr "" -#: ../../library/os.rst:2377 +#: ../../library/os.rst:2372 msgid "" "On the first, uncached call, a system call is required on Windows but not on " "Unix." msgstr "" -#: ../../library/os.rst:2382 +#: ../../library/os.rst:2377 msgid "" "Return ``True`` if this entry is a directory or a symbolic link pointing to " "a directory; return ``False`` if the entry is or points to any other kind of " "file, or if it doesn't exist anymore." msgstr "" -#: ../../library/os.rst:2386 +#: ../../library/os.rst:2381 msgid "" "If *follow_symlinks* is ``False``, return ``True`` only if this entry is a " "directory (without following symlinks); return ``False`` if the entry is any " "other kind of file or if it doesn't exist anymore." msgstr "" -#: ../../library/os.rst:2390 +#: ../../library/os.rst:2385 msgid "" "The result is cached on the ``os.DirEntry`` object, with a separate cache " "for *follow_symlinks* ``True`` and ``False``. Call :func:`os.stat` along " "with :func:`stat.S_ISDIR` to fetch up-to-date information." msgstr "" -#: ../../library/os.rst:2394 +#: ../../library/os.rst:2389 msgid "" "On the first, uncached call, no system call is required in most cases. " "Specifically, for non-symlinks, neither Windows or Unix require a system " @@ -2568,46 +2564,46 @@ msgid "" "is ``False``." msgstr "" -#: ../../library/os.rst:2401 ../../library/os.rst:2431 +#: ../../library/os.rst:2396 ../../library/os.rst:2426 msgid "" "This method can raise :exc:`OSError`, such as :exc:`PermissionError`, but :" "exc:`FileNotFoundError` is caught and not raised." msgstr "" -#: ../../library/os.rst:2406 +#: ../../library/os.rst:2401 msgid "" "Return ``True`` if this entry is a file or a symbolic link pointing to a " "file; return ``False`` if the entry is or points to a directory or other non-" "file entry, or if it doesn't exist anymore." msgstr "" -#: ../../library/os.rst:2410 +#: ../../library/os.rst:2405 msgid "" "If *follow_symlinks* is ``False``, return ``True`` only if this entry is a " "file (without following symlinks); return ``False`` if the entry is a " "directory or other non-file entry, or if it doesn't exist anymore." msgstr "" -#: ../../library/os.rst:2414 +#: ../../library/os.rst:2409 msgid "" "The result is cached on the ``os.DirEntry`` object. Caching, system calls " "made, and exceptions raised are as per :func:`~os.DirEntry.is_dir`." msgstr "" -#: ../../library/os.rst:2419 +#: ../../library/os.rst:2414 msgid "" "Return ``True`` if this entry is a symbolic link (even if broken); return " "``False`` if the entry points to a directory or any kind of file, or if it " "doesn't exist anymore." msgstr "" -#: ../../library/os.rst:2423 +#: ../../library/os.rst:2418 msgid "" "The result is cached on the ``os.DirEntry`` object. Call :func:`os.path." "islink` to fetch up-to-date information." msgstr "" -#: ../../library/os.rst:2426 +#: ../../library/os.rst:2421 msgid "" "On the first, uncached call, no system call is required in most cases. " "Specifically, neither Windows or Unix require a system call, except on " @@ -2615,35 +2611,35 @@ msgid "" "``dirent.d_type == DT_UNKNOWN``." msgstr "" -#: ../../library/os.rst:2436 +#: ../../library/os.rst:2431 msgid "" "Return a :class:`stat_result` object for this entry. This method follows " "symbolic links by default; to stat a symbolic link add the " "``follow_symlinks=False`` argument." msgstr "" -#: ../../library/os.rst:2440 +#: ../../library/os.rst:2435 msgid "" "On Unix, this method always requires a system call. On Windows, it only " "requires a system call if *follow_symlinks* is ``True`` and the entry is a " "reparse point (for example, a symbolic link or directory junction)." msgstr "" -#: ../../library/os.rst:2445 +#: ../../library/os.rst:2440 msgid "" "On Windows, the ``st_ino``, ``st_dev`` and ``st_nlink`` attributes of the :" "class:`stat_result` are always set to zero. Call :func:`os.stat` to get " "these attributes." msgstr "" -#: ../../library/os.rst:2449 +#: ../../library/os.rst:2444 msgid "" "The result is cached on the ``os.DirEntry`` object, with a separate cache " "for *follow_symlinks* ``True`` and ``False``. Call :func:`os.stat` to fetch " "up-to-date information." msgstr "" -#: ../../library/os.rst:2453 +#: ../../library/os.rst:2448 msgid "" "Note that there is a nice correspondence between several attributes and " "methods of ``os.DirEntry`` and of :class:`pathlib.Path`. In particular, the " @@ -2651,13 +2647,13 @@ msgid "" "``is_file()``, ``is_symlink()`` and ``stat()`` methods." msgstr "" -#: ../../library/os.rst:2461 +#: ../../library/os.rst:2456 msgid "" "Added support for the :class:`~os.PathLike` interface. Added support for :" "class:`bytes` paths on Windows." msgstr "" -#: ../../library/os.rst:2468 +#: ../../library/os.rst:2463 msgid "" "Get the status of a file or a file descriptor. Perform the equivalent of a :" "c:func:`stat` system call on the given path. *path* may be specified as " @@ -2666,21 +2662,21 @@ msgid "" "`stat_result` object." msgstr "" -#: ../../library/os.rst:2474 +#: ../../library/os.rst:2469 msgid "" "This function normally follows symlinks; to stat a symlink add the argument " "``follow_symlinks=False``, or use :func:`lstat`." msgstr "" -#: ../../library/os.rst:2477 ../../library/os.rst:3205 -#: ../../library/os.rst:3221 ../../library/os.rst:3237 -#: ../../library/os.rst:3257 +#: ../../library/os.rst:2472 ../../library/os.rst:3197 +#: ../../library/os.rst:3213 ../../library/os.rst:3229 +#: ../../library/os.rst:3249 msgid "" "This function can support :ref:`specifying a file descriptor ` and :" "ref:`not following symlinks `." msgstr "" -#: ../../library/os.rst:2480 +#: ../../library/os.rst:2475 msgid "" "On Windows, passing ``follow_symlinks=False`` will disable following all " "name-surrogate reparse points, which includes symlinks and directory " @@ -2694,21 +2690,21 @@ msgid "" "junction points, which will raise the usual exceptions." msgstr "" -#: ../../library/os.rst:2493 +#: ../../library/os.rst:2488 msgid "Example::" msgstr "" -#: ../../library/os.rst:2506 +#: ../../library/os.rst:2501 msgid ":func:`fstat` and :func:`lstat` functions." msgstr "" -#: ../../library/os.rst:2508 +#: ../../library/os.rst:2503 msgid "" "Added the *dir_fd* and *follow_symlinks* arguments, specifying a file " "descriptor instead of a path." msgstr "" -#: ../../library/os.rst:2515 +#: ../../library/os.rst:2510 msgid "" "On Windows, all reparse points that can be resolved by the operating system " "are now followed, and passing ``follow_symlinks=False`` disables following " @@ -2718,100 +2714,100 @@ msgid "" "of raising an error." msgstr "" -#: ../../library/os.rst:2526 +#: ../../library/os.rst:2521 msgid "" "Object whose attributes correspond roughly to the members of the :c:type:" "`stat` structure. It is used for the result of :func:`os.stat`, :func:`os." "fstat` and :func:`os.lstat`." msgstr "" -#: ../../library/os.rst:2530 +#: ../../library/os.rst:2525 msgid "Attributes:" msgstr "" -#: ../../library/os.rst:2534 +#: ../../library/os.rst:2529 msgid "File mode: file type and file mode bits (permissions)." msgstr "" -#: ../../library/os.rst:2538 +#: ../../library/os.rst:2533 msgid "" "Platform dependent, but if non-zero, uniquely identifies the file for a " "given value of ``st_dev``. Typically:" msgstr "" -#: ../../library/os.rst:2541 +#: ../../library/os.rst:2536 msgid "the inode number on Unix," msgstr "" -#: ../../library/os.rst:2542 +#: ../../library/os.rst:2537 msgid "" "the `file index `_ on " "Windows" msgstr "" -#: ../../library/os.rst:2548 +#: ../../library/os.rst:2543 msgid "Identifier of the device on which this file resides." msgstr "" -#: ../../library/os.rst:2552 +#: ../../library/os.rst:2547 msgid "Number of hard links." msgstr "" -#: ../../library/os.rst:2556 +#: ../../library/os.rst:2551 msgid "User identifier of the file owner." msgstr "" -#: ../../library/os.rst:2560 +#: ../../library/os.rst:2555 msgid "Group identifier of the file owner." msgstr "" -#: ../../library/os.rst:2564 +#: ../../library/os.rst:2559 msgid "" "Size of the file in bytes, if it is a regular file or a symbolic link. The " "size of a symbolic link is the length of the pathname it contains, without a " "terminating null byte." msgstr "" -#: ../../library/os.rst:2568 +#: ../../library/os.rst:2563 msgid "Timestamps:" msgstr "" -#: ../../library/os.rst:2572 +#: ../../library/os.rst:2567 msgid "Time of most recent access expressed in seconds." msgstr "" -#: ../../library/os.rst:2576 +#: ../../library/os.rst:2571 msgid "Time of most recent content modification expressed in seconds." msgstr "" -#: ../../library/os.rst:2580 ../../library/os.rst:2596 +#: ../../library/os.rst:2575 ../../library/os.rst:2591 msgid "Platform dependent:" msgstr "" -#: ../../library/os.rst:2582 ../../library/os.rst:2598 +#: ../../library/os.rst:2577 ../../library/os.rst:2593 msgid "the time of most recent metadata change on Unix," msgstr "" -#: ../../library/os.rst:2583 +#: ../../library/os.rst:2578 msgid "the time of creation on Windows, expressed in seconds." msgstr "" -#: ../../library/os.rst:2587 +#: ../../library/os.rst:2582 msgid "Time of most recent access expressed in nanoseconds as an integer." msgstr "" -#: ../../library/os.rst:2591 +#: ../../library/os.rst:2586 msgid "" "Time of most recent content modification expressed in nanoseconds as an " "integer." msgstr "" -#: ../../library/os.rst:2599 +#: ../../library/os.rst:2594 msgid "" "the time of creation on Windows, expressed in nanoseconds as an integer." msgstr "" -#: ../../library/os.rst:2604 +#: ../../library/os.rst:2599 msgid "" "The exact meaning and resolution of the :attr:`st_atime`, :attr:`st_mtime`, " "and :attr:`st_ctime` attributes depend on the operating system and the file " @@ -2820,7 +2816,7 @@ msgid "" "only 1-day resolution. See your operating system documentation for details." msgstr "" -#: ../../library/os.rst:2611 +#: ../../library/os.rst:2606 msgid "" "Similarly, although :attr:`st_atime_ns`, :attr:`st_mtime_ns`, and :attr:" "`st_ctime_ns` are always expressed in nanoseconds, many systems do not " @@ -2831,78 +2827,78 @@ msgid "" "attr:`st_atime_ns`, :attr:`st_mtime_ns`, and :attr:`st_ctime_ns`." msgstr "" -#: ../../library/os.rst:2620 +#: ../../library/os.rst:2615 msgid "" "On some Unix systems (such as Linux), the following attributes may also be " "available:" msgstr "" -#: ../../library/os.rst:2625 +#: ../../library/os.rst:2620 msgid "" "Number of 512-byte blocks allocated for file. This may be smaller than :attr:" "`st_size`/512 when the file has holes." msgstr "" -#: ../../library/os.rst:2630 +#: ../../library/os.rst:2625 msgid "" "\"Preferred\" blocksize for efficient file system I/O. Writing to a file in " "smaller chunks may cause an inefficient read-modify-rewrite." msgstr "" -#: ../../library/os.rst:2635 +#: ../../library/os.rst:2630 msgid "Type of device if an inode device." msgstr "" -#: ../../library/os.rst:2639 +#: ../../library/os.rst:2634 msgid "User defined flags for file." msgstr "" -#: ../../library/os.rst:2641 +#: ../../library/os.rst:2636 msgid "" "On other Unix systems (such as FreeBSD), the following attributes may be " "available (but may be only filled out if root tries to use them):" msgstr "" -#: ../../library/os.rst:2646 +#: ../../library/os.rst:2641 msgid "File generation number." msgstr "" -#: ../../library/os.rst:2650 +#: ../../library/os.rst:2645 msgid "Time of file creation." msgstr "" -#: ../../library/os.rst:2652 +#: ../../library/os.rst:2647 msgid "" "On Solaris and derivatives, the following attributes may also be available:" msgstr "" -#: ../../library/os.rst:2657 +#: ../../library/os.rst:2652 msgid "" "String that uniquely identifies the type of the filesystem that contains the " "file." msgstr "" -#: ../../library/os.rst:2660 +#: ../../library/os.rst:2655 msgid "On Mac OS systems, the following attributes may also be available:" msgstr "" -#: ../../library/os.rst:2664 +#: ../../library/os.rst:2659 msgid "Real size of the file." msgstr "" -#: ../../library/os.rst:2668 +#: ../../library/os.rst:2663 msgid "Creator of the file." msgstr "" -#: ../../library/os.rst:2672 +#: ../../library/os.rst:2667 msgid "File type." msgstr "" -#: ../../library/os.rst:2674 +#: ../../library/os.rst:2669 msgid "On Windows systems, the following attributes are also available:" msgstr "" -#: ../../library/os.rst:2678 +#: ../../library/os.rst:2673 msgid "" "Windows file attributes: ``dwFileAttributes`` member of the " "``BY_HANDLE_FILE_INFORMATION`` structure returned by :c:func:" @@ -2910,21 +2906,21 @@ msgid "" "mod:`stat` module." msgstr "" -#: ../../library/os.rst:2685 +#: ../../library/os.rst:2680 msgid "" "When :attr:`st_file_attributes` has the ``FILE_ATTRIBUTE_REPARSE_POINT`` " "set, this field contains the tag identifying the type of reparse point. See " "the ``IO_REPARSE_TAG_*`` constants in the :mod:`stat` module." msgstr "" -#: ../../library/os.rst:2689 +#: ../../library/os.rst:2684 msgid "" "The standard module :mod:`stat` defines functions and constants that are " "useful for extracting information from a :c:type:`stat` structure. (On " "Windows, some items are filled with dummy values.)" msgstr "" -#: ../../library/os.rst:2693 +#: ../../library/os.rst:2688 msgid "" "For backward compatibility, a :class:`stat_result` instance is also " "accessible as a tuple of at least 10 integers giving the most important (and " @@ -2936,35 +2932,35 @@ msgid "" "class:`stat_result` as a tuple always returns integers." msgstr "" -#: ../../library/os.rst:2702 +#: ../../library/os.rst:2697 msgid "" "Added the :attr:`st_atime_ns`, :attr:`st_mtime_ns`, and :attr:`st_ctime_ns` " "members." msgstr "" -#: ../../library/os.rst:2706 +#: ../../library/os.rst:2701 msgid "Added the :attr:`st_file_attributes` member on Windows." msgstr "" -#: ../../library/os.rst:2709 +#: ../../library/os.rst:2704 msgid "Windows now returns the file index as :attr:`st_ino` when available." msgstr "" -#: ../../library/os.rst:2713 +#: ../../library/os.rst:2708 msgid "Added the :attr:`st_fstype` member to Solaris/derivatives." msgstr "" -#: ../../library/os.rst:2716 +#: ../../library/os.rst:2711 msgid "Added the :attr:`st_reparse_tag` member on Windows." msgstr "" -#: ../../library/os.rst:2719 +#: ../../library/os.rst:2714 msgid "" "On Windows, the :attr:`st_mode` member now identifies special files as :" "const:`S_IFCHR`, :const:`S_IFIFO` or :const:`S_IFBLK` as appropriate." msgstr "" -#: ../../library/os.rst:2726 +#: ../../library/os.rst:2721 msgid "" "Perform a :c:func:`statvfs` system call on the given path. The return value " "is an object whose attributes describe the filesystem on the given path, and " @@ -2974,7 +2970,7 @@ msgid "" "`f_flag`, :attr:`f_namemax`, :attr:`f_fsid`." msgstr "" -#: ../../library/os.rst:2733 +#: ../../library/os.rst:2728 msgid "" "Two module-level constants are defined for the :attr:`f_flag` attribute's " "bit-flags: if :const:`ST_RDONLY` is set, the filesystem is mounted read-" @@ -2982,7 +2978,7 @@ msgid "" "are disabled or not supported." msgstr "" -#: ../../library/os.rst:2738 +#: ../../library/os.rst:2733 msgid "" "Additional module-level constants are defined for GNU/glibc based systems. " "These are :const:`ST_NODEV` (disallow access to device special files), :" @@ -2995,11 +2991,11 @@ msgid "" "relative to mtime/ctime)." msgstr "" -#: ../../library/os.rst:2751 +#: ../../library/os.rst:2746 msgid "The :const:`ST_RDONLY` and :const:`ST_NOSUID` constants were added." msgstr "" -#: ../../library/os.rst:2757 +#: ../../library/os.rst:2752 msgid "" "The :const:`ST_NODEV`, :const:`ST_NOEXEC`, :const:`ST_SYNCHRONOUS`, :const:" "`ST_MANDLOCK`, :const:`ST_WRITE`, :const:`ST_APPEND`, :const:" @@ -3007,11 +3003,11 @@ msgid "" "`ST_RELATIME` constants were added." msgstr "" -#: ../../library/os.rst:2766 +#: ../../library/os.rst:2761 msgid "Added :attr:`f_fsid`." msgstr "" -#: ../../library/os.rst:2772 +#: ../../library/os.rst:2767 msgid "" "A :class:`set` object indicating which functions in the :mod:`os` module " "accept an open file descriptor for their *dir_fd* parameter. Different " @@ -3023,7 +3019,7 @@ msgid "" "(Specifying ``None`` for *dir_fd* is always supported on all platforms.)" msgstr "" -#: ../../library/os.rst:2782 +#: ../../library/os.rst:2777 msgid "" "To check whether a particular function accepts an open file descriptor for " "its *dir_fd* parameter, use the ``in`` operator on ``supports_dir_fd``. As " @@ -3031,13 +3027,13 @@ msgid "" "open file descriptors for *dir_fd* on the local platform::" msgstr "" -#: ../../library/os.rst:2789 +#: ../../library/os.rst:2784 msgid "" "Currently *dir_fd* parameters only work on Unix platforms; none of them work " "on Windows." msgstr "" -#: ../../library/os.rst:2797 +#: ../../library/os.rst:2792 msgid "" "A :class:`set` object indicating whether :func:`os.access` permits " "specifying ``True`` for its *effective_ids* parameter on the local platform. " @@ -3046,19 +3042,19 @@ msgid "" "func:`os.access`; otherwise it will be empty." msgstr "" -#: ../../library/os.rst:2803 +#: ../../library/os.rst:2798 msgid "" "This expression evaluates to ``True`` if :func:`os.access` supports " "``effective_ids=True`` on the local platform::" msgstr "" -#: ../../library/os.rst:2808 +#: ../../library/os.rst:2803 msgid "" "Currently *effective_ids* is only supported on Unix platforms; it does not " "work on Windows." msgstr "" -#: ../../library/os.rst:2816 +#: ../../library/os.rst:2811 msgid "" "A :class:`set` object indicating which functions in the :mod:`os` module " "permit specifying their *path* parameter as an open file descriptor on the " @@ -3067,7 +3063,7 @@ msgid "" "*path* arguments is not available on all platforms Python supports." msgstr "" -#: ../../library/os.rst:2823 +#: ../../library/os.rst:2818 msgid "" "To determine whether a particular function permits specifying an open file " "descriptor for its *path* parameter, use the ``in`` operator on " @@ -3076,7 +3072,7 @@ msgid "" "platform::" msgstr "" -#: ../../library/os.rst:2836 +#: ../../library/os.rst:2831 msgid "" "A :class:`set` object indicating which functions in the :mod:`os` module " "accept ``False`` for their *follow_symlinks* parameter on the local " @@ -3089,7 +3085,7 @@ msgid "" "on all platforms.)" msgstr "" -#: ../../library/os.rst:2846 +#: ../../library/os.rst:2841 msgid "" "To check whether a particular function accepts ``False`` for its " "*follow_symlinks* parameter, use the ``in`` operator on " @@ -3098,11 +3094,11 @@ msgid "" "stat` on the local platform::" msgstr "" -#: ../../library/os.rst:2859 +#: ../../library/os.rst:2854 msgid "Create a symbolic link pointing to *src* named *dst*." msgstr "" -#: ../../library/os.rst:2861 +#: ../../library/os.rst:2856 msgid "" "On Windows, a symlink represents either a file or a directory, and does not " "morph to the target dynamically. If the target is present, the type of the " @@ -3112,7 +3108,7 @@ msgid "" "ignored." msgstr "" -#: ../../library/os.rst:2872 +#: ../../library/os.rst:2867 msgid "" "On newer versions of Windows 10, unprivileged accounts can create symlinks " "if Developer Mode is enabled. When Developer Mode is not available/enabled, " @@ -3120,83 +3116,83 @@ msgid "" "must be run as an administrator." msgstr "" -#: ../../library/os.rst:2878 +#: ../../library/os.rst:2873 msgid "" ":exc:`OSError` is raised when the function is called by an unprivileged user." msgstr "" -#: ../../library/os.rst:2881 +#: ../../library/os.rst:2877 msgid "" "Raises an :ref:`auditing event ` ``os.symlink`` with arguments " "``src``, ``dst``, ``dir_fd``." msgstr "" -#: ../../library/os.rst:2888 +#: ../../library/os.rst:2883 msgid "" "Added the *dir_fd* argument, and now allow *target_is_directory* on non-" "Windows platforms." msgstr "" -#: ../../library/os.rst:2895 +#: ../../library/os.rst:2890 msgid "Added support for unelevated symlinks on Windows with Developer Mode." msgstr "" -#: ../../library/os.rst:2901 +#: ../../library/os.rst:2896 msgid "Force write of everything to disk." msgstr "" -#: ../../library/os.rst:2910 +#: ../../library/os.rst:2905 msgid "" "Truncate the file corresponding to *path*, so that it is at most *length* " "bytes in size." msgstr "" -#: ../../library/os.rst:2915 +#: ../../library/os.rst:2911 msgid "" "Raises an :ref:`auditing event ` ``os.truncate`` with arguments " "``path``, ``length``." msgstr "" -#: ../../library/os.rst:2930 +#: ../../library/os.rst:2925 msgid "" "Remove (delete) the file *path*. This function is semantically identical " "to :func:`remove`; the ``unlink`` name is its traditional Unix name. Please " "see the documentation for :func:`remove` for further information." msgstr "" -#: ../../library/os.rst:2946 +#: ../../library/os.rst:2941 msgid "Set the access and modified times of the file specified by *path*." msgstr "" -#: ../../library/os.rst:2948 +#: ../../library/os.rst:2943 msgid "" ":func:`utime` takes two optional parameters, *times* and *ns*. These specify " "the times set on *path* and are used as follows:" msgstr "" -#: ../../library/os.rst:2951 +#: ../../library/os.rst:2946 msgid "" "If *ns* is specified, it must be a 2-tuple of the form ``(atime_ns, " "mtime_ns)`` where each member is an int expressing nanoseconds." msgstr "" -#: ../../library/os.rst:2954 +#: ../../library/os.rst:2949 msgid "" "If *times* is not ``None``, it must be a 2-tuple of the form ``(atime, " "mtime)`` where each member is an int or float expressing seconds." msgstr "" -#: ../../library/os.rst:2957 +#: ../../library/os.rst:2952 msgid "" "If *times* is ``None`` and *ns* is unspecified, this is equivalent to " "specifying ``ns=(atime_ns, mtime_ns)`` where both times are the current time." msgstr "" -#: ../../library/os.rst:2961 +#: ../../library/os.rst:2956 msgid "It is an error to specify tuples for both *times* and *ns*." msgstr "" -#: ../../library/os.rst:2963 +#: ../../library/os.rst:2958 msgid "" "Note that the exact times you set here may not be returned by a subsequent :" "func:`~os.stat` call, depending on the resolution with which your operating " @@ -3206,19 +3202,19 @@ msgid "" "`utime`." msgstr "" -#: ../../library/os.rst:2974 +#: ../../library/os.rst:2970 msgid "" "Raises an :ref:`auditing event ` ``os.utime`` with arguments " "``path``, ``times``, ``ns``, ``dir_fd``." msgstr "" -#: ../../library/os.rst:2976 +#: ../../library/os.rst:2971 msgid "" "Added support for specifying *path* as an open file descriptor, and the " "*dir_fd*, *follow_symlinks*, and *ns* parameters." msgstr "" -#: ../../library/os.rst:2990 +#: ../../library/os.rst:2985 msgid "" "Generate the file names in a directory tree by walking the tree either top-" "down or bottom-up. For each directory in the tree rooted at directory *top* " @@ -3226,20 +3222,17 @@ msgid "" "filenames)``." msgstr "" -#: ../../library/os.rst:2995 +#: ../../library/os.rst:2990 msgid "" "*dirpath* is a string, the path to the directory. *dirnames* is a list of " "the names of the subdirectories in *dirpath* (excluding ``'.'`` and " "``'..'``). *filenames* is a list of the names of the non-directory files in " "*dirpath*. Note that the names in the lists contain no path components. To " "get a full path (which begins with *top*) to a file or directory in " -"*dirpath*, do ``os.path.join(dirpath, name)``. Whether or not the lists are " -"sorted depends on the file system. If a file is removed from or added to " -"the *dirpath* directory during generating the lists, whether a name for that " -"file be included is unspecified." +"*dirpath*, do ``os.path.join(dirpath, name)``." msgstr "" -#: ../../library/os.rst:3005 +#: ../../library/os.rst:2997 msgid "" "If optional argument *topdown* is ``True`` or not specified, the triple for " "a directory is generated before the triples for any of its subdirectories " @@ -3250,7 +3243,7 @@ msgid "" "its subdirectories are generated." msgstr "" -#: ../../library/os.rst:3013 +#: ../../library/os.rst:3005 msgid "" "When *topdown* is ``True``, the caller can modify the *dirnames* list in-" "place (perhaps using :keyword:`del` or slice assignment), and :func:`walk` " @@ -3263,7 +3256,7 @@ msgid "" "itself is generated." msgstr "" -#: ../../library/os.rst:3022 +#: ../../library/os.rst:3014 msgid "" "By default, errors from the :func:`scandir` call are ignored. If optional " "argument *onerror* is specified, it should be a function; it will be called " @@ -3273,66 +3266,66 @@ msgid "" "object." msgstr "" -#: ../../library/os.rst:3028 +#: ../../library/os.rst:3020 msgid "" "By default, :func:`walk` will not walk down into symbolic links that resolve " "to directories. Set *followlinks* to ``True`` to visit directories pointed " "to by symlinks, on systems that support them." msgstr "" -#: ../../library/os.rst:3034 +#: ../../library/os.rst:3026 msgid "" "Be aware that setting *followlinks* to ``True`` can lead to infinite " "recursion if a link points to a parent directory of itself. :func:`walk` " "does not keep track of the directories it visited already." msgstr "" -#: ../../library/os.rst:3040 +#: ../../library/os.rst:3032 msgid "" "If you pass a relative pathname, don't change the current working directory " "between resumptions of :func:`walk`. :func:`walk` never changes the current " "directory, and assumes that its caller doesn't either." msgstr "" -#: ../../library/os.rst:3044 ../../library/os.rst:3105 +#: ../../library/os.rst:3036 ../../library/os.rst:3097 msgid "" "This example displays the number of bytes taken by non-directory files in " "each directory under the starting directory, except that it doesn't look " "under any CVS subdirectory::" msgstr "" -#: ../../library/os.rst:3057 +#: ../../library/os.rst:3049 msgid "" "In the next example (simple implementation of :func:`shutil.rmtree`), " "walking the tree bottom-up is essential, :func:`rmdir` doesn't allow " "deleting a directory before the directory is empty::" msgstr "" -#: ../../library/os.rst:3072 +#: ../../library/os.rst:3065 msgid "" "Raises an :ref:`auditing event ` ``os.walk`` with arguments " "``top``, ``topdown``, ``onerror``, ``followlinks``." msgstr "" -#: ../../library/os.rst:3074 +#: ../../library/os.rst:3066 msgid "" "This function now calls :func:`os.scandir` instead of :func:`os.listdir`, " "making it faster by reducing the number of calls to :func:`os.stat`." msgstr "" -#: ../../library/os.rst:3088 +#: ../../library/os.rst:3080 msgid "" "This behaves exactly like :func:`walk`, except that it yields a 4-tuple " "``(dirpath, dirnames, filenames, dirfd)``, and it supports ``dir_fd``." msgstr "" -#: ../../library/os.rst:3091 +#: ../../library/os.rst:3083 msgid "" "*dirpath*, *dirnames* and *filenames* are identical to :func:`walk` output, " "and *dirfd* is a file descriptor referring to the directory *dirpath*." msgstr "" -#: ../../library/os.rst:3094 +#: ../../library/os.rst:3086 msgid "" "This function always supports :ref:`paths relative to directory descriptors " "` and :ref:`not following symlinks `. Note however " @@ -3340,30 +3333,30 @@ msgid "" "*follow_symlinks* is ``False``." msgstr "" -#: ../../library/os.rst:3101 +#: ../../library/os.rst:3093 msgid "" "Since :func:`fwalk` yields file descriptors, those are only valid until the " "next iteration step, so you should duplicate them (e.g. with :func:`dup`) if " "you want to keep them longer." msgstr "" -#: ../../library/os.rst:3118 +#: ../../library/os.rst:3110 msgid "" "In the next example, walking the tree bottom-up is essential: :func:`rmdir` " "doesn't allow deleting a directory before the directory is empty::" msgstr "" -#: ../../library/os.rst:3133 +#: ../../library/os.rst:3126 msgid "" "Raises an :ref:`auditing event ` ``os.fwalk`` with arguments " "``top``, ``topdown``, ``onerror``, ``follow_symlinks``, ``dir_fd``." msgstr "" -#: ../../library/os.rst:3142 +#: ../../library/os.rst:3134 msgid "Added support for :class:`bytes` paths." msgstr "" -#: ../../library/os.rst:3148 +#: ../../library/os.rst:3140 msgid "" "Create an anonymous file and return a file descriptor that refers to it. " "*flags* must be one of the ``os.MFD_*`` constants available on the system " @@ -3371,7 +3364,7 @@ msgid "" "descriptor is :ref:`non-inheritable `." msgstr "" -#: ../../library/os.rst:3153 +#: ../../library/os.rst:3145 msgid "" "The name supplied in *name* is used as a filename and will be displayed as " "the target of the corresponding symbolic link in the directory ``/proc/self/" @@ -3381,31 +3374,31 @@ msgid "" "side effects." msgstr "" -#: ../../library/os.rst:3161 +#: ../../library/os.rst:3153 msgid "" ":ref:`Availability `: Linux 3.17 or newer with glibc 2.27 or " "newer." msgstr "" -#: ../../library/os.rst:3183 +#: ../../library/os.rst:3175 msgid "These flags can be passed to :func:`memfd_create`." msgstr "" -#: ../../library/os.rst:3187 +#: ../../library/os.rst:3179 msgid "" ":ref:`Availability `: Linux 3.17 or newer with glibc 2.27 or " "newer. The ``MFD_HUGE*`` flags are only available since Linux 4.14." msgstr "" -#: ../../library/os.rst:3192 +#: ../../library/os.rst:3184 msgid "Linux extended attributes" msgstr "" -#: ../../library/os.rst:3196 +#: ../../library/os.rst:3188 msgid "These functions are all available on Linux only." msgstr "" -#: ../../library/os.rst:3200 +#: ../../library/os.rst:3192 msgid "" "Return the value of the extended filesystem attribute *attribute* for " "*path*. *attribute* can be bytes or str (directly or indirectly through the :" @@ -3413,18 +3406,18 @@ msgid "" "encoding." msgstr "" -#: ../../library/os.rst:3208 +#: ../../library/os.rst:3201 msgid "" "Raises an :ref:`auditing event ` ``os.getxattr`` with arguments " "``path``, ``attribute``." msgstr "" -#: ../../library/os.rst:3210 ../../library/os.rst:3242 -#: ../../library/os.rst:3267 +#: ../../library/os.rst:3202 ../../library/os.rst:3234 +#: ../../library/os.rst:3259 msgid "Accepts a :term:`path-like object` for *path* and *attribute*." msgstr "" -#: ../../library/os.rst:3216 +#: ../../library/os.rst:3208 msgid "" "Return a list of the extended filesystem attributes on *path*. The " "attributes in the list are represented as strings decoded with the " @@ -3432,13 +3425,13 @@ msgid "" "the current directory." msgstr "" -#: ../../library/os.rst:3224 +#: ../../library/os.rst:3217 msgid "" "Raises an :ref:`auditing event ` ``os.listxattr`` with argument " "``path``." msgstr "" -#: ../../library/os.rst:3232 +#: ../../library/os.rst:3224 msgid "" "Removes the extended filesystem attribute *attribute* from *path*. " "*attribute* should be bytes or str (directly or indirectly through the :" @@ -3446,63 +3439,63 @@ msgid "" "filesystem encoding." msgstr "" -#: ../../library/os.rst:3240 +#: ../../library/os.rst:3233 msgid "" "Raises an :ref:`auditing event ` ``os.removexattr`` with arguments " "``path``, ``attribute``." msgstr "" -#: ../../library/os.rst:3248 +#: ../../library/os.rst:3240 msgid "" "Set the extended filesystem attribute *attribute* on *path* to *value*. " "*attribute* must be a bytes or str with no embedded NULs (directly or " "indirectly through the :class:`PathLike` interface). If it is a str, it is " "encoded with the filesystem encoding. *flags* may be :data:`XATTR_REPLACE` " "or :data:`XATTR_CREATE`. If :data:`XATTR_REPLACE` is given and the attribute " -"does not exist, ``ENODATA`` will be raised. If :data:`XATTR_CREATE` is given " +"does not exist, ``EEXISTS`` will be raised. If :data:`XATTR_CREATE` is given " "and the attribute already exists, the attribute will not be created and " -"``EEXISTS`` will be raised." +"``ENODATA`` will be raised." msgstr "" -#: ../../library/os.rst:3262 +#: ../../library/os.rst:3254 msgid "" "A bug in Linux kernel versions less than 2.6.39 caused the flags argument to " "be ignored on some filesystems." msgstr "" -#: ../../library/os.rst:3265 +#: ../../library/os.rst:3258 msgid "" "Raises an :ref:`auditing event ` ``os.setxattr`` with arguments " "``path``, ``attribute``, ``value``, ``flags``." msgstr "" -#: ../../library/os.rst:3273 +#: ../../library/os.rst:3265 msgid "" "The maximum size the value of an extended attribute can be. Currently, this " "is 64 KiB on Linux." msgstr "" -#: ../../library/os.rst:3279 +#: ../../library/os.rst:3271 msgid "" "This is a possible value for the flags argument in :func:`setxattr`. It " "indicates the operation must create an attribute." msgstr "" -#: ../../library/os.rst:3285 +#: ../../library/os.rst:3277 msgid "" "This is a possible value for the flags argument in :func:`setxattr`. It " "indicates the operation must replace an existing attribute." msgstr "" -#: ../../library/os.rst:3292 +#: ../../library/os.rst:3284 msgid "Process Management" msgstr "" -#: ../../library/os.rst:3294 +#: ../../library/os.rst:3286 msgid "These functions may be used to create and manage processes." msgstr "" -#: ../../library/os.rst:3296 +#: ../../library/os.rst:3288 msgid "" "The various :func:`exec\\* ` functions take a list of arguments for " "the new program loaded into the process. In each case, the first of these " @@ -3513,7 +3506,7 @@ msgid "" "standard output; ``foo`` will seem to be ignored." msgstr "" -#: ../../library/os.rst:3307 +#: ../../library/os.rst:3299 msgid "" "Generate a :const:`SIGABRT` signal to the current process. On Unix, the " "default behavior is to produce a core dump; on Windows, the process " @@ -3522,37 +3515,37 @@ msgid "" "`SIGABRT` with :func:`signal.signal`." msgstr "" -#: ../../library/os.rst:3316 +#: ../../library/os.rst:3308 msgid "Add a path to the DLL search path." msgstr "" -#: ../../library/os.rst:3318 +#: ../../library/os.rst:3310 msgid "" "This search path is used when resolving dependencies for imported extension " "modules (the module itself is resolved through sys.path), and also by :mod:" "`ctypes`." msgstr "" -#: ../../library/os.rst:3322 +#: ../../library/os.rst:3314 msgid "" "Remove the directory by calling **close()** on the returned object or using " "it in a :keyword:`with` statement." msgstr "" -#: ../../library/os.rst:3325 +#: ../../library/os.rst:3317 msgid "" "See the `Microsoft documentation `_ for more information about how " "DLLs are loaded." msgstr "" -#: ../../library/os.rst:3329 +#: ../../library/os.rst:3322 msgid "" "Raises an :ref:`auditing event ` ``os.add_dll_directory`` with " "argument ``path``." msgstr "" -#: ../../library/os.rst:3333 +#: ../../library/os.rst:3325 msgid "" "Previous versions of CPython would resolve DLLs using the default behavior " "for the current process. This led to inconsistencies, such as only sometimes " @@ -3560,14 +3553,14 @@ msgid "" "such as ``AddDllDirectory`` having no effect." msgstr "" -#: ../../library/os.rst:3340 +#: ../../library/os.rst:3332 msgid "" "In 3.8, the two primary ways DLLs are loaded now explicitly override the " "process-wide behavior to ensure consistency. See the :ref:`porting notes " "` for information on updating libraries." msgstr "" -#: ../../library/os.rst:3355 +#: ../../library/os.rst:3347 msgid "" "These functions all execute a new program, replacing the current process; " "they do not return. On Unix, the new executable is loaded into the current " @@ -3575,7 +3568,7 @@ msgid "" "reported as :exc:`OSError` exceptions." msgstr "" -#: ../../library/os.rst:3360 +#: ../../library/os.rst:3352 msgid "" "The current process is replaced immediately. Open file objects and " "descriptors are not flushed, so if there may be data buffered on these open " @@ -3583,7 +3576,7 @@ msgid "" "fsync` before calling an :func:`exec\\* ` function." msgstr "" -#: ../../library/os.rst:3366 +#: ../../library/os.rst:3358 msgid "" "The \"l\" and \"v\" variants of the :func:`exec\\* ` functions differ " "in how command-line arguments are passed. The \"l\" variants are perhaps " @@ -3596,7 +3589,7 @@ msgid "" "enforced." msgstr "" -#: ../../library/os.rst:3375 +#: ../../library/os.rst:3367 msgid "" "The variants which include a \"p\" near the end (:func:`execlp`, :func:" "`execlpe`, :func:`execvp`, and :func:`execvpe`) will use the :envvar:`PATH` " @@ -3609,7 +3602,7 @@ msgid "" "absolute or relative path." msgstr "" -#: ../../library/os.rst:3385 +#: ../../library/os.rst:3377 msgid "" "For :func:`execle`, :func:`execlpe`, :func:`execve`, and :func:`execvpe` " "(note that these all end in \"e\"), the *env* parameter must be a mapping " @@ -3619,7 +3612,7 @@ msgid "" "process to inherit the environment of the current process." msgstr "" -#: ../../library/os.rst:3392 +#: ../../library/os.rst:3384 msgid "" "For :func:`execve` on some platforms, *path* may also be specified as an " "open file descriptor. This functionality may not be supported on your " @@ -3628,31 +3621,31 @@ msgid "" "`NotImplementedError`." msgstr "" -#: ../../library/os.rst:3397 +#: ../../library/os.rst:3390 msgid "" "Raises an :ref:`auditing event ` ``os.exec`` with arguments " "``path``, ``args``, ``env``." msgstr "" -#: ../../library/os.rst:3401 +#: ../../library/os.rst:3393 msgid "" "Added support for specifying *path* as an open file descriptor for :func:" "`execve`." msgstr "" -#: ../../library/os.rst:3410 +#: ../../library/os.rst:3402 msgid "" "Exit the process with status *n*, without calling cleanup handlers, flushing " "stdio buffers, etc." msgstr "" -#: ../../library/os.rst:3415 +#: ../../library/os.rst:3407 msgid "" "The standard way to exit is ``sys.exit(n)``. :func:`_exit` should normally " "only be used in the child process after a :func:`fork`." msgstr "" -#: ../../library/os.rst:3418 +#: ../../library/os.rst:3410 msgid "" "The following exit codes are defined and can be used with :func:`_exit`, " "although they are not required. These are typically used for system " @@ -3660,123 +3653,123 @@ msgid "" "delivery program." msgstr "" -#: ../../library/os.rst:3424 +#: ../../library/os.rst:3416 msgid "" "Some of these may not be available on all Unix platforms, since there is " "some variation. These constants are defined where they are defined by the " "underlying platform." msgstr "" -#: ../../library/os.rst:3431 +#: ../../library/os.rst:3423 msgid "Exit code that means no error occurred." msgstr "" -#: ../../library/os.rst:3438 +#: ../../library/os.rst:3430 msgid "" "Exit code that means the command was used incorrectly, such as when the " "wrong number of arguments are given." msgstr "" -#: ../../library/os.rst:3446 +#: ../../library/os.rst:3438 msgid "Exit code that means the input data was incorrect." msgstr "" -#: ../../library/os.rst:3453 +#: ../../library/os.rst:3445 msgid "Exit code that means an input file did not exist or was not readable." msgstr "" -#: ../../library/os.rst:3460 +#: ../../library/os.rst:3452 msgid "Exit code that means a specified user did not exist." msgstr "" -#: ../../library/os.rst:3467 +#: ../../library/os.rst:3459 msgid "Exit code that means a specified host did not exist." msgstr "" -#: ../../library/os.rst:3474 +#: ../../library/os.rst:3466 msgid "Exit code that means that a required service is unavailable." msgstr "" -#: ../../library/os.rst:3481 +#: ../../library/os.rst:3473 msgid "Exit code that means an internal software error was detected." msgstr "" -#: ../../library/os.rst:3488 +#: ../../library/os.rst:3480 msgid "" "Exit code that means an operating system error was detected, such as the " "inability to fork or create a pipe." msgstr "" -#: ../../library/os.rst:3496 +#: ../../library/os.rst:3488 msgid "" "Exit code that means some system file did not exist, could not be opened, or " "had some other kind of error." msgstr "" -#: ../../library/os.rst:3504 +#: ../../library/os.rst:3496 msgid "Exit code that means a user specified output file could not be created." msgstr "" -#: ../../library/os.rst:3511 +#: ../../library/os.rst:3503 msgid "" "Exit code that means that an error occurred while doing I/O on some file." msgstr "" -#: ../../library/os.rst:3518 +#: ../../library/os.rst:3510 msgid "" "Exit code that means a temporary failure occurred. This indicates something " "that may not really be an error, such as a network connection that couldn't " "be made during a retryable operation." msgstr "" -#: ../../library/os.rst:3527 +#: ../../library/os.rst:3519 msgid "" "Exit code that means that a protocol exchange was illegal, invalid, or not " "understood." msgstr "" -#: ../../library/os.rst:3535 +#: ../../library/os.rst:3527 msgid "" "Exit code that means that there were insufficient permissions to perform the " "operation (but not intended for file system problems)." msgstr "" -#: ../../library/os.rst:3543 +#: ../../library/os.rst:3535 msgid "Exit code that means that some kind of configuration error occurred." msgstr "" -#: ../../library/os.rst:3550 +#: ../../library/os.rst:3542 msgid "Exit code that means something like \"an entry was not found\"." msgstr "" -#: ../../library/os.rst:3557 +#: ../../library/os.rst:3549 msgid "" "Fork a child process. Return ``0`` in the child and the child's process id " "in the parent. If an error occurs :exc:`OSError` is raised." msgstr "" -#: ../../library/os.rst:3560 +#: ../../library/os.rst:3552 msgid "" "Note that some platforms including FreeBSD <= 6.3 and Cygwin have known " "issues when using ``fork()`` from a thread." msgstr "" -#: ../../library/os.rst:3563 +#: ../../library/os.rst:3556 msgid "" "Raises an :ref:`auditing event ` ``os.fork`` with no arguments." msgstr "" -#: ../../library/os.rst:3565 +#: ../../library/os.rst:3557 msgid "" "Calling ``fork()`` in a subinterpreter is no longer supported (:exc:" "`RuntimeError` is raised)." msgstr "" -#: ../../library/os.rst:3571 +#: ../../library/os.rst:3563 msgid "See :mod:`ssl` for applications that use the SSL module with fork()." msgstr "" -#: ../../library/os.rst:3578 +#: ../../library/os.rst:3570 msgid "" "Fork a child process, using a new pseudo-terminal as the child's controlling " "terminal. Return a pair of ``(pid, fd)``, where *pid* is ``0`` in the child, " @@ -3785,24 +3778,24 @@ msgid "" "the :mod:`pty` module. If an error occurs :exc:`OSError` is raised." msgstr "" -#: ../../library/os.rst:3584 +#: ../../library/os.rst:3577 msgid "" "Raises an :ref:`auditing event ` ``os.forkpty`` with no arguments." msgstr "" -#: ../../library/os.rst:3586 +#: ../../library/os.rst:3578 msgid "" "Calling ``forkpty()`` in a subinterpreter is no longer supported (:exc:" "`RuntimeError` is raised)." msgstr "" -#: ../../library/os.rst:3599 +#: ../../library/os.rst:3591 msgid "" "Send signal *sig* to the process *pid*. Constants for the specific signals " "available on the host platform are defined in the :mod:`signal` module." msgstr "" -#: ../../library/os.rst:3602 +#: ../../library/os.rst:3594 msgid "" "Windows: The :data:`signal.CTRL_C_EVENT` and :data:`signal.CTRL_BREAK_EVENT` " "signals are special signals which can only be sent to console processes " @@ -3812,36 +3805,36 @@ msgid "" "version of :func:`kill` additionally takes process handles to be killed." msgstr "" -#: ../../library/os.rst:3610 +#: ../../library/os.rst:3602 msgid "See also :func:`signal.pthread_kill`." msgstr "" -#: ../../library/os.rst:3612 +#: ../../library/os.rst:3605 msgid "" "Raises an :ref:`auditing event ` ``os.kill`` with arguments " "``pid``, ``sig``." msgstr "" -#: ../../library/os.rst:3614 +#: ../../library/os.rst:3606 msgid "Windows support." msgstr "" -#: ../../library/os.rst:3624 +#: ../../library/os.rst:3616 msgid "Send the signal *sig* to the process group *pgid*." msgstr "" -#: ../../library/os.rst:3626 +#: ../../library/os.rst:3619 msgid "" "Raises an :ref:`auditing event ` ``os.killpg`` with arguments " "``pgid``, ``sig``." msgstr "" -#: ../../library/os.rst:3633 +#: ../../library/os.rst:3625 msgid "" "Add *increment* to the process's \"niceness\". Return the new niceness." msgstr "" -#: ../../library/os.rst:3640 +#: ../../library/os.rst:3632 msgid "" "Return a file descriptor referring to the process *pid*. This descriptor " "can be used to perform process management without races and signals. The " @@ -3849,21 +3842,21 @@ msgid "" "currently defined." msgstr "" -#: ../../library/os.rst:3645 +#: ../../library/os.rst:3637 msgid "See the :manpage:`pidfd_open(2)` man page for more details." msgstr "" -#: ../../library/os.rst:3647 +#: ../../library/os.rst:3639 msgid ":ref:`Availability `: Linux 5.3+" msgstr "" -#: ../../library/os.rst:3653 +#: ../../library/os.rst:3645 msgid "" "Lock program segments into memory. The value of *op* (defined in ````) determines which segments are locked." msgstr "" -#: ../../library/os.rst:3661 +#: ../../library/os.rst:3653 msgid "" "Open a pipe to or from command *cmd*. The return value is an open file " "object connected to the pipe, which can be read or written depending on " @@ -3873,7 +3866,7 @@ msgid "" "bytes." msgstr "" -#: ../../library/os.rst:3668 +#: ../../library/os.rst:3660 msgid "" "The ``close`` method returns :const:`None` if the subprocess exited " "successfully, or the subprocess's return code if there was an error. On " @@ -3885,43 +3878,43 @@ msgid "" "contains the signed integer return code from the child process." msgstr "" -#: ../../library/os.rst:3678 +#: ../../library/os.rst:3670 msgid "" "On Unix, :func:`waitstatus_to_exitcode` can be used to convert the ``close`` " "method result (exit status) into an exit code if it is not ``None``. On " "Windows, the ``close`` method result is directly the exit code (or ``None``)." msgstr "" -#: ../../library/os.rst:3683 +#: ../../library/os.rst:3675 msgid "" "This is implemented using :class:`subprocess.Popen`; see that class's " "documentation for more powerful ways to manage and communicate with " "subprocesses." msgstr "" -#: ../../library/os.rst:3692 +#: ../../library/os.rst:3684 msgid "Wraps the :c:func:`posix_spawn` C library API for use from Python." msgstr "" -#: ../../library/os.rst:3694 +#: ../../library/os.rst:3686 msgid "" "Most users should use :func:`subprocess.run` instead of :func:`posix_spawn`." msgstr "" -#: ../../library/os.rst:3696 +#: ../../library/os.rst:3688 msgid "" "The positional-only arguments *path*, *args*, and *env* are similar to :func:" "`execve`." msgstr "" -#: ../../library/os.rst:3699 +#: ../../library/os.rst:3691 msgid "" -"The *path* parameter is the path to the executable file. The *path* should " -"contain a directory. Use :func:`posix_spawnp` to pass an executable file " +"The *path* parameter is the path to the executable file.The *path* should " +"contain a directory.Use :func:`posix_spawnp` to pass an executable file " "without directory." msgstr "" -#: ../../library/os.rst:3703 +#: ../../library/os.rst:3695 msgid "" "The *file_actions* argument may be a sequence of tuples describing actions " "to take on specific file descriptors in the child process between the C " @@ -3930,31 +3923,31 @@ msgid "" "describing the remaining tuple elements:" msgstr "" -#: ../../library/os.rst:3711 +#: ../../library/os.rst:3703 msgid "(``os.POSIX_SPAWN_OPEN``, *fd*, *path*, *flags*, *mode*)" msgstr "" -#: ../../library/os.rst:3713 +#: ../../library/os.rst:3705 msgid "Performs ``os.dup2(os.open(path, flags, mode), fd)``." msgstr "" -#: ../../library/os.rst:3717 +#: ../../library/os.rst:3709 msgid "(``os.POSIX_SPAWN_CLOSE``, *fd*)" msgstr "" -#: ../../library/os.rst:3719 +#: ../../library/os.rst:3711 msgid "Performs ``os.close(fd)``." msgstr "" -#: ../../library/os.rst:3723 +#: ../../library/os.rst:3715 msgid "(``os.POSIX_SPAWN_DUP2``, *fd*, *new_fd*)" msgstr "" -#: ../../library/os.rst:3725 +#: ../../library/os.rst:3717 msgid "Performs ``os.dup2(fd, new_fd)``." msgstr "" -#: ../../library/os.rst:3727 +#: ../../library/os.rst:3719 msgid "" "These tuples correspond to the C library :c:func:" "`posix_spawn_file_actions_addopen`, :c:func:" @@ -3963,7 +3956,7 @@ msgid "" "`posix_spawn` call itself." msgstr "" -#: ../../library/os.rst:3733 +#: ../../library/os.rst:3725 msgid "" "The *setpgroup* argument will set the process group of the child to the " "value specified. If the value specified is 0, the child's process group ID " @@ -3972,7 +3965,7 @@ msgid "" "corresponds to the C library :c:data:`POSIX_SPAWN_SETPGROUP` flag." msgstr "" -#: ../../library/os.rst:3739 +#: ../../library/os.rst:3731 msgid "" "If the *resetids* argument is ``True`` it will reset the effective UID and " "GID of the child to the real UID and GID of the parent process. If the " @@ -3983,7 +3976,7 @@ msgid "" "library :c:data:`POSIX_SPAWN_RESETIDS` flag." msgstr "" -#: ../../library/os.rst:3747 +#: ../../library/os.rst:3739 msgid "" "If the *setsid* argument is ``True``, it will create a new session ID for " "`posix_spawn`. *setsid* requires :c:data:`POSIX_SPAWN_SETSID` or :c:data:" @@ -3991,7 +3984,7 @@ msgid "" "raised." msgstr "" -#: ../../library/os.rst:3752 +#: ../../library/os.rst:3744 msgid "" "The *setsigmask* argument will set the signal mask to the signal set " "specified. If the parameter is not used, then the child inherits the " @@ -3999,14 +3992,14 @@ msgid "" "`POSIX_SPAWN_SETSIGMASK` flag." msgstr "" -#: ../../library/os.rst:3757 +#: ../../library/os.rst:3749 msgid "" "The *sigdef* argument will reset the disposition of all signals in the set " "specified. This argument corresponds to the C library :c:data:" "`POSIX_SPAWN_SETSIGDEF` flag." msgstr "" -#: ../../library/os.rst:3761 +#: ../../library/os.rst:3753 msgid "" "The *scheduler* argument must be a tuple containing the (optional) scheduler " "policy and an instance of :class:`sched_param` with the scheduler " @@ -4016,79 +4009,79 @@ msgid "" "`POSIX_SPAWN_SETSCHEDULER` flags." msgstr "" -#: ../../library/os.rst:3768 ../../library/os.rst:3784 +#: ../../library/os.rst:3761 ../../library/os.rst:3777 msgid "" "Raises an :ref:`auditing event ` ``os.posix_spawn`` with arguments " "``path``, ``argv``, ``env``." msgstr "" -#: ../../library/os.rst:3778 +#: ../../library/os.rst:3770 msgid "Wraps the :c:func:`posix_spawnp` C library API for use from Python." msgstr "" -#: ../../library/os.rst:3780 +#: ../../library/os.rst:3772 msgid "" "Similar to :func:`posix_spawn` except that the system searches for the " "*executable* file in the list of directories specified by the :envvar:`PATH` " "environment variable (in the same way as for ``execvp(3)``)." msgstr "" -#: ../../library/os.rst:3788 +#: ../../library/os.rst:3780 msgid "" ":ref:`Availability `: See :func:`posix_spawn` documentation." msgstr "" -#: ../../library/os.rst:3794 +#: ../../library/os.rst:3786 msgid "" "Register callables to be executed when a new child process is forked using :" "func:`os.fork` or similar process cloning APIs. The parameters are optional " "and keyword-only. Each specifies a different call point." msgstr "" -#: ../../library/os.rst:3799 +#: ../../library/os.rst:3791 msgid "*before* is a function called before forking a child process." msgstr "" -#: ../../library/os.rst:3800 +#: ../../library/os.rst:3792 msgid "" "*after_in_parent* is a function called from the parent process after forking " "a child process." msgstr "" -#: ../../library/os.rst:3802 +#: ../../library/os.rst:3794 msgid "*after_in_child* is a function called from the child process." msgstr "" -#: ../../library/os.rst:3804 +#: ../../library/os.rst:3796 msgid "" "These calls are only made if control is expected to return to the Python " "interpreter. A typical :mod:`subprocess` launch will not trigger them as " "the child is not going to re-enter the interpreter." msgstr "" -#: ../../library/os.rst:3808 +#: ../../library/os.rst:3800 msgid "" "Functions registered for execution before forking are called in reverse " "registration order. Functions registered for execution after forking " "(either in the parent or in the child) are called in registration order." msgstr "" -#: ../../library/os.rst:3813 +#: ../../library/os.rst:3805 msgid "" "Note that :c:func:`fork` calls made by third-party C code may not call those " "functions, unless it explicitly calls :c:func:`PyOS_BeforeFork`, :c:func:" "`PyOS_AfterFork_Parent` and :c:func:`PyOS_AfterFork_Child`." msgstr "" -#: ../../library/os.rst:3817 +#: ../../library/os.rst:3809 msgid "There is no way to unregister a function." msgstr "" -#: ../../library/os.rst:3833 +#: ../../library/os.rst:3825 msgid "Execute the program *path* in a new process." msgstr "" -#: ../../library/os.rst:3835 +#: ../../library/os.rst:3827 msgid "" "(Note that the :mod:`subprocess` module provides more powerful facilities " "for spawning new processes and retrieving their results; using that module " @@ -4096,7 +4089,7 @@ msgid "" "`subprocess-replacements` section.)" msgstr "" -#: ../../library/os.rst:3840 +#: ../../library/os.rst:3832 msgid "" "If *mode* is :const:`P_NOWAIT`, this function returns the process id of the " "new process; if *mode* is :const:`P_WAIT`, returns the process's exit code " @@ -4105,13 +4098,13 @@ msgid "" "handle, so can be used with the :func:`waitpid` function." msgstr "" -#: ../../library/os.rst:3846 +#: ../../library/os.rst:3838 msgid "" "Note on VxWorks, this function doesn't return ``-signal`` when the new " "process is killed. Instead it raises OSError exception." msgstr "" -#: ../../library/os.rst:3849 +#: ../../library/os.rst:3841 msgid "" "The \"l\" and \"v\" variants of the :func:`spawn\\* ` functions " "differ in how command-line arguments are passed. The \"l\" variants are " @@ -4123,7 +4116,7 @@ msgid "" "to the child process must start with the name of the command being run." msgstr "" -#: ../../library/os.rst:3858 +#: ../../library/os.rst:3850 msgid "" "The variants which include a second \"p\" near the end (:func:`spawnlp`, :" "func:`spawnlpe`, :func:`spawnvp`, and :func:`spawnvpe`) will use the :envvar:" @@ -4136,7 +4129,7 @@ msgid "" "appropriate absolute or relative path." msgstr "" -#: ../../library/os.rst:3868 +#: ../../library/os.rst:3860 msgid "" "For :func:`spawnle`, :func:`spawnlpe`, :func:`spawnve`, and :func:`spawnvpe` " "(note that these all end in \"e\"), the *env* parameter must be a mapping " @@ -4148,19 +4141,19 @@ msgid "" "values will cause the function to fail, with a return value of ``127``." msgstr "" -#: ../../library/os.rst:3877 +#: ../../library/os.rst:3869 msgid "" "As an example, the following calls to :func:`spawnlp` and :func:`spawnvpe` " "are equivalent::" msgstr "" -#: ../../library/os.rst:3886 +#: ../../library/os.rst:3879 msgid "" "Raises an :ref:`auditing event ` ``os.spawn`` with arguments " "``mode``, ``path``, ``args``, ``env``." msgstr "" -#: ../../library/os.rst:3892 +#: ../../library/os.rst:3884 msgid "" ":ref:`Availability `: Unix, Windows. :func:`spawnlp`, :func:" "`spawnlpe`, :func:`spawnvp` and :func:`spawnvpe` are not available on " @@ -4168,7 +4161,7 @@ msgid "" "Windows; we advise you to use the :mod:`subprocess` module instead." msgstr "" -#: ../../library/os.rst:3900 +#: ../../library/os.rst:3892 msgid "" "Possible values for the *mode* parameter to the :func:`spawn\\* ` " "family of functions. If either of these values is given, the :func:`spawn" @@ -4176,7 +4169,7 @@ msgid "" "the process id as the return value." msgstr "" -#: ../../library/os.rst:3910 +#: ../../library/os.rst:3902 msgid "" "Possible value for the *mode* parameter to the :func:`spawn\\* ` " "family of functions. If this is given as *mode*, the :func:`spawn\\*` " @@ -4185,7 +4178,7 @@ msgid "" "signal`` if a signal kills the process." msgstr "" -#: ../../library/os.rst:3922 +#: ../../library/os.rst:3914 msgid "" "Possible values for the *mode* parameter to the :func:`spawn\\* ` " "family of functions. These are less portable than those listed above. :" @@ -4195,11 +4188,11 @@ msgid "" "function will not return." msgstr "" -#: ../../library/os.rst:3933 +#: ../../library/os.rst:3925 msgid "Start a file with its associated application." msgstr "" -#: ../../library/os.rst:3935 +#: ../../library/os.rst:3927 msgid "" "When *operation* is not specified or ``'open'``, this acts like double-" "clicking the file in Windows Explorer, or giving the file name as an " @@ -4208,7 +4201,7 @@ msgid "" "associated." msgstr "" -#: ../../library/os.rst:3940 +#: ../../library/os.rst:3932 msgid "" "When another *operation* is given, it must be a \"command verb\" that " "specifies what should be done with the file. Common verbs documented by " @@ -4216,7 +4209,7 @@ msgid "" "``'explore'`` and ``'find'`` (to be used on directories)." msgstr "" -#: ../../library/os.rst:3945 +#: ../../library/os.rst:3937 msgid "" ":func:`startfile` returns as soon as the associated application is launched. " "There is no option to wait for the application to close, and no way to " @@ -4227,37 +4220,37 @@ msgid "" "normpath` function to ensure that the path is properly encoded for Win32." msgstr "" -#: ../../library/os.rst:3953 +#: ../../library/os.rst:3945 msgid "" "To reduce interpreter startup overhead, the Win32 :c:func:`ShellExecute` " "function is not resolved until this function is first called. If the " "function cannot be resolved, :exc:`NotImplementedError` will be raised." msgstr "" -#: ../../library/os.rst:3957 +#: ../../library/os.rst:3950 msgid "" "Raises an :ref:`auditing event ` ``os.startfile`` with arguments " "``path``, ``operation``." msgstr "" -#: ../../library/os.rst:3964 +#: ../../library/os.rst:3956 msgid "" "Execute the command (a string) in a subshell. This is implemented by " "calling the Standard C function :c:func:`system`, and has the same " "limitations. Changes to :data:`sys.stdin`, etc. are not reflected in the " "environment of the executed command. If *command* generates any output, it " -"will be sent to the interpreter standard output stream. The C standard does " -"not specify the meaning of the return value of the C function, so the return " -"value of the Python function is system-dependent." +"will be sent to the interpreter standard output stream." msgstr "" -#: ../../library/os.rst:3972 +#: ../../library/os.rst:3962 msgid "" "On Unix, the return value is the exit status of the process encoded in the " -"format specified for :func:`wait`." +"format specified for :func:`wait`. Note that POSIX does not specify the " +"meaning of the return value of the C :c:func:`system` function, so the " +"return value of the Python function is system-dependent." msgstr "" -#: ../../library/os.rst:3975 +#: ../../library/os.rst:3967 msgid "" "On Windows, the return value is that returned by the system shell after " "running *command*. The shell is given by the Windows environment variable :" @@ -4266,7 +4259,7 @@ msgid "" "shell documentation." msgstr "" -#: ../../library/os.rst:3981 +#: ../../library/os.rst:3973 msgid "" "The :mod:`subprocess` module provides more powerful facilities for spawning " "new processes and retrieving their results; using that module is preferable " @@ -4274,53 +4267,53 @@ msgid "" "the :mod:`subprocess` documentation for some helpful recipes." msgstr "" -#: ../../library/os.rst:3986 +#: ../../library/os.rst:3978 msgid "" "On Unix, :func:`waitstatus_to_exitcode` can be used to convert the result " "(exit status) into an exit code. On Windows, the result is directly the exit " "code." msgstr "" -#: ../../library/os.rst:3990 +#: ../../library/os.rst:3983 msgid "" "Raises an :ref:`auditing event ` ``os.system`` with argument " "``command``." msgstr "" -#: ../../library/os.rst:3997 +#: ../../library/os.rst:3989 msgid "" "Returns the current global process times. The return value is an object with " "five attributes:" msgstr "" -#: ../../library/os.rst:4000 +#: ../../library/os.rst:3992 msgid ":attr:`user` - user time" msgstr "" -#: ../../library/os.rst:4001 +#: ../../library/os.rst:3993 msgid ":attr:`system` - system time" msgstr "" -#: ../../library/os.rst:4002 +#: ../../library/os.rst:3994 msgid ":attr:`children_user` - user time of all child processes" msgstr "" -#: ../../library/os.rst:4003 +#: ../../library/os.rst:3995 msgid ":attr:`children_system` - system time of all child processes" msgstr "" -#: ../../library/os.rst:4004 +#: ../../library/os.rst:3996 msgid ":attr:`elapsed` - elapsed real time since a fixed point in the past" msgstr "" -#: ../../library/os.rst:4006 +#: ../../library/os.rst:3998 msgid "" "For backwards compatibility, this object also behaves like a five-tuple " "containing :attr:`user`, :attr:`system`, :attr:`children_user`, :attr:" "`children_system`, and :attr:`elapsed` in that order." msgstr "" -#: ../../library/os.rst:4010 +#: ../../library/os.rst:4002 msgid "" "See the Unix manual page :manpage:`times(2)` and :manpage:`times(3)` manual " "page on Unix or `the GetProcessTimes MSDN `: Linux 5.4+" msgstr "" -#: ../../library/os.rst:4082 +#: ../../library/os.rst:4074 msgid "" "Flags that can be used in *options* in :func:`waitid` that specify what " "child signal to wait for." msgstr "" -#: ../../library/os.rst:4097 +#: ../../library/os.rst:4089 msgid "" "These are the possible values for :attr:`si_code` in the result returned by :" "func:`waitid`." msgstr "" -#: ../../library/os.rst:4104 +#: ../../library/os.rst:4096 msgid "Added :data:`CLD_KILLED` and :data:`CLD_STOPPED` values." msgstr "" -#: ../../library/os.rst:4110 +#: ../../library/os.rst:4102 msgid "The details of this function differ on Unix and Windows." msgstr "" -#: ../../library/os.rst:4112 +#: ../../library/os.rst:4104 msgid "" "On Unix: Wait for completion of a child process given by process id *pid*, " "and return a tuple containing its process id and exit status indication " @@ -4408,7 +4401,7 @@ msgid "" "operation." msgstr "" -#: ../../library/os.rst:4117 +#: ../../library/os.rst:4109 msgid "" "If *pid* is greater than ``0``, :func:`waitpid` requests status information " "for that specific process. If *pid* is ``0``, the request is for the status " @@ -4418,13 +4411,13 @@ msgid "" "group ``-pid`` (the absolute value of *pid*)." msgstr "" -#: ../../library/os.rst:4124 +#: ../../library/os.rst:4116 msgid "" "An :exc:`OSError` is raised with the value of errno when the syscall returns " "-1." msgstr "" -#: ../../library/os.rst:4127 +#: ../../library/os.rst:4119 msgid "" "On Windows: Wait for completion of a process given by process handle *pid*, " "and return a tuple containing *pid*, and its exit status shifted left by 8 " @@ -4436,7 +4429,7 @@ msgid "" "process handles." msgstr "" -#: ../../library/os.rst:4146 +#: ../../library/os.rst:4138 msgid "" "Similar to :func:`waitpid`, except no process id argument is given and a 3-" "element tuple containing the child's process id, exit status indication, and " @@ -4445,13 +4438,13 @@ msgid "" "argument is the same as that provided to :func:`waitpid` and :func:`wait4`." msgstr "" -#: ../../library/os.rst:4153 ../../library/os.rst:4167 +#: ../../library/os.rst:4145 ../../library/os.rst:4159 msgid "" ":func:`waitstatus_to_exitcode` can be used to convert the exit status into " "an exitcode." msgstr "" -#: ../../library/os.rst:4161 +#: ../../library/os.rst:4153 msgid "" "Similar to :func:`waitpid`, except a 3-element tuple, containing the child's " "process id, exit status indication, and resource usage information is " @@ -4460,22 +4453,22 @@ msgid "" "the same as those provided to :func:`waitpid`." msgstr "" -#: ../../library/os.rst:4175 +#: ../../library/os.rst:4167 msgid "Convert a wait status to an exit code." msgstr "" -#: ../../library/os.rst:4177 +#: ../../library/os.rst:4169 msgid "On Unix:" msgstr "" -#: ../../library/os.rst:4179 +#: ../../library/os.rst:4171 msgid "" "If the process exited normally (if ``WIFEXITED(status)`` is true), return " "the process exit status (return ``WEXITSTATUS(status)``): result greater " "than or equal to 0." msgstr "" -#: ../../library/os.rst:4182 +#: ../../library/os.rst:4174 msgid "" "If the process was terminated by a signal (if ``WIFSIGNALED(status)`` is " "true), return ``-signum`` where *signum* is the number of the signal that " @@ -4483,15 +4476,15 @@ msgid "" "than 0." msgstr "" -#: ../../library/os.rst:4186 +#: ../../library/os.rst:4178 msgid "Otherwise, raise a :exc:`ValueError`." msgstr "" -#: ../../library/os.rst:4188 +#: ../../library/os.rst:4180 msgid "On Windows, return *status* shifted right by 8 bits." msgstr "" -#: ../../library/os.rst:4190 +#: ../../library/os.rst:4182 msgid "" "On Unix, if the process is being traced or if :func:`waitpid` was called " "with :data:`WUNTRACED` option, the caller must first check if " @@ -4499,240 +4492,240 @@ msgid "" "``WIFSTOPPED(status)`` is true." msgstr "" -#: ../../library/os.rst:4197 +#: ../../library/os.rst:4189 msgid "" ":func:`WIFEXITED`, :func:`WEXITSTATUS`, :func:`WIFSIGNALED`, :func:" "`WTERMSIG`, :func:`WIFSTOPPED`, :func:`WSTOPSIG` functions." msgstr "" -#: ../../library/os.rst:4205 +#: ../../library/os.rst:4197 msgid "" "The option for :func:`waitpid` to return immediately if no child process " "status is available immediately. The function returns ``(0, 0)`` in this " "case." msgstr "" -#: ../../library/os.rst:4213 +#: ../../library/os.rst:4205 msgid "" "This option causes child processes to be reported if they have been " "continued from a job control stop since their status was last reported." msgstr "" -#: ../../library/os.rst:4216 +#: ../../library/os.rst:4208 msgid ":ref:`Availability `: some Unix systems." msgstr "" -#: ../../library/os.rst:4221 +#: ../../library/os.rst:4213 msgid "" "This option causes child processes to be reported if they have been stopped " "but their current state has not been reported since they were stopped." msgstr "" -#: ../../library/os.rst:4227 +#: ../../library/os.rst:4219 msgid "" "The following functions take a process status code as returned by :func:" "`system`, :func:`wait`, or :func:`waitpid` as a parameter. They may be used " "to determine the disposition of a process." msgstr "" -#: ../../library/os.rst:4233 +#: ../../library/os.rst:4225 msgid "" "Return ``True`` if a core dump was generated for the process, otherwise " "return ``False``." msgstr "" -#: ../../library/os.rst:4236 ../../library/os.rst:4302 +#: ../../library/os.rst:4228 ../../library/os.rst:4294 msgid "This function should be employed only if :func:`WIFSIGNALED` is true." msgstr "" -#: ../../library/os.rst:4243 +#: ../../library/os.rst:4235 msgid "" "Return ``True`` if a stopped child has been resumed by delivery of :data:" "`~signal.SIGCONT` (if the process has been continued from a job control " "stop), otherwise return ``False``." msgstr "" -#: ../../library/os.rst:4247 +#: ../../library/os.rst:4239 msgid "See :data:`WCONTINUED` option." msgstr "" -#: ../../library/os.rst:4254 +#: ../../library/os.rst:4246 msgid "" "Return ``True`` if the process was stopped by delivery of a signal, " "otherwise return ``False``." msgstr "" -#: ../../library/os.rst:4257 +#: ../../library/os.rst:4249 msgid "" ":func:`WIFSTOPPED` only returns ``True`` if the :func:`waitpid` call was " "done using :data:`WUNTRACED` option or when the process is being traced " "(see :manpage:`ptrace(2)`)." msgstr "" -#: ../../library/os.rst:4265 +#: ../../library/os.rst:4257 msgid "" "Return ``True`` if the process was terminated by a signal, otherwise return " "``False``." msgstr "" -#: ../../library/os.rst:4273 +#: ../../library/os.rst:4265 msgid "" "Return ``True`` if the process exited terminated normally, that is, by " "calling ``exit()`` or ``_exit()``, or by returning from ``main()``; " "otherwise return ``False``." msgstr "" -#: ../../library/os.rst:4282 +#: ../../library/os.rst:4274 msgid "Return the process exit status." msgstr "" -#: ../../library/os.rst:4284 +#: ../../library/os.rst:4276 msgid "This function should be employed only if :func:`WIFEXITED` is true." msgstr "" -#: ../../library/os.rst:4291 +#: ../../library/os.rst:4283 msgid "Return the signal which caused the process to stop." msgstr "" -#: ../../library/os.rst:4293 +#: ../../library/os.rst:4285 msgid "This function should be employed only if :func:`WIFSTOPPED` is true." msgstr "" -#: ../../library/os.rst:4300 +#: ../../library/os.rst:4292 msgid "Return the number of the signal that caused the process to terminate." msgstr "" -#: ../../library/os.rst:4308 +#: ../../library/os.rst:4300 msgid "Interface to the scheduler" msgstr "" -#: ../../library/os.rst:4310 +#: ../../library/os.rst:4302 msgid "" "These functions control how a process is allocated CPU time by the operating " "system. They are only available on some Unix platforms. For more detailed " "information, consult your Unix manpages." msgstr "" -#: ../../library/os.rst:4316 +#: ../../library/os.rst:4308 msgid "" "The following scheduling policies are exposed if they are supported by the " "operating system." msgstr "" -#: ../../library/os.rst:4321 +#: ../../library/os.rst:4313 msgid "The default scheduling policy." msgstr "" -#: ../../library/os.rst:4325 +#: ../../library/os.rst:4317 msgid "" "Scheduling policy for CPU-intensive processes that tries to preserve " "interactivity on the rest of the computer." msgstr "" -#: ../../library/os.rst:4330 +#: ../../library/os.rst:4322 msgid "Scheduling policy for extremely low priority background tasks." msgstr "" -#: ../../library/os.rst:4334 +#: ../../library/os.rst:4326 msgid "Scheduling policy for sporadic server programs." msgstr "" -#: ../../library/os.rst:4338 +#: ../../library/os.rst:4330 msgid "A First In First Out scheduling policy." msgstr "" -#: ../../library/os.rst:4342 +#: ../../library/os.rst:4334 msgid "A round-robin scheduling policy." msgstr "" -#: ../../library/os.rst:4346 +#: ../../library/os.rst:4338 msgid "" "This flag can be OR'ed with any other scheduling policy. When a process with " "this flag set forks, its child's scheduling policy and priority are reset to " "the default." msgstr "" -#: ../../library/os.rst:4353 +#: ../../library/os.rst:4345 msgid "" "This class represents tunable scheduling parameters used in :func:" "`sched_setparam`, :func:`sched_setscheduler`, and :func:`sched_getparam`. It " "is immutable." msgstr "" -#: ../../library/os.rst:4357 +#: ../../library/os.rst:4349 msgid "At the moment, there is only one possible parameter:" msgstr "" -#: ../../library/os.rst:4361 +#: ../../library/os.rst:4353 msgid "The scheduling priority for a scheduling policy." msgstr "" -#: ../../library/os.rst:4366 +#: ../../library/os.rst:4358 msgid "" "Get the minimum priority value for *policy*. *policy* is one of the " "scheduling policy constants above." msgstr "" -#: ../../library/os.rst:4372 +#: ../../library/os.rst:4364 msgid "" "Get the maximum priority value for *policy*. *policy* is one of the " "scheduling policy constants above." msgstr "" -#: ../../library/os.rst:4378 +#: ../../library/os.rst:4370 msgid "" "Set the scheduling policy for the process with PID *pid*. A *pid* of 0 means " "the calling process. *policy* is one of the scheduling policy constants " "above. *param* is a :class:`sched_param` instance." msgstr "" -#: ../../library/os.rst:4385 +#: ../../library/os.rst:4377 msgid "" "Return the scheduling policy for the process with PID *pid*. A *pid* of 0 " "means the calling process. The result is one of the scheduling policy " "constants above." msgstr "" -#: ../../library/os.rst:4392 +#: ../../library/os.rst:4384 msgid "" -"Set the scheduling parameters for the process with PID *pid*. A *pid* of 0 " +"Set a scheduling parameters for the process with PID *pid*. A *pid* of 0 " "means the calling process. *param* is a :class:`sched_param` instance." msgstr "" -#: ../../library/os.rst:4398 +#: ../../library/os.rst:4390 msgid "" "Return the scheduling parameters as a :class:`sched_param` instance for the " "process with PID *pid*. A *pid* of 0 means the calling process." msgstr "" -#: ../../library/os.rst:4404 +#: ../../library/os.rst:4396 msgid "" "Return the round-robin quantum in seconds for the process with PID *pid*. A " "*pid* of 0 means the calling process." msgstr "" -#: ../../library/os.rst:4410 +#: ../../library/os.rst:4402 msgid "Voluntarily relinquish the CPU." msgstr "" -#: ../../library/os.rst:4415 +#: ../../library/os.rst:4407 msgid "" "Restrict the process with PID *pid* (or the current process if zero) to a " "set of CPUs. *mask* is an iterable of integers representing the set of CPUs " "to which the process should be restricted." msgstr "" -#: ../../library/os.rst:4422 +#: ../../library/os.rst:4414 msgid "" "Return the set of CPUs the process with PID *pid* (or the current process if " "zero) is restricted to." msgstr "" -#: ../../library/os.rst:4429 +#: ../../library/os.rst:4421 msgid "Miscellaneous System Information" msgstr "" -#: ../../library/os.rst:4434 +#: ../../library/os.rst:4426 msgid "" "Return string-valued system configuration values. *name* specifies the " "configuration value to retrieve; it may be a string which is the name of a " @@ -4743,13 +4736,13 @@ msgid "" "included in that mapping, passing an integer for *name* is also accepted." msgstr "" -#: ../../library/os.rst:4442 +#: ../../library/os.rst:4434 msgid "" "If the configuration value specified by *name* isn't defined, ``None`` is " "returned." msgstr "" -#: ../../library/os.rst:4445 +#: ../../library/os.rst:4437 msgid "" "If *name* is a string and is not known, :exc:`ValueError` is raised. If a " "specific value for *name* is not supported by the host system, even if it is " @@ -4757,33 +4750,33 @@ msgid "" "`errno.EINVAL` for the error number." msgstr "" -#: ../../library/os.rst:4455 +#: ../../library/os.rst:4447 msgid "" "Dictionary mapping names accepted by :func:`confstr` to the integer values " "defined for those names by the host operating system. This can be used to " "determine the set of names known to the system." msgstr "" -#: ../../library/os.rst:4464 +#: ../../library/os.rst:4456 msgid "" "Return the number of CPUs in the system. Returns ``None`` if undetermined." msgstr "" -#: ../../library/os.rst:4466 +#: ../../library/os.rst:4458 msgid "" "This number is not equivalent to the number of CPUs the current process can " "use. The number of usable CPUs can be obtained with ``len(os." "sched_getaffinity(0))``" msgstr "" -#: ../../library/os.rst:4476 +#: ../../library/os.rst:4468 msgid "" "Return the number of processes in the system run queue averaged over the " "last 1, 5, and 15 minutes or raises :exc:`OSError` if the load average was " "unobtainable." msgstr "" -#: ../../library/os.rst:4485 +#: ../../library/os.rst:4477 msgid "" "Return integer-valued system configuration values. If the configuration " "value specified by *name* isn't defined, ``-1`` is returned. The comments " @@ -4792,40 +4785,40 @@ msgid "" "``sysconf_names``." msgstr "" -#: ../../library/os.rst:4495 +#: ../../library/os.rst:4487 msgid "" "Dictionary mapping names accepted by :func:`sysconf` to the integer values " "defined for those names by the host operating system. This can be used to " "determine the set of names known to the system." msgstr "" -#: ../../library/os.rst:4501 +#: ../../library/os.rst:4493 msgid "" "The following data values are used to support path manipulation operations. " "These are defined for all platforms." msgstr "" -#: ../../library/os.rst:4504 +#: ../../library/os.rst:4496 msgid "" "Higher-level operations on pathnames are defined in the :mod:`os.path` " "module." msgstr "" -#: ../../library/os.rst:4510 +#: ../../library/os.rst:4502 msgid "" "The constant string used by the operating system to refer to the current " "directory. This is ``'.'`` for Windows and POSIX. Also available via :mod:" "`os.path`." msgstr "" -#: ../../library/os.rst:4518 +#: ../../library/os.rst:4510 msgid "" "The constant string used by the operating system to refer to the parent " "directory. This is ``'..'`` for Windows and POSIX. Also available via :mod:" "`os.path`." msgstr "" -#: ../../library/os.rst:4527 +#: ../../library/os.rst:4519 msgid "" "The character used by the operating system to separate pathname components. " "This is ``'/'`` for POSIX and ``'\\\\'`` for Windows. Note that knowing " @@ -4834,7 +4827,7 @@ msgid "" "useful. Also available via :mod:`os.path`." msgstr "" -#: ../../library/os.rst:4537 +#: ../../library/os.rst:4529 msgid "" "An alternative character used by the operating system to separate pathname " "components, or ``None`` if only one separator character exists. This is set " @@ -4842,27 +4835,27 @@ msgid "" "via :mod:`os.path`." msgstr "" -#: ../../library/os.rst:4546 +#: ../../library/os.rst:4538 msgid "" "The character which separates the base filename from the extension; for " "example, the ``'.'`` in :file:`os.py`. Also available via :mod:`os.path`." msgstr "" -#: ../../library/os.rst:4554 +#: ../../library/os.rst:4546 msgid "" "The character conventionally used by the operating system to separate search " "path components (as in :envvar:`PATH`), such as ``':'`` for POSIX or ``';'`` " "for Windows. Also available via :mod:`os.path`." msgstr "" -#: ../../library/os.rst:4561 +#: ../../library/os.rst:4553 msgid "" "The default search path used by :func:`exec\\*p\\* ` and :func:`spawn" "\\*p\\* ` if the environment doesn't have a ``'PATH'`` key. Also " "available via :mod:`os.path`." msgstr "" -#: ../../library/os.rst:4568 +#: ../../library/os.rst:4560 msgid "" "The string used to separate (or, rather, terminate) lines on the current " "platform. This may be a single character, such as ``'\\n'`` for POSIX, or " @@ -4871,36 +4864,36 @@ msgid "" "default); use a single ``'\\n'`` instead, on all platforms." msgstr "" -#: ../../library/os.rst:4577 +#: ../../library/os.rst:4569 msgid "" "The file path of the null device. For example: ``'/dev/null'`` for POSIX, " "``'nul'`` for Windows. Also available via :mod:`os.path`." msgstr "" -#: ../../library/os.rst:4588 +#: ../../library/os.rst:4580 msgid "" "Flags for use with the :func:`~sys.setdlopenflags` and :func:`~sys." "getdlopenflags` functions. See the Unix manual page :manpage:`dlopen(3)` " "for what the different flags mean." msgstr "" -#: ../../library/os.rst:4596 +#: ../../library/os.rst:4588 msgid "Random numbers" msgstr "" -#: ../../library/os.rst:4601 +#: ../../library/os.rst:4593 msgid "" "Get up to *size* random bytes. The function can return less bytes than " "requested." msgstr "" -#: ../../library/os.rst:4604 +#: ../../library/os.rst:4596 msgid "" "These bytes can be used to seed user-space random number generators or for " "cryptographic purposes." msgstr "" -#: ../../library/os.rst:4607 +#: ../../library/os.rst:4599 msgid "" "``getrandom()`` relies on entropy gathered from device drivers and other " "sources of environmental noise. Unnecessarily reading large quantities of " @@ -4908,35 +4901,35 @@ msgid "" "``/dev/urandom`` devices." msgstr "" -#: ../../library/os.rst:4612 +#: ../../library/os.rst:4604 msgid "" "The flags argument is a bit mask that can contain zero or more of the " "following values ORed together: :py:data:`os.GRND_RANDOM` and :py:data:" "`GRND_NONBLOCK`." msgstr "" -#: ../../library/os.rst:4616 +#: ../../library/os.rst:4608 msgid "" "See also the `Linux getrandom() manual page `_." msgstr "" -#: ../../library/os.rst:4620 +#: ../../library/os.rst:4612 msgid ":ref:`Availability `: Linux 3.17 and newer." msgstr "" -#: ../../library/os.rst:4625 +#: ../../library/os.rst:4617 msgid "Return a string of *size* random bytes suitable for cryptographic use." msgstr "" -#: ../../library/os.rst:4627 +#: ../../library/os.rst:4619 msgid "" "This function returns random bytes from an OS-specific randomness source. " "The returned data should be unpredictable enough for cryptographic " "applications, though its exact quality depends on the OS implementation." msgstr "" -#: ../../library/os.rst:4631 +#: ../../library/os.rst:4623 msgid "" "On Linux, if the ``getrandom()`` syscall is available, it is used in " "blocking mode: block until the system urandom entropy pool is initialized " @@ -4946,57 +4939,57 @@ msgid "" "to poll until the system urandom entropy pool is initialized." msgstr "" -#: ../../library/os.rst:4638 +#: ../../library/os.rst:4630 msgid "" "On a Unix-like system, random bytes are read from the ``/dev/urandom`` " "device. If the ``/dev/urandom`` device is not available or not readable, " "the :exc:`NotImplementedError` exception is raised." msgstr "" -#: ../../library/os.rst:4642 +#: ../../library/os.rst:4634 msgid "On Windows, it will use ``CryptGenRandom()``." msgstr "" -#: ../../library/os.rst:4645 +#: ../../library/os.rst:4637 msgid "" "The :mod:`secrets` module provides higher level functions. For an easy-to-" "use interface to the random number generator provided by your platform, " "please see :class:`random.SystemRandom`." msgstr "" -#: ../../library/os.rst:4649 +#: ../../library/os.rst:4641 msgid "" "On Linux, ``getrandom()`` is now used in blocking mode to increase the " "security." msgstr "" -#: ../../library/os.rst:4653 +#: ../../library/os.rst:4645 msgid "" "On Linux, if the ``getrandom()`` syscall blocks (the urandom entropy pool is " "not initialized yet), fall back on reading ``/dev/urandom``." msgstr "" -#: ../../library/os.rst:4657 +#: ../../library/os.rst:4649 msgid "" "On Linux 3.17 and newer, the ``getrandom()`` syscall is now used when " "available. On OpenBSD 5.6 and newer, the C ``getentropy()`` function is now " "used. These functions avoid the usage of an internal file descriptor." msgstr "" -#: ../../library/os.rst:4665 +#: ../../library/os.rst:4657 msgid "" "By default, when reading from ``/dev/random``, :func:`getrandom` blocks if " "no random bytes are available, and when reading from ``/dev/urandom``, it " "blocks if the entropy pool has not yet been initialized." msgstr "" -#: ../../library/os.rst:4669 +#: ../../library/os.rst:4661 msgid "" "If the :py:data:`GRND_NONBLOCK` flag is set, then :func:`getrandom` does not " "block in these cases, but instead immediately raises :exc:`BlockingIOError`." msgstr "" -#: ../../library/os.rst:4676 +#: ../../library/os.rst:4668 msgid "" "If this bit is set, then random bytes are drawn from the ``/dev/" "random`` pool instead of the ``/dev/urandom`` pool." diff --git a/library/pathlib.po b/library/pathlib.po index 3cf2b8c528..3c11f83bb4 100644 --- a/library/pathlib.po +++ b/library/pathlib.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.7\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2021-09-07 06:52+0000\n" +"POT-Creation-Date: 2020-06-20 18:08+0800\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-" @@ -621,96 +621,88 @@ msgid "" "contents::" msgstr "" -#: ../../library/pathlib.rst:893 -msgid "" -"The children are yielded in arbitrary order, and the special entries ``'.'`` " -"and ``'..'`` are not included. If a file is removed from or added to the " -"directory after creating the iterator, whether an path object for that file " -"be included is unspecified." -msgstr "" - -#: ../../library/pathlib.rst:900 +#: ../../library/pathlib.rst:895 msgid "" "Like :meth:`Path.chmod` but, if the path points to a symbolic link, the " "symbolic link's mode is changed rather than its target's." msgstr "" -#: ../../library/pathlib.rst:906 +#: ../../library/pathlib.rst:901 msgid "" "Like :meth:`Path.stat` but, if the path points to a symbolic link, return " "the symbolic link's information rather than its target's." msgstr "" -#: ../../library/pathlib.rst:912 +#: ../../library/pathlib.rst:907 msgid "" "Create a new directory at this given path. If *mode* is given, it is " "combined with the process' ``umask`` value to determine the file mode and " "access flags. If the path already exists, :exc:`FileExistsError` is raised." msgstr "" -#: ../../library/pathlib.rst:917 +#: ../../library/pathlib.rst:912 msgid "" "If *parents* is true, any missing parents of this path are created as " "needed; they are created with the default permissions without taking *mode* " "into account (mimicking the POSIX ``mkdir -p`` command)." msgstr "" -#: ../../library/pathlib.rst:921 +#: ../../library/pathlib.rst:916 msgid "" "If *parents* is false (the default), a missing parent raises :exc:" "`FileNotFoundError`." msgstr "" -#: ../../library/pathlib.rst:924 +#: ../../library/pathlib.rst:919 msgid "" "If *exist_ok* is false (the default), :exc:`FileExistsError` is raised if " "the target directory already exists." msgstr "" -#: ../../library/pathlib.rst:927 +#: ../../library/pathlib.rst:922 msgid "" "If *exist_ok* is true, :exc:`FileExistsError` exceptions will be ignored " "(same behavior as the POSIX ``mkdir -p`` command), but only if the last path " "component is not an existing non-directory file." msgstr "" -#: ../../library/pathlib.rst:931 +#: ../../library/pathlib.rst:926 msgid "The *exist_ok* parameter was added." msgstr "" -#: ../../library/pathlib.rst:937 +#: ../../library/pathlib.rst:932 msgid "" "Open the file pointed to by the path, like the built-in :func:`open` " "function does::" msgstr "" -#: ../../library/pathlib.rst:949 +#: ../../library/pathlib.rst:944 msgid "" "Return the name of the user owning the file. :exc:`KeyError` is raised if " "the file's uid isn't found in the system database." msgstr "" -#: ../../library/pathlib.rst:955 +#: ../../library/pathlib.rst:950 msgid "Return the binary contents of the pointed-to file as a bytes object::" msgstr "" -#: ../../library/pathlib.rst:968 +#: ../../library/pathlib.rst:963 msgid "Return the decoded contents of the pointed-to file as a string::" msgstr "" -#: ../../library/pathlib.rst:976 +#: ../../library/pathlib.rst:971 msgid "" "The file is opened and then closed. The optional parameters have the same " "meaning as in :func:`open`." msgstr "" -#: ../../library/pathlib.rst:984 +#: ../../library/pathlib.rst:979 msgid "" "Return the path to which the symbolic link points (as returned by :func:`os." "readlink`)::" msgstr "" -#: ../../library/pathlib.rst:997 +#: ../../library/pathlib.rst:992 msgid "" "Rename this file or directory to the given *target*, and return a new Path " "instance pointing to *target*. On Unix, if *target* exists and is a file, " @@ -718,37 +710,30 @@ msgid "" "either a string or another path object::" msgstr "" -#: ../../library/pathlib.rst:1011 ../../library/pathlib.rst:1025 -msgid "" -"The target path may be absolute or relative. Relative paths are interpreted " -"relative to the current working directory, *not* the directory of the Path " -"object." -msgstr "" - -#: ../../library/pathlib.rst:1015 ../../library/pathlib.rst:1029 +#: ../../library/pathlib.rst:1006 ../../library/pathlib.rst:1016 msgid "Added return value, return the new Path instance." msgstr "" -#: ../../library/pathlib.rst:1021 +#: ../../library/pathlib.rst:1012 msgid "" "Rename this file or directory to the given *target*, and return a new Path " "instance pointing to *target*. If *target* points to an existing file or " "directory, it will be unconditionally replaced." msgstr "" -#: ../../library/pathlib.rst:1035 +#: ../../library/pathlib.rst:1022 msgid "" "Make the path absolute, resolving any symlinks. A new path object is " "returned::" msgstr "" -#: ../../library/pathlib.rst:1044 +#: ../../library/pathlib.rst:1031 msgid "" "\"``..``\" components are also eliminated (this is the only method to do " "so)::" msgstr "" -#: ../../library/pathlib.rst:1050 +#: ../../library/pathlib.rst:1037 msgid "" "If the path doesn't exist and *strict* is ``True``, :exc:`FileNotFoundError` " "is raised. If *strict* is ``False``, the path is resolved as far as " @@ -757,64 +742,52 @@ msgid "" "`RuntimeError` is raised." msgstr "" -#: ../../library/pathlib.rst:1056 +#: ../../library/pathlib.rst:1043 msgid "The *strict* argument (pre-3.6 behavior is strict)." msgstr "" -#: ../../library/pathlib.rst:1061 +#: ../../library/pathlib.rst:1048 msgid "" "This is like calling :func:`Path.glob` with \"``**/``\" added in front of " "the given relative *pattern*::" msgstr "" -#: ../../library/pathlib.rst:1071 +#: ../../library/pathlib.rst:1058 msgid "" "Raises an :ref:`auditing event ` ``pathlib.Path.rglob`` with " "arguments ``self``, ``pattern``." msgstr "" -#: ../../library/pathlib.rst:1076 +#: ../../library/pathlib.rst:1063 msgid "Remove this directory. The directory must be empty." msgstr "" -#: ../../library/pathlib.rst:1081 +#: ../../library/pathlib.rst:1068 msgid "" "Return whether this path points to the same file as *other_path*, which can " "be either a Path object, or a string. The semantics are similar to :func:" "`os.path.samefile` and :func:`os.path.samestat`." msgstr "" -#: ../../library/pathlib.rst:1085 +#: ../../library/pathlib.rst:1072 msgid "" "An :exc:`OSError` can be raised if either file cannot be accessed for some " "reason." msgstr "" -#: ../../library/pathlib.rst:1102 +#: ../../library/pathlib.rst:1089 msgid "" "Make this path a symbolic link to *target*. Under Windows, " "*target_is_directory* must be true (default ``False``) if the link's target " "is a directory. Under POSIX, *target_is_directory*'s value is ignored." msgstr "" -#: ../../library/pathlib.rst:1118 +#: ../../library/pathlib.rst:1105 msgid "" "The order of arguments (link, target) is the reverse of :func:`os.symlink`'s." msgstr "" -#: ../../library/pathlib.rst:1124 -msgid "Make *target* a hard link to this path." -msgstr "" - -#: ../../library/pathlib.rst:1128 -msgid "" -"This function does not make this path a hard link to *target*, despite the " -"implication of the function and argument names. The argument order (target, " -"link) is the reverse of :func:`Path.symlink_to`, but matches that of :func:" -"`os.link`." -msgstr "" - -#: ../../library/pathlib.rst:1138 +#: ../../library/pathlib.rst:1111 msgid "" "Create a file at this given path. If *mode* is given, it is combined with " "the process' ``umask`` value to determine the file mode and access flags. " @@ -823,267 +796,247 @@ msgid "" "`FileExistsError` is raised." msgstr "" -#: ../../library/pathlib.rst:1147 +#: ../../library/pathlib.rst:1120 msgid "" "Remove this file or symbolic link. If the path points to a directory, use :" "func:`Path.rmdir` instead." msgstr "" -#: ../../library/pathlib.rst:1150 +#: ../../library/pathlib.rst:1123 msgid "" "If *missing_ok* is false (the default), :exc:`FileNotFoundError` is raised " "if the path does not exist." msgstr "" -#: ../../library/pathlib.rst:1153 +#: ../../library/pathlib.rst:1126 msgid "" "If *missing_ok* is true, :exc:`FileNotFoundError` exceptions will be ignored " "(same behavior as the POSIX ``rm -f`` command)." msgstr "" -#: ../../library/pathlib.rst:1156 +#: ../../library/pathlib.rst:1129 msgid "The *missing_ok* parameter was added." msgstr "" -#: ../../library/pathlib.rst:1162 +#: ../../library/pathlib.rst:1135 +msgid "Create a hard link pointing to a path named *target*." +msgstr "" + +#: ../../library/pathlib.rst:1142 msgid "" "Open the file pointed to in bytes mode, write *data* to it, and close the " "file::" msgstr "" -#: ../../library/pathlib.rst:1171 +#: ../../library/pathlib.rst:1151 msgid "An existing file of the same name is overwritten." msgstr "" -#: ../../library/pathlib.rst:1178 +#: ../../library/pathlib.rst:1158 msgid "" "Open the file pointed to in text mode, write *data* to it, and close the " "file::" msgstr "" -#: ../../library/pathlib.rst:1187 +#: ../../library/pathlib.rst:1167 msgid "" "An existing file of the same name is overwritten. The optional parameters " "have the same meaning as in :func:`open`." msgstr "" -#: ../../library/pathlib.rst:1193 +#: ../../library/pathlib.rst:1173 msgid "Correspondence to tools in the :mod:`os` module" msgstr "" -#: ../../library/pathlib.rst:1195 +#: ../../library/pathlib.rst:1175 msgid "" "Below is a table mapping various :mod:`os` functions to their corresponding :" "class:`PurePath`/:class:`Path` equivalent." msgstr "" -#: ../../library/pathlib.rst:1200 +#: ../../library/pathlib.rst:1180 msgid "" "Although :func:`os.path.relpath` and :meth:`PurePath.relative_to` have some " "overlapping use-cases, their semantics differ enough to warrant not " "considering them equivalent." msgstr "" -#: ../../library/pathlib.rst:1205 +#: ../../library/pathlib.rst:1185 msgid "os and os.path" msgstr "" -#: ../../library/pathlib.rst:1205 +#: ../../library/pathlib.rst:1185 msgid "pathlib" msgstr "" -#: ../../library/pathlib.rst:1207 +#: ../../library/pathlib.rst:1187 msgid ":func:`os.path.abspath`" msgstr "" -#: ../../library/pathlib.rst:1207 +#: ../../library/pathlib.rst:1187 msgid ":meth:`Path.resolve`" msgstr "" -#: ../../library/pathlib.rst:1208 +#: ../../library/pathlib.rst:1188 msgid ":func:`os.chmod`" msgstr "" -#: ../../library/pathlib.rst:1208 +#: ../../library/pathlib.rst:1188 msgid ":meth:`Path.chmod`" msgstr "" -#: ../../library/pathlib.rst:1209 +#: ../../library/pathlib.rst:1189 msgid ":func:`os.mkdir`" msgstr "" -#: ../../library/pathlib.rst:1209 ../../library/pathlib.rst:1210 +#: ../../library/pathlib.rst:1189 ../../library/pathlib.rst:1190 msgid ":meth:`Path.mkdir`" msgstr "" -#: ../../library/pathlib.rst:1210 +#: ../../library/pathlib.rst:1190 msgid ":func:`os.makedirs`" msgstr "" -#: ../../library/pathlib.rst:1211 +#: ../../library/pathlib.rst:1191 msgid ":func:`os.rename`" msgstr "" -#: ../../library/pathlib.rst:1211 +#: ../../library/pathlib.rst:1191 msgid ":meth:`Path.rename`" msgstr "" -#: ../../library/pathlib.rst:1212 +#: ../../library/pathlib.rst:1192 msgid ":func:`os.replace`" msgstr "" -#: ../../library/pathlib.rst:1212 +#: ../../library/pathlib.rst:1192 msgid ":meth:`Path.replace`" msgstr "" -#: ../../library/pathlib.rst:1213 +#: ../../library/pathlib.rst:1193 msgid ":func:`os.rmdir`" msgstr "" -#: ../../library/pathlib.rst:1213 +#: ../../library/pathlib.rst:1193 msgid ":meth:`Path.rmdir`" msgstr "" -#: ../../library/pathlib.rst:1214 +#: ../../library/pathlib.rst:1194 msgid ":func:`os.remove`, :func:`os.unlink`" msgstr "" -#: ../../library/pathlib.rst:1214 +#: ../../library/pathlib.rst:1194 msgid ":meth:`Path.unlink`" msgstr "" -#: ../../library/pathlib.rst:1215 +#: ../../library/pathlib.rst:1195 msgid ":func:`os.getcwd`" msgstr "" -#: ../../library/pathlib.rst:1215 +#: ../../library/pathlib.rst:1195 msgid ":func:`Path.cwd`" msgstr "" -#: ../../library/pathlib.rst:1216 +#: ../../library/pathlib.rst:1196 msgid ":func:`os.path.exists`" msgstr "" -#: ../../library/pathlib.rst:1216 +#: ../../library/pathlib.rst:1196 msgid ":meth:`Path.exists`" msgstr "" -#: ../../library/pathlib.rst:1217 +#: ../../library/pathlib.rst:1197 msgid ":func:`os.path.expanduser`" msgstr "" -#: ../../library/pathlib.rst:1217 +#: ../../library/pathlib.rst:1197 msgid ":meth:`Path.expanduser` and :meth:`Path.home`" msgstr "" -#: ../../library/pathlib.rst:1219 -msgid ":func:`os.listdir`" -msgstr "" - -#: ../../library/pathlib.rst:1219 -msgid ":meth:`Path.iterdir`" -msgstr "" - -#: ../../library/pathlib.rst:1220 +#: ../../library/pathlib.rst:1199 msgid ":func:`os.path.isdir`" msgstr "" -#: ../../library/pathlib.rst:1220 +#: ../../library/pathlib.rst:1199 msgid ":meth:`Path.is_dir`" msgstr "" -#: ../../library/pathlib.rst:1221 +#: ../../library/pathlib.rst:1200 msgid ":func:`os.path.isfile`" msgstr "" -#: ../../library/pathlib.rst:1221 +#: ../../library/pathlib.rst:1200 msgid ":meth:`Path.is_file`" msgstr "" -#: ../../library/pathlib.rst:1222 +#: ../../library/pathlib.rst:1201 msgid ":func:`os.path.islink`" msgstr "" -#: ../../library/pathlib.rst:1222 +#: ../../library/pathlib.rst:1201 msgid ":meth:`Path.is_symlink`" msgstr "" -#: ../../library/pathlib.rst:1223 -msgid ":func:`os.link`" -msgstr "" - -#: ../../library/pathlib.rst:1223 -msgid ":meth:`Path.link_to`" -msgstr "" - -#: ../../library/pathlib.rst:1224 -msgid ":func:`os.symlink`" -msgstr "" - -#: ../../library/pathlib.rst:1224 -msgid ":meth:`Path.symlink_to`" -msgstr "" - -#: ../../library/pathlib.rst:1225 +#: ../../library/pathlib.rst:1202 msgid ":func:`os.readlink`" msgstr "" -#: ../../library/pathlib.rst:1225 +#: ../../library/pathlib.rst:1202 msgid ":meth:`Path.readlink`" msgstr "" -#: ../../library/pathlib.rst:1226 +#: ../../library/pathlib.rst:1203 msgid ":func:`os.stat`" msgstr "" -#: ../../library/pathlib.rst:1226 +#: ../../library/pathlib.rst:1203 msgid ":meth:`Path.stat`, :meth:`Path.owner`, :meth:`Path.group`" msgstr "" -#: ../../library/pathlib.rst:1229 +#: ../../library/pathlib.rst:1206 msgid ":func:`os.path.isabs`" msgstr "" -#: ../../library/pathlib.rst:1229 +#: ../../library/pathlib.rst:1206 msgid ":meth:`PurePath.is_absolute`" msgstr "" -#: ../../library/pathlib.rst:1230 +#: ../../library/pathlib.rst:1207 msgid ":func:`os.path.join`" msgstr "" -#: ../../library/pathlib.rst:1230 +#: ../../library/pathlib.rst:1207 msgid ":func:`PurePath.joinpath`" msgstr "" -#: ../../library/pathlib.rst:1231 +#: ../../library/pathlib.rst:1208 msgid ":func:`os.path.basename`" msgstr "" -#: ../../library/pathlib.rst:1231 +#: ../../library/pathlib.rst:1208 msgid ":data:`PurePath.name`" msgstr "" -#: ../../library/pathlib.rst:1232 +#: ../../library/pathlib.rst:1209 msgid ":func:`os.path.dirname`" msgstr "" -#: ../../library/pathlib.rst:1232 +#: ../../library/pathlib.rst:1209 msgid ":data:`PurePath.parent`" msgstr "" -#: ../../library/pathlib.rst:1233 +#: ../../library/pathlib.rst:1210 msgid ":func:`os.path.samefile`" msgstr "" -#: ../../library/pathlib.rst:1233 +#: ../../library/pathlib.rst:1210 msgid ":meth:`Path.samefile`" msgstr "" -#: ../../library/pathlib.rst:1234 +#: ../../library/pathlib.rst:1211 msgid ":func:`os.path.splitext`" msgstr "" -#: ../../library/pathlib.rst:1234 +#: ../../library/pathlib.rst:1211 msgid ":data:`PurePath.suffix`" msgstr "" diff --git a/library/pdb.po b/library/pdb.po index 3d98e40818..aeabab61e5 100644 --- a/library/pdb.po +++ b/library/pdb.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.7\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2021-09-07 06:52+0000\n" +"POT-Creation-Date: 2020-06-20 18:08+0800\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-" @@ -209,7 +209,7 @@ msgstr "" msgid "Example call to enable tracing with *skip*::" msgstr "" -#: ../../library/pdb.rst:184 +#: ../../library/pdb.rst:185 msgid "" "Raises an :ref:`auditing event ` ``pdb.Pdb`` with no arguments." msgstr "" @@ -620,15 +620,11 @@ msgid "" "arbitrary expression or statement to be executed in the current environment)." msgstr "" -#: ../../library/pdb.rst:542 -msgid "Print the return value for the last return of a function." -msgstr "" - -#: ../../library/pdb.rst:545 +#: ../../library/pdb.rst:544 msgid "Footnotes" msgstr "註解" -#: ../../library/pdb.rst:546 +#: ../../library/pdb.rst:545 msgid "" "Whether a frame is considered to originate in a certain module is determined " "by the ``__name__`` in the frame globals." diff --git a/library/pkgutil.po b/library/pkgutil.po index 31fc5e6cbd..29132a8a0e 100644 --- a/library/pkgutil.po +++ b/library/pkgutil.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.7\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2021-09-07 06:52+0000\n" +"POT-Creation-Date: 2020-06-20 18:08+0800\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-" @@ -102,8 +102,7 @@ msgid "" msgstr "" #: ../../library/pkgutil.rst:71 -msgid "" -":term:`Loader ` that wraps Python's \"classic\" import algorithm." +msgid ":term:`Loader` that wraps Python's \"classic\" import algorithm." msgstr "" #: ../../library/pkgutil.rst:80 diff --git a/library/platform.po b/library/platform.po index 5180d931f0..6c1111f79d 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-07 06:52+0000\n" +"POT-Creation-Date: 2020-06-20 18:08+0800\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-" @@ -67,7 +67,7 @@ msgstr "" #: ../../library/platform.rst:45 msgid "" -"On macOS (and perhaps other platforms), executable files may be universal " +"On Mac OS X (and perhaps other platforms), executable files may be universal " "files containing multiple architectures." msgstr "" @@ -264,39 +264,46 @@ msgstr "" #: ../../library/platform.rst:214 msgid "" +"This function works best with Mark Hammond's :mod:`win32all` package " +"installed, but also on Python 2.3 and later (support for this was added in " +"Python 2.6). It obviously only runs on Win32 compatible platforms." +msgstr "" + +#: ../../library/platform.rst:221 +msgid "" "Returns a string representing the current Windows edition. Possible values " "include but are not limited to ``'Enterprise'``, ``'IoTUAP'``, " "``'ServerStandard'``, and ``'nanoserver'``." msgstr "" -#: ../../library/platform.rst:222 +#: ../../library/platform.rst:229 msgid "" "Return ``True`` if the Windows edition returned by :func:`win32_edition` is " "recognized as an IoT edition." msgstr "" -#: ../../library/platform.rst:229 +#: ../../library/platform.rst:236 msgid "Mac OS Platform" msgstr "" -#: ../../library/platform.rst:234 +#: ../../library/platform.rst:241 msgid "" "Get Mac OS version information and return it as tuple ``(release, " "versioninfo, machine)`` with *versioninfo* being a tuple ``(version, " "dev_stage, non_release_version)``." msgstr "" -#: ../../library/platform.rst:238 +#: ../../library/platform.rst:245 msgid "" "Entries which cannot be determined are set to ``''``. All tuple entries are " "strings." msgstr "" -#: ../../library/platform.rst:243 +#: ../../library/platform.rst:250 msgid "Unix Platforms" msgstr "" -#: ../../library/platform.rst:247 +#: ../../library/platform.rst:254 msgid "" "Tries to determine the libc version against which the file executable " "(defaults to the Python interpreter) is linked. Returns a tuple of strings " @@ -304,13 +311,13 @@ msgid "" "fails." msgstr "" -#: ../../library/platform.rst:251 +#: ../../library/platform.rst:258 msgid "" "Note that this function has intimate knowledge of how different libc " "versions add symbols to the executable is probably only usable for " "executables compiled using :program:`gcc`." msgstr "" -#: ../../library/platform.rst:255 +#: ../../library/platform.rst:262 msgid "The file is read and scanned in chunks of *chunksize* bytes." msgstr "" diff --git a/library/poplib.po b/library/poplib.po index 80492bacd8..3b4b97070d 100644 --- a/library/poplib.po +++ b/library/poplib.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.7\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2021-09-07 06:52+0000\n" +"POT-Creation-Date: 2020-06-20 18:08+0800\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-" @@ -64,13 +64,13 @@ msgid "" "timeout setting will be used)." msgstr "" -#: ../../library/poplib.rst:42 ../../library/poplib.rst:68 +#: ../../library/poplib.rst:43 ../../library/poplib.rst:69 msgid "" "Raises an :ref:`auditing event ` ``poplib.connect`` with arguments " "``self``, ``host``, ``port``." msgstr "" -#: ../../library/poplib.rst:44 ../../library/poplib.rst:70 +#: ../../library/poplib.rst:None msgid "" "Raises an :ref:`auditing event ` ``poplib.putline`` with arguments " "``self``, ``line``." diff --git a/library/pty.po b/library/pty.po index dc0eaf7978..e1125308aa 100644 --- a/library/pty.po +++ b/library/pty.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.7\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2021-09-07 06:52+0000\n" +"POT-Creation-Date: 2020-06-20 18:08+0800\n" "PO-Revision-Date: 2016-11-19 00:33+0000\n" "Last-Translator: Liang-Bo Wang \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -115,7 +115,7 @@ msgid "" "an exit code." msgstr "" -#: ../../library/pty.rst:77 +#: ../../library/pty.rst:78 msgid "" "Raises an :ref:`auditing event ` ``pty.spawn`` with argument " "``argv``." diff --git a/library/py_compile.po b/library/py_compile.po index 368a6a6628..8fea04a7ee 100644 --- a/library/py_compile.po +++ b/library/py_compile.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.7\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2021-09-07 06:52+0000\n" +"POT-Creation-Date: 2020-06-20 18:08+0800\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-" @@ -53,11 +53,11 @@ msgid "" "ending in ``.pyc``. For example, if *file* is ``/foo/bar/baz.py`` *cfile* " "will default to ``/foo/bar/__pycache__/baz.cpython-32.pyc`` for Python 3.2. " "If *dfile* is specified, it is used as the name of the source file in error " -"messages instead of *file*. If *doraise* is true, a :exc:`PyCompileError` " -"is raised when an error is encountered while compiling *file*. If *doraise* " -"is false (the default), an error string is written to ``sys.stderr``, but no " -"exception is raised. This function returns the path to byte-compiled file, " -"i.e. whatever *cfile* value was used." +"messages when instead of *file*. If *doraise* is true, a :exc:" +"`PyCompileError` is raised when an error is encountered while compiling " +"*file*. If *doraise* is false (the default), an error string is written to " +"``sys.stderr``, but no exception is raised. This function returns the path " +"to byte-compiled file, i.e. whatever *cfile* value was used." msgstr "" #: ../../library/py_compile.rst:45 diff --git a/library/pyexpat.po b/library/pyexpat.po index d0621d159c..1ddcb4cd6f 100644 --- a/library/pyexpat.po +++ b/library/pyexpat.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.7\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2021-09-07 06:52+0000\n" +"POT-Creation-Date: 2018-06-26 18:54+0800\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-" @@ -638,11 +638,11 @@ msgid "The ``errors`` module has the following attributes:" msgstr "" #: ../../library/pyexpat.rst:668 -msgid "A dictionary mapping string descriptions to their error codes." +msgid "A dictionary mapping numeric error codes to their string descriptions." msgstr "" #: ../../library/pyexpat.rst:675 -msgid "A dictionary mapping numeric error codes to their string descriptions." +msgid "A dictionary mapping string descriptions to their error codes." msgstr "" #: ../../library/pyexpat.rst:685 diff --git a/library/random.po b/library/random.po index cb0172dc2f..740687f256 100644 --- a/library/random.po +++ b/library/random.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.7\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2021-09-07 06:52+0000\n" +"POT-Creation-Date: 2020-06-20 18:08+0800\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-" @@ -209,33 +209,33 @@ msgstr "" #: ../../library/random.rst:145 msgid "" -"Returns a non-negative Python integer with *k* random bits. This method is " -"supplied with the MersenneTwister generator and some other generators may " -"also provide it as an optional part of the API. When available, :meth:" -"`getrandbits` enables :meth:`randrange` to handle arbitrarily large ranges." +"Returns a Python integer with *k* random bits. This method is supplied with " +"the MersenneTwister generator and some other generators may also provide it " +"as an optional part of the API. When available, :meth:`getrandbits` enables :" +"meth:`randrange` to handle arbitrarily large ranges." msgstr "" -#: ../../library/random.rst:151 +#: ../../library/random.rst:150 msgid "This method now accepts zero for *k*." msgstr "" -#: ../../library/random.rst:156 +#: ../../library/random.rst:155 msgid "Functions for sequences" msgstr "" -#: ../../library/random.rst:160 +#: ../../library/random.rst:159 msgid "" "Return a random element from the non-empty sequence *seq*. If *seq* is " "empty, raises :exc:`IndexError`." msgstr "" -#: ../../library/random.rst:165 +#: ../../library/random.rst:164 msgid "" "Return a *k* sized list of elements chosen from the *population* with " "replacement. If the *population* is empty, raises :exc:`IndexError`." msgstr "" -#: ../../library/random.rst:168 +#: ../../library/random.rst:167 msgid "" "If a *weights* sequence is specified, selections are made according to the " "relative weights. Alternatively, if a *cum_weights* sequence is given, the " @@ -246,7 +246,7 @@ msgid "" "before making selections, so supplying the cumulative weights saves work." msgstr "" -#: ../../library/random.rst:177 +#: ../../library/random.rst:176 msgid "" "If neither *weights* nor *cum_weights* are specified, selections are made " "with equal probability. If a weights sequence is supplied, it must be the " @@ -254,7 +254,7 @@ msgid "" "specify both *weights* and *cum_weights*." msgstr "" -#: ../../library/random.rst:182 +#: ../../library/random.rst:181 msgid "" "The *weights* or *cum_weights* can use any numeric type that interoperates " "with the :class:`float` values returned by :func:`random` (that includes " @@ -263,7 +263,7 @@ msgid "" "weights are zero." msgstr "" -#: ../../library/random.rst:188 +#: ../../library/random.rst:187 msgid "" "For a given seed, the :func:`choices` function with equal weighting " "typically produces a different sequence than repeated calls to :func:" @@ -273,27 +273,27 @@ msgid "" "small biases from round-off error." msgstr "" -#: ../../library/random.rst:197 +#: ../../library/random.rst:196 msgid "Raises a :exc:`ValueError` if all weights are zero." msgstr "" -#: ../../library/random.rst:203 +#: ../../library/random.rst:202 msgid "Shuffle the sequence *x* in place." msgstr "" -#: ../../library/random.rst:205 +#: ../../library/random.rst:204 msgid "" "The optional argument *random* is a 0-argument function returning a random " "float in [0.0, 1.0); by default, this is the function :func:`.random`." msgstr "" -#: ../../library/random.rst:208 +#: ../../library/random.rst:207 msgid "" "To shuffle an immutable sequence and return a new shuffled list, use " "``sample(x, k=len(x))`` instead." msgstr "" -#: ../../library/random.rst:211 +#: ../../library/random.rst:210 msgid "" "Note that even for small ``len(x)``, the total number of permutations of *x* " "can quickly grow larger than the period of most random number generators. " @@ -302,17 +302,17 @@ msgid "" "fit within the period of the Mersenne Twister random number generator." msgstr "" -#: ../../library/random.rst:218 +#: ../../library/random.rst:217 msgid "The optional parameter *random*." msgstr "" -#: ../../library/random.rst:223 +#: ../../library/random.rst:222 msgid "" "Return a *k* length list of unique elements chosen from the population " "sequence or set. Used for random sampling without replacement." msgstr "" -#: ../../library/random.rst:226 +#: ../../library/random.rst:225 msgid "" "Returns a new list containing elements from the population while leaving the " "original population unchanged. The resulting list is in selection order so " @@ -321,14 +321,14 @@ msgid "" "winners (the subslices)." msgstr "" -#: ../../library/random.rst:232 +#: ../../library/random.rst:231 msgid "" "Members of the population need not be :term:`hashable` or unique. If the " "population contains repeats, then each occurrence is a possible selection in " "the sample." msgstr "" -#: ../../library/random.rst:235 +#: ../../library/random.rst:234 msgid "" "Repeated elements can be specified one at a time or with the optional " "keyword-only *counts* parameter. For example, ``sample(['red', 'blue'], " @@ -336,24 +336,24 @@ msgid "" "'blue', 'blue'], k=5)``." msgstr "" -#: ../../library/random.rst:240 +#: ../../library/random.rst:239 msgid "" "To choose a sample from a range of integers, use a :func:`range` object as " "an argument. This is especially fast and space efficient for sampling from " "a large population: ``sample(range(10000000), k=60)``." msgstr "" -#: ../../library/random.rst:244 +#: ../../library/random.rst:243 msgid "" "If the sample size is larger than the population size, a :exc:`ValueError` " "is raised." msgstr "" -#: ../../library/random.rst:247 +#: ../../library/random.rst:246 msgid "Added the *counts* parameter." msgstr "" -#: ../../library/random.rst:250 +#: ../../library/random.rst:249 msgid "" "In the future, the *population* must be a sequence. Instances of :class:" "`set` are no longer supported. The set must first be converted to a :class:" @@ -361,11 +361,11 @@ msgid "" "sample is reproducible." msgstr "" -#: ../../library/random.rst:260 +#: ../../library/random.rst:257 msgid "Real-valued distributions" msgstr "" -#: ../../library/random.rst:262 +#: ../../library/random.rst:259 msgid "" "The following functions generate specific real-valued distributions. " "Function parameters are named after the corresponding variables in the " @@ -373,23 +373,23 @@ msgid "" "these equations can be found in any statistics text." msgstr "" -#: ../../library/random.rst:270 +#: ../../library/random.rst:267 msgid "Return the next random floating point number in the range [0.0, 1.0)." msgstr "" -#: ../../library/random.rst:275 +#: ../../library/random.rst:272 msgid "" "Return a random floating point number *N* such that ``a <= N <= b`` for ``a " "<= b`` and ``b <= N <= a`` for ``b < a``." msgstr "" -#: ../../library/random.rst:278 +#: ../../library/random.rst:275 msgid "" "The end-point value ``b`` may or may not be included in the range depending " "on floating-point rounding in the equation ``a + (b-a) * random()``." msgstr "" -#: ../../library/random.rst:284 +#: ../../library/random.rst:281 msgid "" "Return a random floating point number *N* such that ``low <= N <= high`` and " "with the specified *mode* between those bounds. The *low* and *high* bounds " @@ -397,13 +397,13 @@ msgid "" "between the bounds, giving a symmetric distribution." msgstr "" -#: ../../library/random.rst:292 +#: ../../library/random.rst:289 msgid "" "Beta distribution. Conditions on the parameters are ``alpha > 0`` and " "``beta > 0``. Returned values range between 0 and 1." msgstr "" -#: ../../library/random.rst:298 +#: ../../library/random.rst:295 msgid "" "Exponential distribution. *lambd* is 1.0 divided by the desired mean. It " "should be nonzero. (The parameter would be called \"lambda\", but that is a " @@ -412,17 +412,17 @@ msgid "" "negative." msgstr "" -#: ../../library/random.rst:307 +#: ../../library/random.rst:304 msgid "" "Gamma distribution. (*Not* the gamma function!) Conditions on the " "parameters are ``alpha > 0`` and ``beta > 0``." msgstr "" -#: ../../library/random.rst:310 +#: ../../library/random.rst:307 msgid "The probability distribution function is::" msgstr "" -#: ../../library/random.rst:319 +#: ../../library/random.rst:316 msgid "" "Gaussian distribution. *mu* is the mean, and *sigma* is the standard " "deviation. This is slightly faster than the :func:`normalvariate` function " @@ -431,28 +431,19 @@ msgstr "" #: ../../library/random.rst:323 msgid "" -"Multithreading note: When two threads call this function simultaneously, it " -"is possible that they will receive the same return value. This can be " -"avoided in three ways. 1) Have each thread use a different instance of the " -"random number generator. 2) Put locks around all calls. 3) Use the slower, " -"but thread-safe :func:`normalvariate` function instead." -msgstr "" - -#: ../../library/random.rst:333 -msgid "" "Log normal distribution. If you take the natural logarithm of this " "distribution, you'll get a normal distribution with mean *mu* and standard " "deviation *sigma*. *mu* can have any value, and *sigma* must be greater " "than zero." msgstr "" -#: ../../library/random.rst:341 +#: ../../library/random.rst:331 msgid "" "Normal distribution. *mu* is the mean, and *sigma* is the standard " "deviation." msgstr "" -#: ../../library/random.rst:346 +#: ../../library/random.rst:336 msgid "" "*mu* is the mean angle, expressed in radians between 0 and 2\\*\\ *pi*, and " "*kappa* is the concentration parameter, which must be greater than or equal " @@ -460,34 +451,34 @@ msgid "" "uniform random angle over the range 0 to 2\\*\\ *pi*." msgstr "" -#: ../../library/random.rst:354 +#: ../../library/random.rst:344 msgid "Pareto distribution. *alpha* is the shape parameter." msgstr "" -#: ../../library/random.rst:359 +#: ../../library/random.rst:349 msgid "" "Weibull distribution. *alpha* is the scale parameter and *beta* is the " "shape parameter." msgstr "" -#: ../../library/random.rst:364 +#: ../../library/random.rst:354 msgid "Alternative Generator" msgstr "" -#: ../../library/random.rst:368 +#: ../../library/random.rst:358 msgid "" "Class that implements the default pseudo-random number generator used by " "the :mod:`random` module." msgstr "" -#: ../../library/random.rst:371 +#: ../../library/random.rst:361 msgid "" "In the future, the *seed* must be one of the following types: :class:" "`NoneType`, :class:`int`, :class:`float`, :class:`str`, :class:`bytes`, or :" "class:`bytearray`." msgstr "" -#: ../../library/random.rst:378 +#: ../../library/random.rst:368 msgid "" "Class that uses the :func:`os.urandom` function for generating random " "numbers from sources provided by the operating system. Not available on all " @@ -497,11 +488,11 @@ msgid "" "`NotImplementedError` if called." msgstr "" -#: ../../library/random.rst:387 +#: ../../library/random.rst:377 msgid "Notes on Reproducibility" msgstr "" -#: ../../library/random.rst:389 +#: ../../library/random.rst:379 msgid "" "Sometimes it is useful to be able to reproduce the sequences given by a " "pseudo-random number generator. By re-using a seed value, the same sequence " @@ -509,44 +500,44 @@ msgid "" "running." msgstr "" -#: ../../library/random.rst:393 +#: ../../library/random.rst:383 msgid "" "Most of the random module's algorithms and seeding functions are subject to " "change across Python versions, but two aspects are guaranteed not to change:" msgstr "" -#: ../../library/random.rst:396 +#: ../../library/random.rst:386 msgid "" "If a new seeding method is added, then a backward compatible seeder will be " "offered." msgstr "" -#: ../../library/random.rst:399 +#: ../../library/random.rst:389 msgid "" "The generator's :meth:`~Random.random` method will continue to produce the " "same sequence when the compatible seeder is given the same seed." msgstr "" -#: ../../library/random.rst:405 -msgid "Examples" +#: ../../library/random.rst:395 +msgid "Examples and Recipes" msgstr "" -#: ../../library/random.rst:407 +#: ../../library/random.rst:397 msgid "Basic examples::" msgstr "" -#: ../../library/random.rst:435 +#: ../../library/random.rst:425 msgid "Simulations::" msgstr "" -#: ../../library/random.rst:463 +#: ../../library/random.rst:453 msgid "" "Example of `statistical bootstrapping `_ using resampling with replacement to estimate " "a confidence interval for the mean of a sample::" msgstr "" -#: ../../library/random.rst:476 +#: ../../library/random.rst:466 msgid "" "Example of a `resampling permutation test `_ to determine the statistical " @@ -554,12 +545,12 @@ msgid "" "observed difference between the effects of a drug versus a placebo::" msgstr "" -#: ../../library/random.rst:503 +#: ../../library/random.rst:493 msgid "" "Simulation of arrival times and service deliveries for a multiserver queue::" msgstr "" -#: ../../library/random.rst:531 +#: ../../library/random.rst:521 msgid "" "`Statistics for Hackers `_ a " "video tutorial by `Jake Vanderplas `_ a simulation of a marketplace by `Peter Norvig `_ a tutorial by `Peter " @@ -584,48 +575,3 @@ msgid "" "theory, how to write simulations, and how to perform data analysis using " "Python." msgstr "" - -#: ../../library/random.rst:552 -msgid "Recipes" -msgstr "" - -#: ../../library/random.rst:554 -msgid "" -"The default :func:`.random` returns multiples of 2⁻⁵³ in the range *0.0 ≤ x " -"< 1.0*. All such numbers are evenly spaced and are exactly representable as " -"Python floats. However, many other representable floats in that interval " -"are not possible selections. For example, ``0.05954861408025609`` isn't an " -"integer multiple of 2⁻⁵³." -msgstr "" - -#: ../../library/random.rst:560 -msgid "" -"The following recipe takes a different approach. All floats in the interval " -"are possible selections. The mantissa comes from a uniform distribution of " -"integers in the range *2⁵² ≤ mantissa < 2⁵³*. The exponent comes from a " -"geometric distribution where exponents smaller than *-53* occur half as " -"often as the next larger exponent." -msgstr "" - -#: ../../library/random.rst:582 -msgid "" -"All :ref:`real valued distributions ` in the " -"class will use the new method::" -msgstr "" - -#: ../../library/random.rst:591 -msgid "" -"The recipe is conceptually equivalent to an algorithm that chooses from all " -"the multiples of 2⁻¹⁰⁷⁴ in the range *0.0 ≤ x < 1.0*. All such numbers are " -"evenly spaced, but most have to be rounded down to the nearest representable " -"Python float. (The value 2⁻¹⁰⁷⁴ is the smallest positive unnormalized float " -"and is equal to ``math.ulp(0.0)``.)" -msgstr "" - -#: ../../library/random.rst:600 -msgid "" -"`Generating Pseudo-random Floating-Point Values `_ a paper by Allen B. Downey describing " -"ways to generate more fine-grained floats than normally generated by :func:`." -"random`." -msgstr "" diff --git a/library/re.po b/library/re.po index 82c0a7503d..55e0316970 100644 --- a/library/re.po +++ b/library/re.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.7\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2021-09-07 06:52+0000\n" +"POT-Creation-Date: 2020-06-20 18:08+0800\n" "PO-Revision-Date: 2018-05-23 16:09+0000\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -145,7 +145,7 @@ msgstr "" msgid "The special characters are:" msgstr "" -#: ../../library/re.rst:104 ../../library/re.rst:1419 +#: ../../library/re.rst:104 ../../library/re.rst:1409 msgid "``.``" msgstr "" @@ -1068,7 +1068,7 @@ msgid "" "previous empty match." msgstr "" -#: ../../library/re.rst:817 ../../library/re.rst:907 ../../library/re.rst:931 +#: ../../library/re.rst:817 ../../library/re.rst:897 ../../library/re.rst:921 msgid "Added the optional flags argument." msgstr "" @@ -1080,25 +1080,17 @@ msgstr "" #: ../../library/re.rst:826 msgid "" "Return all non-overlapping matches of *pattern* in *string*, as a list of " -"strings or tuples. The *string* is scanned left-to-right, and matches are " -"returned in the order found. Empty matches are included in the result." +"strings. The *string* is scanned left-to-right, and matches are returned in " +"the order found. If one or more groups are present in the pattern, return a " +"list of groups; this will be a list of tuples if the pattern has more than " +"one group. Empty matches are included in the result." msgstr "" -#: ../../library/re.rst:830 -msgid "" -"The result depends on the number of capturing groups in the pattern. If " -"there are no groups, return a list of strings matching the whole pattern. " -"If there is exactly one group, return a list of strings matching that " -"group. If multiple groups are present, return a list of tuples of strings " -"matching the groups. Non-capturing groups do not affect the form of the " -"result." -msgstr "" - -#: ../../library/re.rst:842 ../../library/re.rst:853 +#: ../../library/re.rst:832 ../../library/re.rst:843 msgid "Non-empty matches can now start just after a previous empty match." msgstr "" -#: ../../library/re.rst:848 +#: ../../library/re.rst:838 msgid "" "Return an :term:`iterator` yielding :ref:`match objects ` " "over all non-overlapping matches for the RE *pattern* in *string*. The " @@ -1106,7 +1098,7 @@ msgid "" "found. Empty matches are included in the result." msgstr "" -#: ../../library/re.rst:859 +#: ../../library/re.rst:849 msgid "" "Return the string obtained by replacing the leftmost non-overlapping " "occurrences of *pattern* in *string* by the replacement *repl*. If the " @@ -1120,18 +1112,18 @@ msgid "" "For example::" msgstr "" -#: ../../library/re.rst:875 +#: ../../library/re.rst:865 msgid "" "If *repl* is a function, it is called for every non-overlapping occurrence " "of *pattern*. The function takes a single :ref:`match object ` argument, and returns the replacement string. For example::" msgstr "" -#: ../../library/re.rst:887 +#: ../../library/re.rst:877 msgid "The pattern may be a string or a :ref:`pattern object `." msgstr "" -#: ../../library/re.rst:889 +#: ../../library/re.rst:879 msgid "" "The optional argument *count* is the maximum number of pattern occurrences " "to be replaced; *count* must be a non-negative integer. If omitted or zero, " @@ -1140,7 +1132,7 @@ msgid "" "'abxd')`` returns ``'-a-b--d-'``." msgstr "" -#: ../../library/re.rst:897 +#: ../../library/re.rst:887 msgid "" "In string-type *repl* arguments, in addition to the character escapes and " "backreferences described above, ``\\g`` will use the substring matched " @@ -1153,52 +1145,52 @@ msgid "" "RE." msgstr "" -#: ../../library/re.rst:910 ../../library/re.rst:934 ../../library/re.rst:1165 +#: ../../library/re.rst:900 ../../library/re.rst:924 ../../library/re.rst:1155 msgid "Unmatched groups are replaced with an empty string." msgstr "" -#: ../../library/re.rst:913 +#: ../../library/re.rst:903 msgid "" "Unknown escapes in *pattern* consisting of ``'\\'`` and an ASCII letter now " "are errors." msgstr "" -#: ../../library/re.rst:917 +#: ../../library/re.rst:907 msgid "" "Unknown escapes in *repl* consisting of ``'\\'`` and an ASCII letter now are " "errors." msgstr "" -#: ../../library/re.rst:921 +#: ../../library/re.rst:911 msgid "" "Empty matches for the pattern are replaced when adjacent to a previous non-" "empty match." msgstr "" -#: ../../library/re.rst:928 +#: ../../library/re.rst:918 msgid "" "Perform the same operation as :func:`sub`, but return a tuple ``(new_string, " "number_of_subs_made)``." msgstr "" -#: ../../library/re.rst:940 +#: ../../library/re.rst:930 msgid "" "Escape special characters in *pattern*. This is useful if you want to match " "an arbitrary literal string that may have regular expression metacharacters " "in it. For example::" msgstr "" -#: ../../library/re.rst:955 +#: ../../library/re.rst:945 msgid "" "This function must not be used for the replacement string in :func:`sub` " "and :func:`subn`, only backslashes should be escaped. For example::" msgstr "" -#: ../../library/re.rst:963 +#: ../../library/re.rst:953 msgid "The ``'_'`` character is no longer escaped." msgstr "" -#: ../../library/re.rst:966 +#: ../../library/re.rst:956 msgid "" "Only characters that can have special meaning in a regular expression are " "escaped. As a result, ``'!'``, ``'\"'``, ``'%'``, ``\"'\"``, ``','``, " @@ -1206,11 +1198,11 @@ msgid "" "are no longer escaped." msgstr "" -#: ../../library/re.rst:975 +#: ../../library/re.rst:965 msgid "Clear the regular expression cache." msgstr "" -#: ../../library/re.rst:980 +#: ../../library/re.rst:970 msgid "" "Exception raised when a string passed to one of the functions here is not a " "valid regular expression (for example, it might contain unmatched " @@ -1219,41 +1211,41 @@ msgid "" "pattern. The error instance has the following additional attributes:" msgstr "" -#: ../../library/re.rst:988 +#: ../../library/re.rst:978 msgid "The unformatted error message." msgstr "" -#: ../../library/re.rst:992 +#: ../../library/re.rst:982 msgid "The regular expression pattern." msgstr "" -#: ../../library/re.rst:996 +#: ../../library/re.rst:986 msgid "The index in *pattern* where compilation failed (may be ``None``)." msgstr "" -#: ../../library/re.rst:1000 +#: ../../library/re.rst:990 msgid "The line corresponding to *pos* (may be ``None``)." msgstr "" -#: ../../library/re.rst:1004 +#: ../../library/re.rst:994 msgid "The column corresponding to *pos* (may be ``None``)." msgstr "" -#: ../../library/re.rst:1006 +#: ../../library/re.rst:996 msgid "Added additional attributes." msgstr "" -#: ../../library/re.rst:1012 +#: ../../library/re.rst:1002 msgid "Regular Expression Objects" msgstr "" -#: ../../library/re.rst:1014 +#: ../../library/re.rst:1004 msgid "" "Compiled regular expression objects support the following methods and " "attributes:" msgstr "" -#: ../../library/re.rst:1019 +#: ../../library/re.rst:1009 msgid "" "Scan through *string* looking for the first location where this regular " "expression produces a match, and return a corresponding :ref:`match object " @@ -1262,7 +1254,7 @@ msgid "" "some point in the string." msgstr "" -#: ../../library/re.rst:1025 +#: ../../library/re.rst:1015 msgid "" "The optional second parameter *pos* gives an index in the string where the " "search is to start; it defaults to ``0``. This is not completely equivalent " @@ -1271,7 +1263,7 @@ msgid "" "necessarily at the index where the search is to start." msgstr "" -#: ../../library/re.rst:1031 +#: ../../library/re.rst:1021 msgid "" "The optional parameter *endpos* limits how far the string will be searched; " "it will be as if the string is *endpos* characters long, so only the " @@ -1281,7 +1273,7 @@ msgid "" "equivalent to ``rx.search(string[:50], 0)``. ::" msgstr "" -#: ../../library/re.rst:1046 +#: ../../library/re.rst:1036 msgid "" "If zero or more characters at the *beginning* of *string* match this regular " "expression, return a corresponding :ref:`match object `. " @@ -1289,19 +1281,19 @@ msgid "" "different from a zero-length match." msgstr "" -#: ../../library/re.rst:1051 ../../library/re.rst:1069 +#: ../../library/re.rst:1041 ../../library/re.rst:1059 msgid "" "The optional *pos* and *endpos* parameters have the same meaning as for the :" "meth:`~Pattern.search` method. ::" msgstr "" -#: ../../library/re.rst:1059 +#: ../../library/re.rst:1049 msgid "" "If you want to locate a match anywhere in *string*, use :meth:`~Pattern." "search` instead (see also :ref:`search-vs-match`)." msgstr "" -#: ../../library/re.rst:1065 +#: ../../library/re.rst:1055 msgid "" "If the whole *string* matches this regular expression, return a " "corresponding :ref:`match object `. Return ``None`` if the " @@ -1309,76 +1301,76 @@ msgid "" "length match." msgstr "" -#: ../../library/re.rst:1083 +#: ../../library/re.rst:1073 msgid "Identical to the :func:`split` function, using the compiled pattern." msgstr "" -#: ../../library/re.rst:1088 +#: ../../library/re.rst:1078 msgid "" "Similar to the :func:`findall` function, using the compiled pattern, but " "also accepts optional *pos* and *endpos* parameters that limit the search " "region like for :meth:`search`." msgstr "" -#: ../../library/re.rst:1095 +#: ../../library/re.rst:1085 msgid "" "Similar to the :func:`finditer` function, using the compiled pattern, but " "also accepts optional *pos* and *endpos* parameters that limit the search " "region like for :meth:`search`." msgstr "" -#: ../../library/re.rst:1102 +#: ../../library/re.rst:1092 msgid "Identical to the :func:`sub` function, using the compiled pattern." msgstr "" -#: ../../library/re.rst:1107 +#: ../../library/re.rst:1097 msgid "Identical to the :func:`subn` function, using the compiled pattern." msgstr "" -#: ../../library/re.rst:1112 +#: ../../library/re.rst:1102 msgid "" "The regex matching flags. This is a combination of the flags given to :func:" "`.compile`, any ``(?...)`` inline flags in the pattern, and implicit flags " "such as :data:`UNICODE` if the pattern is a Unicode string." msgstr "" -#: ../../library/re.rst:1119 +#: ../../library/re.rst:1109 msgid "The number of capturing groups in the pattern." msgstr "" -#: ../../library/re.rst:1124 +#: ../../library/re.rst:1114 msgid "" "A dictionary mapping any symbolic group names defined by ``(?P)`` to " "group numbers. The dictionary is empty if no symbolic groups were used in " "the pattern." msgstr "" -#: ../../library/re.rst:1131 +#: ../../library/re.rst:1121 msgid "The pattern string from which the pattern object was compiled." msgstr "" -#: ../../library/re.rst:1134 +#: ../../library/re.rst:1124 msgid "" "Added support of :func:`copy.copy` and :func:`copy.deepcopy`. Compiled " "regular expression objects are considered atomic." msgstr "" -#: ../../library/re.rst:1142 +#: ../../library/re.rst:1132 msgid "Match Objects" msgstr "" -#: ../../library/re.rst:1144 +#: ../../library/re.rst:1134 msgid "" "Match objects always have a boolean value of ``True``. Since :meth:`~Pattern." "match` and :meth:`~Pattern.search` return ``None`` when there is no match, " "you can test whether there was a match with a simple ``if`` statement::" msgstr "" -#: ../../library/re.rst:1153 +#: ../../library/re.rst:1143 msgid "Match objects support the following methods and attributes:" msgstr "" -#: ../../library/re.rst:1158 +#: ../../library/re.rst:1148 msgid "" "Return the string obtained by doing backslash substitution on the template " "string *template*, as done by the :meth:`~Pattern.sub` method. Escapes such " @@ -1387,7 +1379,7 @@ msgid "" "\\g``) are replaced by the contents of the corresponding group." msgstr "" -#: ../../library/re.rst:1170 +#: ../../library/re.rst:1160 msgid "" "Returns one or more subgroups of the match. If there is a single argument, " "the result is a single string; if there are multiple arguments, the result " @@ -1402,7 +1394,7 @@ msgid "" "the pattern that matched multiple times, the last match is returned. ::" msgstr "" -#: ../../library/re.rst:1192 +#: ../../library/re.rst:1182 msgid "" "If the regular expression uses the ``(?P...)`` syntax, the *groupN* " "arguments may also be strings identifying groups by their group name. If a " @@ -1410,50 +1402,50 @@ msgid "" "`IndexError` exception is raised." msgstr "" -#: ../../library/re.rst:1197 +#: ../../library/re.rst:1187 msgid "A moderately complicated example::" msgstr "" -#: ../../library/re.rst:1205 +#: ../../library/re.rst:1195 msgid "Named groups can also be referred to by their index::" msgstr "" -#: ../../library/re.rst:1212 +#: ../../library/re.rst:1202 msgid "If a group matches multiple times, only the last match is accessible::" msgstr "" -#: ../../library/re.rst:1221 +#: ../../library/re.rst:1211 msgid "" "This is identical to ``m.group(g)``. This allows easier access to an " "individual group from a match::" msgstr "" -#: ../../library/re.rst:1237 +#: ../../library/re.rst:1227 msgid "" "Return a tuple containing all the subgroups of the match, from 1 up to " "however many groups are in the pattern. The *default* argument is used for " "groups that did not participate in the match; it defaults to ``None``." msgstr "" -#: ../../library/re.rst:1241 ../../library/re.rst:1463 +#: ../../library/re.rst:1231 ../../library/re.rst:1453 msgid "For example::" msgstr "" -#: ../../library/re.rst:1247 +#: ../../library/re.rst:1237 msgid "" "If we make the decimal place and everything after it optional, not all " "groups might participate in the match. These groups will default to " "``None`` unless the *default* argument is given::" msgstr "" -#: ../../library/re.rst:1260 +#: ../../library/re.rst:1250 msgid "" "Return a dictionary containing all the *named* subgroups of the match, keyed " "by the subgroup name. The *default* argument is used for groups that did " "not participate in the match; it defaults to ``None``. For example::" msgstr "" -#: ../../library/re.rst:1272 +#: ../../library/re.rst:1262 msgid "" "Return the indices of the start and end of the substring matched by *group*; " "*group* defaults to zero (meaning the whole matched substring). Return " @@ -1462,7 +1454,7 @@ msgid "" "matched by group *g* (equivalent to ``m.group(g)``) is ::" msgstr "" -#: ../../library/re.rst:1280 +#: ../../library/re.rst:1270 msgid "" "Note that ``m.start(group)`` will equal ``m.end(group)`` if *group* matched " "a null string. For example, after ``m = re.search('b(c?)', 'cba')``, ``m." @@ -1470,32 +1462,32 @@ msgid "" "2, and ``m.start(2)`` raises an :exc:`IndexError` exception." msgstr "" -#: ../../library/re.rst:1285 +#: ../../library/re.rst:1275 msgid "An example that will remove *remove_this* from email addresses::" msgstr "" -#: ../../library/re.rst:1295 +#: ../../library/re.rst:1285 msgid "" "For a match *m*, return the 2-tuple ``(m.start(group), m.end(group))``. Note " "that if *group* did not contribute to the match, this is ``(-1, -1)``. " "*group* defaults to zero, the entire match." msgstr "" -#: ../../library/re.rst:1302 +#: ../../library/re.rst:1292 msgid "" "The value of *pos* which was passed to the :meth:`~Pattern.search` or :meth:" "`~Pattern.match` method of a :ref:`regex object `. This is the " "index into the string at which the RE engine started looking for a match." msgstr "" -#: ../../library/re.rst:1309 +#: ../../library/re.rst:1299 msgid "" "The value of *endpos* which was passed to the :meth:`~Pattern.search` or :" "meth:`~Pattern.match` method of a :ref:`regex object `. This is " "the index into the string beyond which the RE engine will not go." msgstr "" -#: ../../library/re.rst:1316 +#: ../../library/re.rst:1306 msgid "" "The integer index of the last matched capturing group, or ``None`` if no " "group was matched at all. For example, the expressions ``(a)b``, ``((a)" @@ -1504,43 +1496,43 @@ msgid "" "applied to the same string." msgstr "" -#: ../../library/re.rst:1325 +#: ../../library/re.rst:1315 msgid "" "The name of the last matched capturing group, or ``None`` if the group " "didn't have a name, or if no group was matched at all." msgstr "" -#: ../../library/re.rst:1331 +#: ../../library/re.rst:1321 msgid "" "The :ref:`regular expression object ` whose :meth:`~Pattern." "match` or :meth:`~Pattern.search` method produced this match instance." msgstr "" -#: ../../library/re.rst:1337 +#: ../../library/re.rst:1327 msgid "The string passed to :meth:`~Pattern.match` or :meth:`~Pattern.search`." msgstr "" -#: ../../library/re.rst:1340 +#: ../../library/re.rst:1330 msgid "" "Added support of :func:`copy.copy` and :func:`copy.deepcopy`. Match objects " "are considered atomic." msgstr "" -#: ../../library/re.rst:1348 +#: ../../library/re.rst:1338 msgid "Regular Expression Examples" msgstr "" -#: ../../library/re.rst:1352 +#: ../../library/re.rst:1342 msgid "Checking for a Pair" msgstr "" -#: ../../library/re.rst:1354 +#: ../../library/re.rst:1344 msgid "" "In this example, we'll use the following helper function to display match " "objects a little more gracefully::" msgstr "" -#: ../../library/re.rst:1362 +#: ../../library/re.rst:1352 msgid "" "Suppose you are writing a poker program where a player's hand is represented " "as a 5-character string with each character representing a card, \"a\" for " @@ -1548,28 +1540,28 @@ msgid "" "\"2\" through \"9\" representing the card with that value." msgstr "" -#: ../../library/re.rst:1367 +#: ../../library/re.rst:1357 msgid "To see if a given string is a valid hand, one could do the following::" msgstr "" -#: ../../library/re.rst:1377 +#: ../../library/re.rst:1367 msgid "" "That last hand, ``\"727ak\"``, contained a pair, or two of the same valued " "cards. To match this with a regular expression, one could use backreferences " "as such::" msgstr "" -#: ../../library/re.rst:1387 +#: ../../library/re.rst:1377 msgid "" "To find out what card the pair consists of, one could use the :meth:`~Match." "group` method of the match object in the following manner::" msgstr "" -#: ../../library/re.rst:1406 +#: ../../library/re.rst:1396 msgid "Simulating scanf()" msgstr "" -#: ../../library/re.rst:1410 +#: ../../library/re.rst:1400 msgid "" "Python does not currently have an equivalent to :c:func:`scanf`. Regular " "expressions are generally more powerful, though also more verbose, than :c:" @@ -1578,99 +1570,99 @@ msgid "" "expressions." msgstr "" -#: ../../library/re.rst:1417 +#: ../../library/re.rst:1407 msgid ":c:func:`scanf` Token" msgstr "" -#: ../../library/re.rst:1417 +#: ../../library/re.rst:1407 msgid "Regular Expression" msgstr "" -#: ../../library/re.rst:1419 +#: ../../library/re.rst:1409 msgid "``%c``" msgstr "" -#: ../../library/re.rst:1421 +#: ../../library/re.rst:1411 msgid "``%5c``" msgstr "" -#: ../../library/re.rst:1421 +#: ../../library/re.rst:1411 msgid "``.{5}``" msgstr "" -#: ../../library/re.rst:1423 +#: ../../library/re.rst:1413 msgid "``%d``" msgstr "" -#: ../../library/re.rst:1423 +#: ../../library/re.rst:1413 msgid "``[-+]?\\d+``" msgstr "" -#: ../../library/re.rst:1425 +#: ../../library/re.rst:1415 msgid "``%e``, ``%E``, ``%f``, ``%g``" msgstr "" -#: ../../library/re.rst:1425 +#: ../../library/re.rst:1415 msgid "``[-+]?(\\d+(\\.\\d*)?|\\.\\d+)([eE][-+]?\\d+)?``" msgstr "" -#: ../../library/re.rst:1427 +#: ../../library/re.rst:1417 msgid "``%i``" msgstr "" -#: ../../library/re.rst:1427 +#: ../../library/re.rst:1417 msgid "``[-+]?(0[xX][\\dA-Fa-f]+|0[0-7]*|\\d+)``" msgstr "" -#: ../../library/re.rst:1429 +#: ../../library/re.rst:1419 msgid "``%o``" msgstr "" -#: ../../library/re.rst:1429 +#: ../../library/re.rst:1419 msgid "``[-+]?[0-7]+``" msgstr "" -#: ../../library/re.rst:1431 +#: ../../library/re.rst:1421 msgid "``%s``" msgstr "" -#: ../../library/re.rst:1431 +#: ../../library/re.rst:1421 msgid "``\\S+``" msgstr "" -#: ../../library/re.rst:1433 +#: ../../library/re.rst:1423 msgid "``%u``" msgstr "" -#: ../../library/re.rst:1433 +#: ../../library/re.rst:1423 msgid "``\\d+``" msgstr "" -#: ../../library/re.rst:1435 +#: ../../library/re.rst:1425 msgid "``%x``, ``%X``" msgstr "" -#: ../../library/re.rst:1435 +#: ../../library/re.rst:1425 msgid "``[-+]?(0[xX])?[\\dA-Fa-f]+``" msgstr "" -#: ../../library/re.rst:1438 +#: ../../library/re.rst:1428 msgid "To extract the filename and numbers from a string like ::" msgstr "" -#: ../../library/re.rst:1442 +#: ../../library/re.rst:1432 msgid "you would use a :c:func:`scanf` format like ::" msgstr "" -#: ../../library/re.rst:1446 +#: ../../library/re.rst:1436 msgid "The equivalent regular expression would be ::" msgstr "" -#: ../../library/re.rst:1454 +#: ../../library/re.rst:1444 msgid "search() vs. match()" msgstr "" -#: ../../library/re.rst:1458 +#: ../../library/re.rst:1448 msgid "" "Python offers two different primitive operations based on regular " "expressions: :func:`re.match` checks for a match only at the beginning of " @@ -1678,13 +1670,13 @@ msgid "" "string (this is what Perl does by default)." msgstr "" -#: ../../library/re.rst:1469 +#: ../../library/re.rst:1459 msgid "" "Regular expressions beginning with ``'^'`` can be used with :func:`search` " "to restrict the match at the beginning of the string::" msgstr "" -#: ../../library/re.rst:1477 +#: ../../library/re.rst:1467 msgid "" "Note however that in :const:`MULTILINE` mode :func:`match` only matches at " "the beginning of the string, whereas using :func:`search` with a regular " @@ -1692,11 +1684,11 @@ msgid "" "line. ::" msgstr "" -#: ../../library/re.rst:1487 +#: ../../library/re.rst:1477 msgid "Making a Phonebook" msgstr "" -#: ../../library/re.rst:1489 +#: ../../library/re.rst:1479 msgid "" ":func:`split` splits a string into a list delimited by the passed pattern. " "The method is invaluable for converting textual data into data structures " @@ -1704,37 +1696,37 @@ msgid "" "following example that creates a phonebook." msgstr "" -#: ../../library/re.rst:1494 +#: ../../library/re.rst:1484 msgid "" "First, here is the input. Normally it may come from a file, here we are " "using triple-quoted string syntax" msgstr "" -#: ../../library/re.rst:1507 +#: ../../library/re.rst:1497 msgid "" "The entries are separated by one or more newlines. Now we convert the string " "into a list with each nonempty line having its own entry:" msgstr "" -#: ../../library/re.rst:1520 +#: ../../library/re.rst:1510 msgid "" "Finally, split each entry into a list with first name, last name, telephone " "number, and address. We use the ``maxsplit`` parameter of :func:`split` " "because the address has spaces, our splitting pattern, in it:" msgstr "" -#: ../../library/re.rst:1533 +#: ../../library/re.rst:1523 msgid "" "The ``:?`` pattern matches the colon after the last name, so that it does " "not occur in the result list. With a ``maxsplit`` of ``4``, we could " "separate the house number from the street name:" msgstr "" -#: ../../library/re.rst:1548 +#: ../../library/re.rst:1538 msgid "Text Munging" msgstr "" -#: ../../library/re.rst:1550 +#: ../../library/re.rst:1540 msgid "" ":func:`sub` replaces every occurrence of a pattern with a string or the " "result of a function. This example demonstrates using :func:`sub` with a " @@ -1742,11 +1734,11 @@ msgid "" "each word of a sentence except for the first and last characters::" msgstr "" -#: ../../library/re.rst:1567 +#: ../../library/re.rst:1557 msgid "Finding all Adverbs" msgstr "" -#: ../../library/re.rst:1569 +#: ../../library/re.rst:1559 msgid "" ":func:`findall` matches *all* occurrences of a pattern, not just the first " "one as :func:`search` does. For example, if a writer wanted to find all of " @@ -1754,11 +1746,11 @@ msgid "" "manner::" msgstr "" -#: ../../library/re.rst:1580 +#: ../../library/re.rst:1570 msgid "Finding all Adverbs and their Positions" msgstr "" -#: ../../library/re.rst:1582 +#: ../../library/re.rst:1572 msgid "" "If one wants more information about all matches of a pattern than the " "matched text, :func:`finditer` is useful as it provides :ref:`match objects " @@ -1767,11 +1759,11 @@ msgid "" "text, they would use :func:`finditer` in the following manner::" msgstr "" -#: ../../library/re.rst:1596 +#: ../../library/re.rst:1586 msgid "Raw String Notation" msgstr "" -#: ../../library/re.rst:1598 +#: ../../library/re.rst:1588 msgid "" "Raw string notation (``r\"text\"``) keeps regular expressions sane. Without " "it, every backslash (``'\\'``) in a regular expression would have to be " @@ -1779,7 +1771,7 @@ msgid "" "lines of code are functionally identical::" msgstr "" -#: ../../library/re.rst:1608 +#: ../../library/re.rst:1598 msgid "" "When one wants to match a literal backslash, it must be escaped in the " "regular expression. With raw string notation, this means ``r\"\\\\\"``. " @@ -1787,29 +1779,29 @@ msgid "" "following lines of code functionally identical::" msgstr "" -#: ../../library/re.rst:1620 +#: ../../library/re.rst:1610 msgid "Writing a Tokenizer" msgstr "" -#: ../../library/re.rst:1622 +#: ../../library/re.rst:1612 msgid "" "A `tokenizer or scanner `_ " "analyzes a string to categorize groups of characters. This is a useful " "first step in writing a compiler or interpreter." msgstr "" -#: ../../library/re.rst:1626 +#: ../../library/re.rst:1616 msgid "" "The text categories are specified with regular expressions. The technique " "is to combine those into a single master regular expression and to loop over " "successive matches::" msgstr "" -#: ../../library/re.rst:1682 +#: ../../library/re.rst:1672 msgid "The tokenizer produces the following output::" msgstr "" -#: ../../library/re.rst:1705 +#: ../../library/re.rst:1695 msgid "" "Friedl, Jeffrey. Mastering Regular Expressions. 3rd ed., O'Reilly Media, " "2009. The third edition of the book no longer covers Python at all, but the " diff --git a/library/resource.po b/library/resource.po index 52721f9ef4..593cb9fb21 100644 --- a/library/resource.po +++ b/library/resource.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.7\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2021-09-07 06:52+0000\n" +"POT-Creation-Date: 2020-06-20 18:08+0800\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-" @@ -139,7 +139,7 @@ msgid "" "process." msgstr "" -#: ../../library/resource.rst:100 +#: ../../library/resource.rst:101 msgid "" "Raises an :ref:`auditing event ` ``resource.prlimit`` with " "arguments ``pid``, ``resource``, ``limits``." @@ -268,8 +268,8 @@ msgid "" "this user may hold at any time." msgstr "" -#: ../../library/resource.rst:236 ../../library/resource.rst:249 -#: ../../library/resource.rst:257 +#: ../../library/resource.rst:236 ../../library/resource.rst:247 +#: ../../library/resource.rst:255 msgid ":ref:`Availability `: FreeBSD 9 or later." msgstr "" @@ -277,24 +277,23 @@ msgstr "" msgid "" "The maximum size (in bytes) of the swap space that may be reserved or used " "by all of this user id's processes. This limit is enforced only if bit 1 of " -"the vm.overcommit sysctl is set. Please see `tuning(7) `__ for a complete description of " -"this sysctl." +"the vm.overcommit sysctl is set. Please see :manpage:`tuning(7)` for a " +"complete description of this sysctl." msgstr "" -#: ../../library/resource.rst:254 +#: ../../library/resource.rst:252 msgid "The maximum number of pseudo-terminals created by this user id." msgstr "" -#: ../../library/resource.rst:261 +#: ../../library/resource.rst:259 msgid "Resource Usage" msgstr "" -#: ../../library/resource.rst:263 +#: ../../library/resource.rst:261 msgid "These functions are used to retrieve resource usage information:" msgstr "" -#: ../../library/resource.rst:268 +#: ../../library/resource.rst:266 msgid "" "This function returns an object that describes the resources consumed by " "either the current process or its children, as specified by the *who* " @@ -302,11 +301,11 @@ msgid "" "`RUSAGE_\\*` constants described below." msgstr "" -#: ../../library/resource.rst:273 +#: ../../library/resource.rst:271 msgid "A simple example::" msgstr "" -#: ../../library/resource.rst:287 +#: ../../library/resource.rst:285 msgid "" "The fields of the return value each describe how a particular system " "resource has been used, e.g. amount of time spent running is user mode or " @@ -315,13 +314,13 @@ msgid "" "is using." msgstr "" -#: ../../library/resource.rst:292 +#: ../../library/resource.rst:290 msgid "" "For backward compatibility, the return value is also accessible as a tuple " "of 16 elements." msgstr "" -#: ../../library/resource.rst:295 +#: ../../library/resource.rst:293 msgid "" "The fields :attr:`ru_utime` and :attr:`ru_stime` of the return value are " "floating point values representing the amount of time spent executing in " @@ -331,249 +330,249 @@ msgid "" "summary is presented here:" msgstr "" -#: ../../library/resource.rst:302 +#: ../../library/resource.rst:300 msgid "Index" msgstr "" -#: ../../library/resource.rst:302 +#: ../../library/resource.rst:300 msgid "Field" msgstr "" -#: ../../library/resource.rst:302 +#: ../../library/resource.rst:300 msgid "Resource" msgstr "" -#: ../../library/resource.rst:304 +#: ../../library/resource.rst:302 msgid "``0``" msgstr "" -#: ../../library/resource.rst:304 +#: ../../library/resource.rst:302 msgid ":attr:`ru_utime`" msgstr "" -#: ../../library/resource.rst:304 +#: ../../library/resource.rst:302 msgid "time in user mode (float seconds)" msgstr "" -#: ../../library/resource.rst:306 +#: ../../library/resource.rst:304 msgid "``1``" msgstr "" -#: ../../library/resource.rst:306 +#: ../../library/resource.rst:304 msgid ":attr:`ru_stime`" msgstr "" -#: ../../library/resource.rst:306 +#: ../../library/resource.rst:304 msgid "time in system mode (float seconds)" msgstr "" -#: ../../library/resource.rst:308 +#: ../../library/resource.rst:306 msgid "``2``" msgstr "" -#: ../../library/resource.rst:308 +#: ../../library/resource.rst:306 msgid ":attr:`ru_maxrss`" msgstr "" -#: ../../library/resource.rst:308 +#: ../../library/resource.rst:306 msgid "maximum resident set size" msgstr "" -#: ../../library/resource.rst:310 +#: ../../library/resource.rst:308 msgid "``3``" msgstr "" -#: ../../library/resource.rst:310 +#: ../../library/resource.rst:308 msgid ":attr:`ru_ixrss`" msgstr "" -#: ../../library/resource.rst:310 +#: ../../library/resource.rst:308 msgid "shared memory size" msgstr "" -#: ../../library/resource.rst:312 +#: ../../library/resource.rst:310 msgid "``4``" msgstr "" -#: ../../library/resource.rst:312 +#: ../../library/resource.rst:310 msgid ":attr:`ru_idrss`" msgstr "" -#: ../../library/resource.rst:312 +#: ../../library/resource.rst:310 msgid "unshared memory size" msgstr "" -#: ../../library/resource.rst:314 +#: ../../library/resource.rst:312 msgid "``5``" msgstr "" -#: ../../library/resource.rst:314 +#: ../../library/resource.rst:312 msgid ":attr:`ru_isrss`" msgstr "" -#: ../../library/resource.rst:314 +#: ../../library/resource.rst:312 msgid "unshared stack size" msgstr "" -#: ../../library/resource.rst:316 +#: ../../library/resource.rst:314 msgid "``6``" msgstr "" -#: ../../library/resource.rst:316 +#: ../../library/resource.rst:314 msgid ":attr:`ru_minflt`" msgstr "" -#: ../../library/resource.rst:316 +#: ../../library/resource.rst:314 msgid "page faults not requiring I/O" msgstr "" -#: ../../library/resource.rst:318 +#: ../../library/resource.rst:316 msgid "``7``" msgstr "" -#: ../../library/resource.rst:318 +#: ../../library/resource.rst:316 msgid ":attr:`ru_majflt`" msgstr "" -#: ../../library/resource.rst:318 +#: ../../library/resource.rst:316 msgid "page faults requiring I/O" msgstr "" -#: ../../library/resource.rst:320 +#: ../../library/resource.rst:318 msgid "``8``" msgstr "" -#: ../../library/resource.rst:320 +#: ../../library/resource.rst:318 msgid ":attr:`ru_nswap`" msgstr "" -#: ../../library/resource.rst:320 +#: ../../library/resource.rst:318 msgid "number of swap outs" msgstr "" -#: ../../library/resource.rst:322 +#: ../../library/resource.rst:320 msgid "``9``" msgstr "" -#: ../../library/resource.rst:322 +#: ../../library/resource.rst:320 msgid ":attr:`ru_inblock`" msgstr "" -#: ../../library/resource.rst:322 +#: ../../library/resource.rst:320 msgid "block input operations" msgstr "" -#: ../../library/resource.rst:324 +#: ../../library/resource.rst:322 msgid "``10``" msgstr "" -#: ../../library/resource.rst:324 +#: ../../library/resource.rst:322 msgid ":attr:`ru_oublock`" msgstr "" -#: ../../library/resource.rst:324 +#: ../../library/resource.rst:322 msgid "block output operations" msgstr "" -#: ../../library/resource.rst:326 +#: ../../library/resource.rst:324 msgid "``11``" msgstr "" -#: ../../library/resource.rst:326 +#: ../../library/resource.rst:324 msgid ":attr:`ru_msgsnd`" msgstr "" -#: ../../library/resource.rst:326 +#: ../../library/resource.rst:324 msgid "messages sent" msgstr "" -#: ../../library/resource.rst:328 +#: ../../library/resource.rst:326 msgid "``12``" msgstr "" -#: ../../library/resource.rst:328 +#: ../../library/resource.rst:326 msgid ":attr:`ru_msgrcv`" msgstr "" -#: ../../library/resource.rst:328 +#: ../../library/resource.rst:326 msgid "messages received" msgstr "" -#: ../../library/resource.rst:330 +#: ../../library/resource.rst:328 msgid "``13``" msgstr "" -#: ../../library/resource.rst:330 +#: ../../library/resource.rst:328 msgid ":attr:`ru_nsignals`" msgstr "" -#: ../../library/resource.rst:330 +#: ../../library/resource.rst:328 msgid "signals received" msgstr "" -#: ../../library/resource.rst:332 +#: ../../library/resource.rst:330 msgid "``14``" msgstr "" -#: ../../library/resource.rst:332 +#: ../../library/resource.rst:330 msgid ":attr:`ru_nvcsw`" msgstr "" -#: ../../library/resource.rst:332 +#: ../../library/resource.rst:330 msgid "voluntary context switches" msgstr "" -#: ../../library/resource.rst:334 +#: ../../library/resource.rst:332 msgid "``15``" msgstr "" -#: ../../library/resource.rst:334 +#: ../../library/resource.rst:332 msgid ":attr:`ru_nivcsw`" msgstr "" -#: ../../library/resource.rst:334 +#: ../../library/resource.rst:332 msgid "involuntary context switches" msgstr "" -#: ../../library/resource.rst:337 +#: ../../library/resource.rst:335 msgid "" "This function will raise a :exc:`ValueError` if an invalid *who* parameter " "is specified. It may also raise :exc:`error` exception in unusual " "circumstances." msgstr "" -#: ../../library/resource.rst:343 +#: ../../library/resource.rst:341 msgid "" "Returns the number of bytes in a system page. (This need not be the same as " "the hardware page size.)" msgstr "" -#: ../../library/resource.rst:346 +#: ../../library/resource.rst:344 msgid "" "The following :const:`RUSAGE_\\*` symbols are passed to the :func:" "`getrusage` function to specify which processes information should be " "provided for." msgstr "" -#: ../../library/resource.rst:352 +#: ../../library/resource.rst:350 msgid "" "Pass to :func:`getrusage` to request resources consumed by the calling " "process, which is the sum of resources used by all threads in the process." msgstr "" -#: ../../library/resource.rst:358 +#: ../../library/resource.rst:356 msgid "" "Pass to :func:`getrusage` to request resources consumed by child processes " "of the calling process which have been terminated and waited for." msgstr "" -#: ../../library/resource.rst:364 +#: ../../library/resource.rst:362 msgid "" "Pass to :func:`getrusage` to request resources consumed by both the current " "process and child processes. May not be available on all systems." msgstr "" -#: ../../library/resource.rst:370 +#: ../../library/resource.rst:368 msgid "" "Pass to :func:`getrusage` to request resources consumed by the current " "thread. May not be available on all systems." diff --git a/library/secrets.po b/library/secrets.po index f002d624f8..172eee20dd 100644 --- a/library/secrets.po +++ b/library/secrets.po @@ -8,9 +8,8 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.7\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2021-09-07 06:52+0000\n" +"POT-Creation-Date: 2020-06-20 18:08+0800\n" "PO-Revision-Date: 2021-03-10 23:40+0800\n" -"Last-Translator: \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" "tw)\n" "Language: zh_TW\n" @@ -18,6 +17,7 @@ msgstr "" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" "Plural-Forms: nplurals=1; plural=0;\n" +"Last-Translator: \n" "X-Generator: Poedit 2.4.2\n" #: ../../library/secrets.rst:2 @@ -43,8 +43,8 @@ msgid "" "pseudo-random number generator in the :mod:`random` module, which is " "designed for modelling and simulation, not security or cryptography." msgstr "" -"尤其應優先使用 :mod:`secrets` 作為預設來替代 :mod:`random` 模組中的預設偽亂數" -"產生器(pseudo-random number generator),該模組被設計用於建模和模擬,而非用" +"尤其應優先使用 :mod:`secrets` 作為預設來替代 :mod:`random` 模組中的預設偽亂" +"數產生器(pseudo-random number generator),該模組被設計用於建模和模擬,而非用" "於安全性和加密。" #: ../../library/secrets.rst:30 @@ -59,7 +59,8 @@ msgstr "亂數" msgid "" "The :mod:`secrets` module provides access to the most secure source of " "randomness that your operating system provides." -msgstr " :mod:`secrets` 模組使你得以存取作業系統所提供安全性最高的亂數產生器。" +msgstr "" +" :mod:`secrets` 模組使你得以存取作業系統所提供安全性最高的亂數產生器。" #: ../../library/secrets.rst:41 msgid "" @@ -109,9 +110,9 @@ msgid "" "bytes, each byte converted to two hex digits. If *nbytes* is ``None`` or " "not supplied, a reasonable default is used." msgstr "" -"回傳一以十六進位表示的隨機字串。 字串具有 *nbytes* 個隨機位元組,每個位元組會" -"轉成兩個十六進位的數字。 如果 *nbytes* 為 ``None`` 或未提供,則會使用一個合理" -"的預設值。" +"回傳一以十六進位表示的隨機字串。 字串具有 *nbytes* 個隨機位" +"元組,每個位元組會轉成兩個十六進位的數字。 如果 *nbytes* 為 ``None`` " +"或未提供,則會使用一個合理的預設值。" #: ../../library/secrets.rst:90 msgid "" @@ -152,8 +153,8 @@ msgid "" "the number of bytes of randomness to use." msgstr "" "對於想自行管理權杖長度的使用者,你可以對各種 ``token_*`` 函式明白地指定 :" -"class:`int` 引數(argument)來指定權杖要使用的隨機性程度。 該引數以位元組數來" -"表示要使用的隨機性程度。" +"class:`int` 引數(argument)來指定權杖要使用的隨機性程度。 該引" +"數以位元組數來表示要使用的隨機性程度。" #: ../../library/secrets.rst:117 msgid "" @@ -207,8 +208,8 @@ msgid "" "(irreversible) hash function." msgstr "" "應用程式不能 `以可復原的格式存儲密碼 `_,無論是用純文本還是經過加密。 它們應當先加鹽" -"(salt),再使用高加密強度的單向(不可逆)雜湊函數來產生雜湊值。" +"definitions/257.html>`_,無論是用純文本還是經過加密。 它們應當先加鹽(salt),再使用" +"高加密強度的單向(不可逆)雜湊函數來產生雜湊值。" #: ../../library/secrets.rst:161 msgid "" diff --git a/library/security_warnings.po b/library/security_warnings.po deleted file mode 100644 index 866d0ad2e9..0000000000 --- a/library/security_warnings.po +++ /dev/null @@ -1,96 +0,0 @@ -# SOME DESCRIPTIVE TITLE. -# Copyright (C) 2001-2021, Python Software Foundation -# This file is distributed under the same license as the Python package. -# FIRST AUTHOR , YEAR. -# -#, fuzzy -msgid "" -msgstr "" -"Project-Id-Version: Python 3.9\n" -"Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2021-09-07 06:52+0000\n" -"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" -"Last-Translator: FULL NAME \n" -"Language-Team: LANGUAGE \n" -"MIME-Version: 1.0\n" -"Content-Type: text/plain; charset=UTF-8\n" -"Content-Transfer-Encoding: 8bit\n" - -#: ../../library/security_warnings.rst:6 -msgid "Security Considerations" -msgstr "" - -#: ../../library/security_warnings.rst:8 -msgid "The following modules have specific security considerations:" -msgstr "" - -#: ../../library/security_warnings.rst:10 -msgid ":mod:`cgi`: :ref:`CGI security considerations `" -msgstr "" - -#: ../../library/security_warnings.rst:11 -msgid "" -":mod:`hashlib`: :ref:`all constructors take a \"usedforsecurity\" keyword-" -"only argument disabling known insecure and blocked algorithms `" -msgstr "" - -#: ../../library/security_warnings.rst:14 -msgid "" -":mod:`http.server` is not suitable for production use, only implementing " -"basic security checks" -msgstr "" - -#: ../../library/security_warnings.rst:16 -msgid "" -":mod:`logging`: :ref:`Logging configuration uses eval() `" -msgstr "" - -#: ../../library/security_warnings.rst:18 -msgid "" -":mod:`multiprocessing`: :ref:`Connection.recv() uses pickle `" -msgstr "" - -#: ../../library/security_warnings.rst:20 -msgid ":mod:`pickle`: :ref:`Restricting globals in pickle `" -msgstr "" - -#: ../../library/security_warnings.rst:21 -msgid "" -":mod:`random` shouldn't be used for security purposes, use :mod:`secrets` " -"instead" -msgstr "" - -#: ../../library/security_warnings.rst:23 -msgid "" -":mod:`shelve`: :ref:`shelve is based on pickle and thus unsuitable for " -"dealing with untrusted sources `" -msgstr "" - -#: ../../library/security_warnings.rst:25 -msgid ":mod:`ssl`: :ref:`SSL/TLS security considerations `" -msgstr "" - -#: ../../library/security_warnings.rst:26 -msgid "" -":mod:`subprocess`: :ref:`Subprocess security considerations `" -msgstr "" - -#: ../../library/security_warnings.rst:28 -msgid "" -":mod:`tempfile`: :ref:`mktemp is deprecated due to vulnerability to race " -"conditions `" -msgstr "" - -#: ../../library/security_warnings.rst:30 -msgid ":mod:`xml`: :ref:`XML vulnerabilities `" -msgstr "" - -#: ../../library/security_warnings.rst:31 -msgid "" -":mod:`zipfile`: :ref:`maliciously prepared .zip files can cause disk volume " -"exhaustion `" -msgstr "" diff --git a/library/shelve.po b/library/shelve.po index 255af5d978..deb98ad2f5 100644 --- a/library/shelve.po +++ b/library/shelve.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.7\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2021-09-07 06:52+0000\n" +"POT-Creation-Date: 2018-06-26 18:54+0800\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-" @@ -74,26 +74,25 @@ msgid "" "`shelve.open` as a context manager::" msgstr "" -#: ../../library/shelve.rst:56 +#: ../../library/shelve.rst:54 msgid "" "Because the :mod:`shelve` module is backed by :mod:`pickle`, it is insecure " "to load a shelf from an untrusted source. Like with pickle, loading a shelf " "can execute arbitrary code." msgstr "" -#: ../../library/shelve.rst:60 +#: ../../library/shelve.rst:58 msgid "" -"Shelf objects support most of methods and operations supported by " -"dictionaries (except copying, constructors and operators ``|`` and ``|=``). " -"This eases the transition from dictionary based scripts to those requiring " -"persistent storage." +"Shelf objects support all methods supported by dictionaries. This eases the " +"transition from dictionary based scripts to those requiring persistent " +"storage." msgstr "" -#: ../../library/shelve.rst:64 +#: ../../library/shelve.rst:61 msgid "Two additional methods are supported:" msgstr "" -#: ../../library/shelve.rst:68 +#: ../../library/shelve.rst:65 msgid "" "Write back all entries in the cache if the shelf was opened with *writeback* " "set to :const:`True`. Also empty the cache and synchronize the persistent " @@ -101,24 +100,24 @@ msgid "" "shelf is closed with :meth:`close`." msgstr "" -#: ../../library/shelve.rst:75 +#: ../../library/shelve.rst:72 msgid "" "Synchronize and close the persistent *dict* object. Operations on a closed " "shelf will fail with a :exc:`ValueError`." msgstr "" -#: ../../library/shelve.rst:81 +#: ../../library/shelve.rst:78 msgid "" "`Persistent dictionary recipe `_ with widely supported storage formats and having the speed of native " "dictionaries." msgstr "" -#: ../../library/shelve.rst:87 +#: ../../library/shelve.rst:84 msgid "Restrictions" msgstr "" -#: ../../library/shelve.rst:93 +#: ../../library/shelve.rst:90 msgid "" "The choice of which database package will be used (such as :mod:`dbm.ndbm` " "or :mod:`dbm.gnu`) depends on which interface is available. Therefore it is " @@ -129,7 +128,7 @@ msgid "" "cause the database to refuse updates." msgstr "" -#: ../../library/shelve.rst:101 +#: ../../library/shelve.rst:98 msgid "" "The :mod:`shelve` module does not support *concurrent* read/write access to " "shelved objects. (Multiple simultaneous read accesses are safe.) When a " @@ -139,20 +138,20 @@ msgid "" "implementation used." msgstr "" -#: ../../library/shelve.rst:111 +#: ../../library/shelve.rst:108 msgid "" "A subclass of :class:`collections.abc.MutableMapping` which stores pickled " "values in the *dict* object." msgstr "" -#: ../../library/shelve.rst:114 +#: ../../library/shelve.rst:111 msgid "" "By default, version 3 pickles are used to serialize values. The version of " "the pickle protocol can be specified with the *protocol* parameter. See the :" "mod:`pickle` documentation for a discussion of the pickle protocols." msgstr "" -#: ../../library/shelve.rst:118 +#: ../../library/shelve.rst:115 msgid "" "If the *writeback* parameter is ``True``, the object will hold a cache of " "all entries accessed and write them back to the *dict* at sync and close " @@ -160,29 +159,29 @@ msgid "" "much more memory and make sync and close take a long time." msgstr "" -#: ../../library/shelve.rst:123 +#: ../../library/shelve.rst:120 msgid "" "The *keyencoding* parameter is the encoding used to encode keys before they " "are used with the underlying dict." msgstr "" -#: ../../library/shelve.rst:126 +#: ../../library/shelve.rst:123 msgid "" "A :class:`Shelf` object can also be used as a context manager, in which case " "it will be automatically closed when the :keyword:`with` block ends." msgstr "" -#: ../../library/shelve.rst:129 +#: ../../library/shelve.rst:126 msgid "" "Added the *keyencoding* parameter; previously, keys were always encoded in " "UTF-8." msgstr "" -#: ../../library/shelve.rst:133 +#: ../../library/shelve.rst:130 msgid "Added context manager support." msgstr "" -#: ../../library/shelve.rst:139 +#: ../../library/shelve.rst:136 msgid "" "A subclass of :class:`Shelf` which exposes :meth:`first`, :meth:`!next`, :" "meth:`previous`, :meth:`last` and :meth:`set_location` which are available " @@ -195,7 +194,7 @@ msgid "" "for the :class:`Shelf` class." msgstr "" -#: ../../library/shelve.rst:152 +#: ../../library/shelve.rst:149 msgid "" "A subclass of :class:`Shelf` which accepts a *filename* instead of a dict-" "like object. The underlying file will be opened using :func:`dbm.open`. By " @@ -205,28 +204,28 @@ msgid "" "same interpretation as for the :class:`Shelf` class." msgstr "" -#: ../../library/shelve.rst:163 +#: ../../library/shelve.rst:160 msgid "Example" msgstr "" -#: ../../library/shelve.rst:165 +#: ../../library/shelve.rst:162 msgid "" "To summarize the interface (``key`` is a string, ``data`` is an arbitrary " "object)::" msgstr "" -#: ../../library/shelve.rst:202 +#: ../../library/shelve.rst:199 msgid "Module :mod:`dbm`" msgstr "" -#: ../../library/shelve.rst:202 +#: ../../library/shelve.rst:199 msgid "Generic interface to ``dbm``-style databases." msgstr "" -#: ../../library/shelve.rst:204 +#: ../../library/shelve.rst:201 msgid "Module :mod:`pickle`" msgstr "" -#: ../../library/shelve.rst:205 +#: ../../library/shelve.rst:202 msgid "Object serialization used by :mod:`shelve`." msgstr "" diff --git a/library/shutil.po b/library/shutil.po index 086d071960..8d4c02b12f 100644 --- a/library/shutil.po +++ b/library/shutil.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.7\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2021-09-07 06:52+0000\n" +"POT-Creation-Date: 2020-06-20 18:08+0800\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-" @@ -92,8 +92,8 @@ msgid "" "link will be created instead of copying the file *src* points to." msgstr "" -#: ../../library/shutil.rst:70 ../../library/shutil.rst:176 -#: ../../library/shutil.rst:207 +#: ../../library/shutil.rst:71 ../../library/shutil.rst:177 +#: ../../library/shutil.rst:208 msgid "" "Raises an :ref:`auditing event ` ``shutil.copyfile`` with " "arguments ``src``, ``dst``." @@ -138,7 +138,7 @@ msgid "" "platform, and it is asked to do so, it will do nothing and return." msgstr "" -#: ../../library/shutil.rst:106 ../../library/shutil.rst:178 +#: ../../library/shutil.rst:107 ../../library/shutil.rst:179 msgid "" "Raises an :ref:`auditing event ` ``shutil.copymode`` with " "arguments ``src``, ``dst``." @@ -201,7 +201,7 @@ msgstr "" msgid "Please see :data:`os.supports_follow_symlinks` for more information." msgstr "" -#: ../../library/shutil.rst:153 ../../library/shutil.rst:209 +#: ../../library/shutil.rst:154 ../../library/shutil.rst:210 msgid "" "Raises an :ref:`auditing event ` ``shutil.copystat`` with " "arguments ``src``, ``dst``." @@ -215,9 +215,9 @@ msgstr "" #: ../../library/shutil.rst:160 msgid "" "Copies the file *src* to the file or directory *dst*. *src* and *dst* " -"should be :term:`path-like objects ` or strings. If *dst* " -"specifies a directory, the file will be copied into *dst* using the base " -"filename from *src*. Returns the path to the newly created file." +"should be strings. If *dst* specifies a directory, the file will be copied " +"into *dst* using the base filename from *src*. Returns the path to the " +"newly created file." msgstr "" #: ../../library/shutil.rst:165 @@ -335,7 +335,7 @@ msgid "" "that supports the same signature (like :func:`~shutil.copy`) can be used." msgstr "" -#: ../../library/shutil.rst:269 +#: ../../library/shutil.rst:270 msgid "" "Raises an :ref:`auditing event ` ``shutil.copytree`` with " "arguments ``src``, ``dst``." @@ -391,7 +391,7 @@ msgid "" "exc_info`. Exceptions raised by *onerror* will not be caught." msgstr "" -#: ../../library/shutil.rst:318 +#: ../../library/shutil.rst:319 msgid "" "Raises an :ref:`auditing event ` ``shutil.rmtree`` with argument " "``path``." @@ -440,7 +440,7 @@ msgstr "" #: ../../library/shutil.rst:351 msgid "" "If *copy_function* is given, it must be a callable that takes two arguments " -"*src* and *dst*, and will be used to copy *src* to *dst* if :func:`os." +"*src* and *dst*, and will be used to copy *src* to *dest* if :func:`os." "rename` cannot be used. If the source is a directory, :func:`copytree` is " "called, passing it the :func:`copy_function`. The default *copy_function* " "is :func:`copy2`. Using :func:`~shutil.copy` as the *copy_function* allows " @@ -448,7 +448,7 @@ msgid "" "the expense of not copying any of the metadata." msgstr "" -#: ../../library/shutil.rst:359 +#: ../../library/shutil.rst:360 msgid "" "Raises an :ref:`auditing event ` ``shutil.move`` with arguments " "``src``, ``dst``." @@ -497,7 +497,7 @@ msgstr "" msgid "See also :func:`os.chown`, the underlying function." msgstr "" -#: ../../library/shutil.rst:400 +#: ../../library/shutil.rst:401 msgid "" "Raises an :ref:`auditing event ` ``shutil.chown`` with arguments " "``path``, ``user``, ``group``." @@ -555,66 +555,66 @@ msgstr "" #: ../../library/shutil.rst:446 msgid "" -"Starting from Python 3.8, all functions involving a file copy (:func:" -"`copyfile`, :func:`~shutil.copy`, :func:`copy2`, :func:`copytree`, and :func:" -"`move`) may use platform-specific \"fast-copy\" syscalls in order to copy " -"the file more efficiently (see :issue:`33671`). \"fast-copy\" means that the " -"copying operation occurs within the kernel, avoiding the use of userspace " -"buffers in Python as in \"``outfd.write(infd.read())``\"." +"Starting from Python 3.8 all functions involving a file copy (:func:" +"`copyfile`, :func:`copy`, :func:`copy2`, :func:`copytree`, and :func:`move`) " +"may use platform-specific \"fast-copy\" syscalls in order to copy the file " +"more efficiently (see :issue:`33671`). \"fast-copy\" means that the copying " +"operation occurs within the kernel, avoiding the use of userspace buffers in " +"Python as in \"``outfd.write(infd.read())``\"." msgstr "" -#: ../../library/shutil.rst:454 +#: ../../library/shutil.rst:453 msgid "On macOS `fcopyfile`_ is used to copy the file content (not metadata)." msgstr "" -#: ../../library/shutil.rst:456 +#: ../../library/shutil.rst:455 msgid "On Linux :func:`os.sendfile` is used." msgstr "" -#: ../../library/shutil.rst:458 +#: ../../library/shutil.rst:457 msgid "" "On Windows :func:`shutil.copyfile` uses a bigger default buffer size (1 MiB " "instead of 64 KiB) and a :func:`memoryview`-based variant of :func:`shutil." "copyfileobj` is used." msgstr "" -#: ../../library/shutil.rst:462 +#: ../../library/shutil.rst:461 msgid "" "If the fast-copy operation fails and no data was written in the destination " "file then shutil will silently fallback on using less efficient :func:" "`copyfileobj` function internally." msgstr "" -#: ../../library/shutil.rst:471 +#: ../../library/shutil.rst:470 msgid "copytree example" msgstr "" -#: ../../library/shutil.rst:473 +#: ../../library/shutil.rst:472 msgid "" "This example is the implementation of the :func:`copytree` function, " "described above, with the docstring omitted. It demonstrates many of the " "other functions provided by this module. ::" msgstr "" -#: ../../library/shutil.rst:508 +#: ../../library/shutil.rst:507 msgid "Another example that uses the :func:`ignore_patterns` helper::" msgstr "" -#: ../../library/shutil.rst:514 +#: ../../library/shutil.rst:513 msgid "" "This will copy everything except ``.pyc`` files and files or directories " "whose name starts with ``tmp``." msgstr "" -#: ../../library/shutil.rst:517 +#: ../../library/shutil.rst:516 msgid "Another example that uses the *ignore* argument to add a logging call::" msgstr "" -#: ../../library/shutil.rst:532 +#: ../../library/shutil.rst:531 msgid "rmtree example" msgstr "" -#: ../../library/shutil.rst:534 +#: ../../library/shutil.rst:533 msgid "" "This example shows how to remove a directory tree on Windows where some of " "the files have their read-only bit set. It uses the onerror callback to " @@ -622,25 +622,25 @@ msgid "" "propagate. ::" msgstr "" -#: ../../library/shutil.rst:552 +#: ../../library/shutil.rst:551 msgid "Archiving operations" msgstr "" -#: ../../library/shutil.rst:556 +#: ../../library/shutil.rst:555 msgid "Added support for the *xztar* format." msgstr "" -#: ../../library/shutil.rst:560 +#: ../../library/shutil.rst:559 msgid "" "High-level utilities to create and read compressed and archived files are " "also provided. They rely on the :mod:`zipfile` and :mod:`tarfile` modules." msgstr "" -#: ../../library/shutil.rst:565 +#: ../../library/shutil.rst:564 msgid "Create an archive file (such as zip or tar) and return its name." msgstr "" -#: ../../library/shutil.rst:567 +#: ../../library/shutil.rst:566 msgid "" "*base_name* is the name of the file to create, including the path, minus any " "format-specific extension. *format* is the archive format: one of \"zip" @@ -649,14 +649,14 @@ msgid "" "available), or \"xztar\" (if the :mod:`lzma` module is available)." msgstr "" -#: ../../library/shutil.rst:573 +#: ../../library/shutil.rst:572 msgid "" "*root_dir* is a directory that will be the root directory of the archive, " "all paths in the archive will be relative to it; for example, we typically " "chdir into *root_dir* before creating the archive." msgstr "" -#: ../../library/shutil.rst:577 +#: ../../library/shutil.rst:576 msgid "" "*base_dir* is the directory where we start archiving from; i.e. *base_dir* " "will be the common prefix of all files and directories in the archive. " @@ -664,29 +664,29 @@ msgid "" "example-with-basedir` for how to use *base_dir* and *root_dir* together." msgstr "" -#: ../../library/shutil.rst:583 +#: ../../library/shutil.rst:582 msgid "*root_dir* and *base_dir* both default to the current directory." msgstr "" -#: ../../library/shutil.rst:585 +#: ../../library/shutil.rst:584 msgid "" "If *dry_run* is true, no archive is created, but the operations that would " "be executed are logged to *logger*." msgstr "" -#: ../../library/shutil.rst:588 +#: ../../library/shutil.rst:587 msgid "" "*owner* and *group* are used when creating a tar archive. By default, uses " "the current owner and group." msgstr "" -#: ../../library/shutil.rst:591 +#: ../../library/shutil.rst:590 msgid "" "*logger* must be an object compatible with :pep:`282`, usually an instance " "of :class:`logging.Logger`." msgstr "" -#: ../../library/shutil.rst:594 +#: ../../library/shutil.rst:593 msgid "The *verbose* argument is unused and deprecated." msgstr "" @@ -696,58 +696,54 @@ msgid "" "arguments ``base_name``, ``format``, ``root_dir``, ``base_dir``." msgstr "" -#: ../../library/shutil.rst:600 -msgid "This function is not thread-safe." -msgstr "" - -#: ../../library/shutil.rst:602 +#: ../../library/shutil.rst:597 msgid "" "The modern pax (POSIX.1-2001) format is now used instead of the legacy GNU " "format for archives created with ``format=\"tar\"``." msgstr "" -#: ../../library/shutil.rst:609 +#: ../../library/shutil.rst:604 msgid "" "Return a list of supported formats for archiving. Each element of the " "returned sequence is a tuple ``(name, description)``." msgstr "" -#: ../../library/shutil.rst:612 ../../library/shutil.rst:694 +#: ../../library/shutil.rst:607 ../../library/shutil.rst:689 msgid "By default :mod:`shutil` provides these formats:" msgstr "" -#: ../../library/shutil.rst:614 +#: ../../library/shutil.rst:609 msgid "*zip*: ZIP file (if the :mod:`zlib` module is available)." msgstr "" -#: ../../library/shutil.rst:615 +#: ../../library/shutil.rst:610 msgid "" "*tar*: Uncompressed tar file. Uses POSIX.1-2001 pax format for new archives." msgstr "" -#: ../../library/shutil.rst:616 ../../library/shutil.rst:699 +#: ../../library/shutil.rst:611 ../../library/shutil.rst:694 msgid "*gztar*: gzip'ed tar-file (if the :mod:`zlib` module is available)." msgstr "" -#: ../../library/shutil.rst:617 ../../library/shutil.rst:700 +#: ../../library/shutil.rst:612 ../../library/shutil.rst:695 msgid "*bztar*: bzip2'ed tar-file (if the :mod:`bz2` module is available)." msgstr "" -#: ../../library/shutil.rst:618 ../../library/shutil.rst:701 +#: ../../library/shutil.rst:613 ../../library/shutil.rst:696 msgid "*xztar*: xz'ed tar-file (if the :mod:`lzma` module is available)." msgstr "" -#: ../../library/shutil.rst:620 +#: ../../library/shutil.rst:615 msgid "" "You can register new formats or provide your own archiver for any existing " "formats, by using :func:`register_archive_format`." msgstr "" -#: ../../library/shutil.rst:626 +#: ../../library/shutil.rst:621 msgid "Register an archiver for the format *name*." msgstr "" -#: ../../library/shutil.rst:628 +#: ../../library/shutil.rst:623 msgid "" "*function* is the callable that will be used to unpack archives. The " "callable will receive the *base_name* of the file to create, followed by the " @@ -756,33 +752,33 @@ msgid "" "*dry_run* and *logger* (as passed in :func:`make_archive`)." msgstr "" -#: ../../library/shutil.rst:634 +#: ../../library/shutil.rst:629 msgid "" "If given, *extra_args* is a sequence of ``(name, value)`` pairs that will be " "used as extra keywords arguments when the archiver callable is used." msgstr "" -#: ../../library/shutil.rst:637 +#: ../../library/shutil.rst:632 msgid "" "*description* is used by :func:`get_archive_formats` which returns the list " "of archivers. Defaults to an empty string." msgstr "" -#: ../../library/shutil.rst:643 +#: ../../library/shutil.rst:638 msgid "Remove the archive format *name* from the list of supported formats." msgstr "" -#: ../../library/shutil.rst:648 +#: ../../library/shutil.rst:643 msgid "Unpack an archive. *filename* is the full path of the archive." msgstr "" -#: ../../library/shutil.rst:650 +#: ../../library/shutil.rst:645 msgid "" "*extract_dir* is the name of the target directory where the archive is " "unpacked. If not provided, the current working directory is used." msgstr "" -#: ../../library/shutil.rst:653 +#: ../../library/shutil.rst:648 msgid "" "*format* is the archive format: one of \"zip\", \"tar\", \"gztar\", \"bztar" "\", or \"xztar\". Or any other format registered with :func:" @@ -791,126 +787,126 @@ msgid "" "that extension. In case none is found, a :exc:`ValueError` is raised." msgstr "" -#: ../../library/shutil.rst:660 +#: ../../library/shutil.rst:656 msgid "" "Raises an :ref:`auditing event ` ``shutil.unpack_archive`` with " "arguments ``filename``, ``extract_dir``, ``format``." msgstr "" -#: ../../library/shutil.rst:662 +#: ../../library/shutil.rst:657 msgid "Accepts a :term:`path-like object` for *filename* and *extract_dir*." msgstr "" -#: ../../library/shutil.rst:668 +#: ../../library/shutil.rst:663 msgid "" "Registers an unpack format. *name* is the name of the format and " "*extensions* is a list of extensions corresponding to the format, like ``." "zip`` for Zip files." msgstr "" -#: ../../library/shutil.rst:672 +#: ../../library/shutil.rst:667 msgid "" "*function* is the callable that will be used to unpack archives. The " "callable will receive the path of the archive, followed by the directory the " "archive must be extracted to." msgstr "" -#: ../../library/shutil.rst:676 +#: ../../library/shutil.rst:671 msgid "" "When provided, *extra_args* is a sequence of ``(name, value)`` tuples that " "will be passed as keywords arguments to the callable." msgstr "" -#: ../../library/shutil.rst:679 +#: ../../library/shutil.rst:674 msgid "" "*description* can be provided to describe the format, and will be returned " "by the :func:`get_unpack_formats` function." msgstr "" -#: ../../library/shutil.rst:685 +#: ../../library/shutil.rst:680 msgid "Unregister an unpack format. *name* is the name of the format." msgstr "" -#: ../../library/shutil.rst:690 +#: ../../library/shutil.rst:685 msgid "" "Return a list of all registered formats for unpacking. Each element of the " "returned sequence is a tuple ``(name, extensions, description)``." msgstr "" -#: ../../library/shutil.rst:696 +#: ../../library/shutil.rst:691 msgid "" "*zip*: ZIP file (unpacking compressed files works only if the corresponding " "module is available)." msgstr "" -#: ../../library/shutil.rst:698 +#: ../../library/shutil.rst:693 msgid "*tar*: uncompressed tar file." msgstr "" -#: ../../library/shutil.rst:703 +#: ../../library/shutil.rst:698 msgid "" "You can register new formats or provide your own unpacker for any existing " "formats, by using :func:`register_unpack_format`." msgstr "" -#: ../../library/shutil.rst:710 +#: ../../library/shutil.rst:705 msgid "Archiving example" msgstr "" -#: ../../library/shutil.rst:712 +#: ../../library/shutil.rst:707 msgid "" "In this example, we create a gzip'ed tar-file archive containing all files " "found in the :file:`.ssh` directory of the user::" msgstr "" -#: ../../library/shutil.rst:722 +#: ../../library/shutil.rst:717 msgid "The resulting archive contains:" msgstr "" -#: ../../library/shutil.rst:740 +#: ../../library/shutil.rst:735 msgid "Archiving example with *base_dir*" msgstr "" -#: ../../library/shutil.rst:742 +#: ../../library/shutil.rst:737 msgid "" "In this example, similar to the `one above `_, we " "show how to use :func:`make_archive`, but this time with the usage of " "*base_dir*. We now have the following directory structure:" msgstr "" -#: ../../library/shutil.rst:756 +#: ../../library/shutil.rst:751 msgid "" "In the final archive, :file:`please_add.txt` should be included, but :file:" "`do_not_add.txt` should not. Therefore we use the following::" msgstr "" -#: ../../library/shutil.rst:770 +#: ../../library/shutil.rst:765 msgid "Listing the files in the resulting archive gives us:" msgstr "" -#: ../../library/shutil.rst:780 +#: ../../library/shutil.rst:775 msgid "Querying the size of the output terminal" msgstr "" -#: ../../library/shutil.rst:784 +#: ../../library/shutil.rst:779 msgid "Get the size of the terminal window." msgstr "" -#: ../../library/shutil.rst:786 +#: ../../library/shutil.rst:781 msgid "" "For each of the two dimensions, the environment variable, ``COLUMNS`` and " "``LINES`` respectively, is checked. If the variable is defined and the value " "is a positive integer, it is used." msgstr "" -#: ../../library/shutil.rst:790 +#: ../../library/shutil.rst:785 msgid "" "When ``COLUMNS`` or ``LINES`` is not defined, which is the common case, the " "terminal connected to :data:`sys.__stdout__` is queried by invoking :func:" "`os.get_terminal_size`." msgstr "" -#: ../../library/shutil.rst:794 +#: ../../library/shutil.rst:789 msgid "" "If the terminal size cannot be successfully queried, either because the " "system doesn't support querying, or because we are not connected to a " @@ -919,11 +915,11 @@ msgid "" "emulators." msgstr "" -#: ../../library/shutil.rst:800 +#: ../../library/shutil.rst:795 msgid "The value returned is a named tuple of type :class:`os.terminal_size`." msgstr "" -#: ../../library/shutil.rst:802 +#: ../../library/shutil.rst:797 msgid "" "See also: The Single UNIX Specification, Version 2, `Other Environment " "Variables`_." diff --git a/library/signal.po b/library/signal.po index f87c50719d..3e7d53ef53 100644 --- a/library/signal.po +++ b/library/signal.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.7\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2021-09-07 06:52+0000\n" +"POT-Creation-Date: 2020-06-20 18:08+0800\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-" @@ -138,11 +138,11 @@ msgid "Timer signal from :manpage:`alarm(2)`." msgstr "" #: ../../library/signal.rst:102 ../../library/signal.rst:114 -#: ../../library/signal.rst:120 ../../library/signal.rst:130 -#: ../../library/signal.rst:144 ../../library/signal.rst:162 -#: ../../library/signal.rst:170 ../../library/signal.rst:184 -#: ../../library/signal.rst:190 ../../library/signal.rst:196 -#: ../../library/signal.rst:447 ../../library/signal.rst:454 +#: ../../library/signal.rst:130 ../../library/signal.rst:144 +#: ../../library/signal.rst:162 ../../library/signal.rst:170 +#: ../../library/signal.rst:184 ../../library/signal.rst:190 +#: ../../library/signal.rst:196 ../../library/signal.rst:447 +#: ../../library/signal.rst:454 msgid ":ref:`Availability `: Unix." msgstr "" @@ -150,8 +150,8 @@ msgstr "" msgid "Interrupt from keyboard (CTRL + BREAK)." msgstr "" -#: ../../library/signal.rst:108 ../../library/signal.rst:215 -#: ../../library/signal.rst:225 +#: ../../library/signal.rst:108 ../../library/signal.rst:120 +#: ../../library/signal.rst:215 ../../library/signal.rst:225 msgid ":ref:`Availability `: Windows." msgstr "" @@ -425,7 +425,7 @@ msgid "" "performed; this can be used to check if the target thread is still running." msgstr "" -#: ../../library/signal.rst:384 +#: ../../library/signal.rst:385 msgid "" "Raises an :ref:`auditing event ` ``signal.pthread_kill`` with " "arguments ``thread_id``, ``signalnum``." diff --git a/library/site.po b/library/site.po index 00f146b078..3629326247 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-07 06:52+0000\n" +"POT-Creation-Date: 2020-06-20 18:08+0800\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-" @@ -252,21 +252,20 @@ msgstr "" msgid "" "Return the path of the user-specific site-packages directory, :data:" "`USER_SITE`. If it is not initialized yet, this function will also set it, " -"respecting :data:`USER_BASE`. To determine if the user-specific site-" -"packages was added to ``sys.path`` :data:`ENABLE_USER_SITE` should be used." +"respecting :envvar:`PYTHONNOUSERSITE` and :data:`USER_BASE`." msgstr "" -#: ../../library/site.rst:244 +#: ../../library/site.rst:242 msgid "Command Line Interface" msgstr "" -#: ../../library/site.rst:248 +#: ../../library/site.rst:246 msgid "" "The :mod:`site` module also provides a way to get the user directories from " "the command line:" msgstr "" -#: ../../library/site.rst:256 +#: ../../library/site.rst:254 msgid "" "If it is called without arguments, it will print the contents of :data:`sys." "path` on the standard output, followed by the value of :data:`USER_BASE` and " @@ -274,21 +273,21 @@ msgid "" "finally the value of :data:`ENABLE_USER_SITE`." msgstr "" -#: ../../library/site.rst:263 +#: ../../library/site.rst:261 msgid "Print the path to the user base directory." msgstr "" -#: ../../library/site.rst:267 +#: ../../library/site.rst:265 msgid "Print the path to the user site-packages directory." msgstr "" -#: ../../library/site.rst:269 +#: ../../library/site.rst:267 msgid "" "If both options are given, user base and user site will be printed (always " "in this order), separated by :data:`os.pathsep`." msgstr "" -#: ../../library/site.rst:272 +#: ../../library/site.rst:270 msgid "" "If any option is given, the script will exit with one of these values: ``0`` " "if the user site-packages directory is enabled, ``1`` if it was disabled by " @@ -296,6 +295,6 @@ msgid "" "administrator, and a value greater than 2 if there is an error." msgstr "" -#: ../../library/site.rst:279 +#: ../../library/site.rst:277 msgid ":pep:`370` -- Per user site-packages directory" msgstr "" diff --git a/library/smtplib.po b/library/smtplib.po index 191eb77964..073e50ed0b 100644 --- a/library/smtplib.po +++ b/library/smtplib.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.7\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2021-09-07 06:52+0000\n" +"POT-Creation-Date: 2020-06-20 18:08+0800\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-" @@ -67,7 +67,7 @@ msgid "" "keyword:`!with` statement exits. E.g.::" msgstr "" -#: ../../library/smtplib.rst:58 +#: ../../library/smtplib.rst:None msgid "" "Raises an :ref:`auditing event ` ``smtplib.send`` with arguments " "``self``, ``data``." diff --git a/library/socket.po b/library/socket.po index 3f50c163d1..2565e1cefe 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-07 06:52+0000\n" +"POT-Creation-Date: 2020-06-20 18:08+0800\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-" @@ -100,8 +100,8 @@ msgid "" "Previously, :const:`AF_UNIX` socket paths were assumed to use UTF-8 encoding." msgstr "" -#: ../../library/socket.rst:63 ../../library/socket.rst:966 -#: ../../library/socket.rst:1008 ../../library/socket.rst:1738 +#: ../../library/socket.rst:63 ../../library/socket.rst:965 +#: ../../library/socket.rst:1007 ../../library/socket.rst:1713 msgid "Writable :term:`bytes-like object` is now accepted." msgstr "" @@ -597,7 +597,7 @@ msgid "" "the :meth:`~socket.socket.ioctl` method of socket objects." msgstr "" -#: ../../library/socket.rst:476 ../../library/socket.rst:1360 +#: ../../library/socket.rst:476 ../../library/socket.rst:1314 msgid "``SIO_LOOPBACK_FAST_PATH`` was added." msgstr "" @@ -611,7 +611,7 @@ msgstr "" msgid "Constants for Linux Kernel cryptography." msgstr "" -#: ../../library/socket.rst:492 ../../library/socket.rst:1660 +#: ../../library/socket.rst:492 ../../library/socket.rst:1614 msgid ":ref:`Availability `: Linux >= 2.6.38." msgstr "" @@ -695,11 +695,11 @@ msgid "" msgstr "" #: ../../library/socket.rst:572 ../../library/socket.rst:706 -#: ../../library/socket.rst:1190 ../../library/socket.rst:1277 +#: ../../library/socket.rst:1144 ../../library/socket.rst:1231 msgid "The newly created socket is :ref:`non-inheritable `." msgstr "" -#: ../../library/socket.rst:574 +#: ../../library/socket.rst:575 msgid "" "Raises an :ref:`auditing event ` ``socket.__new__`` with arguments " "``self``, ``family``, ``type``, ``protocol``." @@ -853,7 +853,7 @@ msgid "" "method. The socket is assumed to be in blocking mode." msgstr "" -#: ../../library/socket.rst:718 ../../library/socket.rst:1763 +#: ../../library/socket.rst:718 ../../library/socket.rst:1738 msgid ":ref:`Availability `: Windows." msgstr "" @@ -919,7 +919,7 @@ msgid "" "be passed to the :meth:`socket.connect` method." msgstr "" -#: ../../library/socket.rst:773 +#: ../../library/socket.rst:774 msgid "" "Raises an :ref:`auditing event ` ``socket.getaddrinfo`` with " "arguments ``host``, ``port``, ``family``, ``type``, ``protocol``." @@ -948,12 +948,11 @@ msgid "" "empty, it is interpreted as the local host. To find the fully qualified " "name, the hostname returned by :func:`gethostbyaddr` is checked, followed by " "aliases for the host, if available. The first name which includes a period " -"is selected. In case no fully qualified domain name is available and *name* " -"was provided, it is returned unchanged. If *name* was empty or equal to " -"``'0.0.0.0'``, the hostname from :func:`gethostname` is returned." +"is selected. In case no fully qualified domain name is available, the " +"hostname as returned by :func:`gethostname` is returned." msgstr "" -#: ../../library/socket.rst:805 +#: ../../library/socket.rst:804 msgid "" "Translate a host name to IPv4 address format. The IPv4 address is returned " "as a string, such as ``'100.50.200.5'``. If the host name is an IPv4 " @@ -963,13 +962,13 @@ msgid "" "stack support." msgstr "" -#: ../../library/socket.rst:811 ../../library/socket.rst:825 +#: ../../library/socket.rst:810 ../../library/socket.rst:824 msgid "" "Raises an :ref:`auditing event ` ``socket.gethostbyname`` with " "argument ``hostname``." msgstr "" -#: ../../library/socket.rst:816 +#: ../../library/socket.rst:815 msgid "" "Translate a host name to IPv4 address format, extended interface. Return a " "triple ``(hostname, aliaslist, ipaddrlist)`` where *hostname* is the primary " @@ -981,7 +980,7 @@ msgid "" "IPv4/v6 dual stack support." msgstr "" -#: ../../library/socket.rst:830 +#: ../../library/socket.rst:829 msgid "" "Return a string containing the hostname of the machine where the Python " "interpreter is currently executing." @@ -993,13 +992,13 @@ msgid "" "arguments." msgstr "" -#: ../../library/socket.rst:835 +#: ../../library/socket.rst:834 msgid "" "Note: :func:`gethostname` doesn't always return the fully qualified domain " "name; use :func:`getfqdn` for that." msgstr "" -#: ../../library/socket.rst:841 +#: ../../library/socket.rst:840 msgid "" "Return a triple ``(hostname, aliaslist, ipaddrlist)`` where *hostname* is " "the primary host name responding to the given *ip_address*, *aliaslist* is a " @@ -1010,13 +1009,13 @@ msgid "" "`gethostbyaddr` supports both IPv4 and IPv6." msgstr "" -#: ../../library/socket.rst:849 +#: ../../library/socket.rst:848 msgid "" "Raises an :ref:`auditing event ` ``socket.gethostbyaddr`` with " "argument ``ip_address``." msgstr "" -#: ../../library/socket.rst:854 +#: ../../library/socket.rst:853 msgid "" "Translate a socket address *sockaddr* into a 2-tuple ``(host, port)``. " "Depending on the settings of *flags*, the result can contain a fully-" @@ -1024,24 +1023,24 @@ msgid "" "Similarly, *port* can contain a string port name or a numeric port number." msgstr "" -#: ../../library/socket.rst:859 +#: ../../library/socket.rst:858 msgid "" "For IPv6 addresses, ``%scope_id`` is appended to the host part if *sockaddr* " "contains meaningful *scope_id*. Usually this happens for multicast addresses." msgstr "" -#: ../../library/socket.rst:862 +#: ../../library/socket.rst:861 msgid "" "For more information about *flags* you can consult :manpage:`getnameinfo(3)`." msgstr "" -#: ../../library/socket.rst:864 +#: ../../library/socket.rst:863 msgid "" "Raises an :ref:`auditing event ` ``socket.getnameinfo`` with " "argument ``sockaddr``." msgstr "" -#: ../../library/socket.rst:868 +#: ../../library/socket.rst:867 msgid "" "Translate an Internet protocol name (for example, ``'icmp'``) to a constant " "suitable for passing as the (optional) third argument to the :func:`.socket` " @@ -1050,47 +1049,47 @@ msgid "" "chosen automatically if the protocol is omitted or zero." msgstr "" -#: ../../library/socket.rst:877 +#: ../../library/socket.rst:876 msgid "" "Translate an Internet service name and protocol name to a port number for " "that service. The optional protocol name, if given, should be ``'tcp'`` or " "``'udp'``, otherwise any protocol will match." msgstr "" -#: ../../library/socket.rst:881 +#: ../../library/socket.rst:880 msgid "" "Raises an :ref:`auditing event ` ``socket.getservbyname`` with " "arguments ``servicename``, ``protocolname``." msgstr "" -#: ../../library/socket.rst:886 +#: ../../library/socket.rst:885 msgid "" "Translate an Internet port number and protocol name to a service name for " "that service. The optional protocol name, if given, should be ``'tcp'`` or " "``'udp'``, otherwise any protocol will match." msgstr "" -#: ../../library/socket.rst:890 +#: ../../library/socket.rst:889 msgid "" "Raises an :ref:`auditing event ` ``socket.getservbyport`` with " "arguments ``port``, ``protocolname``." msgstr "" -#: ../../library/socket.rst:895 +#: ../../library/socket.rst:894 msgid "" "Convert 32-bit positive integers from network to host byte order. On " "machines where the host byte order is the same as network byte order, this " "is a no-op; otherwise, it performs a 4-byte swap operation." msgstr "" -#: ../../library/socket.rst:902 +#: ../../library/socket.rst:901 msgid "" "Convert 16-bit positive integers from network to host byte order. On " "machines where the host byte order is the same as network byte order, this " "is a no-op; otherwise, it performs a 2-byte swap operation." msgstr "" -#: ../../library/socket.rst:906 ../../library/socket.rst:926 +#: ../../library/socket.rst:905 ../../library/socket.rst:925 msgid "" "In case *x* does not fit in 16-bit unsigned integer, but does fit in a " "positive C int, it is silently truncated to 16-bit unsigned integer. This " @@ -1098,21 +1097,21 @@ msgid "" "future versions of Python." msgstr "" -#: ../../library/socket.rst:915 +#: ../../library/socket.rst:914 msgid "" "Convert 32-bit positive integers from host to network byte order. On " "machines where the host byte order is the same as network byte order, this " "is a no-op; otherwise, it performs a 4-byte swap operation." msgstr "" -#: ../../library/socket.rst:922 +#: ../../library/socket.rst:921 msgid "" "Convert 16-bit positive integers from host to network byte order. On " "machines where the host byte order is the same as network byte order, this " "is a no-op; otherwise, it performs a 2-byte swap operation." msgstr "" -#: ../../library/socket.rst:935 +#: ../../library/socket.rst:934 msgid "" "Convert an IPv4 address from dotted-quad string format (for example, " "'123.45.67.89') to 32-bit packed binary format, as a bytes object four " @@ -1122,26 +1121,26 @@ msgid "" "returns." msgstr "" -#: ../../library/socket.rst:941 +#: ../../library/socket.rst:940 msgid "" ":func:`inet_aton` also accepts strings with less than three dots; see the " "Unix manual page :manpage:`inet(3)` for details." msgstr "" -#: ../../library/socket.rst:944 +#: ../../library/socket.rst:943 msgid "" "If the IPv4 address string passed to this function is invalid, :exc:" "`OSError` will be raised. Note that exactly what is valid depends on the " "underlying C implementation of :c:func:`inet_aton`." msgstr "" -#: ../../library/socket.rst:948 +#: ../../library/socket.rst:947 msgid "" ":func:`inet_aton` does not support IPv6, and :func:`inet_pton` should be " "used instead for IPv4/v6 dual stack support." msgstr "" -#: ../../library/socket.rst:954 +#: ../../library/socket.rst:953 msgid "" "Convert a 32-bit packed IPv4 address (a :term:`bytes-like object` four bytes " "in length) to its standard dotted-quad string representation (for example, " @@ -1151,7 +1150,7 @@ msgid "" "an argument." msgstr "" -#: ../../library/socket.rst:961 +#: ../../library/socket.rst:960 msgid "" "If the byte sequence passed to this function is not exactly 4 bytes in " "length, :exc:`OSError` will be raised. :func:`inet_ntoa` does not support " @@ -1159,7 +1158,7 @@ msgid "" "support." msgstr "" -#: ../../library/socket.rst:972 +#: ../../library/socket.rst:971 msgid "" "Convert an IP address from its family-specific string format to a packed, " "binary format. :func:`inet_pton` is useful when a library or network " @@ -1167,7 +1166,7 @@ msgid "" "func:`inet_aton`) or :c:type:`struct in6_addr`." msgstr "" -#: ../../library/socket.rst:977 +#: ../../library/socket.rst:976 msgid "" "Supported values for *address_family* are currently :const:`AF_INET` and :" "const:`AF_INET6`. If the IP address string *ip_string* is invalid, :exc:" @@ -1176,16 +1175,16 @@ msgid "" "`inet_pton`." msgstr "" -#: ../../library/socket.rst:984 ../../library/socket.rst:1004 +#: ../../library/socket.rst:983 ../../library/socket.rst:1003 msgid "" ":ref:`Availability `: Unix (maybe not all platforms), Windows." msgstr "" -#: ../../library/socket.rst:985 ../../library/socket.rst:1005 +#: ../../library/socket.rst:984 ../../library/socket.rst:1004 msgid "Windows support added" msgstr "" -#: ../../library/socket.rst:991 +#: ../../library/socket.rst:990 msgid "" "Convert a packed IP address (a :term:`bytes-like object` of some number of " "bytes) to its standard, family-specific string representation (for example, " @@ -1194,7 +1193,7 @@ msgid "" "in_addr` (similar to :func:`inet_ntoa`) or :c:type:`struct in6_addr`." msgstr "" -#: ../../library/socket.rst:998 +#: ../../library/socket.rst:997 msgid "" "Supported values for *address_family* are currently :const:`AF_INET` and :" "const:`AF_INET6`. If the bytes object *packed_ip* is not the correct length " @@ -1202,7 +1201,7 @@ msgid "" "`OSError` is raised for errors from the call to :func:`inet_ntop`." msgstr "" -#: ../../library/socket.rst:1020 +#: ../../library/socket.rst:1019 msgid "" "Return the total length, without trailing padding, of an ancillary data item " "with associated data of the given *length*. This value can often be used as " @@ -1213,14 +1212,14 @@ msgid "" "the permissible range of values." msgstr "" -#: ../../library/socket.rst:1030 ../../library/socket.rst:1051 -#: ../../library/socket.rst:1496 ../../library/socket.rst:1538 -#: ../../library/socket.rst:1644 +#: ../../library/socket.rst:1029 ../../library/socket.rst:1050 +#: ../../library/socket.rst:1450 ../../library/socket.rst:1492 +#: ../../library/socket.rst:1598 msgid "" ":ref:`Availability `: most Unix platforms, possibly others." msgstr "" -#: ../../library/socket.rst:1036 +#: ../../library/socket.rst:1035 msgid "" "Return the buffer size needed for :meth:`~socket.recvmsg` to receive an " "ancillary data item with associated data of the given *length*, along with " @@ -1230,7 +1229,7 @@ msgid "" "values." msgstr "" -#: ../../library/socket.rst:1044 +#: ../../library/socket.rst:1043 msgid "" "Note that some systems might support ancillary data without providing this " "function. Also note that setting the buffer size using the results of this " @@ -1238,21 +1237,21 @@ msgid "" "received, since additional data may be able to fit into the padding area." msgstr "" -#: ../../library/socket.rst:1057 +#: ../../library/socket.rst:1056 msgid "" "Return the default timeout in seconds (float) for new socket objects. A " "value of ``None`` indicates that new socket objects have no timeout. When " "the socket module is first imported, the default is ``None``." msgstr "" -#: ../../library/socket.rst:1064 +#: ../../library/socket.rst:1063 msgid "" "Set the default timeout in seconds (float) for new socket objects. When the " "socket module is first imported, the default is ``None``. See :meth:" "`~socket.settimeout` for possible values and their respective meanings." msgstr "" -#: ../../library/socket.rst:1072 +#: ../../library/socket.rst:1071 msgid "" "Set the machine's hostname to *name*. This will raise an :exc:`OSError` if " "you don't have enough rights." @@ -1264,117 +1263,55 @@ msgid "" "argument ``name``." msgstr "" -#: ../../library/socket.rst:1078 +#: ../../library/socket.rst:1077 msgid ":ref:`Availability `: Unix." msgstr "" -#: ../../library/socket.rst:1084 +#: ../../library/socket.rst:1083 msgid "" "Return a list of network interface information (index int, name string) " "tuples. :exc:`OSError` if the system call fails." msgstr "" -#: ../../library/socket.rst:1089 ../../library/socket.rst:1116 -#: ../../library/socket.rst:1133 +#: ../../library/socket.rst:1088 ../../library/socket.rst:1102 +#: ../../library/socket.rst:1116 msgid ":ref:`Availability `: Unix, Windows." msgstr "" -#: ../../library/socket.rst:1092 ../../library/socket.rst:1119 -#: ../../library/socket.rst:1136 +#: ../../library/socket.rst:1091 ../../library/socket.rst:1105 +#: ../../library/socket.rst:1119 msgid "Windows support was added." msgstr "" #: ../../library/socket.rst:1097 msgid "" -"On Windows network interfaces have different names in different contexts " -"(all names are examples):" -msgstr "" - -#: ../../library/socket.rst:1100 -msgid "UUID: ``{FB605B73-AAC2-49A6-9A2F-25416AEA0573}``" -msgstr "" - -#: ../../library/socket.rst:1101 -msgid "name: ``ethernet_32770``" -msgstr "" - -#: ../../library/socket.rst:1102 -msgid "friendly name: ``vEthernet (nat)``" -msgstr "" - -#: ../../library/socket.rst:1103 -msgid "description: ``Hyper-V Virtual Ethernet Adapter``" -msgstr "" - -#: ../../library/socket.rst:1105 -msgid "" -"This function returns names of the second form from the list, " -"``ethernet_32770`` in this example case." -msgstr "" - -#: ../../library/socket.rst:1111 -msgid "" "Return a network interface index number corresponding to an interface name. :" "exc:`OSError` if no interface with the given name exists." msgstr "" -#: ../../library/socket.rst:1123 ../../library/socket.rst:1140 -msgid "\"Interface name\" is a name as documented in :func:`if_nameindex`." -msgstr "" - -#: ../../library/socket.rst:1128 +#: ../../library/socket.rst:1111 msgid "" "Return a network interface name corresponding to an interface index number. :" "exc:`OSError` if no interface with the given index exists." msgstr "" -#: ../../library/socket.rst:1145 -msgid "" -"Send the list of file descriptors *fds* over an :const:`AF_UNIX` socket " -"*sock*. The *fds* parameter is a sequence of file descriptors. Consult :meth:" -"`sendmsg` for the documentation of these parameters." -msgstr "" - -#: ../../library/socket.rst:1150 -msgid "" -":ref:`Availability `: Unix supporting :meth:`~socket.sendmsg` " -"and :const:`SCM_RIGHTS` mechanism." -msgstr "" - -#: ../../library/socket.rst:1156 -msgid "" -"Receive up to *maxfds* file descriptors from an :const:`AF_UNIX` socket " -"*sock*. Return ``(msg, list(fds), flags, addr)``. Consult :meth:`recvmsg` " -"for the documentation of these parameters." -msgstr "" - -#: ../../library/socket.rst:1161 -msgid "" -":ref:`Availability `: Unix supporting :meth:`~socket.recvmsg` " -"and :const:`SCM_RIGHTS` mechanism." -msgstr "" - -#: ../../library/socket.rst:1166 -msgid "Any truncated integers at the end of the list of file descriptors." -msgstr "" - -#: ../../library/socket.rst:1172 +#: ../../library/socket.rst:1126 msgid "Socket Objects" msgstr "" -#: ../../library/socket.rst:1174 +#: ../../library/socket.rst:1128 msgid "" "Socket objects have the following methods. Except for :meth:`~socket." "makefile`, these correspond to Unix system calls applicable to sockets." msgstr "" -#: ../../library/socket.rst:1178 +#: ../../library/socket.rst:1132 msgid "" "Support for the :term:`context manager` protocol was added. Exiting the " "context manager is equivalent to calling :meth:`~socket.close`." msgstr "" -#: ../../library/socket.rst:1185 +#: ../../library/socket.rst:1139 msgid "" "Accept a connection. The socket must be bound to an address and listening " "for connections. The return value is a pair ``(conn, address)`` where *conn* " @@ -1383,33 +1320,33 @@ msgid "" "connection." msgstr "" -#: ../../library/socket.rst:1192 ../../library/socket.rst:1279 +#: ../../library/socket.rst:1146 ../../library/socket.rst:1233 msgid "The socket is now non-inheritable." msgstr "" -#: ../../library/socket.rst:1195 ../../library/socket.rst:1410 -#: ../../library/socket.rst:1424 ../../library/socket.rst:1499 -#: ../../library/socket.rst:1570 ../../library/socket.rst:1589 -#: ../../library/socket.rst:1606 ../../library/socket.rst:1649 +#: ../../library/socket.rst:1149 ../../library/socket.rst:1364 +#: ../../library/socket.rst:1378 ../../library/socket.rst:1453 +#: ../../library/socket.rst:1524 ../../library/socket.rst:1543 +#: ../../library/socket.rst:1560 ../../library/socket.rst:1603 msgid "" "If the system call is interrupted and the signal handler does not raise an " "exception, the method now retries the system call instead of raising an :exc:" "`InterruptedError` exception (see :pep:`475` for the rationale)." msgstr "" -#: ../../library/socket.rst:1203 +#: ../../library/socket.rst:1157 msgid "" "Bind the socket to *address*. The socket must not already be bound. (The " "format of *address* depends on the address family --- see above.)" msgstr "" -#: ../../library/socket.rst:1206 +#: ../../library/socket.rst:1160 msgid "" "Raises an :ref:`auditing event ` ``socket.bind`` with arguments " "``self``, ``address``." msgstr "" -#: ../../library/socket.rst:1210 +#: ../../library/socket.rst:1164 msgid "" "Mark the socket closed. The underlying system resource (e.g. a file " "descriptor) is also closed when all file objects from :meth:`makefile()` are " @@ -1418,20 +1355,20 @@ msgid "" "flushed)." msgstr "" -#: ../../library/socket.rst:1216 +#: ../../library/socket.rst:1170 msgid "" "Sockets are automatically closed when they are garbage-collected, but it is " "recommended to :meth:`close` them explicitly, or to use a :keyword:`with` " "statement around them." msgstr "" -#: ../../library/socket.rst:1220 +#: ../../library/socket.rst:1174 msgid "" ":exc:`OSError` is now raised if an error occurs when the underlying :c:func:" "`close` call is made." msgstr "" -#: ../../library/socket.rst:1226 +#: ../../library/socket.rst:1180 msgid "" ":meth:`close()` releases the resource associated with a connection but does " "not necessarily close the connection immediately. If you want to close the " @@ -1439,13 +1376,13 @@ msgid "" "`close()`." msgstr "" -#: ../../library/socket.rst:1234 +#: ../../library/socket.rst:1188 msgid "" "Connect to a remote socket at *address*. (The format of *address* depends on " "the address family --- see above.)" msgstr "" -#: ../../library/socket.rst:1237 +#: ../../library/socket.rst:1191 msgid "" "If the connection is interrupted by a signal, the method waits until the " "connection completes, or raise a :exc:`socket.timeout` on timeout, if the " @@ -1455,13 +1392,13 @@ msgid "" "(or the exception raised by the signal handler)." msgstr "" -#: ../../library/socket.rst:1244 ../../library/socket.rst:1262 +#: ../../library/socket.rst:1199 ../../library/socket.rst:1216 msgid "" "Raises an :ref:`auditing event ` ``socket.connect`` with arguments " "``self``, ``address``." msgstr "" -#: ../../library/socket.rst:1246 +#: ../../library/socket.rst:1200 msgid "" "The method now waits until the connection completes instead of raising an :" "exc:`InterruptedError` exception if the connection is interrupted by a " @@ -1469,7 +1406,7 @@ msgid "" "blocking or has a timeout (see the :pep:`475` for the rationale)." msgstr "" -#: ../../library/socket.rst:1255 +#: ../../library/socket.rst:1209 msgid "" "Like ``connect(address)``, but return an error indicator instead of raising " "an exception for errors returned by the C-level :c:func:`connect` call " @@ -1479,38 +1416,38 @@ msgid "" "asynchronous connects." msgstr "" -#: ../../library/socket.rst:1266 +#: ../../library/socket.rst:1220 msgid "" "Put the socket object into closed state without actually closing the " "underlying file descriptor. The file descriptor is returned, and can be " "reused for other purposes." msgstr "" -#: ../../library/socket.rst:1275 +#: ../../library/socket.rst:1229 msgid "Duplicate the socket." msgstr "" -#: ../../library/socket.rst:1285 +#: ../../library/socket.rst:1239 msgid "" "Return the socket's file descriptor (a small integer), or -1 on failure. " "This is useful with :func:`select.select`." msgstr "" -#: ../../library/socket.rst:1288 +#: ../../library/socket.rst:1242 msgid "" "Under Windows the small integer returned by this method cannot be used where " "a file descriptor can be used (such as :func:`os.fdopen`). Unix does not " "have this limitation." msgstr "" -#: ../../library/socket.rst:1294 +#: ../../library/socket.rst:1248 msgid "" "Get the :ref:`inheritable flag ` of the socket's file " "descriptor or socket's handle: ``True`` if the socket can be inherited in " "child processes, ``False`` if it cannot." msgstr "" -#: ../../library/socket.rst:1303 +#: ../../library/socket.rst:1257 msgid "" "Return the remote address to which the socket is connected. This is useful " "to find out the port number of a remote IPv4/v6 socket, for instance. (The " @@ -1518,14 +1455,14 @@ msgid "" "above.) On some systems this function is not supported." msgstr "" -#: ../../library/socket.rst:1311 +#: ../../library/socket.rst:1265 msgid "" "Return the socket's own address. This is useful to find out the port number " "of an IPv4/v6 socket, for instance. (The format of the address returned " "depends on the address family --- see above.)" msgstr "" -#: ../../library/socket.rst:1318 +#: ../../library/socket.rst:1272 msgid "" "Return the value of the given socket option (see the Unix man page :manpage:" "`getsockopt(2)`). The needed symbolic constants (:const:`SO_\\*` etc.) are " @@ -1537,16 +1474,16 @@ msgid "" "`struct` for a way to decode C structures encoded as byte strings)." msgstr "" -#: ../../library/socket.rst:1330 +#: ../../library/socket.rst:1284 msgid "" "Return ``True`` if socket is in blocking mode, ``False`` if in non-blocking." msgstr "" -#: ../../library/socket.rst:1333 +#: ../../library/socket.rst:1287 msgid "This is equivalent to checking ``socket.gettimeout() == 0``." msgstr "" -#: ../../library/socket.rst:1340 +#: ../../library/socket.rst:1294 msgid "" "Return the timeout in seconds (float) associated with socket operations, or " "``None`` if no timeout is set. This reflects the last call to :meth:" @@ -1557,30 +1494,30 @@ msgstr "" msgid "platform" msgstr "" -#: ../../library/socket.rst:1347 +#: ../../library/socket.rst:1301 msgid "Windows" msgstr "" -#: ../../library/socket.rst:1349 +#: ../../library/socket.rst:1303 msgid "" "The :meth:`ioctl` method is a limited interface to the WSAIoctl system " "interface. Please refer to the `Win32 documentation `_ for more information." msgstr "" -#: ../../library/socket.rst:1354 +#: ../../library/socket.rst:1308 msgid "" "On other platforms, the generic :func:`fcntl.fcntl` and :func:`fcntl.ioctl` " "functions may be used; they accept a socket object as their first argument." msgstr "" -#: ../../library/socket.rst:1357 +#: ../../library/socket.rst:1311 msgid "" "Currently only the following control codes are supported: ``SIO_RCVALL``, " "``SIO_KEEPALIVE_VALS``, and ``SIO_LOOPBACK_FAST_PATH``." msgstr "" -#: ../../library/socket.rst:1365 +#: ../../library/socket.rst:1319 msgid "" "Enable a server to accept connections. If *backlog* is specified, it must " "be at least 0 (if it is lower, it is set to 0); it specifies the number of " @@ -1588,11 +1525,11 @@ msgid "" "connections. If not specified, a default reasonable value is chosen." msgstr "" -#: ../../library/socket.rst:1370 +#: ../../library/socket.rst:1324 msgid "The *backlog* parameter is now optional." msgstr "" -#: ../../library/socket.rst:1378 +#: ../../library/socket.rst:1332 msgid "" "Return a :term:`file object` associated with the socket. The exact returned " "type depends on the arguments given to :meth:`makefile`. These arguments " @@ -1601,28 +1538,28 @@ msgid "" "``'b'``." msgstr "" -#: ../../library/socket.rst:1383 +#: ../../library/socket.rst:1337 msgid "" "The socket must be in blocking mode; it can have a timeout, but the file " "object's internal buffer may end up in an inconsistent state if a timeout " "occurs." msgstr "" -#: ../../library/socket.rst:1387 +#: ../../library/socket.rst:1341 msgid "" "Closing the file object returned by :meth:`makefile` won't close the " "original socket unless all other file objects have been closed and :meth:" "`socket.close` has been called on the socket object." msgstr "" -#: ../../library/socket.rst:1393 +#: ../../library/socket.rst:1347 msgid "" "On Windows, the file-like object created by :meth:`makefile` cannot be used " "where a file object with a file descriptor is expected, such as the stream " "arguments of :meth:`subprocess.Popen`." msgstr "" -#: ../../library/socket.rst:1400 +#: ../../library/socket.rst:1354 msgid "" "Receive data from the socket. The return value is a bytes object " "representing the data received. The maximum amount of data to be received " @@ -1631,13 +1568,13 @@ msgid "" "zero." msgstr "" -#: ../../library/socket.rst:1407 +#: ../../library/socket.rst:1361 msgid "" "For best match with hardware and network realities, the value of *bufsize* " "should be a relatively small power of 2, for example, 4096." msgstr "" -#: ../../library/socket.rst:1418 +#: ../../library/socket.rst:1372 msgid "" "Receive data from the socket. The return value is a pair ``(bytes, " "address)`` where *bytes* is a bytes object representing the data received " @@ -1647,14 +1584,14 @@ msgid "" "address family --- see above.)" msgstr "" -#: ../../library/socket.rst:1429 +#: ../../library/socket.rst:1383 msgid "" "For multicast IPv6 address, first item of *address* does not contain ``" "%scope_id`` part anymore. In order to get full IPv6 address use :func:" "`getnameinfo`." msgstr "" -#: ../../library/socket.rst:1436 +#: ../../library/socket.rst:1390 msgid "" "Receive normal data (up to *bufsize* bytes) and ancillary data from the " "socket. The *ancbufsize* argument sets the size in bytes of the internal " @@ -1665,7 +1602,7 @@ msgid "" "*flags* argument defaults to 0 and has the same meaning as for :meth:`recv`." msgstr "" -#: ../../library/socket.rst:1446 +#: ../../library/socket.rst:1400 msgid "" "The return value is a 4-tuple: ``(data, ancdata, msg_flags, address)``. The " "*data* item is a :class:`bytes` object holding the non-ancillary data " @@ -1680,7 +1617,7 @@ msgid "" "socket, if available; otherwise, its value is unspecified." msgstr "" -#: ../../library/socket.rst:1460 +#: ../../library/socket.rst:1414 msgid "" "On some systems, :meth:`sendmsg` and :meth:`recvmsg` can be used to pass " "file descriptors between processes over an :const:`AF_UNIX` socket. When " @@ -1693,7 +1630,7 @@ msgid "" "descriptors received via this mechanism." msgstr "" -#: ../../library/socket.rst:1471 +#: ../../library/socket.rst:1425 msgid "" "Some systems do not indicate the truncated length of ancillary data items " "which have been only partially received. If an item appears to extend " @@ -1702,7 +1639,7 @@ msgid "" "provided it has not been truncated before the start of its associated data." msgstr "" -#: ../../library/socket.rst:1478 +#: ../../library/socket.rst:1432 msgid "" "On systems which support the :const:`SCM_RIGHTS` mechanism, the following " "function will receive up to *maxfds* file descriptors, returning the message " @@ -1711,7 +1648,7 @@ msgid "" "meth:`sendmsg`. ::" msgstr "" -#: ../../library/socket.rst:1507 +#: ../../library/socket.rst:1461 msgid "" "Receive normal data and ancillary data from the socket, behaving as :meth:" "`recvmsg` would, but scatter the non-ancillary data into a series of buffers " @@ -1724,7 +1661,7 @@ msgid "" "arguments have the same meaning as for :meth:`recvmsg`." msgstr "" -#: ../../library/socket.rst:1518 +#: ../../library/socket.rst:1472 msgid "" "The return value is a 4-tuple: ``(nbytes, ancdata, msg_flags, address)``, " "where *nbytes* is the total number of bytes of non-ancillary data written " @@ -1732,11 +1669,11 @@ msgid "" "for :meth:`recvmsg`." msgstr "" -#: ../../library/socket.rst:1523 +#: ../../library/socket.rst:1477 msgid "Example::" msgstr "" -#: ../../library/socket.rst:1544 +#: ../../library/socket.rst:1498 msgid "" "Receive data from the socket, writing it into *buffer* instead of creating a " "new bytestring. The return value is a pair ``(nbytes, address)`` where " @@ -1746,7 +1683,7 @@ msgid "" "format of *address* depends on the address family --- see above.)" msgstr "" -#: ../../library/socket.rst:1554 +#: ../../library/socket.rst:1508 msgid "" "Receive up to *nbytes* bytes from the socket, storing the data into a buffer " "rather than creating a new bytestring. If *nbytes* is not specified (or 0), " @@ -1755,7 +1692,7 @@ msgid "" "of the optional argument *flags*; it defaults to zero." msgstr "" -#: ../../library/socket.rst:1563 +#: ../../library/socket.rst:1517 msgid "" "Send data to the socket. The socket must be connected to a remote socket. " "The optional *flags* argument has the same meaning as for :meth:`recv` " @@ -1765,7 +1702,7 @@ msgid "" "data. For further information on this topic, consult the :ref:`socket-howto`." msgstr "" -#: ../../library/socket.rst:1578 +#: ../../library/socket.rst:1532 msgid "" "Send data to the socket. The socket must be connected to a remote socket. " "The optional *flags* argument has the same meaning as for :meth:`recv` " @@ -1775,13 +1712,13 @@ msgid "" "to determine how much data, if any, was successfully sent." msgstr "" -#: ../../library/socket.rst:1585 +#: ../../library/socket.rst:1539 msgid "" "The socket timeout is no more reset each time data is sent successfully. The " "socket timeout is now the maximum total duration to send all data." msgstr "" -#: ../../library/socket.rst:1598 +#: ../../library/socket.rst:1552 msgid "" "Send data to the socket. The socket should not be connected to a remote " "socket, since the destination socket is specified by *address*. The " @@ -1790,13 +1727,13 @@ msgid "" "address family --- see above.)" msgstr "" -#: ../../library/socket.rst:1604 +#: ../../library/socket.rst:1559 msgid "" "Raises an :ref:`auditing event ` ``socket.sendto`` with arguments " "``self``, ``address``." msgstr "" -#: ../../library/socket.rst:1614 +#: ../../library/socket.rst:1568 msgid "" "Send normal and ancillary data to the socket, gathering the non-ancillary " "data from a series of buffers and concatenating it into a single message. " @@ -1816,27 +1753,56 @@ msgid "" "bytes of non-ancillary data sent." msgstr "" -#: ../../library/socket.rst:1634 +#: ../../library/socket.rst:1588 msgid "" "The following function sends the list of file descriptors *fds* over an :" "const:`AF_UNIX` socket, on systems which support the :const:`SCM_RIGHTS` " "mechanism. See also :meth:`recvmsg`. ::" msgstr "" -#: ../../library/socket.rst:1645 +#: ../../library/socket.rst:1600 msgid "" "Raises an :ref:`auditing event ` ``socket.sendmsg`` with arguments " "``self``, ``address``." msgstr "" -#: ../../library/socket.rst:1656 +#: ../../library/socket.rst:1610 msgid "" "Specialized version of :meth:`~socket.sendmsg` for :const:`AF_ALG` socket. " "Set mode, IV, AEAD associated data length and flags for :const:`AF_ALG` " "socket." msgstr "" -#: ../../library/socket.rst:1665 +#: ../../library/socket.rst:1619 +msgid "" +"Send the list of file descriptors *fds* over an :const:`AF_UNIX` socket. The " +"*fds* parameter is a sequence of file descriptors. Consult :meth:`sendmsg` " +"for the documentation of these parameters." +msgstr "" + +#: ../../library/socket.rst:1624 +msgid "" +":ref:`Availability `: Unix supporting :meth:`~socket.sendmsg` " +"and :const:`SCM_RIGHTS` mechanism." +msgstr "" + +#: ../../library/socket.rst:1629 +msgid "" +"Receive up to *maxfds* file descriptors. Return ``(msg, list(fds), flags, " +"addr)``. Consult :meth:`recvmsg` for the documentation of these parameters." +msgstr "" + +#: ../../library/socket.rst:1633 +msgid "" +":ref:`Availability `: Unix supporting :meth:`~socket.recvmsg` " +"and :const:`SCM_RIGHTS` mechanism." +msgstr "" + +#: ../../library/socket.rst:1638 +msgid "Any truncated integers at the end of the list of file descriptors." +msgstr "" + +#: ../../library/socket.rst:1642 msgid "" "Send a file until EOF is reached by using high-performance :mod:`os." "sendfile` and return the total number of bytes which were sent. *file* must " @@ -1850,38 +1816,38 @@ msgid "" "be of :const:`SOCK_STREAM` type. Non-blocking sockets are not supported." msgstr "" -#: ../../library/socket.rst:1681 +#: ../../library/socket.rst:1658 msgid "" "Set the :ref:`inheritable flag ` of the socket's file " "descriptor or socket's handle." msgstr "" -#: ../../library/socket.rst:1689 +#: ../../library/socket.rst:1666 msgid "" "Set blocking or non-blocking mode of the socket: if *flag* is false, the " "socket is set to non-blocking, else to blocking mode." msgstr "" -#: ../../library/socket.rst:1692 +#: ../../library/socket.rst:1669 msgid "" "This method is a shorthand for certain :meth:`~socket.settimeout` calls:" msgstr "" -#: ../../library/socket.rst:1694 +#: ../../library/socket.rst:1671 msgid "``sock.setblocking(True)`` is equivalent to ``sock.settimeout(None)``" msgstr "" -#: ../../library/socket.rst:1696 +#: ../../library/socket.rst:1673 msgid "``sock.setblocking(False)`` is equivalent to ``sock.settimeout(0.0)``" msgstr "" -#: ../../library/socket.rst:1698 +#: ../../library/socket.rst:1675 msgid "" "The method no longer applies :const:`SOCK_NONBLOCK` flag on :attr:`socket." "type`." msgstr "" -#: ../../library/socket.rst:1705 +#: ../../library/socket.rst:1682 msgid "" "Set a timeout on blocking socket operations. The *value* argument can be a " "nonnegative floating point number expressing seconds, or ``None``. If a non-" @@ -1891,19 +1857,19 @@ msgid "" "blocking mode. If ``None`` is given, the socket is put in blocking mode." msgstr "" -#: ../../library/socket.rst:1712 +#: ../../library/socket.rst:1689 msgid "" "For further information, please consult the :ref:`notes on socket timeouts " "`." msgstr "" -#: ../../library/socket.rst:1714 +#: ../../library/socket.rst:1691 msgid "" "The method no longer toggles :const:`SOCK_NONBLOCK` flag on :attr:`socket." "type`." msgstr "" -#: ../../library/socket.rst:1727 +#: ../../library/socket.rst:1702 msgid "" "Set the value of the given socket option (see the Unix manual page :manpage:" "`setsockopt(2)`). The needed symbolic constants are defined in the :mod:" @@ -1916,11 +1882,11 @@ msgid "" "C function with ``optval=NULL`` and ``optlen=optlen``." msgstr "" -#: ../../library/socket.rst:1741 +#: ../../library/socket.rst:1716 msgid "setsockopt(level, optname, None, optlen: int) form added." msgstr "" -#: ../../library/socket.rst:1747 +#: ../../library/socket.rst:1722 msgid "" "Shut down one or both halves of the connection. If *how* is :const:" "`SHUT_RD`, further receives are disallowed. If *how* is :const:`SHUT_WR`, " @@ -1928,7 +1894,7 @@ msgid "" "and receives are disallowed." msgstr "" -#: ../../library/socket.rst:1755 +#: ../../library/socket.rst:1730 msgid "" "Duplicate a socket and prepare it for sharing with a target process. The " "target process must be provided with *process_id*. The resulting bytes " @@ -1939,48 +1905,48 @@ msgid "" "process." msgstr "" -#: ../../library/socket.rst:1767 +#: ../../library/socket.rst:1742 msgid "" "Note that there are no methods :meth:`read` or :meth:`write`; use :meth:" "`~socket.recv` and :meth:`~socket.send` without *flags* argument instead." msgstr "" -#: ../../library/socket.rst:1770 +#: ../../library/socket.rst:1745 msgid "" "Socket objects also have these (read-only) attributes that correspond to the " "values given to the :class:`~socket.socket` constructor." msgstr "" -#: ../../library/socket.rst:1776 +#: ../../library/socket.rst:1751 msgid "The socket family." msgstr "" -#: ../../library/socket.rst:1781 +#: ../../library/socket.rst:1756 msgid "The socket type." msgstr "" -#: ../../library/socket.rst:1786 +#: ../../library/socket.rst:1761 msgid "The socket protocol." msgstr "" -#: ../../library/socket.rst:1793 +#: ../../library/socket.rst:1768 msgid "Notes on socket timeouts" msgstr "" -#: ../../library/socket.rst:1795 +#: ../../library/socket.rst:1770 msgid "" "A socket object can be in one of three modes: blocking, non-blocking, or " "timeout. Sockets are by default always created in blocking mode, but this " "can be changed by calling :func:`setdefaulttimeout`." msgstr "" -#: ../../library/socket.rst:1799 +#: ../../library/socket.rst:1774 msgid "" "In *blocking mode*, operations block until complete or the system returns an " "error (such as connection timed out)." msgstr "" -#: ../../library/socket.rst:1802 +#: ../../library/socket.rst:1777 msgid "" "In *non-blocking mode*, operations fail (with an error that is unfortunately " "system-dependent) if they cannot be completed immediately: functions from " @@ -1988,14 +1954,14 @@ msgid "" "for reading or writing." msgstr "" -#: ../../library/socket.rst:1807 +#: ../../library/socket.rst:1782 msgid "" "In *timeout mode*, operations fail if they cannot be completed within the " "timeout specified for the socket (they raise a :exc:`timeout` exception) or " "if the system returns an error." msgstr "" -#: ../../library/socket.rst:1812 +#: ../../library/socket.rst:1787 msgid "" "At the operating system level, sockets in *timeout mode* are internally set " "in non-blocking mode. Also, the blocking and timeout modes are shared " @@ -2004,11 +1970,11 @@ msgid "" "you decide to use the :meth:`~socket.fileno()` of a socket." msgstr "" -#: ../../library/socket.rst:1819 +#: ../../library/socket.rst:1794 msgid "Timeouts and the ``connect`` method" msgstr "" -#: ../../library/socket.rst:1821 +#: ../../library/socket.rst:1796 msgid "" "The :meth:`~socket.connect` operation is also subject to the timeout " "setting, and in general it is recommended to call :meth:`~socket.settimeout` " @@ -2018,24 +1984,24 @@ msgid "" "setting." msgstr "" -#: ../../library/socket.rst:1829 +#: ../../library/socket.rst:1804 msgid "Timeouts and the ``accept`` method" msgstr "" -#: ../../library/socket.rst:1831 +#: ../../library/socket.rst:1806 msgid "" "If :func:`getdefaulttimeout` is not :const:`None`, sockets returned by the :" "meth:`~socket.accept` method inherit that timeout. Otherwise, the behaviour " "depends on settings of the listening socket:" msgstr "" -#: ../../library/socket.rst:1835 +#: ../../library/socket.rst:1810 msgid "" "if the listening socket is in *blocking mode* or in *timeout mode*, the " "socket returned by :meth:`~socket.accept` is in *blocking mode*;" msgstr "" -#: ../../library/socket.rst:1838 +#: ../../library/socket.rst:1813 msgid "" "if the listening socket is in *non-blocking mode*, whether the socket " "returned by :meth:`~socket.accept` is in blocking or non-blocking mode is " @@ -2043,11 +2009,11 @@ msgid "" "it is recommended you manually override this setting." msgstr "" -#: ../../library/socket.rst:1847 +#: ../../library/socket.rst:1822 msgid "Example" msgstr "" -#: ../../library/socket.rst:1849 +#: ../../library/socket.rst:1824 msgid "" "Here are four minimal example programs using the TCP/IP protocol: a server " "that echoes all data that it receives back (servicing only one client), and " @@ -2060,11 +2026,11 @@ msgid "" "new socket returned by :meth:`~socket.accept`." msgstr "" -#: ../../library/socket.rst:1859 +#: ../../library/socket.rst:1834 msgid "The first two examples support IPv4 only. ::" msgstr "" -#: ../../library/socket.rst:1890 +#: ../../library/socket.rst:1865 msgid "" "The next two examples are identical to the above two, but support both IPv4 " "and IPv6. The server side will listen to the first address family available " @@ -2074,73 +2040,73 @@ msgid "" "resolution, and sends traffic to the first one connected successfully. ::" msgstr "" -#: ../../library/socket.rst:1962 +#: ../../library/socket.rst:1937 msgid "" "The next example shows how to write a very simple network sniffer with raw " "sockets on Windows. The example requires administrator privileges to modify " "the interface::" msgstr "" -#: ../../library/socket.rst:1987 +#: ../../library/socket.rst:1962 msgid "" "The next example shows how to use the socket interface to communicate to a " "CAN network using the raw socket protocol. To use CAN with the broadcast " "manager protocol instead, open a socket with::" msgstr "" -#: ../../library/socket.rst:1993 +#: ../../library/socket.rst:1968 msgid "" "After binding (:const:`CAN_RAW`) or connecting (:const:`CAN_BCM`) the " "socket, you can use the :meth:`socket.send`, and the :meth:`socket.recv` " "operations (and their counterparts) on the socket object as usual." msgstr "" -#: ../../library/socket.rst:1997 +#: ../../library/socket.rst:1972 msgid "This last example might require special privileges::" msgstr "" -#: ../../library/socket.rst:2037 +#: ../../library/socket.rst:2012 msgid "" "Running an example several times with too small delay between executions, " "could lead to this error::" msgstr "" -#: ../../library/socket.rst:2042 +#: ../../library/socket.rst:2017 msgid "" "This is because the previous execution has left the socket in a " "``TIME_WAIT`` state, and can't be immediately reused." msgstr "" -#: ../../library/socket.rst:2045 +#: ../../library/socket.rst:2020 msgid "" "There is a :mod:`socket` flag to set, in order to prevent this, :data:" "`socket.SO_REUSEADDR`::" msgstr "" -#: ../../library/socket.rst:2052 +#: ../../library/socket.rst:2027 msgid "" "the :data:`SO_REUSEADDR` flag tells the kernel to reuse a local socket in " "``TIME_WAIT`` state, without waiting for its natural timeout to expire." msgstr "" -#: ../../library/socket.rst:2058 +#: ../../library/socket.rst:2033 msgid "" "For an introduction to socket programming (in C), see the following papers:" msgstr "" -#: ../../library/socket.rst:2060 +#: ../../library/socket.rst:2035 msgid "" "*An Introductory 4.3BSD Interprocess Communication Tutorial*, by Stuart " "Sechrest" msgstr "" -#: ../../library/socket.rst:2062 +#: ../../library/socket.rst:2037 msgid "" "*An Advanced 4.3BSD Interprocess Communication Tutorial*, by Samuel J. " "Leffler et al," msgstr "" -#: ../../library/socket.rst:2065 +#: ../../library/socket.rst:2040 msgid "" "both in the UNIX Programmer's Manual, Supplementary Documents 1 (sections " "PS1:7 and PS1:8). The platform-specific reference material for the various " diff --git a/library/sqlite3.po b/library/sqlite3.po index 17c248bd97..de01a0b5ec 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-07 06:52+0000\n" +"POT-Creation-Date: 2020-06-20 18:08+0800\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-" @@ -69,98 +69,101 @@ msgstr "" #: ../../library/sqlite3.rst:57 msgid "" +"Usually your SQL operations will need to use values from Python variables. " +"You shouldn't assemble your query using Python's string operations because " +"doing so is insecure; it makes your program vulnerable to an SQL injection " +"attack (see https://xkcd.com/327/ for humorous example of what can go wrong)." +msgstr "" + +#: ../../library/sqlite3.rst:62 +msgid "" +"Instead, use the DB-API's parameter substitution. Put ``?`` as a " +"placeholder wherever you want to use a value, and then provide a tuple of " +"values as the second argument to the cursor's :meth:`~Cursor.execute` " +"method. (Other database modules may use a different placeholder, such as ``" +"%s`` or ``:1``.) For example::" +msgstr "" + +#: ../../library/sqlite3.rst:84 +msgid "" "To retrieve data after executing a SELECT statement, you can either treat " "the cursor as an :term:`iterator`, call the cursor's :meth:`~Cursor." "fetchone` method to retrieve a single matching row, or call :meth:`~Cursor." "fetchall` to get a list of the matching rows." msgstr "" -#: ../../library/sqlite3.rst:62 +#: ../../library/sqlite3.rst:89 msgid "This example uses the iterator form::" msgstr "" -#: ../../library/sqlite3.rst:75 -msgid "" -"Usually your SQL operations will need to use values from Python variables. " -"You shouldn't assemble your query using Python's string operations because " -"doing so is insecure; it makes your program vulnerable to an SQL injection " -"attack (see the `xkcd webcomic `_ for a humorous " -"example of what can go wrong)::" +#: ../../library/sqlite3.rst:104 +msgid "https://github.com/ghaering/pysqlite" msgstr "" -#: ../../library/sqlite3.rst:85 +#: ../../library/sqlite3.rst:103 msgid "" -"Instead, use the DB-API's parameter substitution. Put a placeholder wherever " -"you want to use a value, and then provide a tuple of values as the second " -"argument to the cursor's :meth:`~Cursor.execute` method. An SQL statement " -"may use one of two kinds of placeholders: question marks (qmark style) or " -"named placeholders (named style). For the qmark style, ``parameters`` must " -"be a :term:`sequence `. For the named style, it can be either a :" -"term:`sequence ` or :class:`dict` instance. The length of the :" -"term:`sequence ` must match the number of placeholders, or a :exc:" -"`ProgrammingError` is raised. If a :class:`dict` is given, it must contain " -"keys for all named parameters. Any extra items are ignored. Here's an " -"example of both styles:" +"The pysqlite web page -- sqlite3 is developed externally under the name " +"\"pysqlite\"." msgstr "" -#: ../../library/sqlite3.rst:104 +#: ../../library/sqlite3.rst:108 msgid "https://www.sqlite.org/" msgstr "" -#: ../../library/sqlite3.rst:103 +#: ../../library/sqlite3.rst:107 msgid "" "The SQLite web page; the documentation describes the syntax and the " "available data types for the supported SQL dialect." msgstr "" -#: ../../library/sqlite3.rst:107 +#: ../../library/sqlite3.rst:111 msgid "https://www.w3schools.com/sql/" msgstr "" -#: ../../library/sqlite3.rst:107 +#: ../../library/sqlite3.rst:111 msgid "Tutorial, reference and examples for learning SQL syntax." msgstr "" -#: ../../library/sqlite3.rst:109 +#: ../../library/sqlite3.rst:113 msgid ":pep:`249` - Database API Specification 2.0" msgstr "" -#: ../../library/sqlite3.rst:110 +#: ../../library/sqlite3.rst:114 msgid "PEP written by Marc-André Lemburg." msgstr "" -#: ../../library/sqlite3.rst:116 +#: ../../library/sqlite3.rst:120 msgid "Module functions and constants" msgstr "" -#: ../../library/sqlite3.rst:121 +#: ../../library/sqlite3.rst:125 msgid "" "The version number of this module, as a string. This is not the version of " "the SQLite library." msgstr "" -#: ../../library/sqlite3.rst:127 +#: ../../library/sqlite3.rst:131 msgid "" "The version number of this module, as a tuple of integers. This is not the " "version of the SQLite library." msgstr "" -#: ../../library/sqlite3.rst:133 +#: ../../library/sqlite3.rst:137 msgid "The version number of the run-time SQLite library, as a string." msgstr "" -#: ../../library/sqlite3.rst:138 +#: ../../library/sqlite3.rst:142 msgid "" "The version number of the run-time SQLite library, as a tuple of integers." msgstr "" -#: ../../library/sqlite3.rst:143 ../../library/sqlite3.rst:156 +#: ../../library/sqlite3.rst:147 ../../library/sqlite3.rst:160 msgid "" "This constant is meant to be used with the *detect_types* parameter of the :" "func:`connect` function." msgstr "" -#: ../../library/sqlite3.rst:146 +#: ../../library/sqlite3.rst:150 msgid "" "Setting it makes the :mod:`sqlite3` module parse the declared type for each " "column it returns. It will parse out the first word of the declared type, " @@ -170,7 +173,7 @@ msgid "" "registered for that type there." msgstr "" -#: ../../library/sqlite3.rst:159 +#: ../../library/sqlite3.rst:163 msgid "" "Setting this makes the SQLite interface parse the column name for each " "column it returns. It will look for a string formed [mytype] in there, and " @@ -180,16 +183,16 @@ msgid "" "`Cursor.description` does not include the type, i. e. if you use something " "like ``'as \"Expiration date [datetime]\"'`` in your SQL, then we will parse " "out everything until the first ``'['`` for the column name and strip the " -"preceding space: the column name would simply be \"Expiration date\"." +"preceeding space: the column name would simply be \"Expiration date\"." msgstr "" -#: ../../library/sqlite3.rst:172 +#: ../../library/sqlite3.rst:176 msgid "" "Opens a connection to the SQLite database file *database*. By default " "returns a :class:`Connection` object, unless a custom *factory* is given." msgstr "" -#: ../../library/sqlite3.rst:175 +#: ../../library/sqlite3.rst:179 msgid "" "*database* is a :term:`path-like object` giving the pathname (absolute or " "relative to the current working directory) of the database file to be " @@ -197,7 +200,7 @@ msgid "" "database that resides in RAM instead of on disk." msgstr "" -#: ../../library/sqlite3.rst:180 +#: ../../library/sqlite3.rst:184 msgid "" "When a database is accessed by multiple connections, and one of the " "processes modifies the database, the SQLite database is locked until that " @@ -206,13 +209,13 @@ msgid "" "The default for the timeout parameter is 5.0 (five seconds)." msgstr "" -#: ../../library/sqlite3.rst:186 +#: ../../library/sqlite3.rst:190 msgid "" "For the *isolation_level* parameter, please see the :attr:`~Connection." "isolation_level` property of :class:`Connection` objects." msgstr "" -#: ../../library/sqlite3.rst:189 +#: ../../library/sqlite3.rst:193 msgid "" "SQLite natively supports only the types TEXT, INTEGER, REAL, BLOB and NULL. " "If you want to use other types you must add support for them yourself. The " @@ -221,16 +224,14 @@ msgid "" "that." msgstr "" -#: ../../library/sqlite3.rst:194 +#: ../../library/sqlite3.rst:198 msgid "" "*detect_types* defaults to 0 (i. e. off, no type detection), you can set it " "to any combination of :const:`PARSE_DECLTYPES` and :const:`PARSE_COLNAMES` " -"to turn type detection on. Due to SQLite behaviour, types can't be detected " -"for generated fields (for example ``max(data)``), even when *detect_types* " -"parameter is set. In such case, the returned type is :class:`str`." +"to turn type detection on." msgstr "" -#: ../../library/sqlite3.rst:200 +#: ../../library/sqlite3.rst:202 msgid "" "By default, *check_same_thread* is :const:`True` and only the creating " "thread may use the connection. If set :const:`False`, the returned " @@ -239,7 +240,7 @@ msgid "" "the user to avoid data corruption." msgstr "" -#: ../../library/sqlite3.rst:205 +#: ../../library/sqlite3.rst:207 msgid "" "By default, the :mod:`sqlite3` module uses its :class:`Connection` class for " "the connect call. You can, however, subclass the :class:`Connection` class " @@ -247,11 +248,11 @@ msgid "" "the *factory* parameter." msgstr "" -#: ../../library/sqlite3.rst:210 +#: ../../library/sqlite3.rst:212 msgid "Consult the section :ref:`sqlite3-types` of this manual for details." msgstr "" -#: ../../library/sqlite3.rst:212 +#: ../../library/sqlite3.rst:214 msgid "" "The :mod:`sqlite3` module internally uses a statement cache to avoid SQL " "parsing overhead. If you want to explicitly set the number of statements " @@ -259,36 +260,36 @@ msgid "" "parameter. The currently implemented default is to cache 100 statements." msgstr "" -#: ../../library/sqlite3.rst:217 +#: ../../library/sqlite3.rst:219 msgid "" "If *uri* is true, *database* is interpreted as a URI. This allows you to " "specify options. For example, to open a database in read-only mode you can " "use::" msgstr "" -#: ../../library/sqlite3.rst:223 +#: ../../library/sqlite3.rst:225 msgid "" "More information about this feature, including a list of recognized options, " "can be found in the `SQLite URI documentation `_." msgstr "" -#: ../../library/sqlite3.rst:226 +#: ../../library/sqlite3.rst:229 msgid "" "Raises an :ref:`auditing event ` ``sqlite3.connect`` with argument " "``database``." msgstr "" -#: ../../library/sqlite3.rst:228 +#: ../../library/sqlite3.rst:230 msgid "Added the *uri* parameter." msgstr "" -#: ../../library/sqlite3.rst:231 +#: ../../library/sqlite3.rst:233 msgid "" "*database* can now also be a :term:`path-like object`, not only a string." msgstr "" -#: ../../library/sqlite3.rst:237 +#: ../../library/sqlite3.rst:239 msgid "" "Registers a callable to convert a bytestring from the database into a custom " "Python type. The callable will be invoked for all database values that are " @@ -298,7 +299,7 @@ msgid "" "manner." msgstr "" -#: ../../library/sqlite3.rst:246 +#: ../../library/sqlite3.rst:248 msgid "" "Registers a callable to convert the custom Python type *type* into one of " "SQLite's supported types. The callable *callable* accepts as single " @@ -306,7 +307,7 @@ msgid "" "int, float, str or bytes." msgstr "" -#: ../../library/sqlite3.rst:254 +#: ../../library/sqlite3.rst:256 msgid "" "Returns :const:`True` if the string *sql* contains one or more complete SQL " "statements terminated by semicolons. It does not verify that the SQL is " @@ -314,12 +315,12 @@ msgid "" "the statement is terminated by a semicolon." msgstr "" -#: ../../library/sqlite3.rst:259 +#: ../../library/sqlite3.rst:261 msgid "" "This can be used to build a shell for SQLite, as in the following example:" msgstr "" -#: ../../library/sqlite3.rst:267 +#: ../../library/sqlite3.rst:269 msgid "" "By default you will not get any tracebacks in user-defined functions, " "aggregates, converters, authorizer callbacks etc. If you want to debug them, " @@ -328,35 +329,35 @@ msgid "" "disable the feature again." msgstr "" -#: ../../library/sqlite3.rst:277 +#: ../../library/sqlite3.rst:279 msgid "Connection Objects" msgstr "" -#: ../../library/sqlite3.rst:281 +#: ../../library/sqlite3.rst:283 msgid "A SQLite database connection has the following attributes and methods:" msgstr "" -#: ../../library/sqlite3.rst:285 +#: ../../library/sqlite3.rst:287 msgid "" "Get or set the current default isolation level. :const:`None` for autocommit " "mode or one of \"DEFERRED\", \"IMMEDIATE\" or \"EXCLUSIVE\". See section :" "ref:`sqlite3-controlling-transactions` for a more detailed explanation." msgstr "" -#: ../../library/sqlite3.rst:291 +#: ../../library/sqlite3.rst:293 msgid "" ":const:`True` if a transaction is active (there are uncommitted changes), :" "const:`False` otherwise. Read-only attribute." msgstr "" -#: ../../library/sqlite3.rst:298 +#: ../../library/sqlite3.rst:300 msgid "" "The cursor method accepts a single optional parameter *factory*. If " "supplied, this must be a callable returning an instance of :class:`Cursor` " "or its subclasses." msgstr "" -#: ../../library/sqlite3.rst:304 +#: ../../library/sqlite3.rst:306 msgid "" "This method commits the current transaction. If you don't call this method, " "anything you did since the last call to ``commit()`` is not visible from " @@ -364,41 +365,41 @@ msgid "" "written to the database, please check you didn't forget to call this method." msgstr "" -#: ../../library/sqlite3.rst:311 +#: ../../library/sqlite3.rst:313 msgid "" "This method rolls back any changes to the database since the last call to :" "meth:`commit`." msgstr "" -#: ../../library/sqlite3.rst:316 +#: ../../library/sqlite3.rst:318 msgid "" "This closes the database connection. Note that this does not automatically " "call :meth:`commit`. If you just close your database connection without " "calling :meth:`commit` first, your changes will be lost!" msgstr "" -#: ../../library/sqlite3.rst:322 +#: ../../library/sqlite3.rst:324 msgid "" "This is a nonstandard shortcut that creates a cursor object by calling the :" "meth:`~Connection.cursor` method, calls the cursor's :meth:`~Cursor.execute` " "method with the *parameters* given, and returns the cursor." msgstr "" -#: ../../library/sqlite3.rst:329 +#: ../../library/sqlite3.rst:331 msgid "" "This is a nonstandard shortcut that creates a cursor object by calling the :" "meth:`~Connection.cursor` method, calls the cursor's :meth:`~Cursor." "executemany` method with the *parameters* given, and returns the cursor." msgstr "" -#: ../../library/sqlite3.rst:336 +#: ../../library/sqlite3.rst:338 msgid "" "This is a nonstandard shortcut that creates a cursor object by calling the :" "meth:`~Connection.cursor` method, calls the cursor's :meth:`~Cursor." "executescript` method with the given *sql_script*, and returns the cursor." msgstr "" -#: ../../library/sqlite3.rst:343 +#: ../../library/sqlite3.rst:345 msgid "" "Creates a user-defined function that you can later use from within SQL " "statements under the function name *name*. *num_params* is the number of " @@ -411,26 +412,26 @@ msgid "" "older versions." msgstr "" -#: ../../library/sqlite3.rst:353 +#: ../../library/sqlite3.rst:355 msgid "" "The function can return any of the types supported by SQLite: bytes, str, " "int, float and ``None``." msgstr "" -#: ../../library/sqlite3.rst:356 +#: ../../library/sqlite3.rst:358 msgid "The *deterministic* parameter was added." msgstr "" -#: ../../library/sqlite3.rst:359 ../../library/sqlite3.rst:376 -#: ../../library/sqlite3.rst:490 ../../library/sqlite3.rst:643 +#: ../../library/sqlite3.rst:361 ../../library/sqlite3.rst:378 +#: ../../library/sqlite3.rst:492 ../../library/sqlite3.rst:649 msgid "Example:" msgstr "" -#: ../../library/sqlite3.rst:366 +#: ../../library/sqlite3.rst:368 msgid "Creates a user-defined aggregate function." msgstr "" -#: ../../library/sqlite3.rst:368 +#: ../../library/sqlite3.rst:370 msgid "" "The aggregate class must implement a ``step`` method, which accepts the " "number of parameters *num_params* (if *num_params* is -1, the function may " @@ -438,13 +439,13 @@ msgid "" "the final result of the aggregate." msgstr "" -#: ../../library/sqlite3.rst:373 +#: ../../library/sqlite3.rst:375 msgid "" "The ``finalize`` method can return any of the types supported by SQLite: " "bytes, str, int, float and ``None``." msgstr "" -#: ../../library/sqlite3.rst:383 +#: ../../library/sqlite3.rst:385 msgid "" "Creates a collation with the specified *name* and *callable*. The callable " "will be passed two string arguments. It should return -1 if the first is " @@ -453,30 +454,30 @@ msgid "" "(ORDER BY in SQL) so your comparisons don't affect other SQL operations." msgstr "" -#: ../../library/sqlite3.rst:389 +#: ../../library/sqlite3.rst:391 msgid "" "Note that the callable will get its parameters as Python bytestrings, which " "will normally be encoded in UTF-8." msgstr "" -#: ../../library/sqlite3.rst:392 +#: ../../library/sqlite3.rst:394 msgid "" "The following example shows a custom collation that sorts \"the wrong way\":" msgstr "" -#: ../../library/sqlite3.rst:396 +#: ../../library/sqlite3.rst:398 msgid "" "To remove a collation, call ``create_collation`` with ``None`` as callable::" msgstr "" -#: ../../library/sqlite3.rst:403 +#: ../../library/sqlite3.rst:405 msgid "" "You can call this method from a different thread to abort any queries that " "might be executing on the connection. The query will then abort and the " "caller will get an exception." msgstr "" -#: ../../library/sqlite3.rst:410 +#: ../../library/sqlite3.rst:412 msgid "" "This routine registers a callback. The callback is invoked for each attempt " "to access a column of a table in the database. The callback should return :" @@ -486,7 +487,7 @@ msgid "" "in the :mod:`sqlite3` module." msgstr "" -#: ../../library/sqlite3.rst:417 +#: ../../library/sqlite3.rst:419 msgid "" "The first argument to the callback signifies what kind of operation is to be " "authorized. The second and third argument will be arguments or :const:`None` " @@ -497,7 +498,7 @@ msgid "" "code." msgstr "" -#: ../../library/sqlite3.rst:424 +#: ../../library/sqlite3.rst:426 msgid "" "Please consult the SQLite documentation about the possible values for the " "first argument and the meaning of the second and third argument depending on " @@ -505,7 +506,7 @@ msgid "" "module." msgstr "" -#: ../../library/sqlite3.rst:431 +#: ../../library/sqlite3.rst:433 msgid "" "This routine registers a callback. The callback is invoked for every *n* " "instructions of the SQLite virtual machine. This is useful if you want to " @@ -513,26 +514,26 @@ msgid "" "a GUI." msgstr "" -#: ../../library/sqlite3.rst:436 +#: ../../library/sqlite3.rst:438 msgid "" "If you want to clear any previously installed progress handler, call the " "method with :const:`None` for *handler*." msgstr "" -#: ../../library/sqlite3.rst:439 +#: ../../library/sqlite3.rst:441 msgid "" "Returning a non-zero value from the handler function will terminate the " "currently executing query and cause it to raise an :exc:`OperationalError` " "exception." msgstr "" -#: ../../library/sqlite3.rst:446 +#: ../../library/sqlite3.rst:448 msgid "" "Registers *trace_callback* to be called for each SQL statement that is " "actually executed by the SQLite backend." msgstr "" -#: ../../library/sqlite3.rst:449 +#: ../../library/sqlite3.rst:451 msgid "" "The only argument passed to the callback is the statement (as string) that " "is being executed. The return value of the callback is ignored. Note that " @@ -541,12 +542,12 @@ msgid "" "Python module and the execution of triggers defined in the current database." msgstr "" -#: ../../library/sqlite3.rst:455 +#: ../../library/sqlite3.rst:457 msgid "" "Passing :const:`None` as *trace_callback* will disable the trace callback." msgstr "" -#: ../../library/sqlite3.rst:462 +#: ../../library/sqlite3.rst:464 msgid "" "This routine allows/disallows the SQLite engine to load SQLite extensions " "from shared libraries. SQLite extensions can define new functions, " @@ -554,18 +555,18 @@ msgid "" "extension is the fulltext-search extension distributed with SQLite." msgstr "" -#: ../../library/sqlite3.rst:467 ../../library/sqlite3.rst:479 +#: ../../library/sqlite3.rst:469 ../../library/sqlite3.rst:481 msgid "Loadable extensions are disabled by default. See [#f1]_." msgstr "" -#: ../../library/sqlite3.rst:475 +#: ../../library/sqlite3.rst:477 msgid "" "This routine loads a SQLite extension from a shared library. You have to " "enable extension loading with :meth:`enable_load_extension` before you can " "use this routine." msgstr "" -#: ../../library/sqlite3.rst:485 +#: ../../library/sqlite3.rst:487 msgid "" "You can change this attribute to a callable that accepts the cursor and the " "original row as a tuple and will return the real result row. This way, you " @@ -573,7 +574,7 @@ msgid "" "object that can also access columns by name." msgstr "" -#: ../../library/sqlite3.rst:494 +#: ../../library/sqlite3.rst:496 msgid "" "If returning a tuple doesn't suffice and you want name-based access to " "columns, you should consider setting :attr:`row_factory` to the highly-" @@ -583,7 +584,7 @@ msgid "" "approach or even a db_row based solution." msgstr "" -#: ../../library/sqlite3.rst:506 +#: ../../library/sqlite3.rst:508 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 " @@ -591,23 +592,23 @@ msgid "" "want to return bytestrings instead, you can set it to :class:`bytes`." msgstr "" -#: ../../library/sqlite3.rst:511 +#: ../../library/sqlite3.rst:513 msgid "" "You can also set it to any other callable that accepts a single bytestring " "parameter and returns the resulting object." msgstr "" -#: ../../library/sqlite3.rst:514 +#: ../../library/sqlite3.rst:516 msgid "See the following example code for illustration:" msgstr "" -#: ../../library/sqlite3.rst:521 +#: ../../library/sqlite3.rst:523 msgid "" "Returns the total number of database rows that have been modified, inserted, " "or deleted since the database connection was opened." msgstr "" -#: ../../library/sqlite3.rst:527 +#: ../../library/sqlite3.rst:529 msgid "" "Returns an iterator to dump the database in an SQL text format. Useful when " "saving an in-memory database for later restoration. This function provides " @@ -615,11 +616,11 @@ msgid "" "shell." msgstr "" -#: ../../library/sqlite3.rst:532 +#: ../../library/sqlite3.rst:534 msgid "Example::" msgstr "" -#: ../../library/sqlite3.rst:546 +#: ../../library/sqlite3.rst:548 msgid "" "This method makes a backup of a SQLite database even while it's being " "accessed by other clients, or concurrently by the same connection. The copy " @@ -627,14 +628,14 @@ msgid "" "class:`Connection` instance." msgstr "" -#: ../../library/sqlite3.rst:551 +#: ../../library/sqlite3.rst:553 msgid "" "By default, or when *pages* is either ``0`` or a negative integer, the " "entire database is copied in a single step; otherwise the method performs a " "loop copying up to *pages* pages at a time." msgstr "" -#: ../../library/sqlite3.rst:555 +#: ../../library/sqlite3.rst:557 msgid "" "If *progress* is specified, it must either be ``None`` or a callable object " "that will be executed at each iteration with three integer arguments, " @@ -642,7 +643,7 @@ msgid "" "pages still to be copied and the *total* number of pages." msgstr "" -#: ../../library/sqlite3.rst:560 +#: ../../library/sqlite3.rst:562 msgid "" "The *name* argument specifies the database name that will be copied: it must " "be a string containing either ``\"main\"``, the default, to indicate the " @@ -651,40 +652,46 @@ msgid "" "an attached database." msgstr "" -#: ../../library/sqlite3.rst:566 +#: ../../library/sqlite3.rst:568 msgid "" "The *sleep* argument specifies the number of seconds to sleep by between " "successive attempts to backup remaining pages, can be specified either as an " "integer or a floating point value." msgstr "" -#: ../../library/sqlite3.rst:570 +#: ../../library/sqlite3.rst:572 msgid "Example 1, copy an existing database into another::" msgstr "" -#: ../../library/sqlite3.rst:584 +#: ../../library/sqlite3.rst:586 msgid "Example 2, copy an existing database into a transient copy::" msgstr "" -#: ../../library/sqlite3.rst:592 +#: ../../library/sqlite3.rst:594 msgid "Availability: SQLite 3.6.11 or higher" msgstr "" -#: ../../library/sqlite3.rst:600 +#: ../../library/sqlite3.rst:602 msgid "Cursor Objects" msgstr "" -#: ../../library/sqlite3.rst:604 +#: ../../library/sqlite3.rst:606 msgid "A :class:`Cursor` instance has the following attributes and methods." msgstr "" -#: ../../library/sqlite3.rst:611 +#: ../../library/sqlite3.rst:613 msgid "" -"Executes an SQL statement. Values may be bound to the statement using :ref:" -"`placeholders `." +"Executes an SQL statement. The SQL statement may be parameterized (i. e. " +"placeholders instead of SQL literals). The :mod:`sqlite3` module supports " +"two kinds of placeholders: question marks (qmark style) and named " +"placeholders (named style)." +msgstr "" + +#: ../../library/sqlite3.rst:618 +msgid "Here's an example of both styles:" msgstr "" -#: ../../library/sqlite3.rst:614 +#: ../../library/sqlite3.rst:622 msgid "" ":meth:`execute` will only execute a single SQL statement. If you try to " "execute more than one statement with it, it will raise a :exc:`.Warning`. " @@ -692,43 +699,41 @@ msgid "" "with one call." msgstr "" -#: ../../library/sqlite3.rst:622 +#: ../../library/sqlite3.rst:630 msgid "" -"Executes a :ref:`parameterized ` SQL command against " -"all parameter sequences or mappings found in the sequence " -"*seq_of_parameters*. The :mod:`sqlite3` module also allows using an :term:" -"`iterator` yielding parameters instead of a sequence." +"Executes an SQL command against all parameter sequences or mappings found in " +"the sequence *seq_of_parameters*. The :mod:`sqlite3` module also allows " +"using an :term:`iterator` yielding parameters instead of a sequence." msgstr "" -#: ../../library/sqlite3.rst:629 +#: ../../library/sqlite3.rst:636 msgid "Here's a shorter example using a :term:`generator`:" msgstr "" -#: ../../library/sqlite3.rst:636 +#: ../../library/sqlite3.rst:643 msgid "" "This is a nonstandard convenience method for executing multiple SQL " "statements at once. It issues a ``COMMIT`` statement first, then executes " -"the SQL script it gets as a parameter. This method disregards :attr:" -"`isolation_level`; any transaction control must be added to *sql_script*." +"the SQL script it gets as a parameter." msgstr "" -#: ../../library/sqlite3.rst:641 +#: ../../library/sqlite3.rst:647 msgid "*sql_script* can be an instance of :class:`str`." msgstr "" -#: ../../library/sqlite3.rst:650 +#: ../../library/sqlite3.rst:656 msgid "" "Fetches the next row of a query result set, returning a single sequence, or :" "const:`None` when no more data is available." msgstr "" -#: ../../library/sqlite3.rst:656 +#: ../../library/sqlite3.rst:662 msgid "" "Fetches the next set of rows of a query result, returning a list. An empty " "list is returned when no more rows are available." msgstr "" -#: ../../library/sqlite3.rst:659 +#: ../../library/sqlite3.rst:665 msgid "" "The number of rows to fetch per call is specified by the *size* parameter. " "If it is not given, the cursor's arraysize determines the number of rows to " @@ -737,7 +742,7 @@ msgid "" "not being available, fewer rows may be returned." msgstr "" -#: ../../library/sqlite3.rst:665 +#: ../../library/sqlite3.rst:671 msgid "" "Note there are performance considerations involved with the *size* " "parameter. For optimal performance, it is usually best to use the arraysize " @@ -745,38 +750,38 @@ msgid "" "the same value from one :meth:`fetchmany` call to the next." msgstr "" -#: ../../library/sqlite3.rst:672 +#: ../../library/sqlite3.rst:678 msgid "" "Fetches all (remaining) rows of a query result, returning a list. Note that " "the cursor's arraysize attribute can affect the performance of this " "operation. An empty list is returned when no rows are available." msgstr "" -#: ../../library/sqlite3.rst:678 +#: ../../library/sqlite3.rst:684 msgid "Close the cursor now (rather than whenever ``__del__`` is called)." msgstr "" -#: ../../library/sqlite3.rst:680 +#: ../../library/sqlite3.rst:686 msgid "" "The cursor will be unusable from this point forward; a :exc:" "`ProgrammingError` exception will be raised if any operation is attempted " "with the cursor." msgstr "" -#: ../../library/sqlite3.rst:685 +#: ../../library/sqlite3.rst:691 msgid "" "Although the :class:`Cursor` class of the :mod:`sqlite3` module implements " "this attribute, the database engine's own support for the determination of " "\"rows affected\"/\"rows selected\" is quirky." msgstr "" -#: ../../library/sqlite3.rst:689 +#: ../../library/sqlite3.rst:695 msgid "" "For :meth:`executemany` statements, the number of modifications are summed " "up into :attr:`rowcount`." msgstr "" -#: ../../library/sqlite3.rst:692 +#: ../../library/sqlite3.rst:698 msgid "" "As required by the Python DB API Spec, the :attr:`rowcount` attribute \"is " "-1 in case no ``executeXX()`` has been performed on the cursor or the " @@ -785,13 +790,13 @@ msgid "" "rows a query produced until all rows were fetched." msgstr "" -#: ../../library/sqlite3.rst:698 +#: ../../library/sqlite3.rst:704 msgid "" "With SQLite versions before 3.6.5, :attr:`rowcount` is set to 0 if you make " "a ``DELETE FROM table`` without any condition." msgstr "" -#: ../../library/sqlite3.rst:703 +#: ../../library/sqlite3.rst:709 msgid "" "This read-only attribute provides the rowid of the last modified row. It is " "only set if you issued an ``INSERT`` or a ``REPLACE`` statement using the :" @@ -800,35 +805,35 @@ msgid "" "`None`." msgstr "" -#: ../../library/sqlite3.rst:709 +#: ../../library/sqlite3.rst:715 msgid "" "If the ``INSERT`` or ``REPLACE`` statement failed to insert the previous " "successful rowid is returned." msgstr "" -#: ../../library/sqlite3.rst:712 +#: ../../library/sqlite3.rst:718 msgid "Added support for the ``REPLACE`` statement." msgstr "" -#: ../../library/sqlite3.rst:717 +#: ../../library/sqlite3.rst:723 msgid "" "Read/write attribute that controls the number of rows returned by :meth:" "`fetchmany`. The default value is 1 which means a single row would be " "fetched per call." msgstr "" -#: ../../library/sqlite3.rst:722 +#: ../../library/sqlite3.rst:728 msgid "" "This read-only attribute provides the column names of the last query. To " "remain compatible with the Python DB API, it returns a 7-tuple for each " "column where the last six items of each tuple are :const:`None`." msgstr "" -#: ../../library/sqlite3.rst:726 +#: ../../library/sqlite3.rst:732 msgid "It is set for ``SELECT`` statements without any matching rows as well." msgstr "" -#: ../../library/sqlite3.rst:730 +#: ../../library/sqlite3.rst:736 msgid "" "This read-only attribute provides the SQLite database :class:`Connection` " "used by the :class:`Cursor` object. A :class:`Cursor` object created by " @@ -836,79 +841,79 @@ msgid "" "`connection` attribute that refers to *con*::" msgstr "" -#: ../../library/sqlite3.rst:743 +#: ../../library/sqlite3.rst:749 msgid "Row Objects" msgstr "" -#: ../../library/sqlite3.rst:747 +#: ../../library/sqlite3.rst:753 msgid "" "A :class:`Row` instance serves as a highly optimized :attr:`~Connection." "row_factory` for :class:`Connection` objects. It tries to mimic a tuple in " "most of its features." msgstr "" -#: ../../library/sqlite3.rst:751 +#: ../../library/sqlite3.rst:757 msgid "" "It supports mapping access by column name and index, iteration, " "representation, equality testing and :func:`len`." msgstr "" -#: ../../library/sqlite3.rst:754 +#: ../../library/sqlite3.rst:760 msgid "" "If two :class:`Row` objects have exactly the same columns and their members " "are equal, they compare equal." msgstr "" -#: ../../library/sqlite3.rst:759 +#: ../../library/sqlite3.rst:765 msgid "" "This method returns a list of column names. Immediately after a query, it is " "the first member of each tuple in :attr:`Cursor.description`." msgstr "" -#: ../../library/sqlite3.rst:762 +#: ../../library/sqlite3.rst:768 msgid "Added support of slicing." msgstr "" -#: ../../library/sqlite3.rst:765 +#: ../../library/sqlite3.rst:771 msgid "Let's assume we initialize a table as in the example given above::" msgstr "" -#: ../../library/sqlite3.rst:777 +#: ../../library/sqlite3.rst:783 msgid "Now we plug :class:`Row` in::" msgstr "" -#: ../../library/sqlite3.rst:809 +#: ../../library/sqlite3.rst:815 msgid "Exceptions" msgstr "" -#: ../../library/sqlite3.rst:813 +#: ../../library/sqlite3.rst:819 msgid "A subclass of :exc:`Exception`." msgstr "" -#: ../../library/sqlite3.rst:817 +#: ../../library/sqlite3.rst:823 msgid "" "The base class of the other exceptions in this module. It is a subclass of :" "exc:`Exception`." msgstr "" -#: ../../library/sqlite3.rst:822 +#: ../../library/sqlite3.rst:828 msgid "Exception raised for errors that are related to the database." msgstr "" -#: ../../library/sqlite3.rst:826 +#: ../../library/sqlite3.rst:832 msgid "" "Exception raised when the relational integrity of the database is affected, " "e.g. a foreign key check fails. It is a subclass of :exc:`DatabaseError`." msgstr "" -#: ../../library/sqlite3.rst:831 +#: ../../library/sqlite3.rst:837 msgid "" "Exception raised for programming errors, e.g. table not found or already " "exists, syntax error in the SQL statement, wrong number of parameters " "specified, etc. It is a subclass of :exc:`DatabaseError`." msgstr "" -#: ../../library/sqlite3.rst:837 +#: ../../library/sqlite3.rst:843 msgid "" "Exception raised for errors that are related to the database's operation and " "not necessarily under the control of the programmer, e.g. an unexpected " @@ -916,7 +921,7 @@ msgid "" "not be processed, etc. It is a subclass of :exc:`DatabaseError`." msgstr "" -#: ../../library/sqlite3.rst:844 +#: ../../library/sqlite3.rst:850 msgid "" "Exception raised in case a method or database API was used which is not " "supported by the database, e.g. calling the :meth:`~Connection.rollback` " @@ -924,82 +929,82 @@ msgid "" "turned off. It is a subclass of :exc:`DatabaseError`." msgstr "" -#: ../../library/sqlite3.rst:853 +#: ../../library/sqlite3.rst:859 msgid "SQLite and Python types" msgstr "" -#: ../../library/sqlite3.rst:857 +#: ../../library/sqlite3.rst:863 msgid "Introduction" msgstr "簡介" -#: ../../library/sqlite3.rst:859 +#: ../../library/sqlite3.rst:865 msgid "" "SQLite natively supports the following types: ``NULL``, ``INTEGER``, " "``REAL``, ``TEXT``, ``BLOB``." msgstr "" -#: ../../library/sqlite3.rst:862 +#: ../../library/sqlite3.rst:868 msgid "" "The following Python types can thus be sent to SQLite without any problem:" msgstr "" -#: ../../library/sqlite3.rst:865 ../../library/sqlite3.rst:882 +#: ../../library/sqlite3.rst:871 ../../library/sqlite3.rst:888 msgid "Python type" msgstr "" -#: ../../library/sqlite3.rst:865 ../../library/sqlite3.rst:882 +#: ../../library/sqlite3.rst:871 ../../library/sqlite3.rst:888 msgid "SQLite type" msgstr "" -#: ../../library/sqlite3.rst:867 ../../library/sqlite3.rst:884 +#: ../../library/sqlite3.rst:873 ../../library/sqlite3.rst:890 msgid ":const:`None`" msgstr "" -#: ../../library/sqlite3.rst:867 ../../library/sqlite3.rst:884 +#: ../../library/sqlite3.rst:873 ../../library/sqlite3.rst:890 msgid "``NULL``" msgstr "" -#: ../../library/sqlite3.rst:869 ../../library/sqlite3.rst:886 +#: ../../library/sqlite3.rst:875 ../../library/sqlite3.rst:892 msgid ":class:`int`" msgstr "" -#: ../../library/sqlite3.rst:869 ../../library/sqlite3.rst:886 +#: ../../library/sqlite3.rst:875 ../../library/sqlite3.rst:892 msgid "``INTEGER``" msgstr "" -#: ../../library/sqlite3.rst:871 ../../library/sqlite3.rst:888 +#: ../../library/sqlite3.rst:877 ../../library/sqlite3.rst:894 msgid ":class:`float`" msgstr "" -#: ../../library/sqlite3.rst:871 ../../library/sqlite3.rst:888 +#: ../../library/sqlite3.rst:877 ../../library/sqlite3.rst:894 msgid "``REAL``" msgstr "" -#: ../../library/sqlite3.rst:873 +#: ../../library/sqlite3.rst:879 msgid ":class:`str`" msgstr "" -#: ../../library/sqlite3.rst:873 ../../library/sqlite3.rst:890 +#: ../../library/sqlite3.rst:879 ../../library/sqlite3.rst:896 msgid "``TEXT``" msgstr "" -#: ../../library/sqlite3.rst:875 ../../library/sqlite3.rst:893 +#: ../../library/sqlite3.rst:881 ../../library/sqlite3.rst:899 msgid ":class:`bytes`" msgstr "" -#: ../../library/sqlite3.rst:875 ../../library/sqlite3.rst:893 +#: ../../library/sqlite3.rst:881 ../../library/sqlite3.rst:899 msgid "``BLOB``" msgstr "" -#: ../../library/sqlite3.rst:879 +#: ../../library/sqlite3.rst:885 msgid "This is how SQLite types are converted to Python types by default:" msgstr "" -#: ../../library/sqlite3.rst:890 +#: ../../library/sqlite3.rst:896 msgid "depends on :attr:`~Connection.text_factory`, :class:`str` by default" msgstr "" -#: ../../library/sqlite3.rst:896 +#: ../../library/sqlite3.rst:902 msgid "" "The type system of the :mod:`sqlite3` module is extensible in two ways: you " "can store additional Python types in a SQLite database via object " @@ -1007,11 +1012,11 @@ msgid "" "to different Python types via converters." msgstr "" -#: ../../library/sqlite3.rst:903 +#: ../../library/sqlite3.rst:909 msgid "Using adapters to store additional Python types in SQLite databases" msgstr "" -#: ../../library/sqlite3.rst:905 +#: ../../library/sqlite3.rst:911 msgid "" "As described before, SQLite supports only a limited set of types natively. " "To use other Python types with SQLite, you must **adapt** them to one of the " @@ -1019,23 +1024,23 @@ msgid "" "str, bytes." msgstr "" -#: ../../library/sqlite3.rst:910 +#: ../../library/sqlite3.rst:916 msgid "" "There are two ways to enable the :mod:`sqlite3` module to adapt a custom " "Python type to one of the supported ones." msgstr "" -#: ../../library/sqlite3.rst:915 +#: ../../library/sqlite3.rst:921 msgid "Letting your object adapt itself" msgstr "" -#: ../../library/sqlite3.rst:917 +#: ../../library/sqlite3.rst:923 msgid "" "This is a good approach if you write the class yourself. Let's suppose you " "have a class like this::" msgstr "" -#: ../../library/sqlite3.rst:924 +#: ../../library/sqlite3.rst:930 msgid "" "Now you want to store the point in a single SQLite column. First you'll " "have to choose one of the supported types to be used for representing the " @@ -1045,18 +1050,18 @@ msgid "" "class:`PrepareProtocol`." msgstr "" -#: ../../library/sqlite3.rst:934 +#: ../../library/sqlite3.rst:940 msgid "Registering an adapter callable" msgstr "" -#: ../../library/sqlite3.rst:936 +#: ../../library/sqlite3.rst:942 msgid "" "The other possibility is to create a function that converts the type to the " "string representation and register the function with :meth:" "`register_adapter`." msgstr "" -#: ../../library/sqlite3.rst:941 +#: ../../library/sqlite3.rst:947 msgid "" "The :mod:`sqlite3` module has two default adapters for Python's built-in :" "class:`datetime.date` and :class:`datetime.datetime` types. Now let's " @@ -1064,110 +1069,110 @@ msgid "" "representation, but as a Unix timestamp." msgstr "" -#: ../../library/sqlite3.rst:950 +#: ../../library/sqlite3.rst:956 msgid "Converting SQLite values to custom Python types" msgstr "" -#: ../../library/sqlite3.rst:952 +#: ../../library/sqlite3.rst:958 msgid "" "Writing an adapter lets you send custom Python types to SQLite. But to make " "it really useful we need to make the Python to SQLite to Python roundtrip " "work." msgstr "" -#: ../../library/sqlite3.rst:955 +#: ../../library/sqlite3.rst:961 msgid "Enter converters." msgstr "" -#: ../../library/sqlite3.rst:957 +#: ../../library/sqlite3.rst:963 msgid "" "Let's go back to the :class:`Point` class. We stored the x and y coordinates " "separated via semicolons as strings in SQLite." msgstr "" -#: ../../library/sqlite3.rst:960 +#: ../../library/sqlite3.rst:966 msgid "" "First, we'll define a converter function that accepts the string as a " "parameter and constructs a :class:`Point` object from it." msgstr "" -#: ../../library/sqlite3.rst:965 +#: ../../library/sqlite3.rst:971 msgid "" "Converter functions **always** get called with a :class:`bytes` object, no " "matter under which data type you sent the value to SQLite." msgstr "" -#: ../../library/sqlite3.rst:974 +#: ../../library/sqlite3.rst:980 msgid "" "Now you need to make the :mod:`sqlite3` module know that what you select " "from the database is actually a point. There are two ways of doing this:" msgstr "" -#: ../../library/sqlite3.rst:977 +#: ../../library/sqlite3.rst:983 msgid "Implicitly via the declared type" msgstr "" -#: ../../library/sqlite3.rst:979 +#: ../../library/sqlite3.rst:985 msgid "Explicitly via the column name" msgstr "" -#: ../../library/sqlite3.rst:981 +#: ../../library/sqlite3.rst:987 msgid "" "Both ways are described in section :ref:`sqlite3-module-contents`, in the " "entries for the constants :const:`PARSE_DECLTYPES` and :const:" "`PARSE_COLNAMES`." msgstr "" -#: ../../library/sqlite3.rst:984 +#: ../../library/sqlite3.rst:990 msgid "The following example illustrates both approaches." msgstr "" -#: ../../library/sqlite3.rst:990 +#: ../../library/sqlite3.rst:996 msgid "Default adapters and converters" msgstr "" -#: ../../library/sqlite3.rst:992 +#: ../../library/sqlite3.rst:998 msgid "" "There are default adapters for the date and datetime types in the datetime " "module. They will be sent as ISO dates/ISO timestamps to SQLite." msgstr "" -#: ../../library/sqlite3.rst:995 +#: ../../library/sqlite3.rst:1001 msgid "" "The default converters are registered under the name \"date\" for :class:" "`datetime.date` and under the name \"timestamp\" for :class:`datetime." "datetime`." msgstr "" -#: ../../library/sqlite3.rst:999 +#: ../../library/sqlite3.rst:1005 msgid "" "This way, you can use date/timestamps from Python without any additional " "fiddling in most cases. The format of the adapters is also compatible with " "the experimental SQLite date/time functions." msgstr "" -#: ../../library/sqlite3.rst:1003 +#: ../../library/sqlite3.rst:1009 msgid "The following example demonstrates this." msgstr "" -#: ../../library/sqlite3.rst:1007 +#: ../../library/sqlite3.rst:1013 msgid "" "If a timestamp stored in SQLite has a fractional part longer than 6 numbers, " "its value will be truncated to microsecond precision by the timestamp " "converter." msgstr "" -#: ../../library/sqlite3.rst:1015 +#: ../../library/sqlite3.rst:1021 msgid "Controlling Transactions" msgstr "" -#: ../../library/sqlite3.rst:1017 +#: ../../library/sqlite3.rst:1023 msgid "" "The underlying ``sqlite3`` library operates in ``autocommit`` mode by " "default, but the Python :mod:`sqlite3` module by default does not." msgstr "" -#: ../../library/sqlite3.rst:1020 +#: ../../library/sqlite3.rst:1026 msgid "" "``autocommit`` mode means that statements that modify the database take " "effect immediately. A ``BEGIN`` or ``SAVEPOINT`` statement disables " @@ -1175,14 +1180,14 @@ msgid "" "ends the outermost transaction, turns ``autocommit`` mode back on." msgstr "" -#: ../../library/sqlite3.rst:1025 +#: ../../library/sqlite3.rst:1031 msgid "" "The Python :mod:`sqlite3` module by default issues a ``BEGIN`` statement " "implicitly before a Data Modification Language (DML) statement (i.e. " "``INSERT``/``UPDATE``/``DELETE``/``REPLACE``)." msgstr "" -#: ../../library/sqlite3.rst:1029 +#: ../../library/sqlite3.rst:1035 msgid "" "You can control which kind of ``BEGIN`` statements :mod:`sqlite3` implicitly " "executes via the *isolation_level* parameter to the :func:`connect` call, or " @@ -1192,7 +1197,7 @@ msgid "" "``EXCLUSIVE``." msgstr "" -#: ../../library/sqlite3.rst:1036 +#: ../../library/sqlite3.rst:1042 msgid "" "You can disable the :mod:`sqlite3` module's implicit transaction management " "by setting :attr:`isolation_level` to ``None``. This will leave the " @@ -1202,27 +1207,21 @@ msgid "" "code." msgstr "" -#: ../../library/sqlite3.rst:1042 -msgid "" -"Note that :meth:`~Cursor.executescript` disregards :attr:`isolation_level`; " -"any transaction control must be added explicitly." -msgstr "" - -#: ../../library/sqlite3.rst:1045 +#: ../../library/sqlite3.rst:1048 msgid "" ":mod:`sqlite3` used to implicitly commit an open transaction before DDL " "statements. This is no longer the case." msgstr "" -#: ../../library/sqlite3.rst:1051 +#: ../../library/sqlite3.rst:1054 msgid "Using :mod:`sqlite3` efficiently" msgstr "" -#: ../../library/sqlite3.rst:1055 +#: ../../library/sqlite3.rst:1058 msgid "Using shortcut methods" msgstr "" -#: ../../library/sqlite3.rst:1057 +#: ../../library/sqlite3.rst:1060 msgid "" "Using the nonstandard :meth:`execute`, :meth:`executemany` and :meth:" "`executescript` methods of the :class:`Connection` object, your code can be " @@ -1234,41 +1233,63 @@ msgid "" "object." msgstr "" -#: ../../library/sqlite3.rst:1069 +#: ../../library/sqlite3.rst:1072 msgid "Accessing columns by name instead of by index" msgstr "" -#: ../../library/sqlite3.rst:1071 +#: ../../library/sqlite3.rst:1074 msgid "" "One useful feature of the :mod:`sqlite3` module is the built-in :class:" "`sqlite3.Row` class designed to be used as a row factory." msgstr "" -#: ../../library/sqlite3.rst:1074 +#: ../../library/sqlite3.rst:1077 msgid "" "Rows wrapped with this class can be accessed both by index (like tuples) and " "case-insensitively by name:" msgstr "" -#: ../../library/sqlite3.rst:1081 +#: ../../library/sqlite3.rst:1084 msgid "Using the connection as a context manager" msgstr "" -#: ../../library/sqlite3.rst:1083 +#: ../../library/sqlite3.rst:1086 msgid "" "Connection objects can be used as context managers that automatically commit " "or rollback transactions. In the event of an exception, the transaction is " "rolled back; otherwise, the transaction is committed:" msgstr "" -#: ../../library/sqlite3.rst:1092 +#: ../../library/sqlite3.rst:1095 +msgid "Common issues" +msgstr "" + +#: ../../library/sqlite3.rst:1098 +msgid "Multithreading" +msgstr "" + +#: ../../library/sqlite3.rst:1100 +msgid "" +"Older SQLite versions had issues with sharing connections between threads. " +"That's why the Python module disallows sharing connections and cursors " +"between threads. If you still try to do so, you will get an exception at " +"runtime." +msgstr "" + +#: ../../library/sqlite3.rst:1104 +msgid "" +"The only exception is calling the :meth:`~Connection.interrupt` method, " +"which only makes sense to call from a different thread." +msgstr "" + +#: ../../library/sqlite3.rst:1108 msgid "Footnotes" msgstr "註解" -#: ../../library/sqlite3.rst:1093 +#: ../../library/sqlite3.rst:1109 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 " "compiled without this feature. To get loadable extension support, you must " -"pass ``--enable-loadable-sqlite-extensions`` to configure." +"pass --enable-loadable-sqlite-extensions to configure." msgstr "" diff --git a/library/ssl.po b/library/ssl.po index c5286a2bfe..ea470a0d60 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-07 06:52+0000\n" +"POT-Creation-Date: 2020-06-20 18:08+0800\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-" @@ -540,8 +540,8 @@ msgid "" "exactly ``True`` if the certificate is trustworthy for all purposes." msgstr "" -#: ../../library/ssl.rst:489 ../../library/ssl.rst:1585 -#: ../../library/ssl.rst:1900 +#: ../../library/ssl.rst:489 ../../library/ssl.rst:1577 +#: ../../library/ssl.rst:1892 msgid "Example::" msgstr "" @@ -619,7 +619,7 @@ msgid "" "does not send any for client cert authentication." msgstr "" -#: ../../library/ssl.rst:560 ../../library/ssl.rst:2330 +#: ../../library/ssl.rst:560 ../../library/ssl.rst:2317 msgid "See the discussion of :ref:`ssl-security` below." msgstr "" @@ -683,7 +683,7 @@ msgid "" "Possible value for :attr:`SSLContext.verify_flags`. In this mode, only the " "peer cert is checked but none of the intermediate CA certificates. The mode " "requires a valid CRL that is signed by the peer cert's issuer (its direct " -"ancestor CA). If no proper CRL has been loaded with :attr:`SSLContext." +"ancestor CA). If no proper CRL has has been loaded with :attr:`SSLContext." "load_verify_locations`, validation will fail." msgstr "" @@ -929,39 +929,31 @@ msgid "Prevent client side from requesting a session ticket." msgstr "" #: ../../library/ssl.rst:891 -msgid "Ignore unexpected shutdown of TLS connections." -msgstr "" - -#: ../../library/ssl.rst:893 -msgid "This option is only available with OpenSSL 3.0.0 and later." -msgstr "" - -#: ../../library/ssl.rst:899 msgid "" "Whether the OpenSSL library has built-in support for the *Application-Layer " "Protocol Negotiation* TLS extension as described in :rfc:`7301`." msgstr "" -#: ../../library/ssl.rst:906 +#: ../../library/ssl.rst:898 msgid "" "Whether the OpenSSL library has built-in support not checking subject common " "name and :attr:`SSLContext.hostname_checks_common_name` is writeable." msgstr "" -#: ../../library/ssl.rst:914 +#: ../../library/ssl.rst:906 msgid "" "Whether the OpenSSL library has built-in support for the Elliptic Curve-" "based Diffie-Hellman key exchange. This should be true unless the feature " "was explicitly disabled by the distributor." msgstr "" -#: ../../library/ssl.rst:922 +#: ../../library/ssl.rst:914 msgid "" "Whether the OpenSSL library has built-in support for the *Server Name " "Indication* extension (as defined in :rfc:`6066`)." msgstr "" -#: ../../library/ssl.rst:929 +#: ../../library/ssl.rst:921 msgid "" "Whether the OpenSSL library has built-in support for the *Next Protocol " "Negotiation* as described in the `Application Layer Protocol Negotiation " @@ -970,57 +962,57 @@ msgid "" "advertise which protocols you want to support." msgstr "" -#: ../../library/ssl.rst:939 +#: ../../library/ssl.rst:931 msgid "" "Whether the OpenSSL library has built-in support for the SSL 2.0 protocol." msgstr "" -#: ../../library/ssl.rst:945 +#: ../../library/ssl.rst:937 msgid "" "Whether the OpenSSL library has built-in support for the SSL 3.0 protocol." msgstr "" -#: ../../library/ssl.rst:951 +#: ../../library/ssl.rst:943 msgid "" "Whether the OpenSSL library has built-in support for the TLS 1.0 protocol." msgstr "" -#: ../../library/ssl.rst:957 +#: ../../library/ssl.rst:949 msgid "" "Whether the OpenSSL library has built-in support for the TLS 1.1 protocol." msgstr "" -#: ../../library/ssl.rst:963 +#: ../../library/ssl.rst:955 msgid "" "Whether the OpenSSL library has built-in support for the TLS 1.2 protocol." msgstr "" -#: ../../library/ssl.rst:969 +#: ../../library/ssl.rst:961 msgid "" "Whether the OpenSSL library has built-in support for the TLS 1.3 protocol." msgstr "" -#: ../../library/ssl.rst:975 +#: ../../library/ssl.rst:967 msgid "" "List of supported TLS channel binding types. Strings in this list can be " "used as arguments to :meth:`SSLSocket.get_channel_binding`." msgstr "" -#: ../../library/ssl.rst:982 +#: ../../library/ssl.rst:974 msgid "The version string of the OpenSSL library loaded by the interpreter::" msgstr "" -#: ../../library/ssl.rst:991 +#: ../../library/ssl.rst:983 msgid "" "A tuple of five integers representing version information about the OpenSSL " "library::" msgstr "" -#: ../../library/ssl.rst:1001 +#: ../../library/ssl.rst:993 msgid "The raw version number of the OpenSSL library, as a single integer::" msgstr "" -#: ../../library/ssl.rst:1014 +#: ../../library/ssl.rst:1006 msgid "" "Alert Descriptions from :rfc:`5246` and others. The `IANA TLS Alert Registry " "`." msgstr "" -#: ../../library/ssl.rst:1108 +#: ../../library/ssl.rst:1100 msgid "" "Instances of :class:`SSLSocket` must be created using the :meth:`SSLContext." "wrap_socket` method." msgstr "" -#: ../../library/ssl.rst:1111 +#: ../../library/ssl.rst:1103 msgid "The :meth:`sendfile` method was added." msgstr "" -#: ../../library/ssl.rst:1114 +#: ../../library/ssl.rst:1106 msgid "" "The :meth:`shutdown` does not reset the socket timeout each time bytes are " "received or sent. The socket timeout is now to maximum total duration of the " "shutdown." msgstr "" -#: ../../library/ssl.rst:1119 +#: ../../library/ssl.rst:1111 msgid "" "It is deprecated to create a :class:`SSLSocket` instance directly, use :meth:" "`SSLContext.wrap_socket` to wrap a socket." msgstr "" -#: ../../library/ssl.rst:1123 +#: ../../library/ssl.rst:1115 msgid "" ":class:`SSLSocket` instances must to created with :meth:`~SSLContext." "wrap_socket`. In earlier versions, it was possible to create instances " "directly. This was never documented or officially supported." msgstr "" -#: ../../library/ssl.rst:1129 +#: ../../library/ssl.rst:1121 msgid "SSL sockets also have the following additional methods and attributes:" msgstr "" -#: ../../library/ssl.rst:1133 +#: ../../library/ssl.rst:1125 msgid "" "Read up to *len* bytes of data from the SSL socket and return the result as " "a ``bytes`` instance. If *buffer* is specified, then read into the buffer " "instead, and return the number of bytes read." msgstr "" -#: ../../library/ssl.rst:1137 +#: ../../library/ssl.rst:1129 msgid "" "Raise :exc:`SSLWantReadError` or :exc:`SSLWantWriteError` if the socket is :" "ref:`non-blocking ` and the read would block." msgstr "" -#: ../../library/ssl.rst:1140 +#: ../../library/ssl.rst:1132 msgid "" "As at any time a re-negotiation is possible, a call to :meth:`read` can also " "cause write operations." msgstr "" -#: ../../library/ssl.rst:1143 +#: ../../library/ssl.rst:1135 msgid "" "The socket timeout is no more reset each time bytes are received or sent. " "The socket timeout is now to maximum total duration to read up to *len* " "bytes." msgstr "" -#: ../../library/ssl.rst:1148 +#: ../../library/ssl.rst:1140 msgid "Use :meth:`~SSLSocket.recv` instead of :meth:`~SSLSocket.read`." msgstr "" -#: ../../library/ssl.rst:1153 +#: ../../library/ssl.rst:1145 msgid "" "Write *buf* to the SSL socket and return the number of bytes written. The " "*buf* argument must be an object supporting the buffer interface." msgstr "" -#: ../../library/ssl.rst:1156 +#: ../../library/ssl.rst:1148 msgid "" "Raise :exc:`SSLWantReadError` or :exc:`SSLWantWriteError` if the socket is :" "ref:`non-blocking ` and the write would block." msgstr "" -#: ../../library/ssl.rst:1159 +#: ../../library/ssl.rst:1151 msgid "" "As at any time a re-negotiation is possible, a call to :meth:`write` can " "also cause read operations." msgstr "" -#: ../../library/ssl.rst:1162 +#: ../../library/ssl.rst:1154 msgid "" "The socket timeout is no more reset each time bytes are received or sent. " "The socket timeout is now to maximum total duration to write *buf*." msgstr "" -#: ../../library/ssl.rst:1166 +#: ../../library/ssl.rst:1158 msgid "Use :meth:`~SSLSocket.send` instead of :meth:`~SSLSocket.write`." msgstr "" -#: ../../library/ssl.rst:1171 +#: ../../library/ssl.rst:1163 msgid "" "The :meth:`~SSLSocket.read` and :meth:`~SSLSocket.write` methods are the low-" "level methods that read and write unencrypted, application-level data and " @@ -1262,30 +1254,30 @@ msgid "" "unwrap` was not called." msgstr "" -#: ../../library/ssl.rst:1177 +#: ../../library/ssl.rst:1169 msgid "" "Normally you should use the socket API methods like :meth:`~socket.socket." "recv` and :meth:`~socket.socket.send` instead of these methods." msgstr "" -#: ../../library/ssl.rst:1183 +#: ../../library/ssl.rst:1175 msgid "Perform the SSL setup handshake." msgstr "" -#: ../../library/ssl.rst:1185 +#: ../../library/ssl.rst:1177 msgid "" "The handshake method also performs :func:`match_hostname` when the :attr:" "`~SSLContext.check_hostname` attribute of the socket's :attr:`~SSLSocket." "context` is true." msgstr "" -#: ../../library/ssl.rst:1190 +#: ../../library/ssl.rst:1182 msgid "" "The socket timeout is no more reset each time bytes are received or sent. " "The socket timeout is now to maximum total duration of the handshake." msgstr "" -#: ../../library/ssl.rst:1194 +#: ../../library/ssl.rst:1186 msgid "" "Hostname or IP address is matched by OpenSSL during handshake. The function :" "func:`match_hostname` is no longer used. In case OpenSSL refuses a hostname " @@ -1293,14 +1285,14 @@ msgid "" "send to the peer." msgstr "" -#: ../../library/ssl.rst:1202 +#: ../../library/ssl.rst:1194 msgid "" "If there is no certificate for the peer on the other end of the connection, " "return ``None``. If the SSL handshake hasn't been done yet, raise :exc:" "`ValueError`." msgstr "" -#: ../../library/ssl.rst:1206 +#: ../../library/ssl.rst:1198 msgid "" "If the ``binary_form`` parameter is :const:`False`, and a certificate was " "received from the peer, this method returns a :class:`dict` instance. If " @@ -1312,7 +1304,7 @@ msgid "" "also be a ``subjectAltName`` key in the dictionary." msgstr "" -#: ../../library/ssl.rst:1215 +#: ../../library/ssl.rst:1207 msgid "" "The ``subject`` and ``issuer`` fields are tuples containing the sequence of " "relative distinguished names (RDNs) given in the certificate's data " @@ -1320,13 +1312,13 @@ msgid "" "value pairs. Here is a real-world example::" msgstr "" -#: ../../library/ssl.rst:1241 +#: ../../library/ssl.rst:1233 msgid "" "To validate a certificate for a particular service, you can use the :func:" "`match_hostname` function." msgstr "" -#: ../../library/ssl.rst:1244 +#: ../../library/ssl.rst:1236 msgid "" "If the ``binary_form`` parameter is :const:`True`, and a certificate was " "provided, this method returns the DER-encoded form of the entire certificate " @@ -1335,13 +1327,13 @@ msgid "" "socket's role:" msgstr "" -#: ../../library/ssl.rst:1250 +#: ../../library/ssl.rst:1242 msgid "" "for a client SSL socket, the server will always provide a certificate, " "regardless of whether validation was required;" msgstr "" -#: ../../library/ssl.rst:1253 +#: ../../library/ssl.rst:1245 msgid "" "for a server SSL socket, the client will only provide a certificate when " "requested by the server; therefore :meth:`getpeercert` will return :const:" @@ -1349,24 +1341,24 @@ msgid "" "or :const:`CERT_REQUIRED`)." msgstr "" -#: ../../library/ssl.rst:1258 +#: ../../library/ssl.rst:1250 msgid "" "The returned dictionary includes additional items such as ``issuer`` and " "``notBefore``." msgstr "" -#: ../../library/ssl.rst:1262 +#: ../../library/ssl.rst:1254 msgid "" ":exc:`ValueError` is raised when the handshake isn't done. The returned " "dictionary includes additional X509v3 extension items such as " "``crlDistributionPoints``, ``caIssuers`` and ``OCSP`` URIs." msgstr "" -#: ../../library/ssl.rst:1267 +#: ../../library/ssl.rst:1259 msgid "IPv6 address strings no longer have a trailing new line." msgstr "" -#: ../../library/ssl.rst:1272 +#: ../../library/ssl.rst:1264 msgid "" "Returns a three-value tuple containing the name of the cipher being used, " "the version of the SSL protocol that defines its use, and the number of " @@ -1374,7 +1366,7 @@ msgid "" "``None``." msgstr "" -#: ../../library/ssl.rst:1278 +#: ../../library/ssl.rst:1270 msgid "" "Return the list of ciphers shared by the client during the handshake. Each " "entry of the returned list is a three-value tuple containing the name of the " @@ -1384,25 +1376,25 @@ msgid "" "socket." msgstr "" -#: ../../library/ssl.rst:1289 +#: ../../library/ssl.rst:1281 msgid "" "Return the compression algorithm being used as a string, or ``None`` if the " "connection isn't compressed." msgstr "" -#: ../../library/ssl.rst:1292 +#: ../../library/ssl.rst:1284 msgid "" "If the higher-level protocol supports its own compression mechanism, you can " "use :data:`OP_NO_COMPRESSION` to disable SSL-level compression." msgstr "" -#: ../../library/ssl.rst:1299 +#: ../../library/ssl.rst:1291 msgid "" "Get channel binding data for current connection, as a bytes object. Returns " "``None`` if not connected or the handshake has not been completed." msgstr "" -#: ../../library/ssl.rst:1302 +#: ../../library/ssl.rst:1294 msgid "" "The *cb_type* parameter allow selection of the desired channel binding type. " "Valid channel binding types are listed in the :data:`CHANNEL_BINDING_TYPES` " @@ -1411,7 +1403,7 @@ msgid "" "channel binding type is requested." msgstr "" -#: ../../library/ssl.rst:1312 +#: ../../library/ssl.rst:1304 msgid "" "Return the protocol that was selected during the TLS handshake. If :meth:" "`SSLContext.set_alpn_protocols` was not called, if the other party does not " @@ -1419,7 +1411,7 @@ msgid "" "protocols, or if the handshake has not happened yet, ``None`` is returned." msgstr "" -#: ../../library/ssl.rst:1322 +#: ../../library/ssl.rst:1314 msgid "" "Return the higher-level protocol that was selected during the TLS/SSL " "handshake. If :meth:`SSLContext.set_npn_protocols` was not called, or if the " @@ -1427,7 +1419,7 @@ msgid "" "this will return ``None``." msgstr "" -#: ../../library/ssl.rst:1331 +#: ../../library/ssl.rst:1323 msgid "" "Performs the SSL shutdown handshake, which removes the TLS layer from the " "underlying socket, and returns the underlying socket object. This can be " @@ -1436,7 +1428,7 @@ msgid "" "other side of the connection, rather than the original socket." msgstr "" -#: ../../library/ssl.rst:1339 +#: ../../library/ssl.rst:1331 msgid "" "Requests post-handshake authentication (PHA) from a TLS 1.3 client. PHA can " "only be initiated for a TLS 1.3 connection from a server-side socket, after " @@ -1444,26 +1436,26 @@ msgid "" "`SSLContext.post_handshake_auth`." msgstr "" -#: ../../library/ssl.rst:1344 +#: ../../library/ssl.rst:1336 msgid "" "The method does not perform a cert exchange immediately. The server-side " "sends a CertificateRequest during the next write event and expects the " "client to respond with a certificate on the next read event." msgstr "" -#: ../../library/ssl.rst:1348 +#: ../../library/ssl.rst:1340 msgid "" "If any precondition isn't met (e.g. not TLS 1.3, PHA not enabled), an :exc:" "`SSLError` is raised." msgstr "" -#: ../../library/ssl.rst:1352 +#: ../../library/ssl.rst:1344 msgid "" "Only available with OpenSSL 1.1.1 and TLS 1.3 enabled. Without TLS 1.3 " "support, the method raises :exc:`NotImplementedError`." msgstr "" -#: ../../library/ssl.rst:1359 +#: ../../library/ssl.rst:1351 msgid "" "Return the actual SSL protocol version negotiated by the connection as a " "string, or ``None`` is no secure connection is established. As of this " @@ -1472,13 +1464,13 @@ msgid "" "may define more return values." msgstr "" -#: ../../library/ssl.rst:1369 +#: ../../library/ssl.rst:1361 msgid "" "Returns the number of already decrypted bytes available for read, pending on " "the connection." msgstr "" -#: ../../library/ssl.rst:1374 +#: ../../library/ssl.rst:1366 msgid "" "The :class:`SSLContext` object this SSL socket is tied to. If the SSL " "socket was created using the deprecated :func:`wrap_socket` function (rather " @@ -1486,19 +1478,19 @@ msgid "" "created for this SSL socket." msgstr "" -#: ../../library/ssl.rst:1383 +#: ../../library/ssl.rst:1375 msgid "" "A boolean which is ``True`` for server-side sockets and ``False`` for client-" "side sockets." msgstr "" -#: ../../library/ssl.rst:1390 +#: ../../library/ssl.rst:1382 msgid "" "Hostname of the server: :class:`str` type, or ``None`` for server-side " "socket or if the hostname was not specified in the constructor." msgstr "" -#: ../../library/ssl.rst:1395 +#: ../../library/ssl.rst:1387 msgid "" "The attribute is now always ASCII text. When ``server_hostname`` is an " "internationalized domain name (IDN), this attribute now stores the A-label " @@ -1506,7 +1498,7 @@ msgid "" "org\"``)." msgstr "" -#: ../../library/ssl.rst:1403 +#: ../../library/ssl.rst:1395 msgid "" "The :class:`SSLSession` for this SSL connection. The session is available " "for client and server side sockets after the TLS handshake has been " @@ -1514,11 +1506,11 @@ msgid "" "`~SSLSocket.do_handshake` has been called to reuse a session." msgstr "" -#: ../../library/ssl.rst:1416 +#: ../../library/ssl.rst:1408 msgid "SSL Contexts" msgstr "" -#: ../../library/ssl.rst:1420 +#: ../../library/ssl.rst:1412 msgid "" "An SSL context holds various data longer-lived than single SSL connections, " "such as SSL configuration options, certificate(s) and private key(s). It " @@ -1526,7 +1518,7 @@ msgid "" "speed up repeated connections from the same clients." msgstr "" -#: ../../library/ssl.rst:1427 +#: ../../library/ssl.rst:1419 msgid "" "Create a new SSL context. You may pass *protocol* which must be one of the " "``PROTOCOL_*`` constants defined in this module. The parameter specifies " @@ -1537,109 +1529,109 @@ msgid "" "provides the most compatibility with other versions." msgstr "" -#: ../../library/ssl.rst:1436 +#: ../../library/ssl.rst:1428 msgid "" "Here's a table showing which versions in a client (down the side) can " "connect to which versions in a server (along the top):" msgstr "" -#: ../../library/ssl.rst:1442 +#: ../../library/ssl.rst:1434 msgid "*client* / **server**" msgstr "" -#: ../../library/ssl.rst:1442 +#: ../../library/ssl.rst:1434 msgid "**SSLv2**" msgstr "" -#: ../../library/ssl.rst:1442 +#: ../../library/ssl.rst:1434 msgid "**SSLv3**" msgstr "" -#: ../../library/ssl.rst:1442 +#: ../../library/ssl.rst:1434 msgid "**TLS** [3]_" msgstr "" -#: ../../library/ssl.rst:1442 +#: ../../library/ssl.rst:1434 msgid "**TLSv1**" msgstr "" -#: ../../library/ssl.rst:1442 +#: ../../library/ssl.rst:1434 msgid "**TLSv1.1**" msgstr "" -#: ../../library/ssl.rst:1442 +#: ../../library/ssl.rst:1434 msgid "**TLSv1.2**" msgstr "" -#: ../../library/ssl.rst:1444 +#: ../../library/ssl.rst:1436 msgid "*SSLv2*" msgstr "" -#: ../../library/ssl.rst:1444 ../../library/ssl.rst:1445 -#: ../../library/ssl.rst:1446 ../../library/ssl.rst:1447 -#: ../../library/ssl.rst:1448 ../../library/ssl.rst:1449 +#: ../../library/ssl.rst:1436 ../../library/ssl.rst:1437 +#: ../../library/ssl.rst:1438 ../../library/ssl.rst:1439 +#: ../../library/ssl.rst:1440 ../../library/ssl.rst:1441 msgid "yes" msgstr "" -#: ../../library/ssl.rst:1444 ../../library/ssl.rst:1445 -#: ../../library/ssl.rst:1447 ../../library/ssl.rst:1448 -#: ../../library/ssl.rst:1449 +#: ../../library/ssl.rst:1436 ../../library/ssl.rst:1437 +#: ../../library/ssl.rst:1439 ../../library/ssl.rst:1440 +#: ../../library/ssl.rst:1441 msgid "no" msgstr "" -#: ../../library/ssl.rst:1444 ../../library/ssl.rst:1446 +#: ../../library/ssl.rst:1436 ../../library/ssl.rst:1438 msgid "no [1]_" msgstr "" -#: ../../library/ssl.rst:1445 +#: ../../library/ssl.rst:1437 msgid "*SSLv3*" msgstr "" -#: ../../library/ssl.rst:1445 ../../library/ssl.rst:1446 +#: ../../library/ssl.rst:1437 ../../library/ssl.rst:1438 msgid "no [2]_" msgstr "" -#: ../../library/ssl.rst:1446 +#: ../../library/ssl.rst:1438 msgid "*TLS* (*SSLv23*) [3]_" msgstr "" -#: ../../library/ssl.rst:1447 +#: ../../library/ssl.rst:1439 msgid "*TLSv1*" msgstr "" -#: ../../library/ssl.rst:1448 +#: ../../library/ssl.rst:1440 msgid "*TLSv1.1*" msgstr "" -#: ../../library/ssl.rst:1449 +#: ../../library/ssl.rst:1441 msgid "*TLSv1.2*" msgstr "" -#: ../../library/ssl.rst:1452 +#: ../../library/ssl.rst:1444 msgid "Footnotes" msgstr "" -#: ../../library/ssl.rst:1453 +#: ../../library/ssl.rst:1445 msgid ":class:`SSLContext` disables SSLv2 with :data:`OP_NO_SSLv2` by default." msgstr "" -#: ../../library/ssl.rst:1454 +#: ../../library/ssl.rst:1446 msgid ":class:`SSLContext` disables SSLv3 with :data:`OP_NO_SSLv3` by default." msgstr "" -#: ../../library/ssl.rst:1455 +#: ../../library/ssl.rst:1447 msgid "" "TLS 1.3 protocol will be available with :data:`PROTOCOL_TLS` in OpenSSL >= " "1.1.1. There is no dedicated PROTOCOL constant for just TLS 1.3." msgstr "" -#: ../../library/ssl.rst:1460 +#: ../../library/ssl.rst:1452 msgid "" ":func:`create_default_context` lets the :mod:`ssl` module choose security " "settings for a given purpose." msgstr "" -#: ../../library/ssl.rst:1465 +#: ../../library/ssl.rst:1457 msgid "" "The context is created with secure default values. The options :data:" "`OP_NO_COMPRESSION`, :data:`OP_CIPHER_SERVER_PREFERENCE`, :data:" @@ -1650,22 +1642,22 @@ msgid "" "for :data:`PROTOCOL_SSLv2`)." msgstr "" -#: ../../library/ssl.rst:1475 +#: ../../library/ssl.rst:1467 msgid ":class:`SSLContext` objects have the following methods and attributes:" msgstr "" -#: ../../library/ssl.rst:1479 +#: ../../library/ssl.rst:1471 msgid "" "Get statistics about quantities of loaded X.509 certificates, count of X.509 " "certificates flagged as CA certificates and certificate revocation lists as " "dictionary." msgstr "" -#: ../../library/ssl.rst:1483 +#: ../../library/ssl.rst:1475 msgid "Example for a context with one CA cert and one other cert::" msgstr "" -#: ../../library/ssl.rst:1493 +#: ../../library/ssl.rst:1485 msgid "" "Load a private key and the corresponding certificate. The *certfile* string " "must be the path to a single file in PEM format containing the certificate " @@ -1677,7 +1669,7 @@ msgid "" "*certfile*." msgstr "" -#: ../../library/ssl.rst:1502 +#: ../../library/ssl.rst:1494 msgid "" "The *password* argument may be a function to call to get the password for " "decrypting the private key. It will only be called if the private key is " @@ -1689,24 +1681,24 @@ msgid "" "encrypted and no password is needed." msgstr "" -#: ../../library/ssl.rst:1511 +#: ../../library/ssl.rst:1503 msgid "" "If the *password* argument is not specified and a password is required, " "OpenSSL's built-in password prompting mechanism will be used to " "interactively prompt the user for a password." msgstr "" -#: ../../library/ssl.rst:1515 +#: ../../library/ssl.rst:1507 msgid "" "An :class:`SSLError` is raised if the private key doesn't match with the " "certificate." msgstr "" -#: ../../library/ssl.rst:1518 +#: ../../library/ssl.rst:1510 msgid "New optional argument *password*." msgstr "" -#: ../../library/ssl.rst:1523 +#: ../../library/ssl.rst:1515 msgid "" "Load a set of default \"certification authority\" (CA) certificates from " "default locations. On Windows it loads CA certs from the ``CA`` and ``ROOT`` " @@ -1715,7 +1707,7 @@ msgid "" "from other locations, too." msgstr "" -#: ../../library/ssl.rst:1529 +#: ../../library/ssl.rst:1521 msgid "" "The *purpose* flag specifies what kind of CA certificates are loaded. The " "default settings :data:`Purpose.SERVER_AUTH` loads certificates, that are " @@ -1724,28 +1716,28 @@ msgid "" "certificate verification on the server side." msgstr "" -#: ../../library/ssl.rst:1539 +#: ../../library/ssl.rst:1531 msgid "" "Load a set of \"certification authority\" (CA) certificates used to validate " "other peers' certificates when :data:`verify_mode` is other than :data:" "`CERT_NONE`. At least one of *cafile* or *capath* must be specified." msgstr "" -#: ../../library/ssl.rst:1543 +#: ../../library/ssl.rst:1535 msgid "" "This method can also load certification revocation lists (CRLs) in PEM or " "DER format. In order to make use of CRLs, :attr:`SSLContext.verify_flags` " "must be configured properly." msgstr "" -#: ../../library/ssl.rst:1547 +#: ../../library/ssl.rst:1539 msgid "" "The *cafile* string, if present, is the path to a file of concatenated CA " "certificates in PEM format. See the discussion of :ref:`ssl-certificates` " "for more information about how to arrange the certificates in this file." msgstr "" -#: ../../library/ssl.rst:1552 +#: ../../library/ssl.rst:1544 msgid "" "The *capath* string, if present, is the path to a directory containing " "several CA certificates in PEM format, following an `OpenSSL specific layout " @@ -1753,7 +1745,7 @@ msgid "" "html>`_." msgstr "" -#: ../../library/ssl.rst:1557 +#: ../../library/ssl.rst:1549 msgid "" "The *cadata* object, if present, is either an ASCII string of one or more " "PEM-encoded certificates or a :term:`bytes-like object` of DER-encoded " @@ -1761,11 +1753,11 @@ msgid "" "are ignored but at least one certificate must be present." msgstr "" -#: ../../library/ssl.rst:1562 +#: ../../library/ssl.rst:1554 msgid "New optional argument *cadata*" msgstr "" -#: ../../library/ssl.rst:1567 +#: ../../library/ssl.rst:1559 msgid "" "Get a list of loaded \"certification authority\" (CA) certificates. If the " "``binary_form`` parameter is :const:`False` each list entry is a dict like " @@ -1775,27 +1767,27 @@ msgid "" "a SSL connection." msgstr "" -#: ../../library/ssl.rst:1575 +#: ../../library/ssl.rst:1567 msgid "" "Certificates in a capath directory aren't loaded unless they have been used " "at least once." msgstr "" -#: ../../library/ssl.rst:1582 +#: ../../library/ssl.rst:1574 msgid "" "Get a list of enabled ciphers. The list is in order of cipher priority. See :" "meth:`SSLContext.set_ciphers`." msgstr "" -#: ../../library/ssl.rst:1605 +#: ../../library/ssl.rst:1597 msgid "On OpenSSL 1.1 and newer the cipher dict contains additional fields::" msgstr "" -#: ../../library/ssl.rst:1634 +#: ../../library/ssl.rst:1626 msgid ":ref:`Availability `: OpenSSL 1.0.2+." msgstr "" -#: ../../library/ssl.rst:1639 +#: ../../library/ssl.rst:1631 msgid "" "Load a set of default \"certification authority\" (CA) certificates from a " "filesystem path defined when building the OpenSSL library. Unfortunately, " @@ -1805,7 +1797,7 @@ msgid "" "configured properly." msgstr "" -#: ../../library/ssl.rst:1648 +#: ../../library/ssl.rst:1640 msgid "" "Set the available ciphers for sockets created with this context. It should " "be a string in the `OpenSSL cipher list format `_" msgstr "" -#: ../../library/ssl.rst:1786 +#: ../../library/ssl.rst:1778 msgid "Vincent Bernat." msgstr "" -#: ../../library/ssl.rst:1792 +#: ../../library/ssl.rst:1784 msgid "" "Wrap an existing Python socket *sock* and return an instance of :attr:" "`SSLContext.sslsocket_class` (default :class:`SSLSocket`). The returned SSL " @@ -2001,13 +1993,13 @@ msgid "" "a :data:`~socket.SOCK_STREAM` socket; other socket types are unsupported." msgstr "" -#: ../../library/ssl.rst:1798 +#: ../../library/ssl.rst:1790 msgid "" "The parameter ``server_side`` is a boolean which identifies whether server-" "side or client-side behavior is desired from this socket." msgstr "" -#: ../../library/ssl.rst:1801 +#: ../../library/ssl.rst:1793 msgid "" "For client-side sockets, the context construction is lazy; if the underlying " "socket isn't connected yet, the context construction will be performed " @@ -2018,7 +2010,7 @@ msgid "" "exc:`SSLError`." msgstr "" -#: ../../library/ssl.rst:1809 +#: ../../library/ssl.rst:1801 msgid "" "On client connections, the optional parameter *server_hostname* specifies " "the hostname of the service which we are connecting to. This allows a " @@ -2027,7 +2019,7 @@ msgid "" "*server_hostname* will raise a :exc:`ValueError` if *server_side* is true." msgstr "" -#: ../../library/ssl.rst:1815 +#: ../../library/ssl.rst:1807 msgid "" "The parameter ``do_handshake_on_connect`` specifies whether to do the SSL " "handshake automatically after doing a :meth:`socket.connect`, or whether the " @@ -2037,7 +2029,7 @@ msgid "" "socket I/O involved in the handshake." msgstr "" -#: ../../library/ssl.rst:1822 +#: ../../library/ssl.rst:1814 msgid "" "The parameter ``suppress_ragged_eofs`` specifies how the :meth:`SSLSocket." "recv` method should signal unexpected EOF from the other end of the " @@ -2047,34 +2039,34 @@ msgid "" "exceptions back to the caller." msgstr "" -#: ../../library/ssl.rst:1829 +#: ../../library/ssl.rst:1821 msgid "*session*, see :attr:`~SSLSocket.session`." msgstr "" -#: ../../library/ssl.rst:1831 +#: ../../library/ssl.rst:1823 msgid "" "Always allow a server_hostname to be passed, even if OpenSSL does not have " "SNI." msgstr "" -#: ../../library/ssl.rst:1835 ../../library/ssl.rst:1861 +#: ../../library/ssl.rst:1827 ../../library/ssl.rst:1853 msgid "*session* argument was added." msgstr "" -#: ../../library/ssl.rst:1838 +#: ../../library/ssl.rst:1830 msgid "" "The method returns on instance of :attr:`SSLContext.sslsocket_class` instead " "of hard-coded :class:`SSLSocket`." msgstr "" -#: ../../library/ssl.rst:1844 +#: ../../library/ssl.rst:1836 msgid "" "The return type of :meth:`SSLContext.wrap_socket`, defaults to :class:" "`SSLSocket`. The attribute can be overridden on instance of class in order " "to return a custom subclass of :class:`SSLSocket`." msgstr "" -#: ../../library/ssl.rst:1853 +#: ../../library/ssl.rst:1845 msgid "" "Wrap the BIO objects *incoming* and *outgoing* and return an instance of :" "attr:`SSLContext.sslobject_class` (default :class:`SSLObject`). The SSL " @@ -2082,26 +2074,26 @@ msgid "" "outgoing BIO." msgstr "" -#: ../../library/ssl.rst:1858 +#: ../../library/ssl.rst:1850 msgid "" "The *server_side*, *server_hostname* and *session* parameters have the same " "meaning as in :meth:`SSLContext.wrap_socket`." msgstr "" -#: ../../library/ssl.rst:1864 +#: ../../library/ssl.rst:1856 msgid "" "The method returns on instance of :attr:`SSLContext.sslobject_class` instead " "of hard-coded :class:`SSLObject`." msgstr "" -#: ../../library/ssl.rst:1870 +#: ../../library/ssl.rst:1862 msgid "" "The return type of :meth:`SSLContext.wrap_bio`, defaults to :class:" "`SSLObject`. The attribute can be overridden on instance of class in order " "to return a custom subclass of :class:`SSLObject`." msgstr "" -#: ../../library/ssl.rst:1878 +#: ../../library/ssl.rst:1870 msgid "" "Get statistics about the SSL sessions created or managed by this context. A " "dictionary is returned which maps the names of each `piece of information " @@ -2110,20 +2102,21 @@ msgid "" "misses in the session cache since the context was created::" msgstr "" -#: ../../library/ssl.rst:1889 +#: ../../library/ssl.rst:1881 msgid "" -"Whether to match the peer cert's hostname in :meth:`SSLSocket.do_handshake`. " -"The context's :attr:`~SSLContext.verify_mode` must be set to :data:" -"`CERT_OPTIONAL` or :data:`CERT_REQUIRED`, and you must pass " -"*server_hostname* to :meth:`~SSLContext.wrap_socket` in order to match the " -"hostname. Enabling hostname checking automatically sets :attr:`~SSLContext." -"verify_mode` from :data:`CERT_NONE` to :data:`CERT_REQUIRED`. It cannot be " -"set back to :data:`CERT_NONE` as long as hostname checking is enabled. The :" -"data:`PROTOCOL_TLS_CLIENT` protocol enables hostname checking by default. " -"With other protocols, hostname checking must be enabled explicitly." +"Whether to match the peer cert's hostname with :func:`match_hostname` in :" +"meth:`SSLSocket.do_handshake`. The context's :attr:`~SSLContext.verify_mode` " +"must be set to :data:`CERT_OPTIONAL` or :data:`CERT_REQUIRED`, and you must " +"pass *server_hostname* to :meth:`~SSLContext.wrap_socket` in order to match " +"the hostname. Enabling hostname checking automatically sets :attr:" +"`~SSLContext.verify_mode` from :data:`CERT_NONE` to :data:`CERT_REQUIRED`. " +"It cannot be set back to :data:`CERT_NONE` as long as hostname checking is " +"enabled. The :data:`PROTOCOL_TLS_CLIENT` protocol enables hostname checking " +"by default. With other protocols, hostname checking must be enabled " +"explicitly." msgstr "" -#: ../../library/ssl.rst:1917 +#: ../../library/ssl.rst:1909 msgid "" ":attr:`~SSLContext.verify_mode` is now automatically changed to :data:" "`CERT_REQUIRED` when hostname checking is enabled and :attr:`~SSLContext." @@ -2131,11 +2124,11 @@ msgid "" "failed with a :exc:`ValueError`." msgstr "" -#: ../../library/ssl.rst:1924 +#: ../../library/ssl.rst:1916 msgid "This features requires OpenSSL 0.9.8f or newer." msgstr "" -#: ../../library/ssl.rst:1928 +#: ../../library/ssl.rst:1920 msgid "" "Write TLS keys to a keylog file, whenever key material is generated or " "received. The keylog file is designed for debugging purposes only. The file " @@ -2144,11 +2137,11 @@ msgid "" "synchronized between threads, but not between processes." msgstr "" -#: ../../library/ssl.rst:1938 +#: ../../library/ssl.rst:1930 msgid "This features requires OpenSSL 1.1.1 or newer." msgstr "" -#: ../../library/ssl.rst:1942 +#: ../../library/ssl.rst:1934 msgid "" "A :class:`TLSVersion` enum member representing the highest supported TLS " "version. The value defaults to :attr:`TLSVersion.MAXIMUM_SUPPORTED`. The " @@ -2156,7 +2149,7 @@ msgid "" "`PROTOCOL_TLS_CLIENT`, and :attr:`PROTOCOL_TLS_SERVER`." msgstr "" -#: ../../library/ssl.rst:1947 +#: ../../library/ssl.rst:1939 msgid "" "The attributes :attr:`~SSLContext.maximum_version`, :attr:`~SSLContext." "minimum_version` and :attr:`SSLContext.options` all affect the supported SSL " @@ -2166,50 +2159,50 @@ msgid "" "`TLSVersion.TLSv1_2` will not be able to establish a TLS 1.2 connection." msgstr "" -#: ../../library/ssl.rst:1958 ../../library/ssl.rst:1970 +#: ../../library/ssl.rst:1950 ../../library/ssl.rst:1962 msgid "" "This attribute is not available unless the ssl module is compiled with " "OpenSSL 1.1.0g or newer." msgstr "" -#: ../../library/ssl.rst:1965 +#: ../../library/ssl.rst:1957 msgid "" "Like :attr:`SSLContext.maximum_version` except it is the lowest supported " "version or :attr:`TLSVersion.MINIMUM_SUPPORTED`." msgstr "" -#: ../../library/ssl.rst:1977 +#: ../../library/ssl.rst:1969 msgid "" "Control the number of TLS 1.3 session tickets of a :attr:" "`TLS_PROTOCOL_SERVER` context. The setting has no impact on TLS 1.0 to 1.2 " "connections." msgstr "" -#: ../../library/ssl.rst:1983 +#: ../../library/ssl.rst:1975 msgid "" "This attribute is not available unless the ssl module is compiled with " "OpenSSL 1.1.1 or newer." msgstr "" -#: ../../library/ssl.rst:1990 +#: ../../library/ssl.rst:1982 msgid "" "An integer representing the set of SSL options enabled on this context. The " "default value is :data:`OP_ALL`, but you can specify other options such as :" "data:`OP_NO_SSLv2` by ORing them together." msgstr "" -#: ../../library/ssl.rst:1995 +#: ../../library/ssl.rst:1987 msgid "" "With versions of OpenSSL older than 0.9.8m, it is only possible to set " "options, not to clear them. Attempting to clear an option (by resetting the " "corresponding bits) will raise a :exc:`ValueError`." msgstr "" -#: ../../library/ssl.rst:1999 +#: ../../library/ssl.rst:1991 msgid ":attr:`SSLContext.options` returns :class:`Options` flags:" msgstr "" -#: ../../library/ssl.rst:2007 +#: ../../library/ssl.rst:1999 msgid "" "Enable TLS 1.3 post-handshake client authentication. Post-handshake auth is " "disabled by default and a server can only request a TLS client certificate " @@ -2217,13 +2210,13 @@ msgid "" "client certificate at any time after the handshake." msgstr "" -#: ../../library/ssl.rst:2012 +#: ../../library/ssl.rst:2004 msgid "" "When enabled on client-side sockets, the client signals the server that it " "supports post-handshake authentication." msgstr "" -#: ../../library/ssl.rst:2015 +#: ../../library/ssl.rst:2007 msgid "" "When enabled on server-side sockets, :attr:`SSLContext.verify_mode` must be " "set to :data:`CERT_OPTIONAL` or :data:`CERT_REQUIRED`, too. The actual " @@ -2231,36 +2224,30 @@ msgid "" "verify_client_post_handshake` is called and some I/O is performed." msgstr "" -#: ../../library/ssl.rst:2022 +#: ../../library/ssl.rst:2014 msgid "" "Only available with OpenSSL 1.1.1 and TLS 1.3 enabled. Without TLS 1.3 " "support, the property value is None and can't be modified" msgstr "" -#: ../../library/ssl.rst:2029 +#: ../../library/ssl.rst:2021 msgid "" "The protocol version chosen when constructing the context. This attribute " "is read-only." msgstr "" -#: ../../library/ssl.rst:2034 +#: ../../library/ssl.rst:2026 msgid "" "Whether :attr:`~SSLContext.check_hostname` falls back to verify the cert's " "subject common name in the absence of a subject alternative name extension " "(default: true)." msgstr "" -#: ../../library/ssl.rst:2039 +#: ../../library/ssl.rst:2031 msgid "Only writeable with OpenSSL 1.1.0 or higher." msgstr "" -#: ../../library/ssl.rst:2045 -msgid "" -"The flag had no effect with OpenSSL before version 1.1.1k. Python 3.8.9, " -"3.9.3, and 3.10 include workarounds for previous versions." -msgstr "" - -#: ../../library/ssl.rst:2050 +#: ../../library/ssl.rst:2037 msgid "" "The flags for certificate verification operations. You can set flags like :" "data:`VERIFY_CRL_CHECK_LEAF` by ORing them together. By default OpenSSL does " @@ -2268,26 +2255,26 @@ msgid "" "only with openssl version 0.9.8+." msgstr "" -#: ../../library/ssl.rst:2057 +#: ../../library/ssl.rst:2044 msgid ":attr:`SSLContext.verify_flags` returns :class:`VerifyFlags` flags:" msgstr "" -#: ../../library/ssl.rst:2065 +#: ../../library/ssl.rst:2052 msgid "" "Whether to try to verify other peers' certificates and how to behave if " "verification fails. This attribute must be one of :data:`CERT_NONE`, :data:" "`CERT_OPTIONAL` or :data:`CERT_REQUIRED`." msgstr "" -#: ../../library/ssl.rst:2069 +#: ../../library/ssl.rst:2056 msgid ":attr:`SSLContext.verify_mode` returns :class:`VerifyMode` enum:" msgstr "" -#: ../../library/ssl.rst:2082 +#: ../../library/ssl.rst:2069 msgid "Certificates" msgstr "" -#: ../../library/ssl.rst:2084 +#: ../../library/ssl.rst:2071 msgid "" "Certificates in general are part of a public-key / private-key system. In " "this system, each *principal*, (which may be a machine, or a person, or an " @@ -2298,7 +2285,7 @@ msgid "" "other part, and **only** with the other part." msgstr "" -#: ../../library/ssl.rst:2092 +#: ../../library/ssl.rst:2079 msgid "" "A certificate contains information about two principals. It contains the " "name of a *subject*, and the subject's public key. It also contains a " @@ -2312,7 +2299,7 @@ msgid "" "as two fields, called \"notBefore\" and \"notAfter\"." msgstr "" -#: ../../library/ssl.rst:2102 +#: ../../library/ssl.rst:2089 msgid "" "In the Python use of certificates, a client or server can use a certificate " "to prove who they are. The other side of a network connection can also be " @@ -2325,18 +2312,18 @@ msgid "" "take place." msgstr "" -#: ../../library/ssl.rst:2112 +#: ../../library/ssl.rst:2099 msgid "" "Python uses files to contain certificates. They should be formatted as \"PEM" "\" (see :rfc:`1422`), which is a base-64 encoded form wrapped with a header " "line and a footer line::" msgstr "" -#: ../../library/ssl.rst:2121 +#: ../../library/ssl.rst:2108 msgid "Certificate chains" msgstr "" -#: ../../library/ssl.rst:2123 +#: ../../library/ssl.rst:2110 msgid "" "The Python files which contain certificates can contain a sequence of " "certificates, sometimes called a *certificate chain*. This chain should " @@ -2352,11 +2339,11 @@ msgid "" "agency which issued the certification authority's certificate::" msgstr "" -#: ../../library/ssl.rst:2147 +#: ../../library/ssl.rst:2134 msgid "CA certificates" msgstr "" -#: ../../library/ssl.rst:2149 +#: ../../library/ssl.rst:2136 msgid "" "If you are going to require validation of the other side of the connection's " "certificate, you need to provide a \"CA certs\" file, filled with the " @@ -2368,11 +2355,11 @@ msgid "" "create_default_context`." msgstr "" -#: ../../library/ssl.rst:2158 +#: ../../library/ssl.rst:2145 msgid "Combined key and certificate" msgstr "" -#: ../../library/ssl.rst:2160 +#: ../../library/ssl.rst:2147 msgid "" "Often the private key is stored in the same file as the certificate; in this " "case, only the ``certfile`` parameter to :meth:`SSLContext.load_cert_chain` " @@ -2381,11 +2368,11 @@ msgid "" "certificate chain::" msgstr "" -#: ../../library/ssl.rst:2174 +#: ../../library/ssl.rst:2161 msgid "Self-signed certificates" msgstr "" -#: ../../library/ssl.rst:2176 +#: ../../library/ssl.rst:2163 msgid "" "If you are going to create a server that provides SSL-encrypted connection " "services, you will need to acquire a certificate for that service. There " @@ -2395,51 +2382,51 @@ msgid "" "package, using something like the following::" msgstr "" -#: ../../library/ssl.rst:2205 +#: ../../library/ssl.rst:2192 msgid "" "The disadvantage of a self-signed certificate is that it is its own root " "certificate, and no one else will have it in their cache of known (and " "trusted) root certificates." msgstr "" -#: ../../library/ssl.rst:2211 +#: ../../library/ssl.rst:2198 msgid "Examples" msgstr "" -#: ../../library/ssl.rst:2214 +#: ../../library/ssl.rst:2201 msgid "Testing for SSL support" msgstr "" -#: ../../library/ssl.rst:2216 +#: ../../library/ssl.rst:2203 msgid "" "To test for the presence of SSL support in a Python installation, user code " "should use the following idiom::" msgstr "" -#: ../../library/ssl.rst:2227 +#: ../../library/ssl.rst:2214 msgid "Client-side operation" msgstr "" -#: ../../library/ssl.rst:2229 +#: ../../library/ssl.rst:2216 msgid "" "This example creates a SSL context with the recommended security settings " "for client sockets, including automatic certificate verification::" msgstr "" -#: ../../library/ssl.rst:2234 +#: ../../library/ssl.rst:2221 msgid "" "If you prefer to tune security settings yourself, you might create a context " "from scratch (but beware that you might not get the settings right)::" msgstr "" -#: ../../library/ssl.rst:2241 +#: ../../library/ssl.rst:2228 msgid "" "(this snippet assumes your operating system places a bundle of all CA " "certificates in ``/etc/ssl/certs/ca-bundle.crt``; if not, you'll get an " "error and have to adjust the location)" msgstr "" -#: ../../library/ssl.rst:2245 +#: ../../library/ssl.rst:2232 msgid "" "The :data:`PROTOCOL_TLS_CLIENT` protocol configures the context for cert " "validation and hostname verification. :attr:`~SSLContext.verify_mode` is set " @@ -2447,7 +2434,7 @@ msgid "" "``True``. All other protocols create SSL contexts with insecure defaults." msgstr "" -#: ../../library/ssl.rst:2250 +#: ../../library/ssl.rst:2237 msgid "" "When you use the context to connect to a server, :const:`CERT_REQUIRED` and :" "attr:`~SSLContext.check_hostname` validate the server certificate: it " @@ -2456,27 +2443,27 @@ msgid "" "properties like validity and identity of the hostname::" msgstr "" -#: ../../library/ssl.rst:2260 +#: ../../library/ssl.rst:2247 msgid "You may then fetch the certificate::" msgstr "" -#: ../../library/ssl.rst:2264 +#: ../../library/ssl.rst:2251 msgid "" "Visual inspection shows that the certificate does identify the desired " "service (that is, the HTTPS host ``www.python.org``)::" msgstr "" -#: ../../library/ssl.rst:2307 +#: ../../library/ssl.rst:2294 msgid "" "Now the SSL channel is established and the certificate verified, you can " "proceed to talk with the server::" msgstr "" -#: ../../library/ssl.rst:2334 +#: ../../library/ssl.rst:2321 msgid "Server-side operation" msgstr "" -#: ../../library/ssl.rst:2336 +#: ../../library/ssl.rst:2323 msgid "" "For server operation, typically you'll need to have a server certificate, " "and private key, each in a file. You'll first create a context holding the " @@ -2485,20 +2472,20 @@ msgid "" "start waiting for clients to connect::" msgstr "" -#: ../../library/ssl.rst:2351 +#: ../../library/ssl.rst:2338 msgid "" "When a client connects, you'll call :meth:`accept` on the socket to get the " "new socket from the other end, and use the context's :meth:`SSLContext." "wrap_socket` method to create a server-side SSL socket for the connection::" msgstr "" -#: ../../library/ssl.rst:2364 +#: ../../library/ssl.rst:2351 msgid "" "Then you'll read data from the ``connstream`` and do something with it till " "you are finished with the client (or the client is finished with you)::" msgstr "" -#: ../../library/ssl.rst:2378 +#: ../../library/ssl.rst:2365 msgid "" "And go back to listening for new client connections (of course, a real " "server would probably handle each client connection in a separate thread, or " @@ -2506,18 +2493,18 @@ msgid "" "event loop)." msgstr "" -#: ../../library/ssl.rst:2386 +#: ../../library/ssl.rst:2373 msgid "Notes on non-blocking sockets" msgstr "" -#: ../../library/ssl.rst:2388 +#: ../../library/ssl.rst:2375 msgid "" "SSL sockets behave slightly different than regular sockets in non-blocking " "mode. When working with non-blocking sockets, there are thus several things " "you need to be aware of:" msgstr "" -#: ../../library/ssl.rst:2392 +#: ../../library/ssl.rst:2379 msgid "" "Most :class:`SSLSocket` methods will raise either :exc:`SSLWantWriteError` " "or :exc:`SSLWantReadError` instead of :exc:`BlockingIOError` if an I/O " @@ -2529,13 +2516,13 @@ msgid "" "require a prior *write* to the underlying socket." msgstr "" -#: ../../library/ssl.rst:2404 +#: ../../library/ssl.rst:2391 msgid "" "In earlier Python versions, the :meth:`!SSLSocket.send` method returned zero " "instead of raising :exc:`SSLWantWriteError` or :exc:`SSLWantReadError`." msgstr "" -#: ../../library/ssl.rst:2408 +#: ../../library/ssl.rst:2395 msgid "" "Calling :func:`~select.select` tells you that the OS-level socket can be " "read from (or written to), but it does not imply that there is sufficient " @@ -2545,7 +2532,7 @@ msgid "" "`~select.select`." msgstr "" -#: ../../library/ssl.rst:2415 +#: ../../library/ssl.rst:2402 msgid "" "Conversely, since the SSL layer has its own framing, a SSL socket may still " "have data available for reading without :func:`~select.select` being aware " @@ -2554,13 +2541,13 @@ msgid "" "call if still necessary." msgstr "" -#: ../../library/ssl.rst:2421 +#: ../../library/ssl.rst:2408 msgid "" "(of course, similar provisions apply when using other primitives such as :" "func:`~select.poll`, or those in the :mod:`selectors` module)" msgstr "" -#: ../../library/ssl.rst:2424 +#: ../../library/ssl.rst:2411 msgid "" "The SSL handshake itself will be non-blocking: the :meth:`SSLSocket." "do_handshake` method has to be retried until it returns successfully. Here " @@ -2568,7 +2555,7 @@ msgid "" "readiness::" msgstr "" -#: ../../library/ssl.rst:2440 +#: ../../library/ssl.rst:2427 msgid "" "The :mod:`asyncio` module supports :ref:`non-blocking SSL sockets ` and provides a higher level API. It polls for events using " @@ -2577,26 +2564,26 @@ msgid "" "handshake asynchronously as well." msgstr "" -#: ../../library/ssl.rst:2449 +#: ../../library/ssl.rst:2436 msgid "Memory BIO Support" msgstr "" -#: ../../library/ssl.rst:2453 +#: ../../library/ssl.rst:2440 msgid "" "Ever since the SSL module was introduced in Python 2.6, the :class:" "`SSLSocket` class has provided two related but distinct areas of " "functionality:" msgstr "" -#: ../../library/ssl.rst:2456 +#: ../../library/ssl.rst:2443 msgid "SSL protocol handling" msgstr "" -#: ../../library/ssl.rst:2457 +#: ../../library/ssl.rst:2444 msgid "Network IO" msgstr "" -#: ../../library/ssl.rst:2459 +#: ../../library/ssl.rst:2446 msgid "" "The network IO API is identical to that provided by :class:`socket.socket`, " "from which :class:`SSLSocket` also inherits. This allows an SSL socket to be " @@ -2604,7 +2591,7 @@ msgid "" "add SSL support to an existing application." msgstr "" -#: ../../library/ssl.rst:2464 +#: ../../library/ssl.rst:2451 msgid "" "Combining SSL protocol handling and network IO usually works well, but there " "are some cases where it doesn't. An example is async IO frameworks that want " @@ -2616,7 +2603,7 @@ msgid "" "`SSLObject` is provided." msgstr "" -#: ../../library/ssl.rst:2475 +#: ../../library/ssl.rst:2462 msgid "" "A reduced-scope variant of :class:`SSLSocket` representing an SSL protocol " "instance that does not contain any network IO methods. This class is " @@ -2624,7 +2611,7 @@ msgid "" "for SSL through memory buffers." msgstr "" -#: ../../library/ssl.rst:2480 +#: ../../library/ssl.rst:2467 msgid "" "This class implements an interface on top of a low-level SSL object as " "implemented by OpenSSL. This object captures the state of an SSL connection " @@ -2632,7 +2619,7 @@ msgid "" "separate \"BIO\" objects which are OpenSSL's IO abstraction layer." msgstr "" -#: ../../library/ssl.rst:2485 +#: ../../library/ssl.rst:2472 msgid "" "This class has no public constructor. An :class:`SSLObject` instance must " "be created using the :meth:`~SSLContext.wrap_bio` method. This method will " @@ -2641,214 +2628,214 @@ msgid "" "instance, while the *outgoing* BIO is used to pass data the other way around." msgstr "" -#: ../../library/ssl.rst:2492 +#: ../../library/ssl.rst:2479 msgid "The following methods are available:" msgstr "" -#: ../../library/ssl.rst:2494 +#: ../../library/ssl.rst:2481 msgid ":attr:`~SSLSocket.context`" msgstr "" -#: ../../library/ssl.rst:2495 +#: ../../library/ssl.rst:2482 msgid ":attr:`~SSLSocket.server_side`" msgstr "" -#: ../../library/ssl.rst:2496 +#: ../../library/ssl.rst:2483 msgid ":attr:`~SSLSocket.server_hostname`" msgstr "" -#: ../../library/ssl.rst:2497 +#: ../../library/ssl.rst:2484 msgid ":attr:`~SSLSocket.session`" msgstr "" -#: ../../library/ssl.rst:2498 +#: ../../library/ssl.rst:2485 msgid ":attr:`~SSLSocket.session_reused`" msgstr "" -#: ../../library/ssl.rst:2499 +#: ../../library/ssl.rst:2486 msgid ":meth:`~SSLSocket.read`" msgstr "" -#: ../../library/ssl.rst:2500 +#: ../../library/ssl.rst:2487 msgid ":meth:`~SSLSocket.write`" msgstr "" -#: ../../library/ssl.rst:2501 +#: ../../library/ssl.rst:2488 msgid ":meth:`~SSLSocket.getpeercert`" msgstr "" -#: ../../library/ssl.rst:2502 +#: ../../library/ssl.rst:2489 msgid ":meth:`~SSLSocket.selected_alpn_protocol`" msgstr "" -#: ../../library/ssl.rst:2503 +#: ../../library/ssl.rst:2490 msgid ":meth:`~SSLSocket.selected_npn_protocol`" msgstr "" -#: ../../library/ssl.rst:2504 +#: ../../library/ssl.rst:2491 msgid ":meth:`~SSLSocket.cipher`" msgstr "" -#: ../../library/ssl.rst:2505 +#: ../../library/ssl.rst:2492 msgid ":meth:`~SSLSocket.shared_ciphers`" msgstr "" -#: ../../library/ssl.rst:2506 +#: ../../library/ssl.rst:2493 msgid ":meth:`~SSLSocket.compression`" msgstr "" -#: ../../library/ssl.rst:2507 +#: ../../library/ssl.rst:2494 msgid ":meth:`~SSLSocket.pending`" msgstr "" -#: ../../library/ssl.rst:2508 +#: ../../library/ssl.rst:2495 msgid ":meth:`~SSLSocket.do_handshake`" msgstr "" -#: ../../library/ssl.rst:2509 +#: ../../library/ssl.rst:2496 msgid ":meth:`~SSLSocket.verify_client_post_handshake`" msgstr "" -#: ../../library/ssl.rst:2510 +#: ../../library/ssl.rst:2497 msgid ":meth:`~SSLSocket.unwrap`" msgstr "" -#: ../../library/ssl.rst:2511 +#: ../../library/ssl.rst:2498 msgid ":meth:`~SSLSocket.get_channel_binding`" msgstr "" -#: ../../library/ssl.rst:2512 +#: ../../library/ssl.rst:2499 msgid ":meth:`~SSLSocket.version`" msgstr "" -#: ../../library/ssl.rst:2514 +#: ../../library/ssl.rst:2501 msgid "" "When compared to :class:`SSLSocket`, this object lacks the following " "features:" msgstr "" -#: ../../library/ssl.rst:2517 +#: ../../library/ssl.rst:2504 msgid "" "Any form of network IO; ``recv()`` and ``send()`` read and write only to the " "underlying :class:`MemoryBIO` buffers." msgstr "" -#: ../../library/ssl.rst:2520 +#: ../../library/ssl.rst:2507 msgid "" "There is no *do_handshake_on_connect* machinery. You must always manually " "call :meth:`~SSLSocket.do_handshake` to start the handshake." msgstr "" -#: ../../library/ssl.rst:2523 +#: ../../library/ssl.rst:2510 msgid "" "There is no handling of *suppress_ragged_eofs*. All end-of-file conditions " "that are in violation of the protocol are reported via the :exc:" "`SSLEOFError` exception." msgstr "" -#: ../../library/ssl.rst:2527 +#: ../../library/ssl.rst:2514 msgid "" "The method :meth:`~SSLSocket.unwrap` call does not return anything, unlike " "for an SSL socket where it returns the underlying socket." msgstr "" -#: ../../library/ssl.rst:2530 +#: ../../library/ssl.rst:2517 msgid "" "The *server_name_callback* callback passed to :meth:`SSLContext." "set_servername_callback` will get an :class:`SSLObject` instance instead of " "a :class:`SSLSocket` instance as its first parameter." msgstr "" -#: ../../library/ssl.rst:2534 +#: ../../library/ssl.rst:2521 msgid "Some notes related to the use of :class:`SSLObject`:" msgstr "" -#: ../../library/ssl.rst:2536 +#: ../../library/ssl.rst:2523 msgid "" "All IO on an :class:`SSLObject` is :ref:`non-blocking `. " "This means that for example :meth:`~SSLSocket.read` will raise an :exc:" "`SSLWantReadError` if it needs more data than the incoming BIO has available." msgstr "" -#: ../../library/ssl.rst:2541 +#: ../../library/ssl.rst:2528 msgid "" "There is no module-level ``wrap_bio()`` call like there is for :meth:" "`~SSLContext.wrap_socket`. An :class:`SSLObject` is always created via an :" "class:`SSLContext`." msgstr "" -#: ../../library/ssl.rst:2545 +#: ../../library/ssl.rst:2532 msgid "" ":class:`SSLObject` instances must to created with :meth:`~SSLContext." "wrap_bio`. In earlier versions, it was possible to create instances " "directly. This was never documented or officially supported." msgstr "" -#: ../../library/ssl.rst:2551 +#: ../../library/ssl.rst:2538 msgid "" "An SSLObject communicates with the outside world using memory buffers. The " "class :class:`MemoryBIO` provides a memory buffer that can be used for this " "purpose. It wraps an OpenSSL memory BIO (Basic IO) object:" msgstr "" -#: ../../library/ssl.rst:2557 +#: ../../library/ssl.rst:2544 msgid "" "A memory buffer that can be used to pass data between Python and an SSL " "protocol instance." msgstr "" -#: ../../library/ssl.rst:2562 +#: ../../library/ssl.rst:2549 msgid "Return the number of bytes currently in the memory buffer." msgstr "" -#: ../../library/ssl.rst:2566 +#: ../../library/ssl.rst:2553 msgid "" "A boolean indicating whether the memory BIO is current at the end-of-file " "position." msgstr "" -#: ../../library/ssl.rst:2571 +#: ../../library/ssl.rst:2558 msgid "" "Read up to *n* bytes from the memory buffer. If *n* is not specified or " "negative, all bytes are returned." msgstr "" -#: ../../library/ssl.rst:2576 +#: ../../library/ssl.rst:2563 msgid "" "Write the bytes from *buf* to the memory BIO. The *buf* argument must be an " "object supporting the buffer protocol." msgstr "" -#: ../../library/ssl.rst:2579 +#: ../../library/ssl.rst:2566 msgid "" "The return value is the number of bytes written, which is always equal to " "the length of *buf*." msgstr "" -#: ../../library/ssl.rst:2584 +#: ../../library/ssl.rst:2571 msgid "" "Write an EOF marker to the memory BIO. After this method has been called, it " "is illegal to call :meth:`~MemoryBIO.write`. The attribute :attr:`eof` will " "become true after all data currently in the buffer has been read." msgstr "" -#: ../../library/ssl.rst:2590 +#: ../../library/ssl.rst:2577 msgid "SSL session" msgstr "" -#: ../../library/ssl.rst:2596 +#: ../../library/ssl.rst:2583 msgid "Session object used by :attr:`~SSLSocket.session`." msgstr "" -#: ../../library/ssl.rst:2608 +#: ../../library/ssl.rst:2595 msgid "Security considerations" msgstr "" -#: ../../library/ssl.rst:2611 +#: ../../library/ssl.rst:2598 msgid "Best defaults" msgstr "" -#: ../../library/ssl.rst:2613 +#: ../../library/ssl.rst:2600 msgid "" "For **client use**, if you don't have any special requirements for your " "security policy, it is highly recommended that you use the :func:" @@ -2858,19 +2845,19 @@ msgid "" "settings." msgstr "" -#: ../../library/ssl.rst:2620 +#: ../../library/ssl.rst:2607 msgid "" "For example, here is how you would use the :class:`smtplib.SMTP` class to " "create a trusted, secure connection to a SMTP server::" msgstr "" -#: ../../library/ssl.rst:2629 +#: ../../library/ssl.rst:2616 msgid "" "If a client certificate is needed for the connection, it can be added with :" "meth:`SSLContext.load_cert_chain`." msgstr "" -#: ../../library/ssl.rst:2632 +#: ../../library/ssl.rst:2619 msgid "" "By contrast, if you create the SSL context by calling the :class:" "`SSLContext` constructor yourself, it will not have certificate validation " @@ -2878,15 +2865,15 @@ msgid "" "paragraphs below to achieve a good security level." msgstr "" -#: ../../library/ssl.rst:2638 +#: ../../library/ssl.rst:2625 msgid "Manual settings" msgstr "" -#: ../../library/ssl.rst:2641 +#: ../../library/ssl.rst:2628 msgid "Verifying certificates" msgstr "" -#: ../../library/ssl.rst:2643 +#: ../../library/ssl.rst:2630 msgid "" "When calling the :class:`SSLContext` constructor directly, :const:" "`CERT_NONE` is the default. Since it does not authenticate the other peer, " @@ -2901,13 +2888,13 @@ msgid "" "automatically performed when :attr:`SSLContext.check_hostname` is enabled." msgstr "" -#: ../../library/ssl.rst:2656 +#: ../../library/ssl.rst:2643 msgid "" "Hostname matchings is now performed by OpenSSL. Python no longer uses :func:" "`match_hostname`." msgstr "" -#: ../../library/ssl.rst:2660 +#: ../../library/ssl.rst:2647 msgid "" "In server mode, if you want to authenticate your clients using the SSL layer " "(rather than using a higher-level authentication mechanism), you'll also " @@ -2915,11 +2902,11 @@ msgid "" "certificate." msgstr "" -#: ../../library/ssl.rst:2666 +#: ../../library/ssl.rst:2653 msgid "Protocol versions" msgstr "" -#: ../../library/ssl.rst:2668 +#: ../../library/ssl.rst:2655 msgid "" "SSL versions 2 and 3 are considered insecure and are therefore dangerous to " "use. If you want maximum compatibility between clients and servers, it is " @@ -2928,7 +2915,7 @@ msgid "" "by default." msgstr "" -#: ../../library/ssl.rst:2681 +#: ../../library/ssl.rst:2668 msgid "" "The SSL context created above will only allow TLSv1.2 and later (if " "supported by your system) connections to a server. :const:" @@ -2936,11 +2923,11 @@ msgid "" "default. You have to load certificates into the context." msgstr "" -#: ../../library/ssl.rst:2688 +#: ../../library/ssl.rst:2675 msgid "Cipher selection" msgstr "" -#: ../../library/ssl.rst:2690 +#: ../../library/ssl.rst:2677 msgid "" "If you have advanced security requirements, fine-tuning of the ciphers " "enabled when negotiating a SSL session is possible through the :meth:" @@ -2953,11 +2940,11 @@ msgid "" "ciphers`` command on your system." msgstr "" -#: ../../library/ssl.rst:2701 +#: ../../library/ssl.rst:2688 msgid "Multi-processing" msgstr "" -#: ../../library/ssl.rst:2703 +#: ../../library/ssl.rst:2690 msgid "" "If using this module as part of a multi-processed application (using, for " "example the :mod:`multiprocessing` or :mod:`concurrent.futures` modules), be " @@ -2968,18 +2955,18 @@ msgid "" "`~ssl.RAND_pseudo_bytes` is sufficient." msgstr "" -#: ../../library/ssl.rst:2715 +#: ../../library/ssl.rst:2702 msgid "TLS 1.3" msgstr "" -#: ../../library/ssl.rst:2719 +#: ../../library/ssl.rst:2706 msgid "" "Python has provisional and experimental support for TLS 1.3 with OpenSSL " "1.1.1. The new protocol behaves slightly differently than previous version " "of TLS/SSL. Some new TLS 1.3 features are not yet available." msgstr "" -#: ../../library/ssl.rst:2723 +#: ../../library/ssl.rst:2710 msgid "" "TLS 1.3 uses a disjunct set of cipher suites. All AES-GCM and ChaCha20 " "cipher suites are enabled by default. The method :meth:`SSLContext." @@ -2987,14 +2974,14 @@ msgid "" "`SSLContext.get_ciphers` returns them." msgstr "" -#: ../../library/ssl.rst:2727 +#: ../../library/ssl.rst:2714 msgid "" "Session tickets are no longer sent as part of the initial handshake and are " "handled differently. :attr:`SSLSocket.session` and :class:`SSLSession` are " "not compatible with TLS 1.3." msgstr "" -#: ../../library/ssl.rst:2730 +#: ../../library/ssl.rst:2717 msgid "" "Client-side certificates are also no longer verified during the initial " "handshake. A server can request a certificate at any time. Clients process " @@ -3002,127 +2989,127 @@ msgid "" "server." msgstr "" -#: ../../library/ssl.rst:2734 +#: ../../library/ssl.rst:2721 msgid "" "TLS 1.3 features like early data, deferred TLS client cert request, " "signature algorithm configuration, and rekeying are not supported yet." msgstr "" -#: ../../library/ssl.rst:2741 +#: ../../library/ssl.rst:2728 msgid "LibreSSL support" msgstr "" -#: ../../library/ssl.rst:2743 +#: ../../library/ssl.rst:2730 msgid "" "LibreSSL is a fork of OpenSSL 1.0.1. The ssl module has limited support for " "LibreSSL. Some features are not available when the ssl module is compiled " "with LibreSSL." msgstr "" -#: ../../library/ssl.rst:2747 +#: ../../library/ssl.rst:2734 msgid "" "LibreSSL >= 2.6.1 no longer supports NPN. The methods :meth:`SSLContext." "set_npn_protocols` and :meth:`SSLSocket.selected_npn_protocol` are not " "available." msgstr "" -#: ../../library/ssl.rst:2750 +#: ../../library/ssl.rst:2737 msgid "" ":meth:`SSLContext.set_default_verify_paths` ignores the env vars :envvar:" "`SSL_CERT_FILE` and :envvar:`SSL_CERT_PATH` although :func:" "`get_default_verify_paths` still reports them." msgstr "" -#: ../../library/ssl.rst:2758 +#: ../../library/ssl.rst:2745 msgid "Class :class:`socket.socket`" msgstr "" -#: ../../library/ssl.rst:2758 +#: ../../library/ssl.rst:2745 msgid "Documentation of underlying :mod:`socket` class" msgstr "" -#: ../../library/ssl.rst:2761 +#: ../../library/ssl.rst:2748 msgid "" "`SSL/TLS Strong Encryption: An Introduction `_" msgstr "" -#: ../../library/ssl.rst:2761 +#: ../../library/ssl.rst:2748 msgid "Intro from the Apache HTTP Server documentation" msgstr "" -#: ../../library/ssl.rst:2764 +#: ../../library/ssl.rst:2751 msgid "" ":rfc:`RFC 1422: Privacy Enhancement for Internet Electronic Mail: Part II: " "Certificate-Based Key Management <1422>`" msgstr "" -#: ../../library/ssl.rst:2764 +#: ../../library/ssl.rst:2751 msgid "Steve Kent" msgstr "" -#: ../../library/ssl.rst:2767 +#: ../../library/ssl.rst:2754 msgid ":rfc:`RFC 4086: Randomness Requirements for Security <4086>`" msgstr "" -#: ../../library/ssl.rst:2767 +#: ../../library/ssl.rst:2754 msgid "Donald E., Jeffrey I. Schiller" msgstr "" -#: ../../library/ssl.rst:2770 +#: ../../library/ssl.rst:2757 msgid "" ":rfc:`RFC 5280: Internet X.509 Public Key Infrastructure Certificate and " "Certificate Revocation List (CRL) Profile <5280>`" msgstr "" -#: ../../library/ssl.rst:2770 +#: ../../library/ssl.rst:2757 msgid "D. Cooper" msgstr "" -#: ../../library/ssl.rst:2773 +#: ../../library/ssl.rst:2760 msgid "" ":rfc:`RFC 5246: The Transport Layer Security (TLS) Protocol Version 1.2 " "<5246>`" msgstr "" -#: ../../library/ssl.rst:2773 +#: ../../library/ssl.rst:2760 msgid "T. Dierks et. al." msgstr "" -#: ../../library/ssl.rst:2776 +#: ../../library/ssl.rst:2763 msgid ":rfc:`RFC 6066: Transport Layer Security (TLS) Extensions <6066>`" msgstr "" -#: ../../library/ssl.rst:2776 +#: ../../library/ssl.rst:2763 msgid "D. Eastlake" msgstr "" -#: ../../library/ssl.rst:2779 +#: ../../library/ssl.rst:2766 msgid "" "`IANA TLS: Transport Layer Security (TLS) Parameters `_" msgstr "" -#: ../../library/ssl.rst:2779 +#: ../../library/ssl.rst:2766 msgid "IANA" msgstr "" -#: ../../library/ssl.rst:2782 +#: ../../library/ssl.rst:2769 msgid "" ":rfc:`RFC 7525: Recommendations for Secure Use of Transport Layer Security " "(TLS) and Datagram Transport Layer Security (DTLS) <7525>`" msgstr "" -#: ../../library/ssl.rst:2782 +#: ../../library/ssl.rst:2769 msgid "IETF" msgstr "" -#: ../../library/ssl.rst:2784 +#: ../../library/ssl.rst:2771 msgid "" "`Mozilla's Server Side TLS recommendations `_" msgstr "" -#: ../../library/ssl.rst:2785 +#: ../../library/ssl.rst:2772 msgid "Mozilla" msgstr "" diff --git a/library/stdtypes.po b/library/stdtypes.po index 5426e9ee1a..e1ad0c59f7 100644 --- a/library/stdtypes.po +++ b/library/stdtypes.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.7\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2021-09-07 06:52+0000\n" +"POT-Creation-Date: 2020-06-20 18:08+0800\n" "PO-Revision-Date: 2018-05-23 16:11+0000\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -116,8 +116,8 @@ msgstr "" #: ../../library/stdtypes.rst:85 ../../library/stdtypes.rst:274 #: ../../library/stdtypes.rst:413 ../../library/stdtypes.rst:861 -#: ../../library/stdtypes.rst:1056 ../../library/stdtypes.rst:2286 -#: ../../library/stdtypes.rst:3506 +#: ../../library/stdtypes.rst:1056 ../../library/stdtypes.rst:2285 +#: ../../library/stdtypes.rst:3505 msgid "Notes" msgstr "註解" @@ -131,8 +131,8 @@ msgstr "" #: ../../library/stdtypes.rst:87 ../../library/stdtypes.rst:284 #: ../../library/stdtypes.rst:863 ../../library/stdtypes.rst:866 -#: ../../library/stdtypes.rst:1067 ../../library/stdtypes.rst:2292 -#: ../../library/stdtypes.rst:3512 +#: ../../library/stdtypes.rst:1067 ../../library/stdtypes.rst:2291 +#: ../../library/stdtypes.rst:3511 msgid "\\(1)" msgstr "\\(1)" @@ -146,8 +146,8 @@ msgstr "" #: ../../library/stdtypes.rst:90 ../../library/stdtypes.rst:287 #: ../../library/stdtypes.rst:307 ../../library/stdtypes.rst:1095 -#: ../../library/stdtypes.rst:2296 ../../library/stdtypes.rst:2298 -#: ../../library/stdtypes.rst:3516 ../../library/stdtypes.rst:3518 +#: ../../library/stdtypes.rst:2295 ../../library/stdtypes.rst:2297 +#: ../../library/stdtypes.rst:3515 ../../library/stdtypes.rst:3517 msgid "\\(2)" msgstr "\\(2)" @@ -160,18 +160,18 @@ msgid "if *x* is false, then ``True``, else ``False``" msgstr "" #: ../../library/stdtypes.rst:93 ../../library/stdtypes.rst:875 -#: ../../library/stdtypes.rst:1098 ../../library/stdtypes.rst:2300 -#: ../../library/stdtypes.rst:2302 ../../library/stdtypes.rst:2304 -#: ../../library/stdtypes.rst:2306 ../../library/stdtypes.rst:3520 -#: ../../library/stdtypes.rst:3522 ../../library/stdtypes.rst:3524 -#: ../../library/stdtypes.rst:3526 +#: ../../library/stdtypes.rst:1098 ../../library/stdtypes.rst:2299 +#: ../../library/stdtypes.rst:2301 ../../library/stdtypes.rst:2303 +#: ../../library/stdtypes.rst:2305 ../../library/stdtypes.rst:3519 +#: ../../library/stdtypes.rst:3521 ../../library/stdtypes.rst:3523 +#: ../../library/stdtypes.rst:3525 msgid "\\(3)" msgstr "" #: ../../library/stdtypes.rst:102 ../../library/stdtypes.rst:318 #: ../../library/stdtypes.rst:431 ../../library/stdtypes.rst:902 -#: ../../library/stdtypes.rst:1106 ../../library/stdtypes.rst:2332 -#: ../../library/stdtypes.rst:3556 +#: ../../library/stdtypes.rst:1106 ../../library/stdtypes.rst:2331 +#: ../../library/stdtypes.rst:3555 msgid "Notes:" msgstr "註解:" @@ -210,9 +210,9 @@ msgstr "" msgid "This table summarizes the comparison operations:" msgstr "" -#: ../../library/stdtypes.rst:143 ../../library/stdtypes.rst:2263 -#: ../../library/stdtypes.rst:2286 ../../library/stdtypes.rst:3483 -#: ../../library/stdtypes.rst:3506 +#: ../../library/stdtypes.rst:143 ../../library/stdtypes.rst:2262 +#: ../../library/stdtypes.rst:2285 ../../library/stdtypes.rst:3482 +#: ../../library/stdtypes.rst:3505 msgid "Meaning" msgstr "" @@ -494,7 +494,7 @@ msgid "" msgstr "" #: ../../library/stdtypes.rst:300 ../../library/stdtypes.rst:1088 -#: ../../library/stdtypes.rst:2294 ../../library/stdtypes.rst:3543 +#: ../../library/stdtypes.rst:2293 ../../library/stdtypes.rst:3542 msgid "\\(6)" msgstr "" @@ -532,9 +532,9 @@ msgstr "" #: ../../library/stdtypes.rst:309 ../../library/stdtypes.rst:311 #: ../../library/stdtypes.rst:1077 ../../library/stdtypes.rst:1080 -#: ../../library/stdtypes.rst:2319 ../../library/stdtypes.rst:2322 -#: ../../library/stdtypes.rst:2325 ../../library/stdtypes.rst:3539 -#: ../../library/stdtypes.rst:3546 +#: ../../library/stdtypes.rst:2318 ../../library/stdtypes.rst:2321 +#: ../../library/stdtypes.rst:2324 ../../library/stdtypes.rst:3538 +#: ../../library/stdtypes.rst:3545 msgid "\\(5)" msgstr "" @@ -670,8 +670,8 @@ msgstr "" #: ../../library/stdtypes.rst:415 ../../library/stdtypes.rst:418 #: ../../library/stdtypes.rst:421 ../../library/stdtypes.rst:1101 -#: ../../library/stdtypes.rst:2308 ../../library/stdtypes.rst:2312 -#: ../../library/stdtypes.rst:3528 ../../library/stdtypes.rst:3532 +#: ../../library/stdtypes.rst:2307 ../../library/stdtypes.rst:2311 +#: ../../library/stdtypes.rst:3527 ../../library/stdtypes.rst:3531 msgid "\\(4)" msgstr "" @@ -1213,7 +1213,7 @@ msgid "" "before index *j*)" msgstr "" -#: ../../library/stdtypes.rst:888 ../../library/stdtypes.rst:3514 +#: ../../library/stdtypes.rst:888 ../../library/stdtypes.rst:3513 msgid "\\(8)" msgstr "" @@ -1478,7 +1478,7 @@ msgid "" msgstr "" #: ../../library/stdtypes.rst:1095 -msgid "``s.pop()`` or ``s.pop(i)``" +msgid "``s.pop([i])``" msgstr "" #: ../../library/stdtypes.rst:1095 @@ -2047,6 +2047,19 @@ msgstr "" #: ../../library/stdtypes.rst:1552 msgid "" +"If the string starts with the *prefix* string, return " +"``string[len(prefix):]``. Otherwise, return a copy of the original string::" +msgstr "" + +#: ../../library/stdtypes.rst:1565 +msgid "" +"If the string ends with the *suffix* string and that *suffix* is not empty, " +"return ``string[:-len(suffix)]``. Otherwise, return a copy of the original " +"string::" +msgstr "" + +#: ../../library/stdtypes.rst:1579 +msgid "" "Return an encoded version of the string as a bytes object. Default encoding " "is ``'utf-8'``. *errors* may be given to set a different error handling " "scheme. The default for *errors* is ``'strict'``, meaning that encoding " @@ -2057,22 +2070,22 @@ msgid "" "encodings`." msgstr "" -#: ../../library/stdtypes.rst:1561 +#: ../../library/stdtypes.rst:1588 msgid "" "By default, the *errors* argument is not checked for best performances, but " "only used at the first encoding error. Enable the :ref:`Python Development " "Mode `, or use a debug build to check *errors*." msgstr "" -#: ../../library/stdtypes.rst:1565 +#: ../../library/stdtypes.rst:1592 msgid "Support for keyword arguments added." msgstr "" -#: ../../library/stdtypes.rst:1568 ../../library/stdtypes.rst:2703 +#: ../../library/stdtypes.rst:1595 ../../library/stdtypes.rst:2702 msgid "The *errors* is now checked in development mode and in debug mode." msgstr "" -#: ../../library/stdtypes.rst:1574 +#: ../../library/stdtypes.rst:1601 msgid "" "Return ``True`` if the string ends with the specified *suffix*, otherwise " "return ``False``. *suffix* can also be a tuple of suffixes to look for. " @@ -2080,7 +2093,7 @@ msgid "" "*end*, stop comparing at that position." msgstr "" -#: ../../library/stdtypes.rst:1582 +#: ../../library/stdtypes.rst:1609 msgid "" "Return a copy of the string where all tab characters are replaced by one or " "more spaces, depending on the current column and the given tab size. Tab " @@ -2096,21 +2109,21 @@ msgid "" "printed." msgstr "" -#: ../../library/stdtypes.rst:1603 +#: ../../library/stdtypes.rst:1630 msgid "" "Return the lowest index in the string where substring *sub* is found within " "the slice ``s[start:end]``. Optional arguments *start* and *end* are " "interpreted as in slice notation. Return ``-1`` if *sub* is not found." msgstr "" -#: ../../library/stdtypes.rst:1609 +#: ../../library/stdtypes.rst:1636 msgid "" "The :meth:`~str.find` method should be used only if you need to know the " "position of *sub*. To check if *sub* is a substring or not, use the :" "keyword:`in` operator::" msgstr "" -#: ../../library/stdtypes.rst:1619 +#: ../../library/stdtypes.rst:1646 msgid "" "Perform a string formatting operation. The string on which this method is " "called can contain literal text or replacement fields delimited by braces " @@ -2120,13 +2133,13 @@ msgid "" "the corresponding argument." msgstr "" -#: ../../library/stdtypes.rst:1629 +#: ../../library/stdtypes.rst:1656 msgid "" "See :ref:`formatstrings` for a description of the various formatting options " "that can be specified in format strings." msgstr "" -#: ../../library/stdtypes.rst:1633 +#: ../../library/stdtypes.rst:1660 msgid "" "When formatting a number (:class:`int`, :class:`float`, :class:`complex`, :" "class:`decimal.Decimal` and subclasses) with the ``n`` type (ex: ``'{:n}'." @@ -2137,26 +2150,26 @@ msgid "" "This temporary change affects other threads." msgstr "" -#: ../../library/stdtypes.rst:1642 +#: ../../library/stdtypes.rst:1669 msgid "" "When formatting a number with the ``n`` type, the function sets temporarily " "the ``LC_CTYPE`` locale to the ``LC_NUMERIC`` locale in some cases." msgstr "" -#: ../../library/stdtypes.rst:1650 +#: ../../library/stdtypes.rst:1677 msgid "" "Similar to ``str.format(**mapping)``, except that ``mapping`` is used " "directly and not copied to a :class:`dict`. This is useful if for example " "``mapping`` is a dict subclass:" msgstr "" -#: ../../library/stdtypes.rst:1666 +#: ../../library/stdtypes.rst:1693 msgid "" "Like :meth:`~str.find`, but raise :exc:`ValueError` when the substring is " "not found." msgstr "" -#: ../../library/stdtypes.rst:1672 +#: ../../library/stdtypes.rst:1699 msgid "" "Return ``True`` if all characters in the string are alphanumeric and there " "is at least one character, ``False`` otherwise. A character ``c`` is " @@ -2164,7 +2177,7 @@ msgid "" "isdecimal()``, ``c.isdigit()``, or ``c.isnumeric()``." msgstr "" -#: ../../library/stdtypes.rst:1680 +#: ../../library/stdtypes.rst:1707 msgid "" "Return ``True`` if all characters in the string are alphabetic and there is " "at least one character, ``False`` otherwise. Alphabetic characters are " @@ -2174,14 +2187,14 @@ msgid "" "property defined in the Unicode Standard." msgstr "" -#: ../../library/stdtypes.rst:1689 +#: ../../library/stdtypes.rst:1716 msgid "" "Return ``True`` if the string is empty or all characters in the string are " "ASCII, ``False`` otherwise. ASCII characters have code points in the range U" "+0000-U+007F." msgstr "" -#: ../../library/stdtypes.rst:1698 +#: ../../library/stdtypes.rst:1725 msgid "" "Return ``True`` if all characters in the string are decimal characters and " "there is at least one character, ``False`` otherwise. Decimal characters are " @@ -2190,7 +2203,7 @@ msgid "" "General Category \"Nd\"." msgstr "" -#: ../../library/stdtypes.rst:1708 +#: ../../library/stdtypes.rst:1735 msgid "" "Return ``True`` if all characters in the string are digits and there is at " "least one character, ``False`` otherwise. Digits include decimal characters " @@ -2200,29 +2213,29 @@ msgid "" "property value Numeric_Type=Digit or Numeric_Type=Decimal." msgstr "" -#: ../../library/stdtypes.rst:1718 +#: ../../library/stdtypes.rst:1745 msgid "" "Return ``True`` if the string is a valid identifier according to the " "language definition, section :ref:`identifiers`." msgstr "" -#: ../../library/stdtypes.rst:1721 +#: ../../library/stdtypes.rst:1748 msgid "" "Call :func:`keyword.iskeyword` to test whether string ``s`` is a reserved " "identifier, such as :keyword:`def` and :keyword:`class`." msgstr "" -#: ../../library/stdtypes.rst:1724 +#: ../../library/stdtypes.rst:1751 msgid "Example: ::" msgstr "" -#: ../../library/stdtypes.rst:1737 +#: ../../library/stdtypes.rst:1764 msgid "" "Return ``True`` if all cased characters [4]_ in the string are lowercase and " "there is at least one cased character, ``False`` otherwise." msgstr "" -#: ../../library/stdtypes.rst:1743 +#: ../../library/stdtypes.rst:1770 msgid "" "Return ``True`` if all characters in the string are numeric characters, and " "there is at least one character, ``False`` otherwise. Numeric characters " @@ -2232,7 +2245,7 @@ msgid "" "Numeric_Type=Decimal or Numeric_Type=Numeric." msgstr "" -#: ../../library/stdtypes.rst:1753 +#: ../../library/stdtypes.rst:1780 msgid "" "Return ``True`` if all characters in the string are printable or the string " "is empty, ``False`` otherwise. Nonprintable characters are those characters " @@ -2243,20 +2256,20 @@ msgid "" "of strings written to :data:`sys.stdout` or :data:`sys.stderr`.)" msgstr "" -#: ../../library/stdtypes.rst:1764 +#: ../../library/stdtypes.rst:1791 msgid "" "Return ``True`` if there are only whitespace characters in the string and " "there is at least one character, ``False`` otherwise." msgstr "" -#: ../../library/stdtypes.rst:1767 +#: ../../library/stdtypes.rst:1794 msgid "" "A character is *whitespace* if in the Unicode character database (see :mod:" "`unicodedata`), either its general category is ``Zs`` (\"Separator, space" "\"), or its bidirectional class is one of ``WS``, ``B``, or ``S``." msgstr "" -#: ../../library/stdtypes.rst:1775 +#: ../../library/stdtypes.rst:1802 msgid "" "Return ``True`` if the string is a titlecased string and there is at least " "one character, for example uppercase characters may only follow uncased " @@ -2264,13 +2277,13 @@ msgid "" "otherwise." msgstr "" -#: ../../library/stdtypes.rst:1782 +#: ../../library/stdtypes.rst:1809 msgid "" "Return ``True`` if all cased characters [4]_ in the string are uppercase and " "there is at least one cased character, ``False`` otherwise." msgstr "" -#: ../../library/stdtypes.rst:1798 +#: ../../library/stdtypes.rst:1825 msgid "" "Return a string which is the concatenation of the strings in *iterable*. A :" "exc:`TypeError` will be raised if there are any non-string values in " @@ -2278,26 +2291,26 @@ msgid "" "elements is the string providing this method." msgstr "" -#: ../../library/stdtypes.rst:1806 +#: ../../library/stdtypes.rst:1833 msgid "" "Return the string left justified in a string of length *width*. Padding is " "done using the specified *fillchar* (default is an ASCII space). The " "original string is returned if *width* is less than or equal to ``len(s)``." msgstr "" -#: ../../library/stdtypes.rst:1813 +#: ../../library/stdtypes.rst:1840 msgid "" "Return a copy of the string with all the cased characters [4]_ converted to " "lowercase." msgstr "" -#: ../../library/stdtypes.rst:1816 +#: ../../library/stdtypes.rst:1843 msgid "" "The lowercasing algorithm used is described in section 3.13 of the Unicode " "Standard." msgstr "" -#: ../../library/stdtypes.rst:1822 +#: ../../library/stdtypes.rst:1849 msgid "" "Return a copy of the string with leading characters removed. The *chars* " "argument is a string specifying the set of characters to be removed. If " @@ -2306,19 +2319,19 @@ msgid "" "are stripped::" msgstr "" -#: ../../library/stdtypes.rst:1832 +#: ../../library/stdtypes.rst:1859 msgid "" "See :meth:`str.removeprefix` for a method that will remove a single prefix " "string rather than all of a set of characters. For example::" msgstr "" -#: ../../library/stdtypes.rst:1843 +#: ../../library/stdtypes.rst:1870 msgid "" "This static method returns a translation table usable for :meth:`str." "translate`." msgstr "" -#: ../../library/stdtypes.rst:1845 +#: ../../library/stdtypes.rst:1872 msgid "" "If there is only one argument, it must be a dictionary mapping Unicode " "ordinals (integers) or characters (strings of length 1) to Unicode ordinals, " @@ -2326,7 +2339,7 @@ msgid "" "converted to ordinals." msgstr "" -#: ../../library/stdtypes.rst:1850 +#: ../../library/stdtypes.rst:1877 msgid "" "If there are two arguments, they must be strings of equal length, and in the " "resulting dictionary, each character in x will be mapped to the character at " @@ -2334,7 +2347,7 @@ msgid "" "whose characters will be mapped to ``None`` in the result." msgstr "" -#: ../../library/stdtypes.rst:1858 +#: ../../library/stdtypes.rst:1885 msgid "" "Split the string at the first occurrence of *sep*, and return a 3-tuple " "containing the part before the separator, the separator itself, and the part " @@ -2342,47 +2355,34 @@ msgid "" "containing the string itself, followed by two empty strings." msgstr "" -#: ../../library/stdtypes.rst:1866 -msgid "" -"If the string starts with the *prefix* string, return " -"``string[len(prefix):]``. Otherwise, return a copy of the original string::" -msgstr "" - -#: ../../library/stdtypes.rst:1880 -msgid "" -"If the string ends with the *suffix* string and that *suffix* is not empty, " -"return ``string[:-len(suffix)]``. Otherwise, return a copy of the original " -"string::" -msgstr "" - -#: ../../library/stdtypes.rst:1894 +#: ../../library/stdtypes.rst:1893 msgid "" "Return a copy of the string with all occurrences of substring *old* replaced " "by *new*. If the optional argument *count* is given, only the first *count* " "occurrences are replaced." msgstr "" -#: ../../library/stdtypes.rst:1901 +#: ../../library/stdtypes.rst:1900 msgid "" "Return the highest index in the string where substring *sub* is found, such " "that *sub* is contained within ``s[start:end]``. Optional arguments *start* " "and *end* are interpreted as in slice notation. Return ``-1`` on failure." msgstr "" -#: ../../library/stdtypes.rst:1908 +#: ../../library/stdtypes.rst:1907 msgid "" "Like :meth:`rfind` but raises :exc:`ValueError` when the substring *sub* is " "not found." msgstr "" -#: ../../library/stdtypes.rst:1914 +#: ../../library/stdtypes.rst:1913 msgid "" "Return the string right justified in a string of length *width*. Padding is " "done using the specified *fillchar* (default is an ASCII space). The " "original string is returned if *width* is less than or equal to ``len(s)``." msgstr "" -#: ../../library/stdtypes.rst:1921 +#: ../../library/stdtypes.rst:1920 msgid "" "Split the string at the last occurrence of *sep*, and return a 3-tuple " "containing the part before the separator, the separator itself, and the part " @@ -2390,7 +2390,7 @@ msgid "" "containing two empty strings, followed by the string itself." msgstr "" -#: ../../library/stdtypes.rst:1929 +#: ../../library/stdtypes.rst:1928 msgid "" "Return a list of the words in the string, using *sep* as the delimiter " "string. If *maxsplit* is given, at most *maxsplit* splits are done, the " @@ -2399,7 +2399,7 @@ msgid "" "behaves like :meth:`split` which is described in detail below." msgstr "" -#: ../../library/stdtypes.rst:1938 +#: ../../library/stdtypes.rst:1937 msgid "" "Return a copy of the string with trailing characters removed. The *chars* " "argument is a string specifying the set of characters to be removed. If " @@ -2408,13 +2408,13 @@ msgid "" "are stripped::" msgstr "" -#: ../../library/stdtypes.rst:1948 +#: ../../library/stdtypes.rst:1947 msgid "" "See :meth:`str.removesuffix` for a method that will remove a single suffix " "string rather than all of a set of characters. For example::" msgstr "" -#: ../../library/stdtypes.rst:1958 +#: ../../library/stdtypes.rst:1957 msgid "" "Return a list of the words in the string, using *sep* as the delimiter " "string. If *maxsplit* is given, at most *maxsplit* splits are done (thus, " @@ -2423,7 +2423,7 @@ msgid "" "possible splits are made)." msgstr "" -#: ../../library/stdtypes.rst:1964 +#: ../../library/stdtypes.rst:1963 msgid "" "If *sep* is given, consecutive delimiters are not grouped together and are " "deemed to delimit empty strings (for example, ``'1,,2'.split(',')`` returns " @@ -2432,20 +2432,20 @@ msgid "" "Splitting an empty string with a specified separator returns ``['']``." msgstr "" -#: ../../library/stdtypes.rst:1970 ../../library/stdtypes.rst:1986 -#: ../../library/stdtypes.rst:2038 ../../library/stdtypes.rst:2106 -#: ../../library/stdtypes.rst:2169 ../../library/stdtypes.rst:3018 -#: ../../library/stdtypes.rst:3034 ../../library/stdtypes.rst:3125 -#: ../../library/stdtypes.rst:3141 ../../library/stdtypes.rst:3166 -#: ../../library/stdtypes.rst:3180 ../../library/stdtypes.rst:3208 -#: ../../library/stdtypes.rst:3222 ../../library/stdtypes.rst:3240 -#: ../../library/stdtypes.rst:3267 ../../library/stdtypes.rst:3290 -#: ../../library/stdtypes.rst:3317 ../../library/stdtypes.rst:3359 -#: ../../library/stdtypes.rst:3383 +#: ../../library/stdtypes.rst:1969 ../../library/stdtypes.rst:1985 +#: ../../library/stdtypes.rst:2037 ../../library/stdtypes.rst:2105 +#: ../../library/stdtypes.rst:2168 ../../library/stdtypes.rst:3017 +#: ../../library/stdtypes.rst:3033 ../../library/stdtypes.rst:3124 +#: ../../library/stdtypes.rst:3140 ../../library/stdtypes.rst:3165 +#: ../../library/stdtypes.rst:3179 ../../library/stdtypes.rst:3207 +#: ../../library/stdtypes.rst:3221 ../../library/stdtypes.rst:3239 +#: ../../library/stdtypes.rst:3266 ../../library/stdtypes.rst:3289 +#: ../../library/stdtypes.rst:3316 ../../library/stdtypes.rst:3358 +#: ../../library/stdtypes.rst:3382 msgid "For example::" msgstr "" -#: ../../library/stdtypes.rst:1979 +#: ../../library/stdtypes.rst:1978 msgid "" "If *sep* is not specified or is ``None``, a different splitting algorithm is " "applied: runs of consecutive whitespace are regarded as a single separator, " @@ -2455,131 +2455,131 @@ msgid "" "returns ``[]``." msgstr "" -#: ../../library/stdtypes.rst:2001 +#: ../../library/stdtypes.rst:2000 msgid "" "Return a list of the lines in the string, breaking at line boundaries. Line " "breaks are not included in the resulting list unless *keepends* is given and " "true." msgstr "" -#: ../../library/stdtypes.rst:2005 +#: ../../library/stdtypes.rst:2004 msgid "" "This method splits on the following line boundaries. In particular, the " "boundaries are a superset of :term:`universal newlines`." msgstr "" -#: ../../library/stdtypes.rst:2009 +#: ../../library/stdtypes.rst:2008 msgid "Representation" msgstr "" -#: ../../library/stdtypes.rst:2009 +#: ../../library/stdtypes.rst:2008 msgid "Description" msgstr "描述" -#: ../../library/stdtypes.rst:2011 +#: ../../library/stdtypes.rst:2010 msgid "``\\n``" msgstr "" -#: ../../library/stdtypes.rst:2011 +#: ../../library/stdtypes.rst:2010 msgid "Line Feed" msgstr "" -#: ../../library/stdtypes.rst:2013 +#: ../../library/stdtypes.rst:2012 msgid "``\\r``" msgstr "" -#: ../../library/stdtypes.rst:2013 +#: ../../library/stdtypes.rst:2012 msgid "Carriage Return" msgstr "" -#: ../../library/stdtypes.rst:2015 +#: ../../library/stdtypes.rst:2014 msgid "``\\r\\n``" msgstr "" -#: ../../library/stdtypes.rst:2015 +#: ../../library/stdtypes.rst:2014 msgid "Carriage Return + Line Feed" msgstr "" -#: ../../library/stdtypes.rst:2017 +#: ../../library/stdtypes.rst:2016 msgid "``\\v`` or ``\\x0b``" msgstr "" -#: ../../library/stdtypes.rst:2017 +#: ../../library/stdtypes.rst:2016 msgid "Line Tabulation" msgstr "" -#: ../../library/stdtypes.rst:2019 +#: ../../library/stdtypes.rst:2018 msgid "``\\f`` or ``\\x0c``" msgstr "" -#: ../../library/stdtypes.rst:2019 +#: ../../library/stdtypes.rst:2018 msgid "Form Feed" msgstr "" -#: ../../library/stdtypes.rst:2021 +#: ../../library/stdtypes.rst:2020 msgid "``\\x1c``" msgstr "" -#: ../../library/stdtypes.rst:2021 +#: ../../library/stdtypes.rst:2020 msgid "File Separator" msgstr "" -#: ../../library/stdtypes.rst:2023 +#: ../../library/stdtypes.rst:2022 msgid "``\\x1d``" msgstr "" -#: ../../library/stdtypes.rst:2023 +#: ../../library/stdtypes.rst:2022 msgid "Group Separator" msgstr "" -#: ../../library/stdtypes.rst:2025 +#: ../../library/stdtypes.rst:2024 msgid "``\\x1e``" msgstr "" -#: ../../library/stdtypes.rst:2025 +#: ../../library/stdtypes.rst:2024 msgid "Record Separator" msgstr "" -#: ../../library/stdtypes.rst:2027 +#: ../../library/stdtypes.rst:2026 msgid "``\\x85``" msgstr "" -#: ../../library/stdtypes.rst:2027 +#: ../../library/stdtypes.rst:2026 msgid "Next Line (C1 Control Code)" msgstr "" -#: ../../library/stdtypes.rst:2029 +#: ../../library/stdtypes.rst:2028 msgid "``\\u2028``" msgstr "" -#: ../../library/stdtypes.rst:2029 +#: ../../library/stdtypes.rst:2028 msgid "Line Separator" msgstr "" -#: ../../library/stdtypes.rst:2031 +#: ../../library/stdtypes.rst:2030 msgid "``\\u2029``" msgstr "" -#: ../../library/stdtypes.rst:2031 +#: ../../library/stdtypes.rst:2030 msgid "Paragraph Separator" msgstr "" -#: ../../library/stdtypes.rst:2036 +#: ../../library/stdtypes.rst:2035 msgid "``\\v`` and ``\\f`` added to list of line boundaries." msgstr "" -#: ../../library/stdtypes.rst:2045 +#: ../../library/stdtypes.rst:2044 msgid "" "Unlike :meth:`~str.split` when a delimiter string *sep* is given, this " "method returns an empty list for the empty string, and a terminal line break " "does not result in an extra line::" msgstr "" -#: ../../library/stdtypes.rst:2054 +#: ../../library/stdtypes.rst:2053 msgid "For comparison, ``split('\\n')`` gives::" msgstr "" -#: ../../library/stdtypes.rst:2064 +#: ../../library/stdtypes.rst:2063 msgid "" "Return ``True`` if string starts with the *prefix*, otherwise return " "``False``. *prefix* can also be a tuple of prefixes to look for. With " @@ -2587,7 +2587,7 @@ msgid "" "*end*, stop comparing string at that position." msgstr "" -#: ../../library/stdtypes.rst:2072 +#: ../../library/stdtypes.rst:2071 msgid "" "Return a copy of the string with the leading and trailing characters " "removed. The *chars* argument is a string specifying the set of characters " @@ -2596,7 +2596,7 @@ msgid "" "all combinations of its values are stripped::" msgstr "" -#: ../../library/stdtypes.rst:2083 +#: ../../library/stdtypes.rst:2082 msgid "" "The outermost leading and trailing *chars* argument values are stripped from " "the string. Characters are removed from the leading end until reaching a " @@ -2604,20 +2604,20 @@ msgid "" "A similar action takes place on the trailing end. For example::" msgstr "" -#: ../../library/stdtypes.rst:2096 +#: ../../library/stdtypes.rst:2095 msgid "" "Return a copy of the string with uppercase characters converted to lowercase " "and vice versa. Note that it is not necessarily true that ``s.swapcase()." "swapcase() == s``." msgstr "" -#: ../../library/stdtypes.rst:2103 +#: ../../library/stdtypes.rst:2102 msgid "" "Return a titlecased version of the string where words start with an " "uppercase character and the remaining characters are lowercase." msgstr "" -#: ../../library/stdtypes.rst:2111 ../../library/stdtypes.rst:3327 +#: ../../library/stdtypes.rst:2110 ../../library/stdtypes.rst:3326 msgid "" "The algorithm uses a simple language-independent definition of a word as " "groups of consecutive letters. The definition works in many contexts but it " @@ -2625,12 +2625,12 @@ msgid "" "which may not be the desired result::" msgstr "" -#: ../../library/stdtypes.rst:2119 ../../library/stdtypes.rst:3335 +#: ../../library/stdtypes.rst:2118 ../../library/stdtypes.rst:3334 msgid "" "A workaround for apostrophes can be constructed using regular expressions::" msgstr "" -#: ../../library/stdtypes.rst:2133 +#: ../../library/stdtypes.rst:2132 msgid "" "Return a copy of the string in which each character has been mapped through " "the given translation table. The table must be an object that implements " @@ -2642,19 +2642,19 @@ msgid "" "exception, to map the character to itself." msgstr "" -#: ../../library/stdtypes.rst:2142 +#: ../../library/stdtypes.rst:2141 msgid "" "You can use :meth:`str.maketrans` to create a translation map from character-" "to-character mappings in different formats." msgstr "" -#: ../../library/stdtypes.rst:2145 +#: ../../library/stdtypes.rst:2144 msgid "" "See also the :mod:`codecs` module for a more flexible approach to custom " "character mappings." msgstr "" -#: ../../library/stdtypes.rst:2151 +#: ../../library/stdtypes.rst:2150 msgid "" "Return a copy of the string with all the cased characters [4]_ converted to " "uppercase. Note that ``s.upper().isupper()`` might be ``False`` if ``s`` " @@ -2663,13 +2663,13 @@ msgid "" "titlecase)." msgstr "" -#: ../../library/stdtypes.rst:2157 +#: ../../library/stdtypes.rst:2156 msgid "" "The uppercasing algorithm used is described in section 3.13 of the Unicode " "Standard." msgstr "" -#: ../../library/stdtypes.rst:2163 +#: ../../library/stdtypes.rst:2162 msgid "" "Return a copy of the string left filled with ASCII ``'0'`` digits to make a " "string of length *width*. A leading sign prefix (``'+'``/``'-'``) is handled " @@ -2677,11 +2677,11 @@ msgid "" "original string is returned if *width* is less than or equal to ``len(s)``." msgstr "" -#: ../../library/stdtypes.rst:2181 +#: ../../library/stdtypes.rst:2180 msgid "``printf``-style String Formatting" msgstr "" -#: ../../library/stdtypes.rst:2194 +#: ../../library/stdtypes.rst:2193 msgid "" "The formatting operations described here exhibit a variety of quirks that " "lead to a number of common errors (such as failing to display tuples and " @@ -2692,7 +2692,7 @@ msgid "" "or extensibility." msgstr "" -#: ../../library/stdtypes.rst:2202 +#: ../../library/stdtypes.rst:2201 msgid "" "String objects have one unique built-in operation: the ``%`` operator " "(modulo). This is also known as the string *formatting* or *interpolation* " @@ -2702,7 +2702,7 @@ msgid "" "in the C language." msgstr "" -#: ../../library/stdtypes.rst:2208 +#: ../../library/stdtypes.rst:2207 msgid "" "If *format* requires a single argument, *values* may be a single non-tuple " "object. [5]_ Otherwise, *values* must be a tuple with exactly the number of " @@ -2710,36 +2710,36 @@ msgid "" "example, a dictionary)." msgstr "" -#: ../../library/stdtypes.rst:2218 ../../library/stdtypes.rst:3438 +#: ../../library/stdtypes.rst:2217 ../../library/stdtypes.rst:3437 msgid "" "A conversion specifier contains two or more characters and has the following " "components, which must occur in this order:" msgstr "" -#: ../../library/stdtypes.rst:2221 ../../library/stdtypes.rst:3441 +#: ../../library/stdtypes.rst:2220 ../../library/stdtypes.rst:3440 msgid "The ``'%'`` character, which marks the start of the specifier." msgstr "" -#: ../../library/stdtypes.rst:2223 ../../library/stdtypes.rst:3443 +#: ../../library/stdtypes.rst:2222 ../../library/stdtypes.rst:3442 msgid "" "Mapping key (optional), consisting of a parenthesised sequence of characters " "(for example, ``(somename)``)." msgstr "" -#: ../../library/stdtypes.rst:2226 ../../library/stdtypes.rst:3446 +#: ../../library/stdtypes.rst:2225 ../../library/stdtypes.rst:3445 msgid "" "Conversion flags (optional), which affect the result of some conversion " "types." msgstr "" -#: ../../library/stdtypes.rst:2229 ../../library/stdtypes.rst:3449 +#: ../../library/stdtypes.rst:2228 ../../library/stdtypes.rst:3448 msgid "" "Minimum field width (optional). If specified as an ``'*'`` (asterisk), the " "actual width is read from the next element of the tuple in *values*, and the " "object to convert comes after the minimum field width and optional precision." msgstr "" -#: ../../library/stdtypes.rst:2233 ../../library/stdtypes.rst:3453 +#: ../../library/stdtypes.rst:2232 ../../library/stdtypes.rst:3452 msgid "" "Precision (optional), given as a ``'.'`` (dot) followed by the precision. " "If specified as ``'*'`` (an asterisk), the actual precision is read from the " @@ -2747,15 +2747,15 @@ msgid "" "the precision." msgstr "" -#: ../../library/stdtypes.rst:2238 ../../library/stdtypes.rst:3458 +#: ../../library/stdtypes.rst:2237 ../../library/stdtypes.rst:3457 msgid "Length modifier (optional)." msgstr "" -#: ../../library/stdtypes.rst:2240 ../../library/stdtypes.rst:3460 +#: ../../library/stdtypes.rst:2239 ../../library/stdtypes.rst:3459 msgid "Conversion type." msgstr "" -#: ../../library/stdtypes.rst:2242 +#: ../../library/stdtypes.rst:2241 msgid "" "When the right argument is a dictionary (or other mapping type), then the " "formats in the string *must* include a parenthesised mapping key into that " @@ -2763,279 +2763,279 @@ msgid "" "selects the value to be formatted from the mapping. For example:" msgstr "" -#: ../../library/stdtypes.rst:2251 ../../library/stdtypes.rst:3471 +#: ../../library/stdtypes.rst:2250 ../../library/stdtypes.rst:3470 msgid "" "In this case no ``*`` specifiers may occur in a format (since they require a " "sequential parameter list)." msgstr "" -#: ../../library/stdtypes.rst:2254 ../../library/stdtypes.rst:3474 +#: ../../library/stdtypes.rst:2253 ../../library/stdtypes.rst:3473 msgid "The conversion flag characters are:" msgstr "" -#: ../../library/stdtypes.rst:2263 ../../library/stdtypes.rst:3483 +#: ../../library/stdtypes.rst:2262 ../../library/stdtypes.rst:3482 msgid "Flag" msgstr "" -#: ../../library/stdtypes.rst:2265 ../../library/stdtypes.rst:3485 +#: ../../library/stdtypes.rst:2264 ../../library/stdtypes.rst:3484 msgid "``'#'``" msgstr "" -#: ../../library/stdtypes.rst:2265 ../../library/stdtypes.rst:3485 +#: ../../library/stdtypes.rst:2264 ../../library/stdtypes.rst:3484 msgid "" "The value conversion will use the \"alternate form\" (where defined below)." msgstr "" -#: ../../library/stdtypes.rst:2268 ../../library/stdtypes.rst:3488 +#: ../../library/stdtypes.rst:2267 ../../library/stdtypes.rst:3487 msgid "``'0'``" msgstr "" -#: ../../library/stdtypes.rst:2268 ../../library/stdtypes.rst:3488 +#: ../../library/stdtypes.rst:2267 ../../library/stdtypes.rst:3487 msgid "The conversion will be zero padded for numeric values." msgstr "" -#: ../../library/stdtypes.rst:2270 ../../library/stdtypes.rst:3490 +#: ../../library/stdtypes.rst:2269 ../../library/stdtypes.rst:3489 msgid "``'-'``" msgstr "" -#: ../../library/stdtypes.rst:2270 ../../library/stdtypes.rst:3490 +#: ../../library/stdtypes.rst:2269 ../../library/stdtypes.rst:3489 msgid "" "The converted value is left adjusted (overrides the ``'0'`` conversion if " "both are given)." msgstr "" -#: ../../library/stdtypes.rst:2273 ../../library/stdtypes.rst:3493 +#: ../../library/stdtypes.rst:2272 ../../library/stdtypes.rst:3492 msgid "``' '``" msgstr "" -#: ../../library/stdtypes.rst:2273 ../../library/stdtypes.rst:3493 +#: ../../library/stdtypes.rst:2272 ../../library/stdtypes.rst:3492 msgid "" "(a space) A blank should be left before a positive number (or empty string) " "produced by a signed conversion." msgstr "" -#: ../../library/stdtypes.rst:2276 ../../library/stdtypes.rst:3496 +#: ../../library/stdtypes.rst:2275 ../../library/stdtypes.rst:3495 msgid "``'+'``" msgstr "" -#: ../../library/stdtypes.rst:2276 ../../library/stdtypes.rst:3496 +#: ../../library/stdtypes.rst:2275 ../../library/stdtypes.rst:3495 msgid "" "A sign character (``'+'`` or ``'-'``) will precede the conversion (overrides " "a \"space\" flag)." msgstr "" -#: ../../library/stdtypes.rst:2280 ../../library/stdtypes.rst:3500 +#: ../../library/stdtypes.rst:2279 ../../library/stdtypes.rst:3499 msgid "" "A length modifier (``h``, ``l``, or ``L``) may be present, but is ignored as " "it is not necessary for Python -- so e.g. ``%ld`` is identical to ``%d``." msgstr "" -#: ../../library/stdtypes.rst:2283 ../../library/stdtypes.rst:3503 +#: ../../library/stdtypes.rst:2282 ../../library/stdtypes.rst:3502 msgid "The conversion types are:" msgstr "" -#: ../../library/stdtypes.rst:2286 ../../library/stdtypes.rst:3506 +#: ../../library/stdtypes.rst:2285 ../../library/stdtypes.rst:3505 msgid "Conversion" msgstr "" -#: ../../library/stdtypes.rst:2288 ../../library/stdtypes.rst:3508 +#: ../../library/stdtypes.rst:2287 ../../library/stdtypes.rst:3507 msgid "``'d'``" msgstr "``'d'``" -#: ../../library/stdtypes.rst:2288 ../../library/stdtypes.rst:2290 -#: ../../library/stdtypes.rst:3508 ../../library/stdtypes.rst:3510 +#: ../../library/stdtypes.rst:2287 ../../library/stdtypes.rst:2289 +#: ../../library/stdtypes.rst:3507 ../../library/stdtypes.rst:3509 msgid "Signed integer decimal." msgstr "" -#: ../../library/stdtypes.rst:2290 ../../library/stdtypes.rst:3510 +#: ../../library/stdtypes.rst:2289 ../../library/stdtypes.rst:3509 msgid "``'i'``" msgstr "``'i'``" -#: ../../library/stdtypes.rst:2292 ../../library/stdtypes.rst:3512 +#: ../../library/stdtypes.rst:2291 ../../library/stdtypes.rst:3511 msgid "``'o'``" msgstr "" -#: ../../library/stdtypes.rst:2292 ../../library/stdtypes.rst:3512 +#: ../../library/stdtypes.rst:2291 ../../library/stdtypes.rst:3511 msgid "Signed octal value." msgstr "" -#: ../../library/stdtypes.rst:2294 ../../library/stdtypes.rst:3514 +#: ../../library/stdtypes.rst:2293 ../../library/stdtypes.rst:3513 msgid "``'u'``" msgstr "``'u'``" -#: ../../library/stdtypes.rst:2294 ../../library/stdtypes.rst:3514 +#: ../../library/stdtypes.rst:2293 ../../library/stdtypes.rst:3513 msgid "Obsolete type -- it is identical to ``'d'``." msgstr "" -#: ../../library/stdtypes.rst:2296 ../../library/stdtypes.rst:3516 +#: ../../library/stdtypes.rst:2295 ../../library/stdtypes.rst:3515 msgid "``'x'``" msgstr "" -#: ../../library/stdtypes.rst:2296 ../../library/stdtypes.rst:3516 +#: ../../library/stdtypes.rst:2295 ../../library/stdtypes.rst:3515 msgid "Signed hexadecimal (lowercase)." msgstr "" -#: ../../library/stdtypes.rst:2298 ../../library/stdtypes.rst:3518 +#: ../../library/stdtypes.rst:2297 ../../library/stdtypes.rst:3517 msgid "``'X'``" msgstr "" -#: ../../library/stdtypes.rst:2298 ../../library/stdtypes.rst:3518 +#: ../../library/stdtypes.rst:2297 ../../library/stdtypes.rst:3517 msgid "Signed hexadecimal (uppercase)." msgstr "" -#: ../../library/stdtypes.rst:2300 ../../library/stdtypes.rst:3520 +#: ../../library/stdtypes.rst:2299 ../../library/stdtypes.rst:3519 msgid "``'e'``" msgstr "" -#: ../../library/stdtypes.rst:2300 ../../library/stdtypes.rst:3520 +#: ../../library/stdtypes.rst:2299 ../../library/stdtypes.rst:3519 msgid "Floating point exponential format (lowercase)." msgstr "" -#: ../../library/stdtypes.rst:2302 ../../library/stdtypes.rst:3522 +#: ../../library/stdtypes.rst:2301 ../../library/stdtypes.rst:3521 msgid "``'E'``" msgstr "" -#: ../../library/stdtypes.rst:2302 ../../library/stdtypes.rst:3522 +#: ../../library/stdtypes.rst:2301 ../../library/stdtypes.rst:3521 msgid "Floating point exponential format (uppercase)." msgstr "" -#: ../../library/stdtypes.rst:2304 ../../library/stdtypes.rst:3524 +#: ../../library/stdtypes.rst:2303 ../../library/stdtypes.rst:3523 msgid "``'f'``" msgstr "``'f'``" -#: ../../library/stdtypes.rst:2304 ../../library/stdtypes.rst:2306 -#: ../../library/stdtypes.rst:3524 ../../library/stdtypes.rst:3526 +#: ../../library/stdtypes.rst:2303 ../../library/stdtypes.rst:2305 +#: ../../library/stdtypes.rst:3523 ../../library/stdtypes.rst:3525 msgid "Floating point decimal format." msgstr "" -#: ../../library/stdtypes.rst:2306 ../../library/stdtypes.rst:3526 +#: ../../library/stdtypes.rst:2305 ../../library/stdtypes.rst:3525 msgid "``'F'``" msgstr "" -#: ../../library/stdtypes.rst:2308 ../../library/stdtypes.rst:3528 +#: ../../library/stdtypes.rst:2307 ../../library/stdtypes.rst:3527 msgid "``'g'``" msgstr "" -#: ../../library/stdtypes.rst:2308 ../../library/stdtypes.rst:3528 +#: ../../library/stdtypes.rst:2307 ../../library/stdtypes.rst:3527 msgid "" "Floating point format. Uses lowercase exponential format if exponent is less " "than -4 or not less than precision, decimal format otherwise." msgstr "" -#: ../../library/stdtypes.rst:2312 ../../library/stdtypes.rst:3532 +#: ../../library/stdtypes.rst:2311 ../../library/stdtypes.rst:3531 msgid "``'G'``" msgstr "" -#: ../../library/stdtypes.rst:2312 ../../library/stdtypes.rst:3532 +#: ../../library/stdtypes.rst:2311 ../../library/stdtypes.rst:3531 msgid "" "Floating point format. Uses uppercase exponential format if exponent is less " "than -4 or not less than precision, decimal format otherwise." msgstr "" -#: ../../library/stdtypes.rst:2316 ../../library/stdtypes.rst:3536 +#: ../../library/stdtypes.rst:2315 ../../library/stdtypes.rst:3535 msgid "``'c'``" msgstr "" -#: ../../library/stdtypes.rst:2316 +#: ../../library/stdtypes.rst:2315 msgid "Single character (accepts integer or single character string)." msgstr "" -#: ../../library/stdtypes.rst:2319 ../../library/stdtypes.rst:3549 +#: ../../library/stdtypes.rst:2318 ../../library/stdtypes.rst:3548 msgid "``'r'``" msgstr "" -#: ../../library/stdtypes.rst:2319 +#: ../../library/stdtypes.rst:2318 msgid "String (converts any Python object using :func:`repr`)." msgstr "" -#: ../../library/stdtypes.rst:2322 ../../library/stdtypes.rst:3543 +#: ../../library/stdtypes.rst:2321 ../../library/stdtypes.rst:3542 msgid "``'s'``" msgstr "" -#: ../../library/stdtypes.rst:2322 +#: ../../library/stdtypes.rst:2321 msgid "String (converts any Python object using :func:`str`)." msgstr "" -#: ../../library/stdtypes.rst:2325 ../../library/stdtypes.rst:3546 +#: ../../library/stdtypes.rst:2324 ../../library/stdtypes.rst:3545 msgid "``'a'``" msgstr "" -#: ../../library/stdtypes.rst:2325 +#: ../../library/stdtypes.rst:2324 msgid "String (converts any Python object using :func:`ascii`)." msgstr "" -#: ../../library/stdtypes.rst:2328 ../../library/stdtypes.rst:3552 +#: ../../library/stdtypes.rst:2327 ../../library/stdtypes.rst:3551 msgid "``'%'``" msgstr "" -#: ../../library/stdtypes.rst:2328 ../../library/stdtypes.rst:3552 +#: ../../library/stdtypes.rst:2327 ../../library/stdtypes.rst:3551 msgid "No argument is converted, results in a ``'%'`` character in the result." msgstr "" -#: ../../library/stdtypes.rst:2335 ../../library/stdtypes.rst:3559 +#: ../../library/stdtypes.rst:2334 ../../library/stdtypes.rst:3558 msgid "" "The alternate form causes a leading octal specifier (``'0o'``) to be " "inserted before the first digit." msgstr "" -#: ../../library/stdtypes.rst:2339 ../../library/stdtypes.rst:3563 +#: ../../library/stdtypes.rst:2338 ../../library/stdtypes.rst:3562 msgid "" "The alternate form causes a leading ``'0x'`` or ``'0X'`` (depending on " "whether the ``'x'`` or ``'X'`` format was used) to be inserted before the " "first digit." msgstr "" -#: ../../library/stdtypes.rst:2343 ../../library/stdtypes.rst:3567 +#: ../../library/stdtypes.rst:2342 ../../library/stdtypes.rst:3566 msgid "" "The alternate form causes the result to always contain a decimal point, even " "if no digits follow it." msgstr "" -#: ../../library/stdtypes.rst:2346 ../../library/stdtypes.rst:3570 +#: ../../library/stdtypes.rst:2345 ../../library/stdtypes.rst:3569 msgid "" "The precision determines the number of digits after the decimal point and " "defaults to 6." msgstr "" -#: ../../library/stdtypes.rst:2350 ../../library/stdtypes.rst:3574 +#: ../../library/stdtypes.rst:2349 ../../library/stdtypes.rst:3573 msgid "" "The alternate form causes the result to always contain a decimal point, and " "trailing zeroes are not removed as they would otherwise be." msgstr "" -#: ../../library/stdtypes.rst:2353 ../../library/stdtypes.rst:3577 +#: ../../library/stdtypes.rst:2352 ../../library/stdtypes.rst:3576 msgid "" "The precision determines the number of significant digits before and after " "the decimal point and defaults to 6." msgstr "" -#: ../../library/stdtypes.rst:2357 ../../library/stdtypes.rst:3581 +#: ../../library/stdtypes.rst:2356 ../../library/stdtypes.rst:3580 msgid "If precision is ``N``, the output is truncated to ``N`` characters." msgstr "" -#: ../../library/stdtypes.rst:2360 ../../library/stdtypes.rst:3590 +#: ../../library/stdtypes.rst:2359 ../../library/stdtypes.rst:3589 msgid "See :pep:`237`." msgstr "" -#: ../../library/stdtypes.rst:2362 +#: ../../library/stdtypes.rst:2361 msgid "" "Since Python strings have an explicit length, ``%s`` conversions do not " "assume that ``'\\0'`` is the end of the string." msgstr "" -#: ../../library/stdtypes.rst:2367 +#: ../../library/stdtypes.rst:2366 msgid "" "``%f`` conversions for numbers whose absolute value is over 1e50 are no " "longer replaced by ``%g`` conversions." msgstr "" -#: ../../library/stdtypes.rst:2378 +#: ../../library/stdtypes.rst:2377 msgid "" "Binary Sequence Types --- :class:`bytes`, :class:`bytearray`, :class:" "`memoryview`" msgstr "" -#: ../../library/stdtypes.rst:2386 +#: ../../library/stdtypes.rst:2385 msgid "" "The core built-in types for manipulating binary data are :class:`bytes` and :" "class:`bytearray`. They are supported by :class:`memoryview` which uses the :" @@ -3043,17 +3043,17 @@ msgid "" "objects without needing to make a copy." msgstr "" -#: ../../library/stdtypes.rst:2391 +#: ../../library/stdtypes.rst:2390 msgid "" "The :mod:`array` module supports efficient storage of basic data types like " "32-bit integers and IEEE754 double-precision floating values." msgstr "" -#: ../../library/stdtypes.rst:2397 +#: ../../library/stdtypes.rst:2396 msgid "Bytes Objects" msgstr "" -#: ../../library/stdtypes.rst:2401 +#: ../../library/stdtypes.rst:2400 msgid "" "Bytes objects are immutable sequences of single bytes. Since many major " "binary protocols are based on the ASCII text encoding, bytes objects offer " @@ -3061,40 +3061,40 @@ msgid "" "and are closely related to string objects in a variety of other ways." msgstr "" -#: ../../library/stdtypes.rst:2408 +#: ../../library/stdtypes.rst:2407 msgid "" "Firstly, the syntax for bytes literals is largely the same as that for " "string literals, except that a ``b`` prefix is added:" msgstr "" -#: ../../library/stdtypes.rst:2411 +#: ../../library/stdtypes.rst:2410 msgid "Single quotes: ``b'still allows embedded \"double\" quotes'``" msgstr "" -#: ../../library/stdtypes.rst:2412 +#: ../../library/stdtypes.rst:2411 msgid "Double quotes: ``b\"still allows embedded 'single' quotes\"``." msgstr "" -#: ../../library/stdtypes.rst:2413 +#: ../../library/stdtypes.rst:2412 msgid "" "Triple quoted: ``b'''3 single quotes'''``, ``b\"\"\"3 double quotes\"\"\"``" msgstr "" -#: ../../library/stdtypes.rst:2415 +#: ../../library/stdtypes.rst:2414 msgid "" "Only ASCII characters are permitted in bytes literals (regardless of the " "declared source code encoding). Any binary values over 127 must be entered " "into bytes literals using the appropriate escape sequence." msgstr "" -#: ../../library/stdtypes.rst:2419 +#: ../../library/stdtypes.rst:2418 msgid "" "As with string literals, bytes literals may also use a ``r`` prefix to " "disable processing of escape sequences. See :ref:`strings` for more about " "the various forms of bytes literal, including supported escape sequences." msgstr "" -#: ../../library/stdtypes.rst:2423 +#: ../../library/stdtypes.rst:2422 msgid "" "While bytes literals and representations are based on ASCII text, bytes " "objects actually behave like immutable sequences of integers, with each " @@ -3107,29 +3107,29 @@ msgid "" "compatible will usually lead to data corruption)." msgstr "" -#: ../../library/stdtypes.rst:2433 +#: ../../library/stdtypes.rst:2432 msgid "" "In addition to the literal forms, bytes objects can be created in a number " "of other ways:" msgstr "" -#: ../../library/stdtypes.rst:2436 +#: ../../library/stdtypes.rst:2435 msgid "A zero-filled bytes object of a specified length: ``bytes(10)``" msgstr "" -#: ../../library/stdtypes.rst:2437 +#: ../../library/stdtypes.rst:2436 msgid "From an iterable of integers: ``bytes(range(20))``" msgstr "" -#: ../../library/stdtypes.rst:2438 +#: ../../library/stdtypes.rst:2437 msgid "Copying existing binary data via the buffer protocol: ``bytes(obj)``" msgstr "" -#: ../../library/stdtypes.rst:2440 +#: ../../library/stdtypes.rst:2439 msgid "Also see the :ref:`bytes ` built-in." msgstr "" -#: ../../library/stdtypes.rst:2442 +#: ../../library/stdtypes.rst:2441 msgid "" "Since 2 hexadecimal digits correspond precisely to a single byte, " "hexadecimal numbers are a commonly used format for describing binary data. " @@ -3137,32 +3137,32 @@ msgid "" "that format:" msgstr "" -#: ../../library/stdtypes.rst:2448 +#: ../../library/stdtypes.rst:2447 msgid "" "This :class:`bytes` class method returns a bytes object, decoding the given " "string object. The string must contain two hexadecimal digits per byte, " "with ASCII whitespace being ignored." msgstr "" -#: ../../library/stdtypes.rst:2455 +#: ../../library/stdtypes.rst:2454 msgid "" ":meth:`bytes.fromhex` now skips all ASCII whitespace in the string, not just " "spaces." msgstr "" -#: ../../library/stdtypes.rst:2459 +#: ../../library/stdtypes.rst:2458 msgid "" "A reverse conversion function exists to transform a bytes object into its " "hexadecimal representation." msgstr "" -#: ../../library/stdtypes.rst:2464 ../../library/stdtypes.rst:2558 +#: ../../library/stdtypes.rst:2463 ../../library/stdtypes.rst:2557 msgid "" "Return a string object containing two hexadecimal digits for each byte in " "the instance." msgstr "" -#: ../../library/stdtypes.rst:2470 +#: ../../library/stdtypes.rst:2469 msgid "" "If you want to make the hex string easier to read, you can specify a single " "character separator *sep* parameter to include in the output. By default " @@ -3171,13 +3171,13 @@ msgid "" "negative values from the left." msgstr "" -#: ../../library/stdtypes.rst:2486 +#: ../../library/stdtypes.rst:2485 msgid "" ":meth:`bytes.hex` now supports optional *sep* and *bytes_per_sep* parameters " "to insert separators between bytes in the hex output." msgstr "" -#: ../../library/stdtypes.rst:2490 +#: ../../library/stdtypes.rst:2489 msgid "" "Since bytes objects are sequences of integers (akin to a tuple), for a bytes " "object *b*, ``b[0]`` will be an integer, while ``b[0:1]`` will be a bytes " @@ -3185,14 +3185,14 @@ msgid "" "and slicing will produce a string of length 1)" msgstr "" -#: ../../library/stdtypes.rst:2495 +#: ../../library/stdtypes.rst:2494 msgid "" "The representation of bytes objects uses the literal format (``b'...'``) " "since it is often more useful than e.g. ``bytes([46, 46, 46])``. You can " "always convert a bytes object into a list of integers using ``list(b)``." msgstr "" -#: ../../library/stdtypes.rst:2500 +#: ../../library/stdtypes.rst:2499 msgid "" "For Python 2.x users: In the Python 2.x series, a variety of implicit " "conversions between 8-bit strings (the closest thing 2.x offers to a built-" @@ -3204,51 +3204,51 @@ msgid "" "objects will always compare unequal." msgstr "" -#: ../../library/stdtypes.rst:2513 +#: ../../library/stdtypes.rst:2512 msgid "Bytearray Objects" msgstr "" -#: ../../library/stdtypes.rst:2517 +#: ../../library/stdtypes.rst:2516 msgid "" ":class:`bytearray` objects are a mutable counterpart to :class:`bytes` " "objects." msgstr "" -#: ../../library/stdtypes.rst:2522 +#: ../../library/stdtypes.rst:2521 msgid "" "There is no dedicated literal syntax for bytearray objects, instead they are " "always created by calling the constructor:" msgstr "" -#: ../../library/stdtypes.rst:2525 +#: ../../library/stdtypes.rst:2524 msgid "Creating an empty instance: ``bytearray()``" msgstr "" -#: ../../library/stdtypes.rst:2526 +#: ../../library/stdtypes.rst:2525 msgid "Creating a zero-filled instance with a given length: ``bytearray(10)``" msgstr "" -#: ../../library/stdtypes.rst:2527 +#: ../../library/stdtypes.rst:2526 msgid "From an iterable of integers: ``bytearray(range(20))``" msgstr "" -#: ../../library/stdtypes.rst:2528 +#: ../../library/stdtypes.rst:2527 msgid "" "Copying existing binary data via the buffer protocol: ``bytearray(b'Hi!')``" msgstr "" -#: ../../library/stdtypes.rst:2530 +#: ../../library/stdtypes.rst:2529 msgid "" "As bytearray objects are mutable, they support the :ref:`mutable ` sequence operations in addition to the common bytes and bytearray " "operations described in :ref:`bytes-methods`." msgstr "" -#: ../../library/stdtypes.rst:2534 +#: ../../library/stdtypes.rst:2533 msgid "Also see the :ref:`bytearray ` built-in." msgstr "" -#: ../../library/stdtypes.rst:2536 +#: ../../library/stdtypes.rst:2535 msgid "" "Since 2 hexadecimal digits correspond precisely to a single byte, " "hexadecimal numbers are a commonly used format for describing binary data. " @@ -3256,33 +3256,33 @@ msgid "" "in that format:" msgstr "" -#: ../../library/stdtypes.rst:2542 +#: ../../library/stdtypes.rst:2541 msgid "" "This :class:`bytearray` class method returns bytearray object, decoding the " "given string object. The string must contain two hexadecimal digits per " "byte, with ASCII whitespace being ignored." msgstr "" -#: ../../library/stdtypes.rst:2549 +#: ../../library/stdtypes.rst:2548 msgid "" ":meth:`bytearray.fromhex` now skips all ASCII whitespace in the string, not " "just spaces." msgstr "" -#: ../../library/stdtypes.rst:2553 +#: ../../library/stdtypes.rst:2552 msgid "" "A reverse conversion function exists to transform a bytearray object into " "its hexadecimal representation." msgstr "" -#: ../../library/stdtypes.rst:2566 +#: ../../library/stdtypes.rst:2565 msgid "" "Similar to :meth:`bytes.hex`, :meth:`bytearray.hex` now supports optional " "*sep* and *bytes_per_sep* parameters to insert separators between bytes in " "the hex output." msgstr "" -#: ../../library/stdtypes.rst:2571 +#: ../../library/stdtypes.rst:2570 msgid "" "Since bytearray objects are sequences of integers (akin to a list), for a " "bytearray object *b*, ``b[0]`` will be an integer, while ``b[0:1]`` will be " @@ -3290,7 +3290,7 @@ msgid "" "both indexing and slicing will produce a string of length 1)" msgstr "" -#: ../../library/stdtypes.rst:2576 +#: ../../library/stdtypes.rst:2575 msgid "" "The representation of bytearray objects uses the bytes literal format " "(``bytearray(b'...')``) since it is often more useful than e.g. " @@ -3298,11 +3298,11 @@ msgid "" "a list of integers using ``list(b)``." msgstr "" -#: ../../library/stdtypes.rst:2585 +#: ../../library/stdtypes.rst:2584 msgid "Bytes and Bytearray Operations" msgstr "" -#: ../../library/stdtypes.rst:2590 +#: ../../library/stdtypes.rst:2589 msgid "" "Both bytes and bytearray objects support the :ref:`common ` " "sequence operations. They interoperate not just with operands of the same " @@ -3311,94 +3311,94 @@ msgid "" "return type of the result may depend on the order of operands." msgstr "" -#: ../../library/stdtypes.rst:2598 +#: ../../library/stdtypes.rst:2597 msgid "" "The methods on bytes and bytearray objects don't accept strings as their " "arguments, just as the methods on strings don't accept bytes as their " "arguments. For example, you have to write::" msgstr "" -#: ../../library/stdtypes.rst:2605 +#: ../../library/stdtypes.rst:2604 msgid "and::" msgstr "" -#: ../../library/stdtypes.rst:2610 +#: ../../library/stdtypes.rst:2609 msgid "" "Some bytes and bytearray operations assume the use of ASCII compatible " "binary formats, and hence should be avoided when working with arbitrary " "binary data. These restrictions are covered below." msgstr "" -#: ../../library/stdtypes.rst:2615 +#: ../../library/stdtypes.rst:2614 msgid "" "Using these ASCII based operations to manipulate binary data that is not " "stored in an ASCII based format may lead to data corruption." msgstr "" -#: ../../library/stdtypes.rst:2618 +#: ../../library/stdtypes.rst:2617 msgid "" "The following methods on bytes and bytearray objects can be used with " "arbitrary binary data." msgstr "" -#: ../../library/stdtypes.rst:2624 +#: ../../library/stdtypes.rst:2623 msgid "" "Return the number of non-overlapping occurrences of subsequence *sub* in the " "range [*start*, *end*]. Optional arguments *start* and *end* are " "interpreted as in slice notation." msgstr "" -#: ../../library/stdtypes.rst:2628 ../../library/stdtypes.rst:2726 -#: ../../library/stdtypes.rst:2748 ../../library/stdtypes.rst:2814 -#: ../../library/stdtypes.rst:2827 +#: ../../library/stdtypes.rst:2627 ../../library/stdtypes.rst:2725 +#: ../../library/stdtypes.rst:2747 ../../library/stdtypes.rst:2813 +#: ../../library/stdtypes.rst:2826 msgid "" "The subsequence to search for may be any :term:`bytes-like object` or an " "integer in the range 0 to 255." msgstr "" -#: ../../library/stdtypes.rst:2631 ../../library/stdtypes.rst:2738 -#: ../../library/stdtypes.rst:2751 ../../library/stdtypes.rst:2817 -#: ../../library/stdtypes.rst:2830 +#: ../../library/stdtypes.rst:2630 ../../library/stdtypes.rst:2737 +#: ../../library/stdtypes.rst:2750 ../../library/stdtypes.rst:2816 +#: ../../library/stdtypes.rst:2829 msgid "Also accept an integer in the range 0 to 255 as the subsequence." msgstr "" -#: ../../library/stdtypes.rst:2638 +#: ../../library/stdtypes.rst:2637 msgid "" "If the binary data starts with the *prefix* string, return " "``bytes[len(prefix):]``. Otherwise, return a copy of the original binary " "data::" msgstr "" -#: ../../library/stdtypes.rst:2647 +#: ../../library/stdtypes.rst:2646 msgid "The *prefix* may be any :term:`bytes-like object`." msgstr "" -#: ../../library/stdtypes.rst:2651 ../../library/stdtypes.rst:2673 -#: ../../library/stdtypes.rst:2802 ../../library/stdtypes.rst:2895 -#: ../../library/stdtypes.rst:2909 ../../library/stdtypes.rst:2940 -#: ../../library/stdtypes.rst:2954 ../../library/stdtypes.rst:2996 -#: ../../library/stdtypes.rst:3066 ../../library/stdtypes.rst:3084 -#: ../../library/stdtypes.rst:3112 ../../library/stdtypes.rst:3251 -#: ../../library/stdtypes.rst:3306 ../../library/stdtypes.rst:3349 -#: ../../library/stdtypes.rst:3370 ../../library/stdtypes.rst:3392 -#: ../../library/stdtypes.rst:3594 +#: ../../library/stdtypes.rst:2650 ../../library/stdtypes.rst:2672 +#: ../../library/stdtypes.rst:2801 ../../library/stdtypes.rst:2894 +#: ../../library/stdtypes.rst:2908 ../../library/stdtypes.rst:2939 +#: ../../library/stdtypes.rst:2953 ../../library/stdtypes.rst:2995 +#: ../../library/stdtypes.rst:3065 ../../library/stdtypes.rst:3083 +#: ../../library/stdtypes.rst:3111 ../../library/stdtypes.rst:3250 +#: ../../library/stdtypes.rst:3305 ../../library/stdtypes.rst:3348 +#: ../../library/stdtypes.rst:3369 ../../library/stdtypes.rst:3391 +#: ../../library/stdtypes.rst:3593 msgid "" "The bytearray version of this method does *not* operate in place - it always " "produces a new object, even if no changes were made." msgstr "" -#: ../../library/stdtypes.rst:2660 +#: ../../library/stdtypes.rst:2659 msgid "" "If the binary data ends with the *suffix* string and that *suffix* is not " "empty, return ``bytes[:-len(suffix)]``. Otherwise, return a copy of the " "original binary data::" msgstr "" -#: ../../library/stdtypes.rst:2669 +#: ../../library/stdtypes.rst:2668 msgid "The *suffix* may be any :term:`bytes-like object`." msgstr "" -#: ../../library/stdtypes.rst:2682 +#: ../../library/stdtypes.rst:2681 msgid "" "Return a string decoded from the given bytes. Default encoding is " "``'utf-8'``. *errors* may be given to set a different error handling " @@ -3409,25 +3409,25 @@ msgid "" "encodings, see section :ref:`standard-encodings`." msgstr "" -#: ../../library/stdtypes.rst:2690 +#: ../../library/stdtypes.rst:2689 msgid "" "By default, the *errors* argument is not checked for best performances, but " "only used at the first decoding error. Enable the :ref:`Python Development " "Mode `, or use a debug build to check *errors*." msgstr "" -#: ../../library/stdtypes.rst:2696 +#: ../../library/stdtypes.rst:2695 msgid "" "Passing the *encoding* argument to :class:`str` allows decoding any :term:" "`bytes-like object` directly, without needing to make a temporary bytes or " "bytearray object." msgstr "" -#: ../../library/stdtypes.rst:2700 +#: ../../library/stdtypes.rst:2699 msgid "Added support for keyword arguments." msgstr "" -#: ../../library/stdtypes.rst:2710 +#: ../../library/stdtypes.rst:2709 msgid "" "Return ``True`` if the binary data ends with the specified *suffix*, " "otherwise return ``False``. *suffix* can also be a tuple of suffixes to " @@ -3435,11 +3435,11 @@ msgid "" "optional *end*, stop comparing at that position." msgstr "" -#: ../../library/stdtypes.rst:2715 +#: ../../library/stdtypes.rst:2714 msgid "The suffix(es) to search for may be any :term:`bytes-like object`." msgstr "" -#: ../../library/stdtypes.rst:2721 +#: ../../library/stdtypes.rst:2720 msgid "" "Return the lowest index in the data where the subsequence *sub* is found, " "such that *sub* is contained in the slice ``s[start:end]``. Optional " @@ -3447,20 +3447,20 @@ msgid "" "``-1`` if *sub* is not found." msgstr "" -#: ../../library/stdtypes.rst:2731 +#: ../../library/stdtypes.rst:2730 msgid "" "The :meth:`~bytes.find` method should be used only if you need to know the " "position of *sub*. To check if *sub* is a substring or not, use the :" "keyword:`in` operator::" msgstr "" -#: ../../library/stdtypes.rst:2745 +#: ../../library/stdtypes.rst:2744 msgid "" "Like :meth:`~bytes.find`, but raise :exc:`ValueError` when the subsequence " "is not found." msgstr "" -#: ../../library/stdtypes.rst:2758 +#: ../../library/stdtypes.rst:2757 msgid "" "Return a bytes or bytearray object which is the concatenation of the binary " "data sequences in *iterable*. A :exc:`TypeError` will be raised if there " @@ -3470,7 +3470,7 @@ msgid "" "method." msgstr "" -#: ../../library/stdtypes.rst:2769 +#: ../../library/stdtypes.rst:2768 msgid "" "This static method returns a translation table usable for :meth:`bytes." "translate` that will map each character in *from* into the character at the " @@ -3478,7 +3478,7 @@ msgid "" "objects ` and have the same length." msgstr "" -#: ../../library/stdtypes.rst:2780 +#: ../../library/stdtypes.rst:2779 msgid "" "Split the sequence at the first occurrence of *sep*, and return a 3-tuple " "containing the part before the separator, the separator itself or its " @@ -3487,24 +3487,24 @@ msgid "" "by two empty bytes or bytearray objects." msgstr "" -#: ../../library/stdtypes.rst:2787 ../../library/stdtypes.rst:2844 +#: ../../library/stdtypes.rst:2786 ../../library/stdtypes.rst:2843 msgid "The separator to search for may be any :term:`bytes-like object`." msgstr "" -#: ../../library/stdtypes.rst:2793 +#: ../../library/stdtypes.rst:2792 msgid "" "Return a copy of the sequence with all occurrences of subsequence *old* " "replaced by *new*. If the optional argument *count* is given, only the " "first *count* occurrences are replaced." msgstr "" -#: ../../library/stdtypes.rst:2797 +#: ../../library/stdtypes.rst:2796 msgid "" "The subsequence to search for and its replacement may be any :term:`bytes-" "like object`." msgstr "" -#: ../../library/stdtypes.rst:2809 +#: ../../library/stdtypes.rst:2808 msgid "" "Return the highest index in the sequence where the subsequence *sub* is " "found, such that *sub* is contained within ``s[start:end]``. Optional " @@ -3512,13 +3512,13 @@ msgid "" "``-1`` on failure." msgstr "" -#: ../../library/stdtypes.rst:2824 +#: ../../library/stdtypes.rst:2823 msgid "" "Like :meth:`~bytes.rfind` but raises :exc:`ValueError` when the subsequence " "*sub* is not found." msgstr "" -#: ../../library/stdtypes.rst:2837 +#: ../../library/stdtypes.rst:2836 msgid "" "Split the sequence at the last occurrence of *sep*, and return a 3-tuple " "containing the part before the separator, the separator itself or its " @@ -3527,7 +3527,7 @@ msgid "" "followed by a copy of the original sequence." msgstr "" -#: ../../library/stdtypes.rst:2850 +#: ../../library/stdtypes.rst:2849 msgid "" "Return ``True`` if the binary data starts with the specified *prefix*, " "otherwise return ``False``. *prefix* can also be a tuple of prefixes to " @@ -3535,11 +3535,11 @@ msgid "" "optional *end*, stop comparing at that position." msgstr "" -#: ../../library/stdtypes.rst:2855 +#: ../../library/stdtypes.rst:2854 msgid "The prefix(es) to search for may be any :term:`bytes-like object`." msgstr "" -#: ../../library/stdtypes.rst:2861 +#: ../../library/stdtypes.rst:2860 msgid "" "Return a copy of the bytes or bytearray object where all bytes occurring in " "the optional argument *delete* are removed, and the remaining bytes have " @@ -3547,22 +3547,22 @@ msgid "" "object of length 256." msgstr "" -#: ../../library/stdtypes.rst:2866 +#: ../../library/stdtypes.rst:2865 msgid "" "You can use the :func:`bytes.maketrans` method to create a translation table." msgstr "" -#: ../../library/stdtypes.rst:2869 +#: ../../library/stdtypes.rst:2868 msgid "" "Set the *table* argument to ``None`` for translations that only delete " "characters::" msgstr "" -#: ../../library/stdtypes.rst:2875 +#: ../../library/stdtypes.rst:2874 msgid "*delete* is now supported as a keyword argument." msgstr "" -#: ../../library/stdtypes.rst:2879 +#: ../../library/stdtypes.rst:2878 msgid "" "The following methods on bytes and bytearray objects have default behaviours " "that assume the use of ASCII compatible binary formats, but can still be " @@ -3571,7 +3571,7 @@ msgid "" "instead produce new objects." msgstr "" -#: ../../library/stdtypes.rst:2888 +#: ../../library/stdtypes.rst:2887 msgid "" "Return a copy of the object centered in a sequence of length *width*. " "Padding is done using the specified *fillbyte* (default is an ASCII space). " @@ -3579,7 +3579,7 @@ msgid "" "less than or equal to ``len(s)``." msgstr "" -#: ../../library/stdtypes.rst:2902 +#: ../../library/stdtypes.rst:2901 msgid "" "Return a copy of the object left justified in a sequence of length *width*. " "Padding is done using the specified *fillbyte* (default is an ASCII space). " @@ -3587,7 +3587,7 @@ msgid "" "less than or equal to ``len(s)``." msgstr "" -#: ../../library/stdtypes.rst:2916 +#: ../../library/stdtypes.rst:2915 msgid "" "Return a copy of the sequence with specified leading bytes removed. The " "*chars* argument is a binary sequence specifying the set of byte values to " @@ -3597,14 +3597,14 @@ msgid "" "all combinations of its values are stripped::" msgstr "" -#: ../../library/stdtypes.rst:2928 +#: ../../library/stdtypes.rst:2927 msgid "" "The binary sequence of byte values to remove may be any :term:`bytes-like " "object`. See :meth:`~bytes.removeprefix` for a method that will remove a " "single prefix string rather than all of a set of characters. For example::" msgstr "" -#: ../../library/stdtypes.rst:2947 +#: ../../library/stdtypes.rst:2946 msgid "" "Return a copy of the object right justified in a sequence of length *width*. " "Padding is done using the specified *fillbyte* (default is an ASCII space). " @@ -3612,7 +3612,7 @@ msgid "" "less than or equal to ``len(s)``." msgstr "" -#: ../../library/stdtypes.rst:2961 +#: ../../library/stdtypes.rst:2960 msgid "" "Split the binary sequence into subsequences of the same type, using *sep* as " "the delimiter string. If *maxsplit* is given, at most *maxsplit* splits are " @@ -3622,7 +3622,7 @@ msgid "" "described in detail below." msgstr "" -#: ../../library/stdtypes.rst:2972 +#: ../../library/stdtypes.rst:2971 msgid "" "Return a copy of the sequence with specified trailing bytes removed. The " "*chars* argument is a binary sequence specifying the set of byte values to " @@ -3632,14 +3632,14 @@ msgid "" "all combinations of its values are stripped::" msgstr "" -#: ../../library/stdtypes.rst:2984 +#: ../../library/stdtypes.rst:2983 msgid "" "The binary sequence of byte values to remove may be any :term:`bytes-like " "object`. See :meth:`~bytes.removesuffix` for a method that will remove a " "single suffix string rather than all of a set of characters. For example::" msgstr "" -#: ../../library/stdtypes.rst:3003 +#: ../../library/stdtypes.rst:3002 msgid "" "Split the binary sequence into subsequences of the same type, using *sep* as " "the delimiter string. If *maxsplit* is given and non-negative, at most " @@ -3648,7 +3648,7 @@ msgid "" "limit on the number of splits (all possible splits are made)." msgstr "" -#: ../../library/stdtypes.rst:3009 +#: ../../library/stdtypes.rst:3008 msgid "" "If *sep* is given, consecutive delimiters are not grouped together and are " "deemed to delimit empty subsequences (for example, ``b'1,,2'.split(b',')`` " @@ -3659,7 +3659,7 @@ msgid "" "object being split. The *sep* argument may be any :term:`bytes-like object`." msgstr "" -#: ../../library/stdtypes.rst:3027 +#: ../../library/stdtypes.rst:3026 msgid "" "If *sep* is not specified or is ``None``, a different splitting algorithm is " "applied: runs of consecutive ASCII whitespace are regarded as a single " @@ -3669,7 +3669,7 @@ msgid "" "without a specified separator returns ``[]``." msgstr "" -#: ../../library/stdtypes.rst:3048 +#: ../../library/stdtypes.rst:3047 msgid "" "Return a copy of the sequence with specified leading and trailing bytes " "removed. The *chars* argument is a binary sequence specifying the set of " @@ -3679,13 +3679,13 @@ msgid "" "a prefix or suffix; rather, all combinations of its values are stripped::" msgstr "" -#: ../../library/stdtypes.rst:3061 +#: ../../library/stdtypes.rst:3060 msgid "" "The binary sequence of byte values to remove may be any :term:`bytes-like " "object`." msgstr "" -#: ../../library/stdtypes.rst:3070 +#: ../../library/stdtypes.rst:3069 msgid "" "The following methods on bytes and bytearray objects assume the use of ASCII " "compatible binary formats and should not be applied to arbitrary binary " @@ -3693,14 +3693,14 @@ msgid "" "operate in place, and instead produce new objects." msgstr "" -#: ../../library/stdtypes.rst:3078 +#: ../../library/stdtypes.rst:3077 msgid "" "Return a copy of the sequence with each byte interpreted as an ASCII " "character, and the first byte capitalized and the rest lowercased. Non-ASCII " "byte values are passed through unchanged." msgstr "" -#: ../../library/stdtypes.rst:3091 +#: ../../library/stdtypes.rst:3090 msgid "" "Return a copy of the sequence where all ASCII tab characters are replaced by " "one or more ASCII spaces, depending on the current column and the given tab " @@ -3716,7 +3716,7 @@ msgid "" "by one regardless of how the byte value is represented when printed::" msgstr "" -#: ../../library/stdtypes.rst:3119 +#: ../../library/stdtypes.rst:3118 msgid "" "Return ``True`` if all bytes in the sequence are alphabetical ASCII " "characters or ASCII decimal digits and the sequence is not empty, ``False`` " @@ -3725,7 +3725,7 @@ msgid "" "digits are those byte values in the sequence ``b'0123456789'``." msgstr "" -#: ../../library/stdtypes.rst:3136 +#: ../../library/stdtypes.rst:3135 msgid "" "Return ``True`` if all bytes in the sequence are alphabetic ASCII characters " "and the sequence is not empty, ``False`` otherwise. Alphabetic ASCII " @@ -3733,35 +3733,35 @@ msgid "" "``b'abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ'``." msgstr "" -#: ../../library/stdtypes.rst:3152 +#: ../../library/stdtypes.rst:3151 msgid "" "Return ``True`` if the sequence is empty or all bytes in the sequence are " "ASCII, ``False`` otherwise. ASCII bytes are in the range 0-0x7F." msgstr "" -#: ../../library/stdtypes.rst:3162 +#: ../../library/stdtypes.rst:3161 msgid "" "Return ``True`` if all bytes in the sequence are ASCII decimal digits and " "the sequence is not empty, ``False`` otherwise. ASCII decimal digits are " "those byte values in the sequence ``b'0123456789'``." msgstr "" -#: ../../library/stdtypes.rst:3177 +#: ../../library/stdtypes.rst:3176 msgid "" "Return ``True`` if there is at least one lowercase ASCII character in the " "sequence and no uppercase ASCII characters, ``False`` otherwise." msgstr "" -#: ../../library/stdtypes.rst:3187 ../../library/stdtypes.rst:3229 -#: ../../library/stdtypes.rst:3245 ../../library/stdtypes.rst:3295 -#: ../../library/stdtypes.rst:3364 +#: ../../library/stdtypes.rst:3186 ../../library/stdtypes.rst:3228 +#: ../../library/stdtypes.rst:3244 ../../library/stdtypes.rst:3294 +#: ../../library/stdtypes.rst:3363 msgid "" "Lowercase ASCII characters are those byte values in the sequence " "``b'abcdefghijklmnopqrstuvwxyz'``. Uppercase ASCII characters are those byte " "values in the sequence ``b'ABCDEFGHIJKLMNOPQRSTUVWXYZ'``." msgstr "" -#: ../../library/stdtypes.rst:3195 +#: ../../library/stdtypes.rst:3194 msgid "" "Return ``True`` if all bytes in the sequence are ASCII whitespace and the " "sequence is not empty, ``False`` otherwise. ASCII whitespace characters are " @@ -3769,27 +3769,27 @@ msgid "" "newline, carriage return, vertical tab, form feed)." msgstr "" -#: ../../library/stdtypes.rst:3204 +#: ../../library/stdtypes.rst:3203 msgid "" "Return ``True`` if the sequence is ASCII titlecase and the sequence is not " "empty, ``False`` otherwise. See :meth:`bytes.title` for more details on the " "definition of \"titlecase\"." msgstr "" -#: ../../library/stdtypes.rst:3219 +#: ../../library/stdtypes.rst:3218 msgid "" "Return ``True`` if there is at least one uppercase alphabetic ASCII " "character in the sequence and no lowercase ASCII characters, ``False`` " "otherwise." msgstr "" -#: ../../library/stdtypes.rst:3237 +#: ../../library/stdtypes.rst:3236 msgid "" "Return a copy of the sequence with all the uppercase ASCII characters " "converted to their corresponding lowercase counterpart." msgstr "" -#: ../../library/stdtypes.rst:3262 +#: ../../library/stdtypes.rst:3261 msgid "" "Return a list of the lines in the binary sequence, breaking at ASCII line " "boundaries. This method uses the :term:`universal newlines` approach to " @@ -3797,20 +3797,20 @@ msgid "" "*keepends* is given and true." msgstr "" -#: ../../library/stdtypes.rst:3274 +#: ../../library/stdtypes.rst:3273 msgid "" "Unlike :meth:`~bytes.split` when a delimiter string *sep* is given, this " "method returns an empty list for the empty string, and a terminal line break " "does not result in an extra line::" msgstr "" -#: ../../library/stdtypes.rst:3287 +#: ../../library/stdtypes.rst:3286 msgid "" "Return a copy of the sequence with all the lowercase ASCII characters " "converted to their corresponding uppercase counterpart and vice-versa." msgstr "" -#: ../../library/stdtypes.rst:3299 +#: ../../library/stdtypes.rst:3298 msgid "" "Unlike :func:`str.swapcase()`, it is always the case that ``bin.swapcase()." "swapcase() == bin`` for the binary versions. Case conversions are " @@ -3818,14 +3818,14 @@ msgid "" "Unicode code points." msgstr "" -#: ../../library/stdtypes.rst:3313 +#: ../../library/stdtypes.rst:3312 msgid "" "Return a titlecased version of the binary sequence where words start with an " "uppercase ASCII character and the remaining characters are lowercase. " "Uncased byte values are left unmodified." msgstr "" -#: ../../library/stdtypes.rst:3322 +#: ../../library/stdtypes.rst:3321 msgid "" "Lowercase ASCII characters are those byte values in the sequence " "``b'abcdefghijklmnopqrstuvwxyz'``. Uppercase ASCII characters are those byte " @@ -3833,13 +3833,13 @@ msgid "" "values are uncased." msgstr "" -#: ../../library/stdtypes.rst:3356 +#: ../../library/stdtypes.rst:3355 msgid "" "Return a copy of the sequence with all the lowercase ASCII characters " "converted to their corresponding uppercase counterpart." msgstr "" -#: ../../library/stdtypes.rst:3377 +#: ../../library/stdtypes.rst:3376 msgid "" "Return a copy of the sequence left filled with ASCII ``b'0'`` digits to make " "a sequence of length *width*. A leading sign prefix (``b'+'``/ ``b'-'``) is " @@ -3848,11 +3848,11 @@ msgid "" "*width* is less than or equal to ``len(seq)``." msgstr "" -#: ../../library/stdtypes.rst:3399 +#: ../../library/stdtypes.rst:3398 msgid "``printf``-style Bytes Formatting" msgstr "" -#: ../../library/stdtypes.rst:3416 +#: ../../library/stdtypes.rst:3415 msgid "" "The formatting operations described here exhibit a variety of quirks that " "lead to a number of common errors (such as failing to display tuples and " @@ -3860,7 +3860,7 @@ msgid "" "dictionary, wrap it in a tuple." msgstr "" -#: ../../library/stdtypes.rst:3421 +#: ../../library/stdtypes.rst:3420 msgid "" "Bytes objects (``bytes``/``bytearray``) have one unique built-in operation: " "the ``%`` operator (modulo). This is also known as the bytes *formatting* or " @@ -3870,7 +3870,7 @@ msgid "" "func:`sprintf` in the C language." msgstr "" -#: ../../library/stdtypes.rst:3428 +#: ../../library/stdtypes.rst:3427 msgid "" "If *format* requires a single argument, *values* may be a single non-tuple " "object. [5]_ Otherwise, *values* must be a tuple with exactly the number of " @@ -3878,7 +3878,7 @@ msgid "" "example, a dictionary)." msgstr "" -#: ../../library/stdtypes.rst:3462 +#: ../../library/stdtypes.rst:3461 msgid "" "When the right argument is a dictionary (or other mapping type), then the " "formats in the bytes object *must* include a parenthesised mapping key into " @@ -3886,78 +3886,78 @@ msgid "" "mapping key selects the value to be formatted from the mapping. For example:" msgstr "" -#: ../../library/stdtypes.rst:3536 +#: ../../library/stdtypes.rst:3535 msgid "Single byte (accepts integer or single byte objects)." msgstr "" -#: ../../library/stdtypes.rst:3539 +#: ../../library/stdtypes.rst:3538 msgid "``'b'``" msgstr "``'b'``" -#: ../../library/stdtypes.rst:3539 +#: ../../library/stdtypes.rst:3538 msgid "" "Bytes (any object that follows the :ref:`buffer protocol ` or " "has :meth:`__bytes__`)." msgstr "" -#: ../../library/stdtypes.rst:3543 +#: ../../library/stdtypes.rst:3542 msgid "" "``'s'`` is an alias for ``'b'`` and should only be used for Python2/3 code " "bases." msgstr "" -#: ../../library/stdtypes.rst:3546 +#: ../../library/stdtypes.rst:3545 msgid "" "Bytes (converts any Python object using ``repr(obj)." "encode('ascii','backslashreplace)``)." msgstr "" -#: ../../library/stdtypes.rst:3549 +#: ../../library/stdtypes.rst:3548 msgid "" "``'r'`` is an alias for ``'a'`` and should only be used for Python2/3 code " "bases." msgstr "" -#: ../../library/stdtypes.rst:3549 +#: ../../library/stdtypes.rst:3548 msgid "\\(7)" msgstr "" -#: ../../library/stdtypes.rst:3584 +#: ../../library/stdtypes.rst:3583 msgid "``b'%s'`` is deprecated, but will not be removed during the 3.x series." msgstr "" -#: ../../library/stdtypes.rst:3587 +#: ../../library/stdtypes.rst:3586 msgid "``b'%r'`` is deprecated, but will not be removed during the 3.x series." msgstr "" -#: ../../library/stdtypes.rst:3599 +#: ../../library/stdtypes.rst:3598 msgid ":pep:`461` - Adding % formatting to bytes and bytearray" msgstr "" -#: ../../library/stdtypes.rst:3606 +#: ../../library/stdtypes.rst:3605 msgid "Memory Views" msgstr "" -#: ../../library/stdtypes.rst:3608 +#: ../../library/stdtypes.rst:3607 msgid "" ":class:`memoryview` objects allow Python code to access the internal data of " "an object that supports the :ref:`buffer protocol ` without " "copying." msgstr "" -#: ../../library/stdtypes.rst:3614 +#: ../../library/stdtypes.rst:3613 msgid "" -"Create a :class:`memoryview` that references *object*. *object* must " -"support the buffer protocol. Built-in objects that support the buffer " -"protocol include :class:`bytes` and :class:`bytearray`." +"Create a :class:`memoryview` that references *obj*. *obj* must support the " +"buffer protocol. Built-in objects that support the buffer protocol include :" +"class:`bytes` and :class:`bytearray`." msgstr "" -#: ../../library/stdtypes.rst:3618 +#: ../../library/stdtypes.rst:3617 msgid "" "A :class:`memoryview` has the notion of an *element*, which is the atomic " -"memory unit handled by the originating *object*. For many simple types such " -"as :class:`bytes` and :class:`bytearray`, an element is a single byte, but " -"other types such as :class:`array.array` may have bigger elements." +"memory unit handled by the originating object *obj*. For many simple types " +"such as :class:`bytes` and :class:`bytearray`, an element is a single byte, " +"but other types such as :class:`array.array` may have bigger elements." msgstr "" #: ../../library/stdtypes.rst:3623 @@ -4299,91 +4299,71 @@ msgid "" msgstr "" #: ../../library/stdtypes.rst:4121 -msgid "Sets can be created by several means:" -msgstr "" - -#: ../../library/stdtypes.rst:4123 -msgid "" -"Use a comma-separated list of elements within braces: ``{'jack', 'sjoerd'}``" -msgstr "" - -#: ../../library/stdtypes.rst:4124 -msgid "" -"Use a set comprehension: ``{c for c in 'abracadabra' if c not in 'abc'}``" -msgstr "" - -#: ../../library/stdtypes.rst:4125 -msgid "" -"Use the type constructor: ``set()``, ``set('foobar')``, ``set(['a', 'b', " -"'foo'])``" -msgstr "" - -#: ../../library/stdtypes.rst:4127 msgid "" "Instances of :class:`set` and :class:`frozenset` provide the following " "operations:" msgstr "" -#: ../../library/stdtypes.rst:4132 +#: ../../library/stdtypes.rst:4126 msgid "Return the number of elements in set *s* (cardinality of *s*)." msgstr "" -#: ../../library/stdtypes.rst:4136 +#: ../../library/stdtypes.rst:4130 msgid "Test *x* for membership in *s*." msgstr "" -#: ../../library/stdtypes.rst:4140 +#: ../../library/stdtypes.rst:4134 msgid "Test *x* for non-membership in *s*." msgstr "" -#: ../../library/stdtypes.rst:4144 +#: ../../library/stdtypes.rst:4138 msgid "" "Return ``True`` if the set has no elements in common with *other*. Sets are " "disjoint if and only if their intersection is the empty set." msgstr "" -#: ../../library/stdtypes.rst:4150 +#: ../../library/stdtypes.rst:4144 msgid "Test whether every element in the set is in *other*." msgstr "" -#: ../../library/stdtypes.rst:4154 +#: ../../library/stdtypes.rst:4148 msgid "" "Test whether the set is a proper subset of *other*, that is, ``set <= other " "and set != other``." msgstr "" -#: ../../library/stdtypes.rst:4160 +#: ../../library/stdtypes.rst:4154 msgid "Test whether every element in *other* is in the set." msgstr "" -#: ../../library/stdtypes.rst:4164 +#: ../../library/stdtypes.rst:4158 msgid "" "Test whether the set is a proper superset of *other*, that is, ``set >= " "other and set != other``." msgstr "" -#: ../../library/stdtypes.rst:4170 +#: ../../library/stdtypes.rst:4164 msgid "Return a new set with elements from the set and all others." msgstr "" -#: ../../library/stdtypes.rst:4175 +#: ../../library/stdtypes.rst:4169 msgid "Return a new set with elements common to the set and all others." msgstr "" -#: ../../library/stdtypes.rst:4180 +#: ../../library/stdtypes.rst:4174 msgid "Return a new set with elements in the set that are not in the others." msgstr "" -#: ../../library/stdtypes.rst:4185 +#: ../../library/stdtypes.rst:4179 msgid "" "Return a new set with elements in either the set or *other* but not both." msgstr "" -#: ../../library/stdtypes.rst:4189 +#: ../../library/stdtypes.rst:4183 msgid "Return a shallow copy of the set." msgstr "" -#: ../../library/stdtypes.rst:4192 +#: ../../library/stdtypes.rst:4186 msgid "" "Note, the non-operator versions of :meth:`union`, :meth:`intersection`, :" "meth:`difference`, and :meth:`symmetric_difference`, :meth:`issubset`, and :" @@ -4393,7 +4373,7 @@ msgid "" "in favor of the more readable ``set('abc').intersection('cbs')``." msgstr "" -#: ../../library/stdtypes.rst:4199 +#: ../../library/stdtypes.rst:4193 msgid "" "Both :class:`set` and :class:`frozenset` support set to set comparisons. Two " "sets are equal if and only if every element of each set is contained in the " @@ -4403,14 +4383,14 @@ msgid "" "set is a proper superset of the second set (is a superset, but is not equal)." msgstr "" -#: ../../library/stdtypes.rst:4206 +#: ../../library/stdtypes.rst:4200 msgid "" "Instances of :class:`set` are compared to instances of :class:`frozenset` " "based on their members. For example, ``set('abc') == frozenset('abc')`` " "returns ``True`` and so does ``set('abc') in set([frozenset('abc')])``." msgstr "" -#: ../../library/stdtypes.rst:4210 +#: ../../library/stdtypes.rst:4204 msgid "" "The subset and equality comparisons do not generalize to a total ordering " "function. For example, any two nonempty disjoint sets are not equal and are " @@ -4418,71 +4398,71 @@ msgid "" "``ab``." msgstr "" -#: ../../library/stdtypes.rst:4215 +#: ../../library/stdtypes.rst:4209 msgid "" "Since sets only define partial ordering (subset relationships), the output " "of the :meth:`list.sort` method is undefined for lists of sets." msgstr "" -#: ../../library/stdtypes.rst:4218 +#: ../../library/stdtypes.rst:4212 msgid "Set elements, like dictionary keys, must be :term:`hashable`." msgstr "" -#: ../../library/stdtypes.rst:4220 +#: ../../library/stdtypes.rst:4214 msgid "" "Binary operations that mix :class:`set` instances with :class:`frozenset` " "return the type of the first operand. For example: ``frozenset('ab') | " "set('bc')`` returns an instance of :class:`frozenset`." msgstr "" -#: ../../library/stdtypes.rst:4224 +#: ../../library/stdtypes.rst:4218 msgid "" "The following table lists operations available for :class:`set` that do not " "apply to immutable instances of :class:`frozenset`:" msgstr "" -#: ../../library/stdtypes.rst:4230 +#: ../../library/stdtypes.rst:4224 msgid "Update the set, adding elements from all others." msgstr "" -#: ../../library/stdtypes.rst:4235 +#: ../../library/stdtypes.rst:4229 msgid "Update the set, keeping only elements found in it and all others." msgstr "" -#: ../../library/stdtypes.rst:4240 +#: ../../library/stdtypes.rst:4234 msgid "Update the set, removing elements found in others." msgstr "" -#: ../../library/stdtypes.rst:4245 +#: ../../library/stdtypes.rst:4239 msgid "" "Update the set, keeping only elements found in either set, but not in both." msgstr "" -#: ../../library/stdtypes.rst:4249 +#: ../../library/stdtypes.rst:4243 msgid "Add element *elem* to the set." msgstr "" -#: ../../library/stdtypes.rst:4253 +#: ../../library/stdtypes.rst:4247 msgid "" "Remove element *elem* from the set. Raises :exc:`KeyError` if *elem* is not " "contained in the set." msgstr "" -#: ../../library/stdtypes.rst:4258 +#: ../../library/stdtypes.rst:4252 msgid "Remove element *elem* from the set if it is present." msgstr "" -#: ../../library/stdtypes.rst:4262 +#: ../../library/stdtypes.rst:4256 msgid "" "Remove and return an arbitrary element from the set. Raises :exc:`KeyError` " "if the set is empty." msgstr "" -#: ../../library/stdtypes.rst:4267 +#: ../../library/stdtypes.rst:4261 msgid "Remove all elements from the set." msgstr "" -#: ../../library/stdtypes.rst:4270 +#: ../../library/stdtypes.rst:4264 msgid "" "Note, the non-operator versions of the :meth:`update`, :meth:" "`intersection_update`, :meth:`difference_update`, and :meth:" @@ -4490,18 +4470,18 @@ msgid "" "argument." msgstr "" -#: ../../library/stdtypes.rst:4275 +#: ../../library/stdtypes.rst:4269 msgid "" "Note, the *elem* argument to the :meth:`__contains__`, :meth:`remove`, and :" "meth:`discard` methods may be a set. To support searching for an equivalent " "frozenset, a temporary one is created from *elem*." msgstr "" -#: ../../library/stdtypes.rst:4283 +#: ../../library/stdtypes.rst:4277 msgid "Mapping Types --- :class:`dict`" msgstr "" -#: ../../library/stdtypes.rst:4293 +#: ../../library/stdtypes.rst:4287 msgid "" "A :term:`mapping` object maps :term:`hashable` values to arbitrary objects. " "Mappings are mutable objects. There is currently only one standard mapping " @@ -4510,7 +4490,7 @@ msgid "" "module.)" msgstr "" -#: ../../library/stdtypes.rst:4299 +#: ../../library/stdtypes.rst:4293 msgid "" "A dictionary's keys are *almost* arbitrary values. Values that are not :" "term:`hashable`, that is, values containing lists, dictionaries or other " @@ -4522,40 +4502,20 @@ msgid "" "approximations it is usually unwise to use them as dictionary keys.)" msgstr "" -#: ../../library/stdtypes.rst:4308 +#: ../../library/stdtypes.rst:4302 msgid "" "Dictionaries can be created by placing a comma-separated list of ``key: " "value`` pairs within braces, for example: ``{'jack': 4098, 'sjoerd': 4127}`` " "or ``{4098: 'jack', 4127: 'sjoerd'}``, or by the :class:`dict` constructor." msgstr "" -#: ../../library/stdtypes.rst:4316 +#: ../../library/stdtypes.rst:4310 msgid "" "Return a new dictionary initialized from an optional positional argument and " "a possibly empty set of keyword arguments." msgstr "" -#: ../../library/stdtypes.rst:4319 -msgid "Dictionaries can be created by several means:" -msgstr "" - -#: ../../library/stdtypes.rst:4321 -msgid "" -"Use a comma-separated list of ``key: value`` pairs within braces: ``{'jack': " -"4098, 'sjoerd': 4127}`` or ``{4098: 'jack', 4127: 'sjoerd'}``" -msgstr "" - -#: ../../library/stdtypes.rst:4323 -msgid "Use a dict comprehension: ``{}``, ``{x: x ** 2 for x in range(10)}``" -msgstr "" - -#: ../../library/stdtypes.rst:4324 -msgid "" -"Use the type constructor: ``dict()``, ``dict([('foo', 100), ('bar', " -"200)])``, ``dict(foo=100, bar=200)``" -msgstr "" - -#: ../../library/stdtypes.rst:4327 +#: ../../library/stdtypes.rst:4313 msgid "" "If no positional argument is given, an empty dictionary is created. If a " "positional argument is given and it is a mapping object, a dictionary is " @@ -4567,7 +4527,7 @@ msgid "" "value for that key becomes the corresponding value in the new dictionary." msgstr "" -#: ../../library/stdtypes.rst:4337 +#: ../../library/stdtypes.rst:4323 msgid "" "If keyword arguments are given, the keyword arguments and their values are " "added to the dictionary created from the positional argument. If a key " @@ -4575,39 +4535,39 @@ msgid "" "the value from the positional argument." msgstr "" -#: ../../library/stdtypes.rst:4342 +#: ../../library/stdtypes.rst:4328 msgid "" "To illustrate, the following examples all return a dictionary equal to " "``{\"one\": 1, \"two\": 2, \"three\": 3}``::" msgstr "" -#: ../../library/stdtypes.rst:4354 +#: ../../library/stdtypes.rst:4340 msgid "" "Providing keyword arguments as in the first example only works for keys that " "are valid Python identifiers. Otherwise, any valid keys can be used." msgstr "" -#: ../../library/stdtypes.rst:4358 +#: ../../library/stdtypes.rst:4344 msgid "" "These are the operations that dictionaries support (and therefore, custom " "mapping types should support too):" msgstr "" -#: ../../library/stdtypes.rst:4363 +#: ../../library/stdtypes.rst:4349 msgid "Return a list of all the keys used in the dictionary *d*." msgstr "" -#: ../../library/stdtypes.rst:4367 +#: ../../library/stdtypes.rst:4353 msgid "Return the number of items in the dictionary *d*." msgstr "" -#: ../../library/stdtypes.rst:4371 +#: ../../library/stdtypes.rst:4357 msgid "" "Return the item of *d* with key *key*. Raises a :exc:`KeyError` if *key* is " "not in the map." msgstr "" -#: ../../library/stdtypes.rst:4376 +#: ../../library/stdtypes.rst:4362 msgid "" "If a subclass of dict defines a method :meth:`__missing__` and *key* is not " "present, the ``d[key]`` operation calls that method with the key *key* as " @@ -4618,51 +4578,51 @@ msgid "" "an instance variable::" msgstr "" -#: ../../library/stdtypes.rst:4394 +#: ../../library/stdtypes.rst:4380 msgid "" "The example above shows part of the implementation of :class:`collections." "Counter`. A different ``__missing__`` method is used by :class:`collections." "defaultdict`." msgstr "" -#: ../../library/stdtypes.rst:4400 +#: ../../library/stdtypes.rst:4386 msgid "Set ``d[key]`` to *value*." msgstr "" -#: ../../library/stdtypes.rst:4404 +#: ../../library/stdtypes.rst:4390 msgid "" "Remove ``d[key]`` from *d*. Raises a :exc:`KeyError` if *key* is not in the " "map." msgstr "" -#: ../../library/stdtypes.rst:4409 +#: ../../library/stdtypes.rst:4395 msgid "Return ``True`` if *d* has a key *key*, else ``False``." msgstr "" -#: ../../library/stdtypes.rst:4413 +#: ../../library/stdtypes.rst:4399 msgid "Equivalent to ``not key in d``." msgstr "" -#: ../../library/stdtypes.rst:4417 +#: ../../library/stdtypes.rst:4403 msgid "" "Return an iterator over the keys of the dictionary. This is a shortcut for " "``iter(d.keys())``." msgstr "" -#: ../../library/stdtypes.rst:4422 +#: ../../library/stdtypes.rst:4408 msgid "Remove all items from the dictionary." msgstr "" -#: ../../library/stdtypes.rst:4426 +#: ../../library/stdtypes.rst:4412 msgid "Return a shallow copy of the dictionary." msgstr "" -#: ../../library/stdtypes.rst:4430 +#: ../../library/stdtypes.rst:4416 msgid "" "Create a new dictionary with keys from *iterable* and values set to *value*." msgstr "" -#: ../../library/stdtypes.rst:4432 +#: ../../library/stdtypes.rst:4418 msgid "" ":meth:`fromkeys` is a class method that returns a new dictionary. *value* " "defaults to ``None``. All of the values refer to just a single instance, so " @@ -4671,70 +4631,70 @@ msgid "" "` instead." msgstr "" -#: ../../library/stdtypes.rst:4440 +#: ../../library/stdtypes.rst:4426 msgid "" "Return the value for *key* if *key* is in the dictionary, else *default*. If " "*default* is not given, it defaults to ``None``, so that this method never " "raises a :exc:`KeyError`." msgstr "" -#: ../../library/stdtypes.rst:4446 +#: ../../library/stdtypes.rst:4432 msgid "" "Return a new view of the dictionary's items (``(key, value)`` pairs). See " "the :ref:`documentation of view objects `." msgstr "" -#: ../../library/stdtypes.rst:4451 +#: ../../library/stdtypes.rst:4437 msgid "" "Return a new view of the dictionary's keys. See the :ref:`documentation of " "view objects `." msgstr "" -#: ../../library/stdtypes.rst:4456 +#: ../../library/stdtypes.rst:4442 msgid "" "If *key* is in the dictionary, remove it and return its value, else return " "*default*. If *default* is not given and *key* is not in the dictionary, a :" "exc:`KeyError` is raised." msgstr "" -#: ../../library/stdtypes.rst:4462 +#: ../../library/stdtypes.rst:4448 msgid "" "Remove and return a ``(key, value)`` pair from the dictionary. Pairs are " "returned in :abbr:`LIFO (last-in, first-out)` order." msgstr "" -#: ../../library/stdtypes.rst:4465 +#: ../../library/stdtypes.rst:4451 msgid "" ":meth:`popitem` is useful to destructively iterate over a dictionary, as " "often used in set algorithms. If the dictionary is empty, calling :meth:" "`popitem` raises a :exc:`KeyError`." msgstr "" -#: ../../library/stdtypes.rst:4469 +#: ../../library/stdtypes.rst:4455 msgid "" "LIFO order is now guaranteed. In prior versions, :meth:`popitem` would " "return an arbitrary key/value pair." msgstr "" -#: ../../library/stdtypes.rst:4475 +#: ../../library/stdtypes.rst:4461 msgid "" "Return a reverse iterator over the keys of the dictionary. This is a " "shortcut for ``reversed(d.keys())``." msgstr "" -#: ../../library/stdtypes.rst:4482 +#: ../../library/stdtypes.rst:4468 msgid "" "If *key* is in the dictionary, return its value. If not, insert *key* with " "a value of *default* and return *default*. *default* defaults to ``None``." msgstr "" -#: ../../library/stdtypes.rst:4488 +#: ../../library/stdtypes.rst:4474 msgid "" "Update the dictionary with the key/value pairs from *other*, overwriting " "existing keys. Return ``None``." msgstr "" -#: ../../library/stdtypes.rst:4491 +#: ../../library/stdtypes.rst:4477 msgid "" ":meth:`update` accepts either another dictionary object or an iterable of " "key/value pairs (as tuples or other iterables of length two). If keyword " @@ -4742,71 +4702,71 @@ msgid "" "pairs: ``d.update(red=1, blue=2)``." msgstr "" -#: ../../library/stdtypes.rst:4498 +#: ../../library/stdtypes.rst:4484 msgid "" "Return a new view of the dictionary's values. See the :ref:`documentation " "of view objects `." msgstr "" -#: ../../library/stdtypes.rst:4501 +#: ../../library/stdtypes.rst:4487 msgid "" "An equality comparison between one ``dict.values()`` view and another will " "always return ``False``. This also applies when comparing ``dict.values()`` " "to itself::" msgstr "" -#: ../../library/stdtypes.rst:4511 +#: ../../library/stdtypes.rst:4497 msgid "" "Create a new dictionary with the merged keys and values of *d* and *other*, " "which must both be dictionaries. The values of *other* take priority when " "*d* and *other* share keys." msgstr "" -#: ../../library/stdtypes.rst:4519 +#: ../../library/stdtypes.rst:4505 msgid "" "Update the dictionary *d* with keys and values from *other*, which may be " "either a :term:`mapping` or an :term:`iterable` of key/value pairs. The " "values of *other* take priority when *d* and *other* share keys." msgstr "" -#: ../../library/stdtypes.rst:4525 +#: ../../library/stdtypes.rst:4511 msgid "" "Dictionaries compare equal if and only if they have the same ``(key, " "value)`` pairs (regardless of ordering). Order comparisons ('<', '<=', '>=', " "'>') raise :exc:`TypeError`." msgstr "" -#: ../../library/stdtypes.rst:4529 +#: ../../library/stdtypes.rst:4515 msgid "" "Dictionaries preserve insertion order. Note that updating a key does not " "affect the order. Keys added after deletion are inserted at the end. ::" msgstr "" -#: ../../library/stdtypes.rst:4547 +#: ../../library/stdtypes.rst:4533 msgid "" "Dictionary order is guaranteed to be insertion order. This behavior was an " "implementation detail of CPython from 3.6." msgstr "" -#: ../../library/stdtypes.rst:4551 +#: ../../library/stdtypes.rst:4537 msgid "Dictionaries and dictionary views are reversible. ::" msgstr "" -#: ../../library/stdtypes.rst:4563 +#: ../../library/stdtypes.rst:4549 msgid "Dictionaries are now reversible." msgstr "" -#: ../../library/stdtypes.rst:4568 +#: ../../library/stdtypes.rst:4554 msgid "" ":class:`types.MappingProxyType` can be used to create a read-only view of a :" "class:`dict`." msgstr "" -#: ../../library/stdtypes.rst:4575 +#: ../../library/stdtypes.rst:4561 msgid "Dictionary view objects" msgstr "" -#: ../../library/stdtypes.rst:4577 +#: ../../library/stdtypes.rst:4563 msgid "" "The objects returned by :meth:`dict.keys`, :meth:`dict.values` and :meth:" "`dict.items` are *view objects*. They provide a dynamic view on the " @@ -4814,23 +4774,23 @@ msgid "" "reflects these changes." msgstr "" -#: ../../library/stdtypes.rst:4582 +#: ../../library/stdtypes.rst:4568 msgid "" "Dictionary views can be iterated over to yield their respective data, and " "support membership tests:" msgstr "" -#: ../../library/stdtypes.rst:4587 +#: ../../library/stdtypes.rst:4573 msgid "Return the number of entries in the dictionary." msgstr "" -#: ../../library/stdtypes.rst:4591 +#: ../../library/stdtypes.rst:4577 msgid "" "Return an iterator over the keys, values or items (represented as tuples of " "``(key, value)``) in the dictionary." msgstr "" -#: ../../library/stdtypes.rst:4594 +#: ../../library/stdtypes.rst:4580 msgid "" "Keys and values are iterated over in insertion order. This allows the " "creation of ``(value, key)`` pairs using :func:`zip`: ``pairs = zip(d." @@ -4838,33 +4798,33 @@ msgid "" "[(v, k) for (k, v) in d.items()]``." msgstr "" -#: ../../library/stdtypes.rst:4599 +#: ../../library/stdtypes.rst:4585 msgid "" "Iterating views while adding or deleting entries in the dictionary may raise " "a :exc:`RuntimeError` or fail to iterate over all entries." msgstr "" -#: ../../library/stdtypes.rst:4602 +#: ../../library/stdtypes.rst:4588 msgid "Dictionary order is guaranteed to be insertion order." msgstr "" -#: ../../library/stdtypes.rst:4607 +#: ../../library/stdtypes.rst:4593 msgid "" "Return ``True`` if *x* is in the underlying dictionary's keys, values or " "items (in the latter case, *x* should be a ``(key, value)`` tuple)." msgstr "" -#: ../../library/stdtypes.rst:4612 +#: ../../library/stdtypes.rst:4598 msgid "" "Return a reverse iterator over the keys, values or items of the dictionary. " "The view will be iterated in reverse order of the insertion." msgstr "" -#: ../../library/stdtypes.rst:4615 +#: ../../library/stdtypes.rst:4601 msgid "Dictionary views are now reversible." msgstr "" -#: ../../library/stdtypes.rst:4619 +#: ../../library/stdtypes.rst:4605 msgid "" "Keys views are set-like since their entries are unique and hashable. If all " "values are hashable, so that ``(key, value)`` pairs are unique and hashable, " @@ -4874,15 +4834,15 @@ msgid "" "abc.Set` are available (for example, ``==``, ``<``, or ``^``)." msgstr "" -#: ../../library/stdtypes.rst:4626 +#: ../../library/stdtypes.rst:4612 msgid "An example of dictionary view usage::" msgstr "" -#: ../../library/stdtypes.rst:4661 +#: ../../library/stdtypes.rst:4647 msgid "Context Manager Types" msgstr "" -#: ../../library/stdtypes.rst:4668 +#: ../../library/stdtypes.rst:4654 msgid "" "Python's :keyword:`with` statement supports the concept of a runtime context " "defined by a context manager. This is implemented using a pair of methods " @@ -4890,7 +4850,7 @@ msgid "" "before the statement body is executed and exited when the statement ends:" msgstr "" -#: ../../library/stdtypes.rst:4676 +#: ../../library/stdtypes.rst:4662 msgid "" "Enter the runtime context and return either this object or another object " "related to the runtime context. The value returned by this method is bound " @@ -4898,14 +4858,14 @@ msgid "" "using this context manager." msgstr "" -#: ../../library/stdtypes.rst:4681 +#: ../../library/stdtypes.rst:4667 msgid "" "An example of a context manager that returns itself is a :term:`file " "object`. File objects return themselves from __enter__() to allow :func:" "`open` to be used as the context expression in a :keyword:`with` statement." msgstr "" -#: ../../library/stdtypes.rst:4685 +#: ../../library/stdtypes.rst:4671 msgid "" "An example of a context manager that returns a related object is the one " "returned by :func:`decimal.localcontext`. These managers set the active " @@ -4915,7 +4875,7 @@ msgid "" "the :keyword:`!with` statement." msgstr "" -#: ../../library/stdtypes.rst:4695 +#: ../../library/stdtypes.rst:4681 msgid "" "Exit the runtime context and return a Boolean flag indicating if any " "exception that occurred should be suppressed. If an exception occurred while " @@ -4924,7 +4884,7 @@ msgid "" "arguments are ``None``." msgstr "" -#: ../../library/stdtypes.rst:4700 +#: ../../library/stdtypes.rst:4686 msgid "" "Returning a true value from this method will cause the :keyword:`with` " "statement to suppress the exception and continue execution with the " @@ -4935,7 +4895,7 @@ msgid "" "statement." msgstr "" -#: ../../library/stdtypes.rst:4707 +#: ../../library/stdtypes.rst:4693 msgid "" "The exception passed in should never be reraised explicitly - instead, this " "method should return a false value to indicate that the method completed " @@ -4944,7 +4904,7 @@ msgid "" "method has actually failed." msgstr "" -#: ../../library/stdtypes.rst:4713 +#: ../../library/stdtypes.rst:4699 msgid "" "Python defines several context managers to support easy thread " "synchronisation, prompt closure of files or other objects, and simpler " @@ -4953,7 +4913,7 @@ msgid "" "management protocol. See the :mod:`contextlib` module for some examples." msgstr "" -#: ../../library/stdtypes.rst:4719 +#: ../../library/stdtypes.rst:4705 msgid "" "Python's :term:`generator`\\s and the :class:`contextlib.contextmanager` " "decorator provide a convenient way to implement these protocols. If a " @@ -4963,7 +4923,7 @@ msgid "" "by an undecorated generator function." msgstr "" -#: ../../library/stdtypes.rst:4726 +#: ../../library/stdtypes.rst:4712 msgid "" "Note that there is no specific slot for any of these methods in the type " "structure for Python objects in the Python/C API. Extension types wanting to " @@ -4972,314 +4932,21 @@ msgid "" "a single class dictionary lookup is negligible." msgstr "" -#: ../../library/stdtypes.rst:4736 -msgid "Generic Alias Type" -msgstr "" - -#: ../../library/stdtypes.rst:4742 -msgid "" -"``GenericAlias`` objects are created by subscripting a class (usually a " -"container), such as ``list[int]``. They are intended primarily for :term:" -"`type annotations `." -msgstr "" - -#: ../../library/stdtypes.rst:4746 -msgid "" -"Usually, the :ref:`subscription ` of container objects calls " -"the method :meth:`__getitem__` of the object. However, the subscription of " -"some containers' classes may call the classmethod :meth:`__class_getitem__` " -"of the class instead. The classmethod :meth:`__class_getitem__` should " -"return a ``GenericAlias`` object." -msgstr "" - -#: ../../library/stdtypes.rst:4753 -msgid "" -"If the :meth:`__getitem__` of the class' metaclass is present, it will take " -"precedence over the :meth:`__class_getitem__` defined in the class (see :pep:" -"`560` for more details)." -msgstr "" - -#: ../../library/stdtypes.rst:4757 -msgid "" -"The ``GenericAlias`` object acts as a proxy for :term:`generic types " -"`, implementing *parameterized generics* - a specific instance " -"of a generic which provides the types for container elements." -msgstr "" - -#: ../../library/stdtypes.rst:4761 -msgid "" -"The user-exposed type for the ``GenericAlias`` object can be accessed from :" -"class:`types.GenericAlias` and used for :func:`isinstance` checks. It can " -"also be used to create ``GenericAlias`` objects directly." -msgstr "" - -#: ../../library/stdtypes.rst:4767 -msgid "" -"Creates a ``GenericAlias`` representing a type ``T`` containing elements of " -"types *X*, *Y*, and more depending on the ``T`` used. For example, a " -"function expecting a :class:`list` containing :class:`float` elements::" -msgstr "" - -#: ../../library/stdtypes.rst:4775 -msgid "" -"Another example for :term:`mapping` objects, using a :class:`dict`, which is " -"a generic type expecting two type parameters representing the key type and " -"the value type. In this example, the function expects a ``dict`` with keys " -"of type :class:`str` and values of type :class:`int`::" -msgstr "" - -#: ../../library/stdtypes.rst:4783 -msgid "" -"The builtin functions :func:`isinstance` and :func:`issubclass` do not " -"accept ``GenericAlias`` types for their second argument::" -msgstr "" - -#: ../../library/stdtypes.rst:4791 -msgid "" -"The Python runtime does not enforce :term:`type annotations `. " -"This extends to generic types and their type parameters. When creating an " -"object from a ``GenericAlias``, container elements are not checked against " -"their type. For example, the following code is discouraged, but will run " -"without errors::" -msgstr "" - -#: ../../library/stdtypes.rst:4801 -msgid "" -"Furthermore, parameterized generics erase type parameters during object " -"creation::" -msgstr "" - -#: ../../library/stdtypes.rst:4812 -msgid "" -"Calling :func:`repr` or :func:`str` on a generic shows the parameterized " -"type::" -msgstr "" - -#: ../../library/stdtypes.rst:4820 -msgid "" -"The :meth:`__getitem__` method of generics will raise an exception to " -"disallow mistakes like ``dict[str][str]``::" -msgstr "" - -#: ../../library/stdtypes.rst:4828 -msgid "" -"However, such expressions are valid when :ref:`type variables ` " -"are used. The index must have as many elements as there are type variable " -"items in the ``GenericAlias`` object's :attr:`__args__ `. ::" -msgstr "" - -#: ../../library/stdtypes.rst:4839 -msgid "Standard Generic Collections" -msgstr "" - -#: ../../library/stdtypes.rst:4841 -msgid "These standard library collections support parameterized generics." -msgstr "" - -#: ../../library/stdtypes.rst:4843 -msgid ":class:`tuple`" -msgstr "" - -#: ../../library/stdtypes.rst:4844 -msgid ":class:`list`" -msgstr "" - -#: ../../library/stdtypes.rst:4845 -msgid ":class:`dict`" -msgstr "" - -#: ../../library/stdtypes.rst:4846 -msgid ":class:`set`" -msgstr "" - -#: ../../library/stdtypes.rst:4847 -msgid ":class:`frozenset`" -msgstr "" - -#: ../../library/stdtypes.rst:4848 -msgid ":class:`type`" -msgstr "" - -#: ../../library/stdtypes.rst:4849 -msgid ":class:`collections.deque`" -msgstr "" - -#: ../../library/stdtypes.rst:4850 -msgid ":class:`collections.defaultdict`" -msgstr "" - -#: ../../library/stdtypes.rst:4851 -msgid ":class:`collections.OrderedDict`" -msgstr "" - -#: ../../library/stdtypes.rst:4852 -msgid ":class:`collections.Counter`" -msgstr "" - -#: ../../library/stdtypes.rst:4853 -msgid ":class:`collections.ChainMap`" -msgstr "" - -#: ../../library/stdtypes.rst:4854 -msgid ":class:`collections.abc.Awaitable`" -msgstr "" - -#: ../../library/stdtypes.rst:4855 -msgid ":class:`collections.abc.Coroutine`" -msgstr "" - -#: ../../library/stdtypes.rst:4856 -msgid ":class:`collections.abc.AsyncIterable`" -msgstr "" - -#: ../../library/stdtypes.rst:4857 -msgid ":class:`collections.abc.AsyncIterator`" -msgstr "" - -#: ../../library/stdtypes.rst:4858 -msgid ":class:`collections.abc.AsyncGenerator`" -msgstr "" - -#: ../../library/stdtypes.rst:4859 -msgid ":class:`collections.abc.Iterable`" -msgstr "" - -#: ../../library/stdtypes.rst:4860 -msgid ":class:`collections.abc.Iterator`" -msgstr "" - -#: ../../library/stdtypes.rst:4861 -msgid ":class:`collections.abc.Generator`" -msgstr "" - -#: ../../library/stdtypes.rst:4862 -msgid ":class:`collections.abc.Reversible`" -msgstr "" - -#: ../../library/stdtypes.rst:4863 -msgid ":class:`collections.abc.Container`" -msgstr "" - -#: ../../library/stdtypes.rst:4864 -msgid ":class:`collections.abc.Collection`" -msgstr "" - -#: ../../library/stdtypes.rst:4865 -msgid ":class:`collections.abc.Callable`" -msgstr "" - -#: ../../library/stdtypes.rst:4866 -msgid ":class:`collections.abc.Set`" -msgstr "" - -#: ../../library/stdtypes.rst:4867 -msgid ":class:`collections.abc.MutableSet`" -msgstr "" - -#: ../../library/stdtypes.rst:4868 -msgid ":class:`collections.abc.Mapping`" -msgstr "" - -#: ../../library/stdtypes.rst:4869 -msgid ":class:`collections.abc.MutableMapping`" -msgstr "" - -#: ../../library/stdtypes.rst:4870 -msgid ":class:`collections.abc.Sequence`" -msgstr "" - -#: ../../library/stdtypes.rst:4871 -msgid ":class:`collections.abc.MutableSequence`" -msgstr "" - -#: ../../library/stdtypes.rst:4872 -msgid ":class:`collections.abc.ByteString`" -msgstr "" - -#: ../../library/stdtypes.rst:4873 -msgid ":class:`collections.abc.MappingView`" -msgstr "" - -#: ../../library/stdtypes.rst:4874 -msgid ":class:`collections.abc.KeysView`" -msgstr "" - -#: ../../library/stdtypes.rst:4875 -msgid ":class:`collections.abc.ItemsView`" -msgstr "" - -#: ../../library/stdtypes.rst:4876 -msgid ":class:`collections.abc.ValuesView`" -msgstr "" - -#: ../../library/stdtypes.rst:4877 -msgid ":class:`contextlib.AbstractContextManager`" -msgstr "" - -#: ../../library/stdtypes.rst:4878 -msgid ":class:`contextlib.AbstractAsyncContextManager`" -msgstr "" - -#: ../../library/stdtypes.rst:4879 -msgid ":ref:`re.Pattern `" -msgstr "" - -#: ../../library/stdtypes.rst:4880 -msgid ":ref:`re.Match `" -msgstr "" - -#: ../../library/stdtypes.rst:4884 -msgid "Special Attributes of Generic Alias" -msgstr "" - -#: ../../library/stdtypes.rst:4886 -msgid "All parameterized generics implement special read-only attributes." -msgstr "" - -#: ../../library/stdtypes.rst:4890 -msgid "This attribute points at the non-parameterized generic class::" -msgstr "" - -#: ../../library/stdtypes.rst:4898 -msgid "" -"This attribute is a :class:`tuple` (possibly of length 1) of generic types " -"passed to the original :meth:`__class_getitem__` of the generic container::" -msgstr "" - -#: ../../library/stdtypes.rst:4908 -msgid "" -"This attribute is a lazily computed tuple (possibly empty) of unique type " -"variables found in ``__args__``::" -msgstr "" - -#: ../../library/stdtypes.rst:4920 -msgid ":pep:`585` -- \"Type Hinting Generics In Standard Collections\"" -msgstr "" - -#: ../../library/stdtypes.rst:4921 -msgid ":meth:`__class_getitem__` -- Used to implement parameterized generics." -msgstr "" - -#: ../../library/stdtypes.rst:4922 -msgid ":ref:`generics` -- Generics in the :mod:`typing` module." -msgstr "" - -#: ../../library/stdtypes.rst:4930 +#: ../../library/stdtypes.rst:4722 msgid "Other Built-in Types" msgstr "" -#: ../../library/stdtypes.rst:4932 +#: ../../library/stdtypes.rst:4724 msgid "" "The interpreter supports several other kinds of objects. Most of these " "support only one or two operations." msgstr "" -#: ../../library/stdtypes.rst:4939 +#: ../../library/stdtypes.rst:4731 msgid "Modules" msgstr "" -#: ../../library/stdtypes.rst:4941 +#: ../../library/stdtypes.rst:4733 msgid "" "The only special operation on a module is attribute access: ``m.name``, " "where *m* is a module and *name* accesses a name defined in *m*'s symbol " @@ -5290,7 +4957,7 @@ msgid "" "*foo* somewhere.)" msgstr "" -#: ../../library/stdtypes.rst:4948 +#: ../../library/stdtypes.rst:4740 msgid "" "A special attribute of every module is :attr:`~object.__dict__`. This is the " "dictionary containing the module's symbol table. Modifying this dictionary " @@ -5301,32 +4968,32 @@ msgid "" "recommended." msgstr "" -#: ../../library/stdtypes.rst:4956 +#: ../../library/stdtypes.rst:4748 msgid "" "Modules built into the interpreter are written like this: ````. If loaded from a file, they are written as ````." msgstr "" -#: ../../library/stdtypes.rst:4964 +#: ../../library/stdtypes.rst:4756 msgid "Classes and Class Instances" msgstr "" -#: ../../library/stdtypes.rst:4966 +#: ../../library/stdtypes.rst:4758 msgid "See :ref:`objects` and :ref:`class` for these." msgstr "" -#: ../../library/stdtypes.rst:4972 +#: ../../library/stdtypes.rst:4764 msgid "Functions" msgstr "" -#: ../../library/stdtypes.rst:4974 +#: ../../library/stdtypes.rst:4766 msgid "" "Function objects are created by function definitions. The only operation on " "a function object is to call it: ``func(argument-list)``." msgstr "" -#: ../../library/stdtypes.rst:4977 +#: ../../library/stdtypes.rst:4769 msgid "" "There are really two flavors of function objects: built-in functions and " "user-defined functions. Both support the same operation (to call the " @@ -5334,15 +5001,15 @@ msgid "" "types." msgstr "" -#: ../../library/stdtypes.rst:4981 +#: ../../library/stdtypes.rst:4773 msgid "See :ref:`function` for more information." msgstr "" -#: ../../library/stdtypes.rst:4987 +#: ../../library/stdtypes.rst:4779 msgid "Methods" msgstr "" -#: ../../library/stdtypes.rst:4991 +#: ../../library/stdtypes.rst:4783 msgid "" "Methods are functions that are called using the attribute notation. There " "are two flavors: built-in methods (such as :meth:`append` on lists) and " @@ -5350,7 +5017,7 @@ msgid "" "support them." msgstr "" -#: ../../library/stdtypes.rst:4996 +#: ../../library/stdtypes.rst:4788 msgid "" "If you access a method (a function defined in a class namespace) through an " "instance, you get a special object: a :dfn:`bound method` (also called :dfn:" @@ -5362,7 +5029,7 @@ msgid "" "arg-2, ..., arg-n)``." msgstr "" -#: ../../library/stdtypes.rst:5005 +#: ../../library/stdtypes.rst:4797 msgid "" "Like function objects, bound method objects support getting arbitrary " "attributes. However, since method attributes are actually stored on the " @@ -5372,15 +5039,15 @@ msgid "" "attribute, you need to explicitly set it on the underlying function object::" msgstr "" -#: ../../library/stdtypes.rst:5025 ../../library/stdtypes.rst:5056 +#: ../../library/stdtypes.rst:4817 ../../library/stdtypes.rst:4845 msgid "See :ref:`types` for more information." msgstr "" -#: ../../library/stdtypes.rst:5033 +#: ../../library/stdtypes.rst:4825 msgid "Code Objects" msgstr "" -#: ../../library/stdtypes.rst:5039 +#: ../../library/stdtypes.rst:4831 msgid "" "Code objects are used by the implementation to represent \"pseudo-compiled\" " "executable Python code such as a function body. They differ from function " @@ -5390,23 +5057,17 @@ msgid "" "`__code__` attribute. See also the :mod:`code` module." msgstr "" -#: ../../library/stdtypes.rst:5046 -msgid "" -"Accessing ``__code__`` raises an :ref:`auditing event ` ``object." -"__getattr__`` with arguments ``obj`` and ``\"__code__\"``." -msgstr "" - -#: ../../library/stdtypes.rst:5053 +#: ../../library/stdtypes.rst:4842 msgid "" "A code object can be executed or evaluated by passing it (instead of a " "source string) to the :func:`exec` or :func:`eval` built-in functions." msgstr "" -#: ../../library/stdtypes.rst:5062 +#: ../../library/stdtypes.rst:4851 msgid "Type Objects" msgstr "" -#: ../../library/stdtypes.rst:5068 +#: ../../library/stdtypes.rst:4857 msgid "" "Type objects represent the various object types. An object's type is " "accessed by the built-in function :func:`type`. There are no special " @@ -5414,30 +5075,30 @@ msgid "" "standard built-in types." msgstr "" -#: ../../library/stdtypes.rst:5073 +#: ../../library/stdtypes.rst:4862 msgid "Types are written like this: ````." msgstr "" -#: ../../library/stdtypes.rst:5079 +#: ../../library/stdtypes.rst:4868 msgid "The Null Object" msgstr "" -#: ../../library/stdtypes.rst:5081 +#: ../../library/stdtypes.rst:4870 msgid "" "This object is returned by functions that don't explicitly return a value. " "It supports no special operations. There is exactly one null object, named " "``None`` (a built-in name). ``type(None)()`` produces the same singleton." msgstr "" -#: ../../library/stdtypes.rst:5085 +#: ../../library/stdtypes.rst:4874 msgid "It is written as ``None``." msgstr "" -#: ../../library/stdtypes.rst:5092 +#: ../../library/stdtypes.rst:4881 msgid "The Ellipsis Object" msgstr "" -#: ../../library/stdtypes.rst:5094 +#: ../../library/stdtypes.rst:4883 msgid "" "This object is commonly used by slicing (see :ref:`slicings`). It supports " "no special operations. There is exactly one ellipsis object, named :const:" @@ -5445,15 +5106,15 @@ msgid "" "`Ellipsis` singleton." msgstr "" -#: ../../library/stdtypes.rst:5099 +#: ../../library/stdtypes.rst:4888 msgid "It is written as ``Ellipsis`` or ``...``." msgstr "" -#: ../../library/stdtypes.rst:5105 +#: ../../library/stdtypes.rst:4894 msgid "The NotImplemented Object" msgstr "" -#: ../../library/stdtypes.rst:5107 +#: ../../library/stdtypes.rst:4896 msgid "" "This object is returned from comparisons and binary operations when they are " "asked to operate on types they don't support. See :ref:`comparisons` for " @@ -5461,15 +5122,15 @@ msgid "" "``type(NotImplemented)()`` produces the singleton instance." msgstr "" -#: ../../library/stdtypes.rst:5112 +#: ../../library/stdtypes.rst:4901 msgid "It is written as ``NotImplemented``." msgstr "" -#: ../../library/stdtypes.rst:5118 +#: ../../library/stdtypes.rst:4907 msgid "Boolean Values" msgstr "" -#: ../../library/stdtypes.rst:5120 +#: ../../library/stdtypes.rst:4909 msgid "" "Boolean values are the two constant objects ``False`` and ``True``. They " "are used to represent truth values (although other values can also be " @@ -5480,104 +5141,103 @@ msgid "" "(see section :ref:`truth` above)." msgstr "" -#: ../../library/stdtypes.rst:5133 +#: ../../library/stdtypes.rst:4922 msgid "They are written as ``False`` and ``True``, respectively." msgstr "" -#: ../../library/stdtypes.rst:5139 +#: ../../library/stdtypes.rst:4928 msgid "Internal Objects" msgstr "" -#: ../../library/stdtypes.rst:5141 +#: ../../library/stdtypes.rst:4930 msgid "" "See :ref:`types` for this information. It describes stack frame objects, " "traceback objects, and slice objects." msgstr "" -#: ../../library/stdtypes.rst:5148 +#: ../../library/stdtypes.rst:4937 msgid "Special Attributes" msgstr "" -#: ../../library/stdtypes.rst:5150 +#: ../../library/stdtypes.rst:4939 msgid "" "The implementation adds a few special read-only attributes to several object " "types, where they are relevant. Some of these are not reported by the :func:" "`dir` built-in function." msgstr "" -#: ../../library/stdtypes.rst:5157 +#: ../../library/stdtypes.rst:4946 msgid "" "A dictionary or other mapping object used to store an object's (writable) " "attributes." msgstr "" -#: ../../library/stdtypes.rst:5163 +#: ../../library/stdtypes.rst:4952 msgid "The class to which a class instance belongs." msgstr "" -#: ../../library/stdtypes.rst:5168 +#: ../../library/stdtypes.rst:4957 msgid "The tuple of base classes of a class object." msgstr "" -#: ../../library/stdtypes.rst:5173 +#: ../../library/stdtypes.rst:4962 msgid "" "The name of the class, function, method, descriptor, or generator instance." msgstr "" -#: ../../library/stdtypes.rst:5179 +#: ../../library/stdtypes.rst:4968 msgid "" "The :term:`qualified name` of the class, function, method, descriptor, or " "generator instance." msgstr "" -#: ../../library/stdtypes.rst:5187 +#: ../../library/stdtypes.rst:4976 msgid "" "This attribute is a tuple of classes that are considered when looking for " "base classes during method resolution." msgstr "" -#: ../../library/stdtypes.rst:5193 +#: ../../library/stdtypes.rst:4982 msgid "" "This method can be overridden by a metaclass to customize the method " "resolution order for its instances. It is called at class instantiation, " "and its result is stored in :attr:`~class.__mro__`." msgstr "" -#: ../../library/stdtypes.rst:5200 +#: ../../library/stdtypes.rst:4989 msgid "" "Each class keeps a list of weak references to its immediate subclasses. " -"This method returns a list of all those references still alive. The list is " -"in definition order. Example::" +"This method returns a list of all those references still alive. Example::" msgstr "" -#: ../../library/stdtypes.rst:5209 +#: ../../library/stdtypes.rst:4998 msgid "Footnotes" msgstr "註解" -#: ../../library/stdtypes.rst:5210 +#: ../../library/stdtypes.rst:4999 msgid "" "Additional information on these special methods may be found in the Python " "Reference Manual (:ref:`customization`)." msgstr "" -#: ../../library/stdtypes.rst:5213 +#: ../../library/stdtypes.rst:5002 msgid "" "As a consequence, the list ``[1, 2]`` is considered equal to ``[1.0, 2.0]``, " "and similarly for tuples." msgstr "" -#: ../../library/stdtypes.rst:5216 +#: ../../library/stdtypes.rst:5005 msgid "They must have since the parser can't tell the type of the operands." msgstr "" -#: ../../library/stdtypes.rst:5218 +#: ../../library/stdtypes.rst:5007 msgid "" "Cased characters are those with general category property being one of \"Lu" "\" (Letter, uppercase), \"Ll\" (Letter, lowercase), or \"Lt\" (Letter, " "titlecase)." msgstr "" -#: ../../library/stdtypes.rst:5221 +#: ../../library/stdtypes.rst:5010 msgid "" "To format only a tuple you should therefore provide a singleton tuple whose " "only element is the tuple to be formatted." diff --git a/library/string.po b/library/string.po index 51a52af9af..652ee723f4 100644 --- a/library/string.po +++ b/library/string.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.7\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2021-09-07 06:52+0000\n" +"POT-Creation-Date: 2020-06-20 18:08+0800\n" "PO-Revision-Date: 2018-05-23 16:11+0000\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -236,9 +236,8 @@ msgid "" "The :meth:`str.format` method and the :class:`Formatter` class share the " "same syntax for format strings (although in the case of :class:`Formatter`, " "subclasses can define their own format string syntax). The syntax is " -"related to that of :ref:`formatted string literals `, but it is " -"less sophisticated and, in particular, does not support arbitrary " -"expressions." +"related to that of :ref:`formatted string literals `, but there " +"are differences." msgstr "" #: ../../library/string.rst:201 @@ -403,7 +402,7 @@ msgstr "" #: ../../library/string.rst:339 ../../library/string.rst:370 #: ../../library/string.rst:439 ../../library/string.rst:450 -#: ../../library/string.rst:485 +#: ../../library/string.rst:482 msgid "Meaning" msgstr "" @@ -494,11 +493,11 @@ msgstr "" msgid "" "The ``'#'`` option causes the \"alternate form\" to be used for the " "conversion. The alternate form is defined differently for different types. " -"This option is only valid for integer, float and complex types. For " +"This option is only valid for integer, float, complex and Decimal types. For " "integers, when binary, octal, or hexadecimal output is used, this option " -"adds the respective prefix ``'0b'``, ``'0o'``, ``'0x'``, or ``'0X'`` to the " -"output value. For float and complex the alternate form causes the result of " -"the conversion to always contain a decimal-point character, even if no " +"adds the prefix respective ``'0b'``, ``'0o'``, or ``'0x'`` to the output " +"value. For floats, complex and Decimal the alternate form causes the result " +"of the conversion to always contain a decimal-point character, even if no " "digits follow it. Normally, a decimal-point character appears in the result " "of these conversions only if a digit follows it. In addition, for ``'g'`` " "and ``'G'`` conversions, trailing zeros are not removed from the result." @@ -562,7 +561,7 @@ msgid "The available string presentation types are:" msgstr "" #: ../../library/string.rst:439 ../../library/string.rst:450 -#: ../../library/string.rst:485 +#: ../../library/string.rst:482 msgid "Type" msgstr "" @@ -574,8 +573,8 @@ msgstr "" msgid "String format. This is the default type for strings and may be omitted." msgstr "" -#: ../../library/string.rst:444 ../../library/string.rst:473 -#: ../../library/string.rst:560 +#: ../../library/string.rst:444 ../../library/string.rst:471 +#: ../../library/string.rst:534 msgid "None" msgstr "" @@ -638,25 +637,24 @@ msgstr "" #: ../../library/string.rst:464 msgid "" "Hex format. Outputs the number in base 16, using upper-case letters for the " -"digits above 9. In case ``'#'`` is specified, the prefix ``'0x'`` will be " -"upper-cased to ``'0X'`` as well." +"digits above 9." msgstr "" -#: ../../library/string.rst:469 ../../library/string.rst:553 +#: ../../library/string.rst:467 ../../library/string.rst:527 msgid "``'n'``" msgstr "" -#: ../../library/string.rst:469 +#: ../../library/string.rst:467 msgid "" "Number. This is the same as ``'d'``, except that it uses the current locale " "setting to insert the appropriate number separator characters." msgstr "" -#: ../../library/string.rst:473 +#: ../../library/string.rst:471 msgid "The same as ``'d'``." msgstr "" -#: ../../library/string.rst:476 +#: ../../library/string.rst:474 msgid "" "In addition to the above presentation types, integers can be formatted with " "the floating point presentation types listed below (except ``'n'`` and " @@ -664,76 +662,63 @@ msgid "" "floating point number before formatting." msgstr "" -#: ../../library/string.rst:481 +#: ../../library/string.rst:479 msgid "" -"The available presentation types for :class:`float` and :class:`~decimal." -"Decimal` values are:" +"The available presentation types for floating point and decimal values are:" msgstr "" -#: ../../library/string.rst:487 +#: ../../library/string.rst:484 msgid "``'e'``" msgstr "" -#: ../../library/string.rst:487 +#: ../../library/string.rst:484 msgid "" -"Scientific notation. For a given precision ``p``, formats the number in " -"scientific notation with the letter 'e' separating the coefficient from the " -"exponent. The coefficient has one digit before and ``p`` digits after the " -"decimal point, for a total of ``p + 1`` significant digits. With no " -"precision given, uses a precision of ``6`` digits after the decimal point " -"for :class:`float`, and shows all coefficient digits for :class:`~decimal." -"Decimal`. If no digits follow the decimal point, the decimal point is also " -"removed unless the ``#`` option is used." +"Exponent notation. Prints the number in scientific notation using the letter " +"'e' to indicate the exponent. The default precision is ``6``." msgstr "" -#: ../../library/string.rst:499 +#: ../../library/string.rst:488 msgid "``'E'``" msgstr "" -#: ../../library/string.rst:499 +#: ../../library/string.rst:488 msgid "" -"Scientific notation. Same as ``'e'`` except it uses an upper case 'E' as the " +"Exponent notation. Same as ``'e'`` except it uses an upper case 'E' as the " "separator character." msgstr "" -#: ../../library/string.rst:502 +#: ../../library/string.rst:491 msgid "``'f'``" msgstr "``'f'``" -#: ../../library/string.rst:502 +#: ../../library/string.rst:491 msgid "" -"Fixed-point notation. For a given precision ``p``, formats the number as a " -"decimal number with exactly ``p`` digits following the decimal point. With " -"no precision given, uses a precision of ``6`` digits after the decimal point " -"for :class:`float`, and uses a precision large enough to show all " -"coefficient digits for :class:`~decimal.Decimal`. If no digits follow the " -"decimal point, the decimal point is also removed unless the ``#`` option is " -"used." +"Fixed-point notation. Displays the number as a fixed-point number. The " +"default precision is ``6``." msgstr "" -#: ../../library/string.rst:512 +#: ../../library/string.rst:494 msgid "``'F'``" msgstr "" -#: ../../library/string.rst:512 +#: ../../library/string.rst:494 msgid "" "Fixed-point notation. Same as ``'f'``, but converts ``nan`` to ``NAN`` and " "``inf`` to ``INF``." msgstr "" -#: ../../library/string.rst:515 +#: ../../library/string.rst:497 msgid "``'g'``" msgstr "" -#: ../../library/string.rst:515 +#: ../../library/string.rst:497 msgid "" "General format. For a given precision ``p >= 1``, this rounds the number to " "``p`` significant digits and then formats the result in either fixed-point " -"format or in scientific notation, depending on its magnitude. A precision of " -"``0`` is treated as equivalent to a precision of ``1``." +"format or in scientific notation, depending on its magnitude." msgstr "" -#: ../../library/string.rst:522 +#: ../../library/string.rst:502 msgid "" "The precise rules are as follows: suppose that the result formatted with " "presentation type ``'e'`` and precision ``p-1`` would have exponent " @@ -746,147 +731,130 @@ msgid "" "unless the ``'#'`` option is used." msgstr "" -#: ../../library/string.rst:535 -msgid "" -"With no precision given, uses a precision of ``6`` significant digits for :" -"class:`float`. For :class:`~decimal.Decimal`, the coefficient of the result " -"is formed from the coefficient digits of the value; scientific notation is " -"used for values smaller than ``1e-6`` in absolute value and values where the " -"place value of the least significant digit is larger than 1, and fixed-point " -"notation is used otherwise." -msgstr "" - -#: ../../library/string.rst:544 +#: ../../library/string.rst:515 msgid "" "Positive and negative infinity, positive and negative zero, and nans, are " "formatted as ``inf``, ``-inf``, ``0``, ``-0`` and ``nan`` respectively, " "regardless of the precision." msgstr "" -#: ../../library/string.rst:549 +#: ../../library/string.rst:520 +msgid "" +"A precision of ``0`` is treated as equivalent to a precision of ``1``. The " +"default precision is ``6``." +msgstr "" + +#: ../../library/string.rst:523 msgid "``'G'``" msgstr "" -#: ../../library/string.rst:549 +#: ../../library/string.rst:523 msgid "" "General format. Same as ``'g'`` except switches to ``'E'`` if the number " "gets too large. The representations of infinity and NaN are uppercased, too." msgstr "" -#: ../../library/string.rst:553 +#: ../../library/string.rst:527 msgid "" "Number. This is the same as ``'g'``, except that it uses the current locale " "setting to insert the appropriate number separator characters." msgstr "" -#: ../../library/string.rst:557 +#: ../../library/string.rst:531 msgid "``'%'``" msgstr "" -#: ../../library/string.rst:557 +#: ../../library/string.rst:531 msgid "" "Percentage. Multiplies the number by 100 and displays in fixed (``'f'``) " "format, followed by a percent sign." msgstr "" -#: ../../library/string.rst:560 +#: ../../library/string.rst:534 msgid "" -"For :class:`float` this is the same as ``'g'``, except that when fixed-point " -"notation is used to format the result, it always includes at least one digit " -"past the decimal point. The precision used is as large as needed to " -"represent the given value faithfully." +"Similar to ``'g'``, except that fixed-point notation, when used, has at " +"least one digit past the decimal point. The default precision is as high as " +"needed to represent the particular value. The overall effect is to match the " +"output of :func:`str` as altered by the other format modifiers." msgstr "" -#: ../../library/string.rst:566 -msgid "" -"For :class:`~decimal.Decimal`, this is the same as either ``'g'`` or ``'G'`` " -"depending on the value of ``context.capitals`` for the current decimal " -"context." -msgstr "" - -#: ../../library/string.rst:570 -msgid "" -"The overall effect is to match the output of :func:`str` as altered by the " -"other format modifiers." -msgstr "" - -#: ../../library/string.rst:578 +#: ../../library/string.rst:546 msgid "Format examples" msgstr "" -#: ../../library/string.rst:580 +#: ../../library/string.rst:548 msgid "" "This section contains examples of the :meth:`str.format` syntax and " "comparison with the old ``%``-formatting." msgstr "" -#: ../../library/string.rst:583 +#: ../../library/string.rst:551 msgid "" "In most of the cases the syntax is similar to the old ``%``-formatting, with " "the addition of the ``{}`` and with ``:`` used instead of ``%``. For " "example, ``'%03.2f'`` can be translated to ``'{:03.2f}'``." msgstr "" -#: ../../library/string.rst:587 +#: ../../library/string.rst:555 msgid "" "The new format syntax also supports new and different options, shown in the " "following examples." msgstr "" -#: ../../library/string.rst:590 +#: ../../library/string.rst:558 msgid "Accessing arguments by position::" msgstr "" -#: ../../library/string.rst:603 +#: ../../library/string.rst:571 msgid "Accessing arguments by name::" msgstr "" -#: ../../library/string.rst:611 +#: ../../library/string.rst:579 msgid "Accessing arguments' attributes::" msgstr "" -#: ../../library/string.rst:626 +#: ../../library/string.rst:594 msgid "Accessing arguments' items::" msgstr "" -#: ../../library/string.rst:632 +#: ../../library/string.rst:600 msgid "Replacing ``%s`` and ``%r``::" msgstr "" -#: ../../library/string.rst:637 +#: ../../library/string.rst:605 msgid "Aligning the text and specifying a width::" msgstr "" -#: ../../library/string.rst:648 +#: ../../library/string.rst:616 msgid "Replacing ``%+f``, ``%-f``, and ``% f`` and specifying a sign::" msgstr "" -#: ../../library/string.rst:657 +#: ../../library/string.rst:625 msgid "" "Replacing ``%x`` and ``%o`` and converting the value to different bases::" msgstr "" -#: ../../library/string.rst:666 +#: ../../library/string.rst:634 msgid "Using the comma as a thousands separator::" msgstr "" -#: ../../library/string.rst:671 +#: ../../library/string.rst:639 msgid "Expressing a percentage::" msgstr "" -#: ../../library/string.rst:678 +#: ../../library/string.rst:646 msgid "Using type-specific formatting::" msgstr "" -#: ../../library/string.rst:685 +#: ../../library/string.rst:653 msgid "Nesting arguments and more complex examples::" msgstr "" -#: ../../library/string.rst:719 +#: ../../library/string.rst:687 msgid "Template strings" msgstr "" -#: ../../library/string.rst:721 +#: ../../library/string.rst:689 msgid "" "Template strings provide simpler string substitutions as described in :pep:" "`292`. A primary use case for template strings is for internationalization " @@ -896,17 +864,17 @@ msgid "" "the `flufl.i18n `_ package." msgstr "" -#: ../../library/string.rst:731 +#: ../../library/string.rst:699 msgid "" "Template strings support ``$``-based substitutions, using the following " "rules:" msgstr "" -#: ../../library/string.rst:733 +#: ../../library/string.rst:701 msgid "``$$`` is an escape; it is replaced with a single ``$``." msgstr "" -#: ../../library/string.rst:735 +#: ../../library/string.rst:703 msgid "" "``$identifier`` names a substitution placeholder matching a mapping key of ``" "\"identifier\"``. By default, ``\"identifier\"`` is restricted to any case-" @@ -915,30 +883,30 @@ msgid "" "after the ``$`` character terminates this placeholder specification." msgstr "" -#: ../../library/string.rst:742 +#: ../../library/string.rst:710 msgid "" "``${identifier}`` is equivalent to ``$identifier``. It is required when " "valid identifier characters follow the placeholder but are not part of the " "placeholder, such as ``\"${noun}ification\"``." msgstr "" -#: ../../library/string.rst:746 +#: ../../library/string.rst:714 msgid "" "Any other appearance of ``$`` in the string will result in a :exc:" "`ValueError` being raised." msgstr "" -#: ../../library/string.rst:749 +#: ../../library/string.rst:717 msgid "" "The :mod:`string` module provides a :class:`Template` class that implements " "these rules. The methods of :class:`Template` are:" msgstr "" -#: ../../library/string.rst:755 +#: ../../library/string.rst:723 msgid "The constructor takes a single argument which is the template string." msgstr "" -#: ../../library/string.rst:760 +#: ../../library/string.rst:728 msgid "" "Performs the template substitution, returning a new string. *mapping* is " "any dictionary-like object with keys that match the placeholders in the " @@ -947,7 +915,7 @@ msgid "" "there are duplicates, the placeholders from *kwds* take precedence." msgstr "" -#: ../../library/string.rst:769 +#: ../../library/string.rst:737 msgid "" "Like :meth:`substitute`, except that if placeholders are missing from " "*mapping* and *kwds*, instead of raising a :exc:`KeyError` exception, the " @@ -956,7 +924,7 @@ msgid "" "simply return ``$`` instead of raising :exc:`ValueError`." msgstr "" -#: ../../library/string.rst:775 +#: ../../library/string.rst:743 msgid "" "While other exceptions may still occur, this method is called \"safe\" " "because it always tries to return a usable string instead of raising an " @@ -966,21 +934,21 @@ msgid "" "Python identifiers." msgstr "" -#: ../../library/string.rst:782 +#: ../../library/string.rst:750 msgid ":class:`Template` instances also provide one public data attribute:" msgstr "" -#: ../../library/string.rst:786 +#: ../../library/string.rst:754 msgid "" "This is the object passed to the constructor's *template* argument. In " "general, you shouldn't change it, but read-only access is not enforced." msgstr "" -#: ../../library/string.rst:789 +#: ../../library/string.rst:757 msgid "Here is an example of how to use a Template::" msgstr "" -#: ../../library/string.rst:807 +#: ../../library/string.rst:775 msgid "" "Advanced usage: you can derive subclasses of :class:`Template` to customize " "the placeholder syntax, delimiter character, or the entire regular " @@ -988,7 +956,7 @@ msgid "" "these class attributes:" msgstr "" -#: ../../library/string.rst:812 +#: ../../library/string.rst:780 msgid "" "*delimiter* -- This is the literal string describing a placeholder " "introducing delimiter. The default value is ``$``. Note that this should " @@ -998,7 +966,7 @@ msgid "" "the subclass's class namespace)." msgstr "" -#: ../../library/string.rst:819 +#: ../../library/string.rst:787 msgid "" "*idpattern* -- This is the regular expression describing the pattern for non-" "braced placeholders. The default value is the regular expression ``(?a:[_a-" @@ -1006,19 +974,19 @@ msgid "" "pattern will also apply to braced placeholders." msgstr "" -#: ../../library/string.rst:826 +#: ../../library/string.rst:794 msgid "" "Since default *flags* is ``re.IGNORECASE``, pattern ``[a-z]`` can match with " "some non-ASCII characters. That's why we use the local ``a`` flag here." msgstr "" -#: ../../library/string.rst:830 +#: ../../library/string.rst:798 msgid "" "*braceidpattern* can be used to define separate patterns used inside and " "outside the braces." msgstr "" -#: ../../library/string.rst:834 +#: ../../library/string.rst:802 msgid "" "*braceidpattern* -- This is like *idpattern* but describes the pattern for " "braced placeholders. Defaults to ``None`` which means to fall back to " @@ -1027,7 +995,7 @@ msgid "" "unbraced placeholders." msgstr "" -#: ../../library/string.rst:842 +#: ../../library/string.rst:810 msgid "" "*flags* -- The regular expression flags that will be applied when compiling " "the regular expression used for recognizing substitutions. The default " @@ -1036,7 +1004,7 @@ msgid "" "regular expressions." msgstr "" -#: ../../library/string.rst:850 +#: ../../library/string.rst:818 msgid "" "Alternatively, you can provide the entire regular expression pattern by " "overriding the class attribute *pattern*. If you do this, the value must be " @@ -1045,35 +1013,35 @@ msgid "" "placeholder rule:" msgstr "" -#: ../../library/string.rst:856 +#: ../../library/string.rst:824 msgid "" "*escaped* -- This group matches the escape sequence, e.g. ``$$``, in the " "default pattern." msgstr "" -#: ../../library/string.rst:859 +#: ../../library/string.rst:827 msgid "" "*named* -- This group matches the unbraced placeholder name; it should not " "include the delimiter in capturing group." msgstr "" -#: ../../library/string.rst:862 +#: ../../library/string.rst:830 msgid "" "*braced* -- This group matches the brace enclosed placeholder name; it " "should not include either the delimiter or braces in the capturing group." msgstr "" -#: ../../library/string.rst:865 +#: ../../library/string.rst:833 msgid "" "*invalid* -- This group matches any other delimiter pattern (usually a " "single delimiter), and it should appear last in the regular expression." msgstr "" -#: ../../library/string.rst:870 +#: ../../library/string.rst:838 msgid "Helper functions" msgstr "" -#: ../../library/string.rst:874 +#: ../../library/string.rst:842 msgid "" "Split the argument into words using :meth:`str.split`, capitalize each word " "using :meth:`str.capitalize`, and join the capitalized words using :meth:" diff --git a/library/struct.po b/library/struct.po index b439f6b42d..636cf51842 100644 --- a/library/struct.po +++ b/library/struct.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.7\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2021-09-07 06:52+0000\n" +"POT-Creation-Date: 2020-06-20 18:08+0800\n" "PO-Revision-Date: 2018-05-23 16:11+0000\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -247,8 +247,8 @@ msgstr "" #: ../../library/struct.rst:162 msgid "" -"The form ``'!'`` represents the network byte order which is always big-" -"endian as defined in `IETF RFC 1700 `_." +"The form ``'!'`` is available for those poor souls who claim they can't " +"remember whether network byte order is big-endian or little-endian." msgstr "" #: ../../library/struct.rst:165 diff --git a/library/subprocess.po b/library/subprocess.po index e3ecf52ae8..195c2897ca 100644 --- a/library/subprocess.po +++ b/library/subprocess.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.7\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2021-09-07 06:52+0000\n" +"POT-Creation-Date: 2020-06-20 18:08+0800\n" "PO-Revision-Date: 2018-05-23 16:11+0000\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -158,7 +158,7 @@ msgid "" "that it ran successfully." msgstr "" -#: ../../library/subprocess.rst:127 ../../library/subprocess.rst:869 +#: ../../library/subprocess.rst:127 ../../library/subprocess.rst:864 msgid "" "A negative value ``-N`` indicates that the child was terminated by signal " "``N`` (POSIX only)." @@ -723,7 +723,7 @@ msgstr "" msgid "*encoding* and *errors* were added." msgstr "" -#: ../../library/subprocess.rst:608 ../../library/subprocess.rst:1202 +#: ../../library/subprocess.rst:608 ../../library/subprocess.rst:1196 msgid "*text* was added as a more readable alias for *universal_newlines*." msgstr "" @@ -789,7 +789,7 @@ msgid "" "waited for. ::" msgstr "" -#: ../../library/subprocess.rst:635 +#: ../../library/subprocess.rst:None msgid "" "Raises an :ref:`auditing event ` ``subprocess.Popen`` with " "arguments ``executable``, ``args``, ``cwd``, ``env``." @@ -836,46 +836,42 @@ msgstr "" msgid "" "The most common exception raised is :exc:`OSError`. This occurs, for " "example, when trying to execute a non-existent file. Applications should " -"prepare for :exc:`OSError` exceptions. Note that, when ``shell=True``, :exc:" -"`OSError` will be raised by the child only if the selected shell itself was " -"not found. To determine if the shell failed to find the requested " -"application, it is necessary to check the return code or output from the " -"subprocess." +"prepare for :exc:`OSError` exceptions." msgstr "" -#: ../../library/subprocess.rst:670 +#: ../../library/subprocess.rst:667 msgid "" "A :exc:`ValueError` will be raised if :class:`Popen` is called with invalid " "arguments." msgstr "" -#: ../../library/subprocess.rst:673 +#: ../../library/subprocess.rst:670 msgid "" ":func:`check_call` and :func:`check_output` will raise :exc:" "`CalledProcessError` if the called process returns a non-zero return code." msgstr "" -#: ../../library/subprocess.rst:677 +#: ../../library/subprocess.rst:674 msgid "" "All of the functions and methods that accept a *timeout* parameter, such as :" "func:`call` and :meth:`Popen.communicate` will raise :exc:`TimeoutExpired` " "if the timeout expires before the process exits." msgstr "" -#: ../../library/subprocess.rst:681 +#: ../../library/subprocess.rst:678 msgid "" "Exceptions defined in this module all inherit from :exc:`SubprocessError`." msgstr "" -#: ../../library/subprocess.rst:683 +#: ../../library/subprocess.rst:680 msgid "The :exc:`SubprocessError` base class was added." msgstr "" -#: ../../library/subprocess.rst:689 +#: ../../library/subprocess.rst:685 msgid "Security Considerations" msgstr "" -#: ../../library/subprocess.rst:691 +#: ../../library/subprocess.rst:687 msgid "" "Unlike some other popen functions, this implementation will never implicitly " "call a system shell. This means that all characters, including shell " @@ -886,41 +882,41 @@ msgid "" "Shell_injection#Shell_injection>`_ vulnerabilities." msgstr "" -#: ../../library/subprocess.rst:700 +#: ../../library/subprocess.rst:696 msgid "" "When using ``shell=True``, the :func:`shlex.quote` function can be used to " "properly escape whitespace and shell metacharacters in strings that are " "going to be used to construct shell commands." msgstr "" -#: ../../library/subprocess.rst:706 +#: ../../library/subprocess.rst:702 msgid "Popen Objects" msgstr "" -#: ../../library/subprocess.rst:708 +#: ../../library/subprocess.rst:704 msgid "Instances of the :class:`Popen` class have the following methods:" msgstr "" -#: ../../library/subprocess.rst:713 +#: ../../library/subprocess.rst:709 msgid "" "Check if child process has terminated. Set and return :attr:`~Popen." "returncode` attribute. Otherwise, returns ``None``." msgstr "" -#: ../../library/subprocess.rst:719 +#: ../../library/subprocess.rst:715 msgid "" "Wait for child process to terminate. Set and return :attr:`~Popen." "returncode` attribute." msgstr "" -#: ../../library/subprocess.rst:722 +#: ../../library/subprocess.rst:718 msgid "" "If the process does not terminate after *timeout* seconds, raise a :exc:" "`TimeoutExpired` exception. It is safe to catch this exception and retry " "the wait." msgstr "" -#: ../../library/subprocess.rst:728 +#: ../../library/subprocess.rst:724 msgid "" "This will deadlock when using ``stdout=PIPE`` or ``stderr=PIPE`` and the " "child process generates enough output to a pipe such that it blocks waiting " @@ -928,36 +924,35 @@ msgid "" "when using pipes to avoid that." msgstr "" -#: ../../library/subprocess.rst:735 +#: ../../library/subprocess.rst:731 msgid "" "The function is implemented using a busy loop (non-blocking call and short " "sleeps). Use the :mod:`asyncio` module for an asynchronous wait: see :class:" "`asyncio.create_subprocess_exec`." msgstr "" -#: ../../library/subprocess.rst:739 ../../library/subprocess.rst:780 -#: ../../library/subprocess.rst:1117 ../../library/subprocess.rst:1147 -#: ../../library/subprocess.rst:1193 +#: ../../library/subprocess.rst:735 ../../library/subprocess.rst:775 +#: ../../library/subprocess.rst:1112 ../../library/subprocess.rst:1142 +#: ../../library/subprocess.rst:1187 msgid "*timeout* was added." msgstr "" -#: ../../library/subprocess.rst:744 +#: ../../library/subprocess.rst:740 msgid "" "Interact with process: Send data to stdin. Read data from stdout and " -"stderr, until end-of-file is reached. Wait for process to terminate and set " -"the :attr:`~Popen.returncode` attribute. The optional *input* argument " -"should be data to be sent to the child process, or ``None``, if no data " -"should be sent to the child. If streams were opened in text mode, *input* " -"must be a string. Otherwise, it must be bytes." +"stderr, until end-of-file is reached. Wait for process to terminate. The " +"optional *input* argument should be data to be sent to the child process, or " +"``None``, if no data should be sent to the child. If streams were opened in " +"text mode, *input* must be a string. Otherwise, it must be bytes." msgstr "" -#: ../../library/subprocess.rst:751 +#: ../../library/subprocess.rst:746 msgid "" ":meth:`communicate` returns a tuple ``(stdout_data, stderr_data)``. The data " "will be strings if streams were opened in text mode; otherwise, bytes." msgstr "" -#: ../../library/subprocess.rst:755 +#: ../../library/subprocess.rst:750 msgid "" "Note that if you want to send data to the process's stdin, you need to " "create the Popen object with ``stdin=PIPE``. Similarly, to get anything " @@ -965,65 +960,65 @@ msgid "" "and/or ``stderr=PIPE`` too." msgstr "" -#: ../../library/subprocess.rst:760 +#: ../../library/subprocess.rst:755 msgid "" "If the process does not terminate after *timeout* seconds, a :exc:" "`TimeoutExpired` exception will be raised. Catching this exception and " "retrying communication will not lose any output." msgstr "" -#: ../../library/subprocess.rst:764 +#: ../../library/subprocess.rst:759 msgid "" "The child process is not killed if the timeout expires, so in order to " "cleanup properly a well-behaved application should kill the child process " "and finish communication::" msgstr "" -#: ../../library/subprocess.rst:777 +#: ../../library/subprocess.rst:772 msgid "" "The data read is buffered in memory, so do not use this method if the data " "size is large or unlimited." msgstr "" -#: ../../library/subprocess.rst:786 +#: ../../library/subprocess.rst:781 msgid "Sends the signal *signal* to the child." msgstr "" -#: ../../library/subprocess.rst:788 +#: ../../library/subprocess.rst:783 msgid "Do nothing if the process completed." msgstr "" -#: ../../library/subprocess.rst:792 +#: ../../library/subprocess.rst:787 msgid "" "On Windows, SIGTERM is an alias for :meth:`terminate`. CTRL_C_EVENT and " "CTRL_BREAK_EVENT can be sent to processes started with a *creationflags* " "parameter which includes `CREATE_NEW_PROCESS_GROUP`." msgstr "" -#: ../../library/subprocess.rst:799 +#: ../../library/subprocess.rst:794 msgid "" "Stop the child. On POSIX OSs the method sends SIGTERM to the child. On " "Windows the Win32 API function :c:func:`TerminateProcess` is called to stop " "the child." msgstr "" -#: ../../library/subprocess.rst:806 +#: ../../library/subprocess.rst:801 msgid "" "Kills the child. On POSIX OSs the function sends SIGKILL to the child. On " "Windows :meth:`kill` is an alias for :meth:`terminate`." msgstr "" -#: ../../library/subprocess.rst:810 +#: ../../library/subprocess.rst:805 msgid "The following attributes are also available:" msgstr "" -#: ../../library/subprocess.rst:814 +#: ../../library/subprocess.rst:809 msgid "" "The *args* argument as it was passed to :class:`Popen` -- a sequence of " "program arguments or else a single string." msgstr "" -#: ../../library/subprocess.rst:821 +#: ../../library/subprocess.rst:816 msgid "" "If the *stdin* argument was :data:`PIPE`, this attribute is a writeable " "stream object as returned by :func:`open`. If the *encoding* or *errors* " @@ -1032,7 +1027,7 @@ msgid "" "argument was not :data:`PIPE`, this attribute is ``None``." msgstr "" -#: ../../library/subprocess.rst:830 +#: ../../library/subprocess.rst:825 msgid "" "If the *stdout* argument was :data:`PIPE`, this attribute is a readable " "stream object as returned by :func:`open`. Reading from the stream provides " @@ -1042,7 +1037,7 @@ msgid "" "not :data:`PIPE`, this attribute is ``None``." msgstr "" -#: ../../library/subprocess.rst:840 +#: ../../library/subprocess.rst:835 msgid "" "If the *stderr* argument was :data:`PIPE`, this attribute is a readable " "stream object as returned by :func:`open`. Reading from the stream provides " @@ -1052,7 +1047,7 @@ msgid "" "was not :data:`PIPE`, this attribute is ``None``." msgstr "" -#: ../../library/subprocess.rst:849 +#: ../../library/subprocess.rst:844 msgid "" "Use :meth:`~Popen.communicate` rather than :attr:`.stdin.write `, :attr:`.stdout.read ` or :attr:`.stderr.read `__ structure is used for :class:`Popen` " @@ -1095,38 +1090,38 @@ msgid "" "only arguments." msgstr "" -#: ../../library/subprocess.rst:887 +#: ../../library/subprocess.rst:882 msgid "Keyword-only argument support was added." msgstr "" -#: ../../library/subprocess.rst:892 +#: ../../library/subprocess.rst:887 msgid "" "A bit field that determines whether certain :class:`STARTUPINFO` attributes " "are used when the process creates a window. ::" msgstr "" -#: ../../library/subprocess.rst:900 +#: ../../library/subprocess.rst:895 msgid "" "If :attr:`dwFlags` specifies :data:`STARTF_USESTDHANDLES`, this attribute is " "the standard input handle for the process. If :data:`STARTF_USESTDHANDLES` " "is not specified, the default for standard input is the keyboard buffer." msgstr "" -#: ../../library/subprocess.rst:907 +#: ../../library/subprocess.rst:902 msgid "" "If :attr:`dwFlags` specifies :data:`STARTF_USESTDHANDLES`, this attribute is " "the standard output handle for the process. Otherwise, this attribute is " "ignored and the default for standard output is the console window's buffer." msgstr "" -#: ../../library/subprocess.rst:914 +#: ../../library/subprocess.rst:909 msgid "" "If :attr:`dwFlags` specifies :data:`STARTF_USESTDHANDLES`, this attribute is " "the standard error handle for the process. Otherwise, this attribute is " "ignored and the default for standard error is the console window's buffer." msgstr "" -#: ../../library/subprocess.rst:920 +#: ../../library/subprocess.rst:915 msgid "" "If :attr:`dwFlags` specifies :data:`STARTF_USESHOWWINDOW`, this attribute " "can be any of the values that can be specified in the ``nCmdShow`` parameter " @@ -1135,34 +1130,34 @@ msgid "" "Otherwise, this attribute is ignored." msgstr "" -#: ../../library/subprocess.rst:927 +#: ../../library/subprocess.rst:922 msgid "" ":data:`SW_HIDE` is provided for this attribute. It is used when :class:" "`Popen` is called with ``shell=True``." msgstr "" -#: ../../library/subprocess.rst:932 +#: ../../library/subprocess.rst:927 msgid "" "A dictionary of additional attributes for process creation as given in " "``STARTUPINFOEX``, see `UpdateProcThreadAttribute `__." msgstr "" -#: ../../library/subprocess.rst:936 +#: ../../library/subprocess.rst:931 msgid "Supported attributes:" msgstr "" -#: ../../library/subprocess.rst:954 +#: ../../library/subprocess.rst:949 msgid "**handle_list**" msgstr "" -#: ../../library/subprocess.rst:939 +#: ../../library/subprocess.rst:934 msgid "" "Sequence of handles that will be inherited. *close_fds* must be true if non-" "empty." msgstr "" -#: ../../library/subprocess.rst:942 +#: ../../library/subprocess.rst:937 msgid "" "The handles must be temporarily made inheritable by :func:`os." "set_handle_inheritable` when passed to the :class:`Popen` constructor, else :" @@ -1170,7 +1165,7 @@ msgid "" "``ERROR_INVALID_PARAMETER`` (87)." msgstr "" -#: ../../library/subprocess.rst:949 +#: ../../library/subprocess.rst:944 msgid "" "In a multithreaded process, use caution to avoid leaking handles that are " "marked inheritable when combining this feature with concurrent calls to " @@ -1179,97 +1174,97 @@ msgid "" "temporarily creates inheritable handles." msgstr "" -#: ../../library/subprocess.rst:959 +#: ../../library/subprocess.rst:954 msgid "Windows Constants" msgstr "" -#: ../../library/subprocess.rst:961 +#: ../../library/subprocess.rst:956 msgid "The :mod:`subprocess` module exposes the following constants." msgstr "" -#: ../../library/subprocess.rst:965 +#: ../../library/subprocess.rst:960 msgid "" "The standard input device. Initially, this is the console input buffer, " "``CONIN$``." msgstr "" -#: ../../library/subprocess.rst:970 +#: ../../library/subprocess.rst:965 msgid "" "The standard output device. Initially, this is the active console screen " "buffer, ``CONOUT$``." msgstr "" -#: ../../library/subprocess.rst:975 +#: ../../library/subprocess.rst:970 msgid "" "The standard error device. Initially, this is the active console screen " "buffer, ``CONOUT$``." msgstr "" -#: ../../library/subprocess.rst:980 +#: ../../library/subprocess.rst:975 msgid "Hides the window. Another window will be activated." msgstr "" -#: ../../library/subprocess.rst:984 +#: ../../library/subprocess.rst:979 msgid "" "Specifies that the :attr:`STARTUPINFO.hStdInput`, :attr:`STARTUPINFO." "hStdOutput`, and :attr:`STARTUPINFO.hStdError` attributes contain additional " "information." msgstr "" -#: ../../library/subprocess.rst:990 +#: ../../library/subprocess.rst:985 msgid "" "Specifies that the :attr:`STARTUPINFO.wShowWindow` attribute contains " "additional information." msgstr "" -#: ../../library/subprocess.rst:995 +#: ../../library/subprocess.rst:990 msgid "" "The new process has a new console, instead of inheriting its parent's " "console (the default)." msgstr "" -#: ../../library/subprocess.rst:1000 +#: ../../library/subprocess.rst:995 msgid "" "A :class:`Popen` ``creationflags`` parameter to specify that a new process " "group will be created. This flag is necessary for using :func:`os.kill` on " "the subprocess." msgstr "" -#: ../../library/subprocess.rst:1004 +#: ../../library/subprocess.rst:999 msgid "This flag is ignored if :data:`CREATE_NEW_CONSOLE` is specified." msgstr "" -#: ../../library/subprocess.rst:1008 +#: ../../library/subprocess.rst:1003 msgid "" "A :class:`Popen` ``creationflags`` parameter to specify that a new process " "will have an above average priority." msgstr "" -#: ../../library/subprocess.rst:1015 +#: ../../library/subprocess.rst:1010 msgid "" "A :class:`Popen` ``creationflags`` parameter to specify that a new process " "will have a below average priority." msgstr "" -#: ../../library/subprocess.rst:1022 +#: ../../library/subprocess.rst:1017 msgid "" "A :class:`Popen` ``creationflags`` parameter to specify that a new process " "will have a high priority." msgstr "" -#: ../../library/subprocess.rst:1029 +#: ../../library/subprocess.rst:1024 msgid "" "A :class:`Popen` ``creationflags`` parameter to specify that a new process " "will have an idle (lowest) priority." msgstr "" -#: ../../library/subprocess.rst:1036 +#: ../../library/subprocess.rst:1031 msgid "" "A :class:`Popen` ``creationflags`` parameter to specify that a new process " "will have an normal priority. (default)" msgstr "" -#: ../../library/subprocess.rst:1043 +#: ../../library/subprocess.rst:1038 msgid "" "A :class:`Popen` ``creationflags`` parameter to specify that a new process " "will have realtime priority. You should almost never use " @@ -1279,20 +1274,20 @@ msgid "" "perform brief tasks that should have limited interruptions." msgstr "" -#: ../../library/subprocess.rst:1054 +#: ../../library/subprocess.rst:1049 msgid "" "A :class:`Popen` ``creationflags`` parameter to specify that a new process " "will not create a window." msgstr "" -#: ../../library/subprocess.rst:1061 +#: ../../library/subprocess.rst:1056 msgid "" "A :class:`Popen` ``creationflags`` parameter to specify that a new process " "will not inherit its parent's console. This value cannot be used with " "CREATE_NEW_CONSOLE." msgstr "" -#: ../../library/subprocess.rst:1069 +#: ../../library/subprocess.rst:1064 msgid "" "A :class:`Popen` ``creationflags`` parameter to specify that a new process " "does not inherit the error mode of the calling process. Instead, the new " @@ -1300,39 +1295,39 @@ msgid "" "multithreaded shell applications that run with hard errors disabled." msgstr "" -#: ../../library/subprocess.rst:1079 +#: ../../library/subprocess.rst:1074 msgid "" "A :class:`Popen` ``creationflags`` parameter to specify that a new process " "is not associated with the job." msgstr "" -#: ../../library/subprocess.rst:1087 +#: ../../library/subprocess.rst:1082 msgid "Older high-level API" msgstr "" -#: ../../library/subprocess.rst:1089 +#: ../../library/subprocess.rst:1084 msgid "" "Prior to Python 3.5, these three functions comprised the high level API to " "subprocess. You can now use :func:`run` in many cases, but lots of existing " "code calls these functions." msgstr "" -#: ../../library/subprocess.rst:1096 +#: ../../library/subprocess.rst:1091 msgid "" "Run the command described by *args*. Wait for command to complete, then " "return the :attr:`~Popen.returncode` attribute." msgstr "" -#: ../../library/subprocess.rst:1099 ../../library/subprocess.rst:1129 +#: ../../library/subprocess.rst:1094 ../../library/subprocess.rst:1124 msgid "" "Code needing to capture stdout or stderr should use :func:`run` instead::" msgstr "" -#: ../../library/subprocess.rst:1103 ../../library/subprocess.rst:1133 +#: ../../library/subprocess.rst:1098 ../../library/subprocess.rst:1128 msgid "To suppress stdout or stderr, supply a value of :data:`DEVNULL`." msgstr "" -#: ../../library/subprocess.rst:1105 ../../library/subprocess.rst:1135 +#: ../../library/subprocess.rst:1100 ../../library/subprocess.rst:1130 msgid "" "The arguments shown above are merely some common ones. The full function " "signature is the same as that of the :class:`Popen` constructor - this " @@ -1340,14 +1335,14 @@ msgid "" "to that interface." msgstr "" -#: ../../library/subprocess.rst:1112 ../../library/subprocess.rst:1142 +#: ../../library/subprocess.rst:1107 ../../library/subprocess.rst:1137 msgid "" "Do not use ``stdout=PIPE`` or ``stderr=PIPE`` with this function. The child " "process will block if it generates enough output to a pipe to fill up the OS " "pipe buffer as the pipes are not being read from." msgstr "" -#: ../../library/subprocess.rst:1124 +#: ../../library/subprocess.rst:1119 msgid "" "Run command with arguments. Wait for command to complete. If the return " "code was zero then return, otherwise raise :exc:`CalledProcessError`. The :" @@ -1355,11 +1350,11 @@ msgid "" "`~CalledProcessError.returncode` attribute." msgstr "" -#: ../../library/subprocess.rst:1156 +#: ../../library/subprocess.rst:1151 msgid "Run command with arguments and return its output." msgstr "" -#: ../../library/subprocess.rst:1158 +#: ../../library/subprocess.rst:1153 msgid "" "If the return code was non-zero it raises a :exc:`CalledProcessError`. The :" "exc:`CalledProcessError` object will have the return code in the :attr:" @@ -1367,66 +1362,65 @@ msgid "" "`~CalledProcessError.output` attribute." msgstr "" -#: ../../library/subprocess.rst:1163 +#: ../../library/subprocess.rst:1158 msgid "This is equivalent to::" msgstr "" -#: ../../library/subprocess.rst:1167 +#: ../../library/subprocess.rst:1162 msgid "" "The arguments shown above are merely some common ones. The full function " "signature is largely the same as that of :func:`run` - most arguments are " -"passed directly through to that interface. One API deviation from :func:" -"`run` behavior exists: passing ``input=None`` will behave the same as " -"``input=b''`` (or ``input=''``, depending on other arguments) rather than " -"using the parent's standard input file handle." +"passed directly through to that interface. However, explicitly passing " +"``input=None`` to inherit the parent's standard input file handle is not " +"supported." msgstr "" -#: ../../library/subprocess.rst:1174 +#: ../../library/subprocess.rst:1168 msgid "" "By default, this function will return the data as encoded bytes. The actual " "encoding of the output data may depend on the command being invoked, so the " "decoding to text will often need to be handled at the application level." msgstr "" -#: ../../library/subprocess.rst:1178 +#: ../../library/subprocess.rst:1172 msgid "" "This behaviour may be overridden by setting *text*, *encoding*, *errors*, or " "*universal_newlines* to ``True`` as described in :ref:`frequently-used-" "arguments` and :func:`run`." msgstr "" -#: ../../library/subprocess.rst:1182 +#: ../../library/subprocess.rst:1176 msgid "" "To also capture standard error in the result, use ``stderr=subprocess." "STDOUT``::" msgstr "" -#: ../../library/subprocess.rst:1196 +#: ../../library/subprocess.rst:1190 msgid "Support for the *input* keyword argument was added." msgstr "" -#: ../../library/subprocess.rst:1199 +#: ../../library/subprocess.rst:1193 msgid "*encoding* and *errors* were added. See :func:`run` for details." msgstr "" -#: ../../library/subprocess.rst:1209 +#: ../../library/subprocess.rst:1203 msgid "Replacing Older Functions with the :mod:`subprocess` Module" msgstr "" -#: ../../library/subprocess.rst:1211 +#: ../../library/subprocess.rst:1205 msgid "" "In this section, \"a becomes b\" means that b can be used as a replacement " "for a." msgstr "" -#: ../../library/subprocess.rst:1215 +#: ../../library/subprocess.rst:1209 msgid "" "All \"a\" functions in this section fail (more or less) silently if the " "executed program cannot be found; the \"b\" replacements raise :exc:" "`OSError` instead." msgstr "" -#: ../../library/subprocess.rst:1219 +#: ../../library/subprocess.rst:1213 msgid "" "In addition, the replacements using :func:`check_output` will fail with a :" "exc:`CalledProcessError` if the requested operation produces a non-zero " @@ -1434,134 +1428,121 @@ msgid "" "output` attribute of the raised exception." msgstr "" -#: ../../library/subprocess.rst:1224 +#: ../../library/subprocess.rst:1218 msgid "" "In the following examples, we assume that the relevant functions have " "already been imported from the :mod:`subprocess` module." msgstr "" -#: ../../library/subprocess.rst:1229 +#: ../../library/subprocess.rst:1223 msgid "Replacing :program:`/bin/sh` shell command substitution" msgstr "" -#: ../../library/subprocess.rst:1235 ../../library/subprocess.rst:1246 -#: ../../library/subprocess.rst:1263 +#: ../../library/subprocess.rst:1229 ../../library/subprocess.rst:1240 +#: ../../library/subprocess.rst:1257 msgid "becomes::" msgstr "" -#: ../../library/subprocess.rst:1240 +#: ../../library/subprocess.rst:1234 msgid "Replacing shell pipeline" msgstr "" -#: ../../library/subprocess.rst:1253 +#: ../../library/subprocess.rst:1247 msgid "" "The ``p1.stdout.close()`` call after starting the p2 is important in order " "for p1 to receive a SIGPIPE if p2 exits before p1." msgstr "" -#: ../../library/subprocess.rst:1256 +#: ../../library/subprocess.rst:1250 msgid "" "Alternatively, for trusted input, the shell's own pipeline support may still " "be used directly:" msgstr "" -#: ../../library/subprocess.rst:1269 +#: ../../library/subprocess.rst:1263 msgid "Replacing :func:`os.system`" msgstr "" -#: ../../library/subprocess.rst:1277 +#: ../../library/subprocess.rst:1271 msgid "Notes:" msgstr "註解:" -#: ../../library/subprocess.rst:1279 +#: ../../library/subprocess.rst:1273 msgid "Calling the program through the shell is usually not required." msgstr "" -#: ../../library/subprocess.rst:1280 -msgid "" -"The :func:`call` return value is encoded differently to that of :func:`os." -"system`." -msgstr "" - -#: ../../library/subprocess.rst:1283 -msgid "" -"The :func:`os.system` function ignores SIGINT and SIGQUIT signals while the " -"command is running, but the caller must do this separately when using the :" -"mod:`subprocess` module." -msgstr "" - -#: ../../library/subprocess.rst:1287 +#: ../../library/subprocess.rst:1275 msgid "A more realistic example would look like this::" msgstr "" -#: ../../library/subprocess.rst:1300 +#: ../../library/subprocess.rst:1288 msgid "Replacing the :func:`os.spawn ` family" msgstr "" -#: ../../library/subprocess.rst:1302 +#: ../../library/subprocess.rst:1290 msgid "P_NOWAIT example::" msgstr "" -#: ../../library/subprocess.rst:1308 +#: ../../library/subprocess.rst:1296 msgid "P_WAIT example::" msgstr "" -#: ../../library/subprocess.rst:1314 +#: ../../library/subprocess.rst:1302 msgid "Vector example::" msgstr "" -#: ../../library/subprocess.rst:1320 +#: ../../library/subprocess.rst:1308 msgid "Environment example::" msgstr "" -#: ../../library/subprocess.rst:1329 +#: ../../library/subprocess.rst:1317 msgid "Replacing :func:`os.popen`, :func:`os.popen2`, :func:`os.popen3`" msgstr "" -#: ../../library/subprocess.rst:1359 +#: ../../library/subprocess.rst:1347 msgid "Return code handling translates as follows::" msgstr "" -#: ../../library/subprocess.rst:1375 +#: ../../library/subprocess.rst:1363 msgid "Replacing functions from the :mod:`popen2` module" msgstr "" -#: ../../library/subprocess.rst:1379 +#: ../../library/subprocess.rst:1367 msgid "" "If the cmd argument to popen2 functions is a string, the command is executed " "through /bin/sh. If it is a list, the command is directly executed." msgstr "" -#: ../../library/subprocess.rst:1398 +#: ../../library/subprocess.rst:1386 msgid "" ":class:`popen2.Popen3` and :class:`popen2.Popen4` basically work as :class:" "`subprocess.Popen`, except that:" msgstr "" -#: ../../library/subprocess.rst:1401 +#: ../../library/subprocess.rst:1389 msgid ":class:`Popen` raises an exception if the execution fails." msgstr "" -#: ../../library/subprocess.rst:1403 +#: ../../library/subprocess.rst:1391 msgid "The *capturestderr* argument is replaced with the *stderr* argument." msgstr "" -#: ../../library/subprocess.rst:1405 +#: ../../library/subprocess.rst:1393 msgid "``stdin=PIPE`` and ``stdout=PIPE`` must be specified." msgstr "" -#: ../../library/subprocess.rst:1407 +#: ../../library/subprocess.rst:1395 msgid "" "popen2 closes all file descriptors by default, but you have to specify " "``close_fds=True`` with :class:`Popen` to guarantee this behavior on all " "platforms or past Python versions." msgstr "" -#: ../../library/subprocess.rst:1413 +#: ../../library/subprocess.rst:1401 msgid "Legacy Shell Invocation Functions" msgstr "" -#: ../../library/subprocess.rst:1415 +#: ../../library/subprocess.rst:1403 msgid "" "This module also provides the following legacy functions from the 2.x " "``commands`` module. These operations implicitly invoke the system shell and " @@ -1569,92 +1550,92 @@ msgid "" "handling consistency are valid for these functions." msgstr "" -#: ../../library/subprocess.rst:1422 +#: ../../library/subprocess.rst:1410 msgid "Return ``(exitcode, output)`` of executing *cmd* in a shell." msgstr "" -#: ../../library/subprocess.rst:1424 +#: ../../library/subprocess.rst:1412 msgid "" "Execute the string *cmd* in a shell with :meth:`Popen.check_output` and " "return a 2-tuple ``(exitcode, output)``. The locale encoding is used; see " "the notes on :ref:`frequently-used-arguments` for more details." msgstr "" -#: ../../library/subprocess.rst:1428 +#: ../../library/subprocess.rst:1416 msgid "" "A trailing newline is stripped from the output. The exit code for the " "command can be interpreted as the return code of subprocess. Example::" msgstr "" -#: ../../library/subprocess.rst:1442 ../../library/subprocess.rst:1462 +#: ../../library/subprocess.rst:1430 ../../library/subprocess.rst:1450 msgid ":ref:`Availability `: POSIX & Windows." msgstr "" -#: ../../library/subprocess.rst:1443 +#: ../../library/subprocess.rst:1431 msgid "Windows support was added." msgstr "" -#: ../../library/subprocess.rst:1446 +#: ../../library/subprocess.rst:1434 msgid "" "The function now returns (exitcode, output) instead of (status, output) as " "it did in Python 3.3.3 and earlier. exitcode has the same value as :attr:" "`~Popen.returncode`." msgstr "" -#: ../../library/subprocess.rst:1453 +#: ../../library/subprocess.rst:1441 msgid "Return output (stdout and stderr) of executing *cmd* in a shell." msgstr "" -#: ../../library/subprocess.rst:1455 +#: ../../library/subprocess.rst:1443 msgid "" "Like :func:`getstatusoutput`, except the exit code is ignored and the return " "value is a string containing the command's output. Example::" msgstr "" -#: ../../library/subprocess.rst:1463 +#: ../../library/subprocess.rst:1451 msgid "Windows support added" msgstr "" -#: ../../library/subprocess.rst:1468 +#: ../../library/subprocess.rst:1456 msgid "Notes" msgstr "註解" -#: ../../library/subprocess.rst:1473 +#: ../../library/subprocess.rst:1461 msgid "Converting an argument sequence to a string on Windows" msgstr "" -#: ../../library/subprocess.rst:1475 +#: ../../library/subprocess.rst:1463 msgid "" "On Windows, an *args* sequence is converted to a string that can be parsed " "using the following rules (which correspond to the rules used by the MS C " "runtime):" msgstr "" -#: ../../library/subprocess.rst:1479 +#: ../../library/subprocess.rst:1467 msgid "" "Arguments are delimited by white space, which is either a space or a tab." msgstr "" -#: ../../library/subprocess.rst:1482 +#: ../../library/subprocess.rst:1470 msgid "" "A string surrounded by double quotation marks is interpreted as a single " "argument, regardless of white space contained within. A quoted string can " "be embedded in an argument." msgstr "" -#: ../../library/subprocess.rst:1487 +#: ../../library/subprocess.rst:1475 msgid "" "A double quotation mark preceded by a backslash is interpreted as a literal " "double quotation mark." msgstr "" -#: ../../library/subprocess.rst:1490 +#: ../../library/subprocess.rst:1478 msgid "" "Backslashes are interpreted literally, unless they immediately precede a " "double quotation mark." msgstr "" -#: ../../library/subprocess.rst:1493 +#: ../../library/subprocess.rst:1481 msgid "" "If backslashes immediately precede a double quotation mark, every pair of " "backslashes is interpreted as a literal backslash. If the number of " @@ -1662,10 +1643,10 @@ msgid "" "mark as described in rule 3." msgstr "" -#: ../../library/subprocess.rst:1502 +#: ../../library/subprocess.rst:1490 msgid ":mod:`shlex`" msgstr "" -#: ../../library/subprocess.rst:1503 +#: ../../library/subprocess.rst:1491 msgid "Module which provides function to parse and escape command lines." msgstr "" diff --git a/library/symtable.po b/library/symtable.po index 62df310a85..fae90c4e3d 100644 --- a/library/symtable.po +++ b/library/symtable.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.7\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2021-09-07 06:52+0000\n" +"POT-Creation-Date: 2020-06-20 18:08+0800\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-" @@ -178,45 +178,41 @@ msgid "Return ``True`` if the symbol is local to its block." msgstr "" #: ../../library/symtable.rst:161 -msgid "Return ``True`` if the symbol is annotated." -msgstr "" - -#: ../../library/symtable.rst:167 msgid "" "Return ``True`` if the symbol is referenced in its block, but not assigned " "to." msgstr "" -#: ../../library/symtable.rst:172 +#: ../../library/symtable.rst:166 msgid "Return ``True`` if the symbol is assigned to in its block." msgstr "" -#: ../../library/symtable.rst:176 +#: ../../library/symtable.rst:170 msgid "Return ``True`` if name binding introduces new namespace." msgstr "" -#: ../../library/symtable.rst:178 +#: ../../library/symtable.rst:172 msgid "" "If the name is used as the target of a function or class statement, this " "will be true." msgstr "" -#: ../../library/symtable.rst:181 +#: ../../library/symtable.rst:175 msgid "For example::" msgstr "" -#: ../../library/symtable.rst:187 +#: ../../library/symtable.rst:181 msgid "" "Note that a single name can be bound to multiple objects. If the result is " "``True``, the name may also be bound to other objects, like an int or list, " "that does not introduce a new namespace." msgstr "" -#: ../../library/symtable.rst:193 +#: ../../library/symtable.rst:187 msgid "Return a list of namespaces bound to this name." msgstr "" -#: ../../library/symtable.rst:197 +#: ../../library/symtable.rst:191 msgid "" "Return the namespace bound to this name. If more than one namespace is " "bound, :exc:`ValueError` is raised." diff --git a/library/sys.po b/library/sys.po index 72b990a597..a9fb98fe43 100644 --- a/library/sys.po +++ b/library/sys.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.7\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2021-09-07 06:52+0000\n" +"POT-Creation-Date: 2020-06-20 18:08+0800\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-" @@ -44,7 +44,7 @@ msgstr "" #: ../../library/sys.rst:28 msgid "" "Append the callable *hook* to the list of active auditing hooks for the " -"current (sub)interpreter." +"current interpreter." msgstr "" #: ../../library/sys.rst:31 @@ -52,46 +52,38 @@ msgid "" "When an auditing event is raised through the :func:`sys.audit` function, " "each hook will be called in the order it was added with the event name and " "the tuple of arguments. Native hooks added by :c:func:`PySys_AddAuditHook` " -"are called first, followed by hooks added in the current (sub)interpreter. " -"Hooks can then log the event, raise an exception to abort the operation, or " -"terminate the process entirely." +"are called first, followed by hooks added in the current interpreter." msgstr "" -#: ../../library/sys.rst:38 +#: ../../library/sys.rst:None msgid "" "Raises an :ref:`auditing event ` ``sys.addaudithook`` with no " "arguments." msgstr "" -#: ../../library/sys.rst:40 +#: ../../library/sys.rst:38 msgid "" -"Calling :func:`sys.addaudithook` will itself raise an auditing event named " -"``sys.addaudithook`` with no arguments. If any existing hooks raise an " -"exception derived from :class:`RuntimeError`, the new hook will not be added " -"and the exception suppressed. As a result, callers cannot assume that their " -"hook has been added unless they control all existing hooks." +"Raise an auditing event ``sys.addaudithook`` with no arguments. If any " +"existing hooks raise an exception derived from :class:`RuntimeError`, the " +"new hook will not be added and the exception suppressed. As a result, " +"callers cannot assume that their hook has been added unless they control all " +"existing hooks." msgstr "" -#: ../../library/sys.rst:47 -msgid "" -"See the :ref:`audit events table ` for all events raised by " -"CPython, and :pep:`578` for the original design discussion." -msgstr "" - -#: ../../library/sys.rst:54 +#: ../../library/sys.rst:48 msgid "" "Exceptions derived from :class:`Exception` but not :class:`RuntimeError` are " "no longer suppressed." msgstr "" -#: ../../library/sys.rst:59 +#: ../../library/sys.rst:53 msgid "" "When tracing is enabled (see :func:`settrace`), Python hooks are only traced " "if the callable has a ``__cantrace__`` member that is set to a true value. " "Otherwise, trace functions will skip the hook." msgstr "" -#: ../../library/sys.rst:66 +#: ../../library/sys.rst:60 msgid "" "The list of command line arguments passed to a Python script. ``argv[0]`` is " "the script name (it is operating system dependent whether this is a full " @@ -101,13 +93,13 @@ msgid "" "is the empty string." msgstr "" -#: ../../library/sys.rst:72 +#: ../../library/sys.rst:66 msgid "" "To loop over the standard input, or the list of files given on the command " "line, see the :mod:`fileinput` module." msgstr "" -#: ../../library/sys.rst:76 +#: ../../library/sys.rst:70 msgid "" "On Unix, command line arguments are passed by bytes from OS. Python decodes " "them with filesystem encoding and \"surrogateescape\" error handler. When " @@ -115,50 +107,40 @@ msgid "" "sys.argv]``." msgstr "" -#: ../../library/sys.rst:88 -msgid "" -"Raise an auditing event and trigger any active auditing hooks. *event* is a " -"string identifying the event, and *args* may contain optional arguments with " -"more information about the event. The number and types of arguments for a " -"given event are considered a public and stable API and should not be " -"modified between releases." -msgstr "" - -#: ../../library/sys.rst:94 +#: ../../library/sys.rst:82 msgid "" -"For example, one auditing event is named ``os.chdir``. This event has one " -"argument called *path* that will contain the requested new working directory." +"Raise an auditing event with any active hooks. The event name is a string " +"identifying the event and its associated schema, which is the number and " +"types of arguments. The schema for a given event is considered public and " +"stable API and should not be modified between releases." msgstr "" -#: ../../library/sys.rst:98 +#: ../../library/sys.rst:87 msgid "" -":func:`sys.audit` will call the existing auditing hooks, passing the event " -"name and arguments, and will re-raise the first exception from any hook. In " -"general, if an exception is raised, it should not be handled and the process " -"should be terminated as quickly as possible. This allows hook " -"implementations to decide how to respond to particular events: they can " -"merely log the event or abort the operation by raising an exception." +"This function will raise the first exception raised by any hook. In general, " +"these errors should not be handled and should terminate the process as " +"quickly as possible." msgstr "" -#: ../../library/sys.rst:106 +#: ../../library/sys.rst:91 msgid "" "Hooks are added using the :func:`sys.addaudithook` or :c:func:" "`PySys_AddAuditHook` functions." msgstr "" -#: ../../library/sys.rst:109 +#: ../../library/sys.rst:94 msgid "" "The native equivalent of this function is :c:func:`PySys_Audit`. Using the " "native function is preferred when possible." msgstr "" -#: ../../library/sys.rst:112 +#: ../../library/sys.rst:97 msgid "" "See the :ref:`audit events table ` for all events raised by " "CPython." msgstr "" -#: ../../library/sys.rst:120 +#: ../../library/sys.rst:105 msgid "" "Set during Python startup, before ``site.py`` is run, to the same value as :" "data:`exec_prefix`. If not running in a :ref:`virtual environment `, " @@ -180,44 +162,44 @@ msgid "" "Python installation (the one which the virtual environment was created from)." msgstr "" -#: ../../library/sys.rst:147 +#: ../../library/sys.rst:132 msgid "" "An indicator of the native byte order. This will have the value ``'big'`` " "on big-endian (most-significant byte first) platforms, and ``'little'`` on " "little-endian (least-significant byte first) platforms." msgstr "" -#: ../../library/sys.rst:154 +#: ../../library/sys.rst:139 msgid "" "A tuple of strings giving the names of all modules that are compiled into " "this Python interpreter. (This information is not available in any other " "way --- ``modules.keys()`` only lists the imported modules.)" msgstr "" -#: ../../library/sys.rst:161 +#: ../../library/sys.rst:146 msgid "" "Call ``func(*args)``, while tracing is enabled. The tracing state is saved, " "and restored afterwards. This is intended to be called from a debugger from " "a checkpoint, to recursively debug some other code." msgstr "" -#: ../../library/sys.rst:168 +#: ../../library/sys.rst:153 msgid "A string containing the copyright pertaining to the Python interpreter." msgstr "" -#: ../../library/sys.rst:173 +#: ../../library/sys.rst:158 msgid "" "Clear the internal type cache. The type cache is used to speed up attribute " "and method lookups. Use the function *only* to drop unnecessary references " "during reference leak debugging." msgstr "" -#: ../../library/sys.rst:177 ../../library/sys.rst:193 +#: ../../library/sys.rst:162 ../../library/sys.rst:178 msgid "" "This function should be used for internal and specialized purposes only." msgstr "" -#: ../../library/sys.rst:182 +#: ../../library/sys.rst:167 msgid "" "Return a dictionary mapping each thread's identifier to the topmost stack " "frame currently active in that thread at the time the function is called. " @@ -225,7 +207,7 @@ msgid "" "given such a frame." msgstr "" -#: ../../library/sys.rst:187 +#: ../../library/sys.rst:172 msgid "" "This is most useful for debugging deadlock: this function does not require " "the deadlocked threads' cooperation, and such threads' call stacks are " @@ -234,20 +216,20 @@ msgid "" "by the time calling code examines the frame." msgstr "" -#: ../../library/sys.rst:195 +#: ../../library/sys.rst:180 msgid "" "Raises an :ref:`auditing event ` ``sys._current_frames`` with no " "arguments." msgstr "" -#: ../../library/sys.rst:200 +#: ../../library/sys.rst:185 msgid "" "This hook function is called by built-in :func:`breakpoint`. By default, it " "drops you into the :mod:`pdb` debugger, but it can be set to any other " "function so that you can choose which debugger gets used." msgstr "" -#: ../../library/sys.rst:204 +#: ../../library/sys.rst:189 msgid "" "The signature of this function is dependent on what it calls. For example, " "the default binding (e.g. ``pdb.set_trace()``) expects no arguments, but you " @@ -257,7 +239,7 @@ msgid "" "returns is returned from ``breakpoint()``." msgstr "" -#: ../../library/sys.rst:211 +#: ../../library/sys.rst:196 msgid "" "The default implementation first consults the environment variable :envvar:" "`PYTHONBREAKPOINT`. If that is set to ``\"0\"`` then this function returns " @@ -271,47 +253,47 @@ msgid "" "breakpointhook()`` returns to the built-in :func:`breakpoint` function." msgstr "" -#: ../../library/sys.rst:223 +#: ../../library/sys.rst:208 msgid "" "Note that if anything goes wrong while importing the callable named by :" "envvar:`PYTHONBREAKPOINT`, a :exc:`RuntimeWarning` is reported and the " "breakpoint is ignored." msgstr "" -#: ../../library/sys.rst:227 +#: ../../library/sys.rst:212 msgid "" "Also note that if ``sys.breakpointhook()`` is overridden programmatically, :" "envvar:`PYTHONBREAKPOINT` is *not* consulted." msgstr "" -#: ../../library/sys.rst:234 +#: ../../library/sys.rst:219 msgid "" "Print low-level information to stderr about the state of CPython's memory " "allocator." msgstr "" -#: ../../library/sys.rst:237 +#: ../../library/sys.rst:222 msgid "" "If Python is configured --with-pydebug, it also performs some expensive " "internal consistency checks." msgstr "" -#: ../../library/sys.rst:244 +#: ../../library/sys.rst:229 msgid "" "This function is specific to CPython. The exact output format is not " "defined here, and may change." msgstr "" -#: ../../library/sys.rst:250 +#: ../../library/sys.rst:235 msgid "Integer specifying the handle of the Python DLL." msgstr "" -#: ../../library/sys.rst:252 ../../library/sys.rst:791 -#: ../../library/sys.rst:1454 ../../library/sys.rst:1666 +#: ../../library/sys.rst:237 ../../library/sys.rst:771 +#: ../../library/sys.rst:1434 ../../library/sys.rst:1646 msgid ":ref:`Availability `: Windows." msgstr "" -#: ../../library/sys.rst:257 +#: ../../library/sys.rst:242 msgid "" "If *value* is not ``None``, this function prints ``repr(value)`` to ``sys." "stdout``, and saves *value* in ``builtins._``. If ``repr(value)`` is not " @@ -320,7 +302,7 @@ msgid "" "encoding`` with ``'backslashreplace'`` error handler." msgstr "" -#: ../../library/sys.rst:263 +#: ../../library/sys.rst:248 msgid "" "``sys.displayhook`` is called on the result of evaluating an :term:" "`expression` entered in an interactive Python session. The display of these " @@ -328,15 +310,15 @@ msgid "" "displayhook``." msgstr "" -#: ../../library/sys.rst:267 +#: ../../library/sys.rst:252 msgid "Pseudo-code::" msgstr "" -#: ../../library/sys.rst:287 +#: ../../library/sys.rst:272 msgid "Use ``'backslashreplace'`` error handler on :exc:`UnicodeEncodeError`." msgstr "" -#: ../../library/sys.rst:293 +#: ../../library/sys.rst:278 msgid "" "If this is true, Python won't try to write ``.pyc`` files on the import of " "source modules. This value is initially set to ``True`` or ``False`` " @@ -345,7 +327,7 @@ msgid "" "to control bytecode file generation." msgstr "" -#: ../../library/sys.rst:302 +#: ../../library/sys.rst:287 msgid "" "If this is set (not ``None``), Python will write bytecode-cache ``.pyc`` " "files to (and read them from) a parallel directory tree rooted at this " @@ -356,12 +338,12 @@ msgid "" "the same pycache prefix (if any) that you will use at runtime." msgstr "" -#: ../../library/sys.rst:310 +#: ../../library/sys.rst:295 msgid "" "A relative path is interpreted relative to the current working directory." msgstr "" -#: ../../library/sys.rst:312 +#: ../../library/sys.rst:297 msgid "" "This value is initially set based on the value of the :option:`-X` " "``pycache_prefix=PATH`` command-line option or the :envvar:" @@ -369,12 +351,12 @@ msgid "" "If neither are set, it is ``None``." msgstr "" -#: ../../library/sys.rst:322 +#: ../../library/sys.rst:307 msgid "" "This function prints out a given traceback and exception to ``sys.stderr``." msgstr "" -#: ../../library/sys.rst:324 +#: ../../library/sys.rst:309 msgid "" "When an exception is raised and uncaught, the interpreter calls ``sys." "excepthook`` with three arguments, the exception class, exception instance, " @@ -385,13 +367,13 @@ msgid "" "excepthook``." msgstr "" -#: ../../library/sys.rst:331 +#: ../../library/sys.rst:None msgid "" "Raises an :ref:`auditing event ` ``sys.excepthook`` with arguments " "``hook``, ``type``, ``value``, ``traceback``." msgstr "" -#: ../../library/sys.rst:333 +#: ../../library/sys.rst:318 msgid "" "Raise an auditing event ``sys.excepthook`` with arguments ``hook``, " "``type``, ``value``, ``traceback`` when an uncaught exception occurs. If no " @@ -401,14 +383,14 @@ msgid "" "excepthook`` will be called." msgstr "" -#: ../../library/sys.rst:342 +#: ../../library/sys.rst:327 msgid "" "The :func:`sys.unraisablehook` function handles unraisable exceptions and " "the :func:`threading.excepthook` function handles exception raised by :func:" "`threading.Thread.run`." msgstr "" -#: ../../library/sys.rst:352 +#: ../../library/sys.rst:337 msgid "" "These objects contain the original values of ``breakpointhook``, " "``displayhook``, ``excepthook``, and ``unraisablehook`` at the start of the " @@ -417,15 +399,15 @@ msgid "" "get replaced with broken or alternative objects." msgstr "" -#: ../../library/sys.rst:358 +#: ../../library/sys.rst:343 msgid "__breakpointhook__" msgstr "" -#: ../../library/sys.rst:361 +#: ../../library/sys.rst:346 msgid "__unraisablehook__" msgstr "" -#: ../../library/sys.rst:366 +#: ../../library/sys.rst:351 msgid "" "This function returns a tuple of three values that give information about " "the exception that is currently being handled. The information returned is " @@ -437,7 +419,7 @@ msgid "" "information about the exception being currently handled is accessible." msgstr "" -#: ../../library/sys.rst:377 +#: ../../library/sys.rst:362 msgid "" "If no exception is being handled anywhere on the stack, a tuple containing " "three ``None`` values is returned. Otherwise, the values returned are " @@ -448,7 +430,7 @@ msgid "" "stack at the point where the exception originally occurred." msgstr "" -#: ../../library/sys.rst:388 +#: ../../library/sys.rst:373 msgid "" "A string giving the site-specific directory prefix where the platform-" "dependent Python files are installed; by default, this is also ``'/usr/" @@ -460,7 +442,7 @@ msgid "" "is the version number of Python, for example ``3.2``." msgstr "" -#: ../../library/sys.rst:399 +#: ../../library/sys.rst:384 msgid "" "If a :ref:`virtual environment ` is in effect, this value will be " "changed in ``site.py`` to point to the virtual environment. The value for " @@ -468,7 +450,7 @@ msgid "" "`base_exec_prefix`." msgstr "" -#: ../../library/sys.rst:407 +#: ../../library/sys.rst:392 msgid "" "A string giving the absolute path of the executable binary for the Python " "interpreter, on systems where this makes sense. If Python is unable to " @@ -476,7 +458,7 @@ msgid "" "empty string or ``None``." msgstr "" -#: ../../library/sys.rst:415 +#: ../../library/sys.rst:400 msgid "" "Exit from Python. This is implemented by raising the :exc:`SystemExit` " "exception, so cleanup actions specified by finally clauses of :keyword:`try` " @@ -484,7 +466,7 @@ msgid "" "an outer level." msgstr "" -#: ../../library/sys.rst:420 +#: ../../library/sys.rst:405 msgid "" "The optional argument *arg* can be an integer giving the exit status " "(defaulting to zero), or another type of object. If it is an integer, zero " @@ -500,175 +482,175 @@ msgid "" "way to exit a program when an error occurs." msgstr "" -#: ../../library/sys.rst:433 +#: ../../library/sys.rst:418 msgid "" "Since :func:`exit` ultimately \"only\" raises an exception, it will only " "exit the process when called from the main thread, and the exception is not " "intercepted." msgstr "" -#: ../../library/sys.rst:437 +#: ../../library/sys.rst:422 msgid "" "If an error occurs in the cleanup after the Python interpreter has caught :" "exc:`SystemExit` (such as an error flushing buffered data in the standard " "streams), the exit status is changed to 120." msgstr "" -#: ../../library/sys.rst:445 +#: ../../library/sys.rst:430 msgid "" "The :term:`named tuple` *flags* exposes the status of command line flags. " "The attributes are read only." msgstr "" -#: ../../library/sys.rst:449 ../../library/sys.rst:498 -#: ../../library/sys.rst:836 +#: ../../library/sys.rst:434 ../../library/sys.rst:483 +#: ../../library/sys.rst:816 msgid "attribute" msgstr "" -#: ../../library/sys.rst:449 +#: ../../library/sys.rst:434 msgid "flag" msgstr "" -#: ../../library/sys.rst:451 +#: ../../library/sys.rst:436 msgid ":const:`debug`" msgstr "" -#: ../../library/sys.rst:451 +#: ../../library/sys.rst:436 msgid ":option:`-d`" msgstr "" -#: ../../library/sys.rst:452 +#: ../../library/sys.rst:437 msgid ":const:`inspect`" msgstr "" -#: ../../library/sys.rst:452 ../../library/sys.rst:453 +#: ../../library/sys.rst:437 ../../library/sys.rst:438 msgid ":option:`-i`" msgstr "" -#: ../../library/sys.rst:453 +#: ../../library/sys.rst:438 msgid ":const:`interactive`" msgstr "" -#: ../../library/sys.rst:454 +#: ../../library/sys.rst:439 msgid ":const:`isolated`" msgstr "" -#: ../../library/sys.rst:454 +#: ../../library/sys.rst:439 msgid ":option:`-I`" msgstr "" -#: ../../library/sys.rst:455 +#: ../../library/sys.rst:440 msgid ":const:`optimize`" msgstr "" -#: ../../library/sys.rst:455 +#: ../../library/sys.rst:440 msgid ":option:`-O` or :option:`-OO`" msgstr "" -#: ../../library/sys.rst:456 +#: ../../library/sys.rst:441 msgid ":const:`dont_write_bytecode`" msgstr "" -#: ../../library/sys.rst:456 +#: ../../library/sys.rst:441 msgid ":option:`-B`" msgstr "" -#: ../../library/sys.rst:457 +#: ../../library/sys.rst:442 msgid ":const:`no_user_site`" msgstr "" -#: ../../library/sys.rst:457 +#: ../../library/sys.rst:442 msgid ":option:`-s`" msgstr "" -#: ../../library/sys.rst:458 +#: ../../library/sys.rst:443 msgid ":const:`no_site`" msgstr "" -#: ../../library/sys.rst:458 +#: ../../library/sys.rst:443 msgid ":option:`-S`" msgstr "" -#: ../../library/sys.rst:459 +#: ../../library/sys.rst:444 msgid ":const:`ignore_environment`" msgstr "" -#: ../../library/sys.rst:459 +#: ../../library/sys.rst:444 msgid ":option:`-E`" msgstr "" -#: ../../library/sys.rst:460 +#: ../../library/sys.rst:445 msgid ":const:`verbose`" msgstr "" -#: ../../library/sys.rst:460 +#: ../../library/sys.rst:445 msgid ":option:`-v`" msgstr "" -#: ../../library/sys.rst:461 +#: ../../library/sys.rst:446 msgid ":const:`bytes_warning`" msgstr "" -#: ../../library/sys.rst:461 +#: ../../library/sys.rst:446 msgid ":option:`-b`" msgstr "" -#: ../../library/sys.rst:462 +#: ../../library/sys.rst:447 msgid ":const:`quiet`" msgstr "" -#: ../../library/sys.rst:462 +#: ../../library/sys.rst:447 msgid ":option:`-q`" msgstr "" -#: ../../library/sys.rst:463 +#: ../../library/sys.rst:448 msgid ":const:`hash_randomization`" msgstr "" -#: ../../library/sys.rst:463 +#: ../../library/sys.rst:448 msgid ":option:`-R`" msgstr "" -#: ../../library/sys.rst:464 +#: ../../library/sys.rst:449 msgid ":const:`dev_mode`" msgstr "" -#: ../../library/sys.rst:464 +#: ../../library/sys.rst:449 msgid ":option:`-X dev <-X>` (:ref:`Python Development Mode `)" msgstr "" -#: ../../library/sys.rst:465 +#: ../../library/sys.rst:450 msgid ":const:`utf8_mode`" msgstr "" -#: ../../library/sys.rst:465 +#: ../../library/sys.rst:450 msgid ":option:`-X utf8 <-X>`" msgstr "" -#: ../../library/sys.rst:468 +#: ../../library/sys.rst:453 msgid "Added ``quiet`` attribute for the new :option:`-q` flag." msgstr "" -#: ../../library/sys.rst:471 +#: ../../library/sys.rst:456 msgid "The ``hash_randomization`` attribute." msgstr "" -#: ../../library/sys.rst:474 +#: ../../library/sys.rst:459 msgid "Removed obsolete ``division_warning`` attribute." msgstr "" -#: ../../library/sys.rst:477 +#: ../../library/sys.rst:462 msgid "Added ``isolated`` attribute for :option:`-I` ``isolated`` flag." msgstr "" -#: ../../library/sys.rst:480 +#: ../../library/sys.rst:465 msgid "" "Added the ``dev_mode`` attribute for the new :ref:`Python Development Mode " "` and the ``utf8_mode`` attribute for the new :option:`-X` " "``utf8`` flag." msgstr "" -#: ../../library/sys.rst:488 +#: ../../library/sys.rst:473 msgid "" "A :term:`named tuple` holding information about the float type. It contains " "low level information about the precision and internal representation. The " @@ -678,163 +660,163 @@ msgid "" "floating types', for details." msgstr "" -#: ../../library/sys.rst:498 +#: ../../library/sys.rst:483 msgid "float.h macro" msgstr "" -#: ../../library/sys.rst:498 ../../library/sys.rst:836 +#: ../../library/sys.rst:483 ../../library/sys.rst:816 msgid "explanation" msgstr "" -#: ../../library/sys.rst:500 +#: ../../library/sys.rst:485 msgid ":const:`epsilon`" msgstr "" -#: ../../library/sys.rst:500 +#: ../../library/sys.rst:485 msgid "DBL_EPSILON" msgstr "" -#: ../../library/sys.rst:500 +#: ../../library/sys.rst:485 msgid "" "difference between 1.0 and the least value greater than 1.0 that is " "representable as a float" msgstr "" -#: ../../library/sys.rst:503 +#: ../../library/sys.rst:488 msgid "See also :func:`math.ulp`." msgstr "" -#: ../../library/sys.rst:505 +#: ../../library/sys.rst:490 msgid ":const:`dig`" msgstr "" -#: ../../library/sys.rst:505 +#: ../../library/sys.rst:490 msgid "DBL_DIG" msgstr "" -#: ../../library/sys.rst:505 +#: ../../library/sys.rst:490 msgid "" "maximum number of decimal digits that can be faithfully represented in a " "float; see below" msgstr "" -#: ../../library/sys.rst:508 +#: ../../library/sys.rst:493 msgid ":const:`mant_dig`" msgstr "" -#: ../../library/sys.rst:508 +#: ../../library/sys.rst:493 msgid "DBL_MANT_DIG" msgstr "" -#: ../../library/sys.rst:508 +#: ../../library/sys.rst:493 msgid "" "float precision: the number of base-``radix`` digits in the significand of a " "float" msgstr "" -#: ../../library/sys.rst:511 +#: ../../library/sys.rst:496 msgid ":const:`max`" msgstr "" -#: ../../library/sys.rst:511 +#: ../../library/sys.rst:496 msgid "DBL_MAX" msgstr "" -#: ../../library/sys.rst:511 +#: ../../library/sys.rst:496 msgid "maximum representable positive finite float" msgstr "" -#: ../../library/sys.rst:513 +#: ../../library/sys.rst:498 msgid ":const:`max_exp`" msgstr "" -#: ../../library/sys.rst:513 +#: ../../library/sys.rst:498 msgid "DBL_MAX_EXP" msgstr "" -#: ../../library/sys.rst:513 +#: ../../library/sys.rst:498 msgid "" "maximum integer *e* such that ``radix**(e-1)`` is a representable finite " "float" msgstr "" -#: ../../library/sys.rst:516 +#: ../../library/sys.rst:501 msgid ":const:`max_10_exp`" msgstr "" -#: ../../library/sys.rst:516 +#: ../../library/sys.rst:501 msgid "DBL_MAX_10_EXP" msgstr "" -#: ../../library/sys.rst:516 +#: ../../library/sys.rst:501 msgid "" "maximum integer *e* such that ``10**e`` is in the range of representable " "finite floats" msgstr "" -#: ../../library/sys.rst:519 +#: ../../library/sys.rst:504 msgid ":const:`min`" msgstr "" -#: ../../library/sys.rst:519 +#: ../../library/sys.rst:504 msgid "DBL_MIN" msgstr "" -#: ../../library/sys.rst:519 +#: ../../library/sys.rst:504 msgid "minimum representable positive *normalized* float" msgstr "" -#: ../../library/sys.rst:521 +#: ../../library/sys.rst:506 msgid "" "Use :func:`math.ulp(0.0) ` to get the smallest positive " "*denormalized* representable float." msgstr "" -#: ../../library/sys.rst:525 +#: ../../library/sys.rst:510 msgid ":const:`min_exp`" msgstr "" -#: ../../library/sys.rst:525 +#: ../../library/sys.rst:510 msgid "DBL_MIN_EXP" msgstr "" -#: ../../library/sys.rst:525 +#: ../../library/sys.rst:510 msgid "minimum integer *e* such that ``radix**(e-1)`` is a normalized float" msgstr "" -#: ../../library/sys.rst:528 +#: ../../library/sys.rst:513 msgid ":const:`min_10_exp`" msgstr "" -#: ../../library/sys.rst:528 +#: ../../library/sys.rst:513 msgid "DBL_MIN_10_EXP" msgstr "" -#: ../../library/sys.rst:528 +#: ../../library/sys.rst:513 msgid "minimum integer *e* such that ``10**e`` is a normalized float" msgstr "" -#: ../../library/sys.rst:531 +#: ../../library/sys.rst:516 msgid ":const:`radix`" msgstr "" -#: ../../library/sys.rst:531 +#: ../../library/sys.rst:516 msgid "FLT_RADIX" msgstr "" -#: ../../library/sys.rst:531 +#: ../../library/sys.rst:516 msgid "radix of exponent representation" msgstr "" -#: ../../library/sys.rst:533 +#: ../../library/sys.rst:518 msgid ":const:`rounds`" msgstr "" -#: ../../library/sys.rst:533 +#: ../../library/sys.rst:518 msgid "FLT_ROUNDS" msgstr "" -#: ../../library/sys.rst:533 +#: ../../library/sys.rst:518 msgid "" "integer constant representing the rounding mode used for arithmetic " "operations. This reflects the value of the system FLT_ROUNDS macro at " @@ -842,7 +824,7 @@ msgid "" "explanation of the possible values and their meanings." msgstr "" -#: ../../library/sys.rst:541 +#: ../../library/sys.rst:526 msgid "" "The attribute :attr:`sys.float_info.dig` needs further explanation. If " "``s`` is any string representing a decimal number with at most :attr:`sys." @@ -850,13 +832,13 @@ msgid "" "back again will recover a string representing the same decimal value::" msgstr "" -#: ../../library/sys.rst:554 +#: ../../library/sys.rst:539 msgid "" "But for strings with more than :attr:`sys.float_info.dig` significant " "digits, this isn't always true::" msgstr "" -#: ../../library/sys.rst:563 +#: ../../library/sys.rst:548 msgid "" "A string indicating how the :func:`repr` function behaves for floats. If " "the string has value ``'short'`` then for a finite float ``x``, ``repr(x)`` " @@ -866,7 +848,7 @@ msgid "" "same way as it did in versions of Python prior to 3.1." msgstr "" -#: ../../library/sys.rst:576 +#: ../../library/sys.rst:561 msgid "" "Return the number of memory blocks currently allocated by the interpreter, " "regardless of their size. This function is mainly useful for tracking and " @@ -876,38 +858,38 @@ msgid "" "results." msgstr "" -#: ../../library/sys.rst:583 +#: ../../library/sys.rst:568 msgid "" "If a Python build or implementation cannot reasonably compute this " "information, :func:`getallocatedblocks()` is allowed to return 0 instead." msgstr "" -#: ../../library/sys.rst:591 +#: ../../library/sys.rst:576 msgid "Return the build time API version of Android as an integer." msgstr "" -#: ../../library/sys.rst:594 +#: ../../library/sys.rst:579 msgid ":ref:`Availability `: Android." msgstr "" -#: ../../library/sys.rst:600 +#: ../../library/sys.rst:585 msgid "" "Return the name of the current default string encoding used by the Unicode " "implementation." msgstr "" -#: ../../library/sys.rst:606 +#: ../../library/sys.rst:591 msgid "" "Return the current value of the flags that are used for :c:func:`dlopen` " "calls. Symbolic names for the flag values can be found in the :mod:`os` " "module (``RTLD_xxx`` constants, e.g. :data:`os.RTLD_LAZY`)." msgstr "" -#: ../../library/sys.rst:611 ../../library/sys.rst:1227 +#: ../../library/sys.rst:596 ../../library/sys.rst:1207 msgid ":ref:`Availability `: Unix." msgstr "" -#: ../../library/sys.rst:616 +#: ../../library/sys.rst:601 msgid "" "Return the name of the encoding used to convert between Unicode filenames " "and bytes filenames. For best compatibility, str should be used for " @@ -916,71 +898,71 @@ msgid "" "str or bytes and internally convert to the system's preferred representation." msgstr "" -#: ../../library/sys.rst:623 +#: ../../library/sys.rst:608 msgid "This encoding is always ASCII-compatible." msgstr "" -#: ../../library/sys.rst:625 ../../library/sys.rst:658 +#: ../../library/sys.rst:610 ../../library/sys.rst:643 msgid "" ":func:`os.fsencode` and :func:`os.fsdecode` should be used to ensure that " "the correct encoding and errors mode are used." msgstr "" -#: ../../library/sys.rst:628 +#: ../../library/sys.rst:613 msgid "In the UTF-8 mode, the encoding is ``utf-8`` on any platform." msgstr "" -#: ../../library/sys.rst:630 +#: ../../library/sys.rst:615 msgid "On macOS, the encoding is ``'utf-8'``." msgstr "" -#: ../../library/sys.rst:632 +#: ../../library/sys.rst:617 msgid "On Unix, the encoding is the locale encoding." msgstr "" -#: ../../library/sys.rst:634 +#: ../../library/sys.rst:619 msgid "" "On Windows, the encoding may be ``'utf-8'`` or ``'mbcs'``, depending on user " "configuration." msgstr "" -#: ../../library/sys.rst:637 +#: ../../library/sys.rst:622 msgid "On Android, the encoding is ``'utf-8'``." msgstr "" -#: ../../library/sys.rst:639 +#: ../../library/sys.rst:624 msgid "On VxWorks, the encoding is ``'utf-8'``." msgstr "" -#: ../../library/sys.rst:641 +#: ../../library/sys.rst:626 msgid ":func:`getfilesystemencoding` result cannot be ``None`` anymore." msgstr "" -#: ../../library/sys.rst:644 +#: ../../library/sys.rst:629 msgid "" "Windows is no longer guaranteed to return ``'mbcs'``. See :pep:`529` and :" "func:`_enablelegacywindowsfsencoding` for more information." msgstr "" -#: ../../library/sys.rst:648 +#: ../../library/sys.rst:633 msgid "Return 'utf-8' in the UTF-8 mode." msgstr "" -#: ../../library/sys.rst:654 +#: ../../library/sys.rst:639 msgid "" "Return the name of the error mode used to convert between Unicode filenames " "and bytes filenames. The encoding name is returned from :func:" "`getfilesystemencoding`." msgstr "" -#: ../../library/sys.rst:665 +#: ../../library/sys.rst:650 msgid "" "Return the reference count of the *object*. The count returned is generally " "one higher than you might expect, because it includes the (temporary) " "reference as an argument to :func:`getrefcount`." msgstr "" -#: ../../library/sys.rst:672 +#: ../../library/sys.rst:657 msgid "" "Return the current value of the recursion limit, the maximum depth of the " "Python interpreter stack. This limit prevents infinite recursion from " @@ -988,46 +970,46 @@ msgid "" "func:`setrecursionlimit`." msgstr "" -#: ../../library/sys.rst:680 +#: ../../library/sys.rst:665 msgid "" "Return the size of an object in bytes. The object can be any type of object. " "All built-in objects will return correct results, but this does not have to " "hold true for third-party extensions as it is implementation specific." msgstr "" -#: ../../library/sys.rst:685 +#: ../../library/sys.rst:670 msgid "" "Only the memory consumption directly attributed to the object is accounted " "for, not the memory consumption of objects it refers to." msgstr "" -#: ../../library/sys.rst:688 +#: ../../library/sys.rst:673 msgid "" "If given, *default* will be returned if the object does not provide means to " "retrieve the size. Otherwise a :exc:`TypeError` will be raised." msgstr "" -#: ../../library/sys.rst:691 +#: ../../library/sys.rst:676 msgid "" ":func:`getsizeof` calls the object's ``__sizeof__`` method and adds an " "additional garbage collector overhead if the object is managed by the " "garbage collector." msgstr "" -#: ../../library/sys.rst:695 +#: ../../library/sys.rst:680 msgid "" "See `recursive sizeof recipe `_ " "for an example of using :func:`getsizeof` recursively to find the size of " "containers and all their contents." msgstr "" -#: ../../library/sys.rst:701 +#: ../../library/sys.rst:686 msgid "" "Return the interpreter's \"thread switch interval\"; see :func:" "`setswitchinterval`." msgstr "" -#: ../../library/sys.rst:709 +#: ../../library/sys.rst:694 msgid "" "Return a frame object from the call stack. If optional integer *depth* is " "given, return the frame object that many calls below the top of the stack. " @@ -1036,27 +1018,27 @@ msgid "" "stack." msgstr "" -#: ../../library/sys.rst:714 +#: ../../library/sys.rst:700 msgid "" "Raises an :ref:`auditing event ` ``sys._getframe`` with no " "arguments." msgstr "" -#: ../../library/sys.rst:718 +#: ../../library/sys.rst:703 msgid "" "This function should be used for internal and specialized purposes only. It " "is not guaranteed to exist in all implementations of Python." msgstr "" -#: ../../library/sys.rst:728 +#: ../../library/sys.rst:713 msgid "Get the profiler function as set by :func:`setprofile`." msgstr "" -#: ../../library/sys.rst:737 +#: ../../library/sys.rst:722 msgid "Get the trace function as set by :func:`settrace`." msgstr "" -#: ../../library/sys.rst:741 +#: ../../library/sys.rst:726 msgid "" "The :func:`gettrace` function is intended only for implementing debuggers, " "profilers, coverage tools and the like. Its behavior is part of the " @@ -1064,7 +1046,7 @@ msgid "" "thus may not be available in all Python implementations." msgstr "" -#: ../../library/sys.rst:749 +#: ../../library/sys.rst:734 msgid "" "Return a named tuple describing the Windows version currently running. The " "named elements are *major*, *minor*, *build*, *platform*, *service_pack*, " @@ -1076,79 +1058,72 @@ msgid "" "first 5 elements are retrievable by indexing." msgstr "" -#: ../../library/sys.rst:760 +#: ../../library/sys.rst:745 msgid "*platform* will be :const:`2 (VER_PLATFORM_WIN32_NT)`." msgstr "" -#: ../../library/sys.rst:762 +#: ../../library/sys.rst:747 msgid "*product_type* may be one of the following values:" msgstr "" -#: ../../library/sys.rst:765 +#: ../../library/sys.rst:750 msgid "Constant" msgstr "" -#: ../../library/sys.rst:765 +#: ../../library/sys.rst:750 msgid "Meaning" msgstr "" -#: ../../library/sys.rst:767 +#: ../../library/sys.rst:752 msgid ":const:`1 (VER_NT_WORKSTATION)`" msgstr "" -#: ../../library/sys.rst:767 +#: ../../library/sys.rst:752 msgid "The system is a workstation." msgstr "" -#: ../../library/sys.rst:769 +#: ../../library/sys.rst:754 msgid ":const:`2 (VER_NT_DOMAIN_CONTROLLER)`" msgstr "" -#: ../../library/sys.rst:769 +#: ../../library/sys.rst:754 msgid "The system is a domain controller." msgstr "" -#: ../../library/sys.rst:772 +#: ../../library/sys.rst:757 msgid ":const:`3 (VER_NT_SERVER)`" msgstr "" -#: ../../library/sys.rst:772 +#: ../../library/sys.rst:757 msgid "The system is a server, but not a domain controller." msgstr "" -#: ../../library/sys.rst:776 +#: ../../library/sys.rst:761 msgid "" "This function wraps the Win32 :c:func:`GetVersionEx` function; see the " "Microsoft documentation on :c:func:`OSVERSIONINFOEX` for more information " "about these fields." msgstr "" -#: ../../library/sys.rst:780 -msgid "" -"*platform_version* returns the major version, minor version and build number " -"of the current operating system, rather than the version that is being " -"emulated for the process. It is intended for use in logging rather than for " -"feature detection." -msgstr "" - -#: ../../library/sys.rst:786 +#: ../../library/sys.rst:765 msgid "" -"*platform_version* derives the version from kernel32.dll which can be of a " -"different version than the OS version. Please use :mod:`platform` module for " -"achieving accurate OS version." +"*platform_version* returns the accurate major version, minor version and " +"build number of the current operating system, rather than the version that " +"is being emulated for the process. It is intended for use in logging rather " +"than for feature detection." msgstr "" -#: ../../library/sys.rst:792 +#: ../../library/sys.rst:772 msgid "" "Changed to a named tuple and added *service_pack_minor*, " "*service_pack_major*, *suite_mask*, and *product_type*." msgstr "" -#: ../../library/sys.rst:796 +#: ../../library/sys.rst:776 msgid "Added *platform_version*" msgstr "" -#: ../../library/sys.rst:802 +#: ../../library/sys.rst:782 msgid "" "Returns an *asyncgen_hooks* object, which is similar to a :class:" "`~collections.namedtuple` of the form `(firstiter, finalizer)`, where " @@ -1158,103 +1133,103 @@ msgid "" "loop." msgstr "" -#: ../../library/sys.rst:809 +#: ../../library/sys.rst:789 msgid "See :pep:`525` for more details." msgstr "" -#: ../../library/sys.rst:813 ../../library/sys.rst:1421 +#: ../../library/sys.rst:793 ../../library/sys.rst:1401 msgid "" "This function has been added on a provisional basis (see :pep:`411` for " "details.)" msgstr "" -#: ../../library/sys.rst:819 +#: ../../library/sys.rst:799 msgid "" "Get the current coroutine origin tracking depth, as set by :func:" "`set_coroutine_origin_tracking_depth`." msgstr "" -#: ../../library/sys.rst:825 ../../library/sys.rst:1442 +#: ../../library/sys.rst:805 ../../library/sys.rst:1422 msgid "" "This function has been added on a provisional basis (see :pep:`411` for " "details.) Use it only for debugging purposes." msgstr "" -#: ../../library/sys.rst:831 +#: ../../library/sys.rst:811 msgid "" "A :term:`named tuple` giving parameters of the numeric hash implementation. " "For more details about hashing of numeric types, see :ref:`numeric-hash`." msgstr "" -#: ../../library/sys.rst:838 +#: ../../library/sys.rst:818 msgid ":const:`width`" msgstr "" -#: ../../library/sys.rst:838 +#: ../../library/sys.rst:818 msgid "width in bits used for hash values" msgstr "" -#: ../../library/sys.rst:840 +#: ../../library/sys.rst:820 msgid ":const:`modulus`" msgstr "" -#: ../../library/sys.rst:840 +#: ../../library/sys.rst:820 msgid "prime modulus P used for numeric hash scheme" msgstr "" -#: ../../library/sys.rst:842 +#: ../../library/sys.rst:822 msgid ":const:`inf`" msgstr "" -#: ../../library/sys.rst:842 +#: ../../library/sys.rst:822 msgid "hash value returned for a positive infinity" msgstr "" -#: ../../library/sys.rst:844 +#: ../../library/sys.rst:824 msgid ":const:`nan`" msgstr "" -#: ../../library/sys.rst:844 +#: ../../library/sys.rst:824 msgid "hash value returned for a nan" msgstr "" -#: ../../library/sys.rst:846 +#: ../../library/sys.rst:826 msgid ":const:`imag`" msgstr "" -#: ../../library/sys.rst:846 +#: ../../library/sys.rst:826 msgid "multiplier used for the imaginary part of a complex number" msgstr "" -#: ../../library/sys.rst:849 +#: ../../library/sys.rst:829 msgid ":const:`algorithm`" msgstr "" -#: ../../library/sys.rst:849 +#: ../../library/sys.rst:829 msgid "name of the algorithm for hashing of str, bytes, and memoryview" msgstr "" -#: ../../library/sys.rst:852 +#: ../../library/sys.rst:832 msgid ":const:`hash_bits`" msgstr "" -#: ../../library/sys.rst:852 +#: ../../library/sys.rst:832 msgid "internal output size of the hash algorithm" msgstr "" -#: ../../library/sys.rst:854 +#: ../../library/sys.rst:834 msgid ":const:`seed_bits`" msgstr "" -#: ../../library/sys.rst:854 +#: ../../library/sys.rst:834 msgid "size of the seed key of the hash algorithm" msgstr "" -#: ../../library/sys.rst:860 +#: ../../library/sys.rst:840 msgid "Added *algorithm*, *hash_bits* and *seed_bits*" msgstr "" -#: ../../library/sys.rst:866 +#: ../../library/sys.rst:846 msgid "" "The version number encoded as a single integer. This is guaranteed to " "increase with each version, including proper support for non-production " @@ -1262,7 +1237,7 @@ msgid "" "version 1.5.2, use::" msgstr "" -#: ../../library/sys.rst:877 +#: ../../library/sys.rst:857 msgid "" "This is called ``hexversion`` since it only really looks meaningful when " "viewed as the result of passing it to the built-in :func:`hex` function. " @@ -1270,25 +1245,25 @@ msgid "" "human-friendly encoding of the same information." msgstr "" -#: ../../library/sys.rst:882 +#: ../../library/sys.rst:862 msgid "More details of ``hexversion`` can be found at :ref:`apiabiversion`." msgstr "" -#: ../../library/sys.rst:887 +#: ../../library/sys.rst:867 msgid "" "An object containing information about the implementation of the currently " "running Python interpreter. The following attributes are required to exist " "in all Python implementations." msgstr "" -#: ../../library/sys.rst:891 +#: ../../library/sys.rst:871 msgid "" "*name* is the implementation's identifier, e.g. ``'cpython'``. The actual " "string is defined by the Python implementation, but it is guaranteed to be " "lower case." msgstr "" -#: ../../library/sys.rst:895 +#: ../../library/sys.rst:875 msgid "" "*version* is a named tuple, in the same format as :data:`sys.version_info`. " "It represents the version of the Python *implementation*. This has a " @@ -1300,13 +1275,13 @@ msgid "" "the same value, since it is the reference implementation." msgstr "" -#: ../../library/sys.rst:905 +#: ../../library/sys.rst:885 msgid "" "*hexversion* is the implementation version in hexadecimal format, like :data:" "`sys.hexversion`." msgstr "" -#: ../../library/sys.rst:908 +#: ../../library/sys.rst:888 msgid "" "*cache_tag* is the tag used by the import machinery in the filenames of " "cached modules. By convention, it would be a composite of the " @@ -1315,7 +1290,7 @@ msgid "" "set to ``None``, it indicates that module caching should be disabled." msgstr "" -#: ../../library/sys.rst:915 +#: ../../library/sys.rst:895 msgid "" ":data:`sys.implementation` may contain additional attributes specific to the " "Python implementation. These non-standard attributes must start with an " @@ -1325,45 +1300,45 @@ msgid "" "versions, however.) See :pep:`421` for more information." msgstr "" -#: ../../library/sys.rst:926 +#: ../../library/sys.rst:906 msgid "" "The addition of new required attributes must go through the normal PEP " "process. See :pep:`421` for more information." msgstr "" -#: ../../library/sys.rst:931 +#: ../../library/sys.rst:911 msgid "" "A :term:`named tuple` that holds information about Python's internal " "representation of integers. The attributes are read only." msgstr "" -#: ../../library/sys.rst:937 ../../library/sys.rst:1551 +#: ../../library/sys.rst:917 ../../library/sys.rst:1531 msgid "Attribute" msgstr "" -#: ../../library/sys.rst:937 ../../library/sys.rst:1551 +#: ../../library/sys.rst:917 ../../library/sys.rst:1531 msgid "Explanation" msgstr "" -#: ../../library/sys.rst:939 +#: ../../library/sys.rst:919 msgid ":const:`bits_per_digit`" msgstr "" -#: ../../library/sys.rst:939 +#: ../../library/sys.rst:919 msgid "" "number of bits held in each digit. Python integers are stored internally in " "base ``2**int_info.bits_per_digit``" msgstr "" -#: ../../library/sys.rst:943 +#: ../../library/sys.rst:923 msgid ":const:`sizeof_digit`" msgstr "" -#: ../../library/sys.rst:943 +#: ../../library/sys.rst:923 msgid "size in bytes of the C type used to represent a digit" msgstr "" -#: ../../library/sys.rst:952 +#: ../../library/sys.rst:932 msgid "" "When this attribute exists, its value is automatically called (with no " "arguments) when the interpreter is launched in :ref:`interactive mode `." msgstr "" -#: ../../library/sys.rst:958 +#: ../../library/sys.rst:None msgid "" "Raises an :ref:`auditing event ` ``cpython.run_interactivehook`` " "with argument ``hook``." msgstr "" -#: ../../library/sys.rst:960 +#: ../../library/sys.rst:940 msgid "" "Raises an :ref:`auditing event ` ``cpython.run_interactivehook`` " "with the hook object as the argument when the hook is called on startup." msgstr "" -#: ../../library/sys.rst:969 +#: ../../library/sys.rst:949 msgid "" "Enter *string* in the table of \"interned\" strings and return the interned " "string -- which is *string* itself or a copy. Interning strings is useful to " @@ -1396,19 +1371,19 @@ msgid "" "attributes have interned keys." msgstr "" -#: ../../library/sys.rst:977 +#: ../../library/sys.rst:957 msgid "" "Interned strings are not immortal; you must keep a reference to the return " "value of :func:`intern` around to benefit from it." msgstr "" -#: ../../library/sys.rst:983 +#: ../../library/sys.rst:963 msgid "" "Return :const:`True` if the Python interpreter is :term:`shutting down " "`, :const:`False` otherwise." msgstr "" -#: ../../library/sys.rst:993 +#: ../../library/sys.rst:973 msgid "" "These three variables are not always defined; they are set when an exception " "is not handled and the interpreter prints an error message and a stack " @@ -1419,33 +1394,33 @@ msgid "" "information.)" msgstr "" -#: ../../library/sys.rst:1001 +#: ../../library/sys.rst:981 msgid "" "The meaning of the variables is the same as that of the return values from :" "func:`exc_info` above." msgstr "" -#: ../../library/sys.rst:1007 +#: ../../library/sys.rst:987 msgid "" "An integer giving the maximum value a variable of type :c:type:`Py_ssize_t` " "can take. It's usually ``2**31 - 1`` on a 32-bit platform and ``2**63 - 1`` " "on a 64-bit platform." msgstr "" -#: ../../library/sys.rst:1014 +#: ../../library/sys.rst:994 msgid "" "An integer giving the value of the largest Unicode code point, i.e. " "``1114111`` (``0x10FFFF`` in hexadecimal)." msgstr "" -#: ../../library/sys.rst:1017 +#: ../../library/sys.rst:997 msgid "" "Before :pep:`393`, ``sys.maxunicode`` used to be either ``0xFFFF`` or " "``0x10FFFF``, depending on the configuration option that specified whether " "Unicode characters were stored as UCS-2 or UCS-4." msgstr "" -#: ../../library/sys.rst:1025 +#: ../../library/sys.rst:1005 msgid "" "A list of :term:`meta path finder` objects that have their :meth:`~importlib." "abc.MetaPathFinder.find_spec` methods called to see if one of the objects " @@ -1457,27 +1432,27 @@ msgid "" "module cannot be found." msgstr "" -#: ../../library/sys.rst:1037 +#: ../../library/sys.rst:1017 msgid ":class:`importlib.abc.MetaPathFinder`" msgstr "" -#: ../../library/sys.rst:1037 +#: ../../library/sys.rst:1017 msgid "" "The abstract base class defining the interface of finder objects on :data:" "`meta_path`." msgstr "" -#: ../../library/sys.rst:1041 +#: ../../library/sys.rst:1021 msgid ":class:`importlib.machinery.ModuleSpec`" msgstr "" -#: ../../library/sys.rst:1040 +#: ../../library/sys.rst:1020 msgid "" "The concrete class which :meth:`~importlib.abc.MetaPathFinder.find_spec` " "should return instances of." msgstr "" -#: ../../library/sys.rst:1046 +#: ../../library/sys.rst:1026 msgid "" ":term:`Module specs ` were introduced in Python 3.4, by :pep:" "`451`. Earlier versions of Python looked for a method called :meth:" @@ -1486,7 +1461,7 @@ msgid "" "MetaPathFinder.find_spec` method." msgstr "" -#: ../../library/sys.rst:1054 +#: ../../library/sys.rst:1034 msgid "" "This is a dictionary that maps module names to modules which have already " "been loaded. This can be manipulated to force reloading of modules and " @@ -1495,14 +1470,14 @@ msgid "" "to fail." msgstr "" -#: ../../library/sys.rst:1064 +#: ../../library/sys.rst:1044 msgid "" "A list of strings that specifies the search path for modules. Initialized " "from the environment variable :envvar:`PYTHONPATH`, plus an installation-" "dependent default." msgstr "" -#: ../../library/sys.rst:1068 +#: ../../library/sys.rst:1048 msgid "" "As initialized upon program startup, the first item of this list, " "``path[0]``, is the directory containing the script that was used to invoke " @@ -1514,31 +1489,31 @@ msgid "" "`PYTHONPATH`." msgstr "" -#: ../../library/sys.rst:1076 +#: ../../library/sys.rst:1056 msgid "" "A program is free to modify this list for its own purposes. Only strings " "and bytes should be added to :data:`sys.path`; all other data types are " "ignored during import." msgstr "" -#: ../../library/sys.rst:1082 +#: ../../library/sys.rst:1062 msgid "" "Module :mod:`site` This describes how to use .pth files to extend :data:`sys." "path`." msgstr "" -#: ../../library/sys.rst:1088 +#: ../../library/sys.rst:1068 msgid "" "A list of callables that take a path argument to try to create a :term:" "`finder` for the path. If a finder can be created, it is to be returned by " "the callable, else raise :exc:`ImportError`." msgstr "" -#: ../../library/sys.rst:1092 ../../library/sys.rst:1103 +#: ../../library/sys.rst:1072 ../../library/sys.rst:1083 msgid "Originally specified in :pep:`302`." msgstr "" -#: ../../library/sys.rst:1097 +#: ../../library/sys.rst:1077 msgid "" "A dictionary acting as a cache for :term:`finder` objects. The keys are " "paths that have been passed to :data:`sys.path_hooks` and the values are the " @@ -1546,19 +1521,19 @@ msgid "" "is found on :data:`sys.path_hooks` then ``None`` is stored." msgstr "" -#: ../../library/sys.rst:1105 +#: ../../library/sys.rst:1085 msgid "" "``None`` is stored instead of :class:`imp.NullImporter` when no finder is " "found." msgstr "" -#: ../../library/sys.rst:1112 +#: ../../library/sys.rst:1092 msgid "" "This string contains a platform identifier that can be used to append " "platform-specific components to :data:`sys.path`, for instance." msgstr "" -#: ../../library/sys.rst:1115 +#: ../../library/sys.rst:1095 msgid "" "For Unix systems, except on Linux and AIX, this is the lowercased OS name as " "returned by ``uname -s`` with the first part of the version as returned by " @@ -1567,59 +1542,59 @@ msgid "" "version, it is therefore recommended to use the following idiom::" msgstr "" -#: ../../library/sys.rst:1128 +#: ../../library/sys.rst:1108 msgid "For other systems, the values are:" msgstr "" -#: ../../library/sys.rst:1131 +#: ../../library/sys.rst:1111 msgid "System" msgstr "" -#: ../../library/sys.rst:1131 +#: ../../library/sys.rst:1111 msgid "``platform`` value" msgstr "" -#: ../../library/sys.rst:1133 +#: ../../library/sys.rst:1113 msgid "AIX" msgstr "" -#: ../../library/sys.rst:1133 +#: ../../library/sys.rst:1113 msgid "``'aix'``" msgstr "" -#: ../../library/sys.rst:1134 +#: ../../library/sys.rst:1114 msgid "Linux" msgstr "" -#: ../../library/sys.rst:1134 +#: ../../library/sys.rst:1114 msgid "``'linux'``" msgstr "" -#: ../../library/sys.rst:1135 +#: ../../library/sys.rst:1115 msgid "Windows" msgstr "" -#: ../../library/sys.rst:1135 +#: ../../library/sys.rst:1115 msgid "``'win32'``" msgstr "" -#: ../../library/sys.rst:1136 +#: ../../library/sys.rst:1116 msgid "Windows/Cygwin" msgstr "" -#: ../../library/sys.rst:1136 +#: ../../library/sys.rst:1116 msgid "``'cygwin'``" msgstr "" -#: ../../library/sys.rst:1137 +#: ../../library/sys.rst:1117 msgid "macOS" msgstr "" -#: ../../library/sys.rst:1137 +#: ../../library/sys.rst:1117 msgid "``'darwin'``" msgstr "" -#: ../../library/sys.rst:1140 +#: ../../library/sys.rst:1120 msgid "" "On Linux, :attr:`sys.platform` doesn't contain the major version anymore. It " "is always ``'linux'``, instead of ``'linux2'`` or ``'linux3'``. Since older " @@ -1627,7 +1602,7 @@ msgid "" "the ``startswith`` idiom presented above." msgstr "" -#: ../../library/sys.rst:1146 +#: ../../library/sys.rst:1126 msgid "" "On AIX, :attr:`sys.platform` doesn't contain the major version anymore. It " "is always ``'aix'``, instead of ``'aix5'`` or ``'aix7'``. Since older " @@ -1635,57 +1610,57 @@ msgid "" "the ``startswith`` idiom presented above." msgstr "" -#: ../../library/sys.rst:1154 +#: ../../library/sys.rst:1134 msgid "" ":attr:`os.name` has a coarser granularity. :func:`os.uname` gives system-" "dependent version information." msgstr "" -#: ../../library/sys.rst:1157 +#: ../../library/sys.rst:1137 msgid "" "The :mod:`platform` module provides detailed checks for the system's " "identity." msgstr "" -#: ../../library/sys.rst:1163 +#: ../../library/sys.rst:1143 msgid "" "Name of the platform-specific library directory. It is used to build the " "path of standard library and the paths of installed extension modules." msgstr "" -#: ../../library/sys.rst:1166 +#: ../../library/sys.rst:1146 msgid "" "It is equal to ``\"lib\"`` on most platforms. On Fedora and SuSE, it is " "equal to ``\"lib64\"`` on 64-bit platforms which gives the following ``sys." "path`` paths (where ``X.Y`` is the Python ``major.minor`` version):" msgstr "" -#: ../../library/sys.rst:1170 +#: ../../library/sys.rst:1150 msgid "" "``/usr/lib64/pythonX.Y/``: Standard library (like ``os.py`` of the :mod:`os` " "module)" msgstr "" -#: ../../library/sys.rst:1172 +#: ../../library/sys.rst:1152 msgid "" "``/usr/lib64/pythonX.Y/lib-dynload/``: C extension modules of the standard " "library (like the :mod:`errno` module, the exact filename is platform " "specific)" msgstr "" -#: ../../library/sys.rst:1175 +#: ../../library/sys.rst:1155 msgid "" "``/usr/lib/pythonX.Y/site-packages/`` (always use ``lib``, not :data:`sys." "platlibdir`): Third-party modules" msgstr "" -#: ../../library/sys.rst:1177 +#: ../../library/sys.rst:1157 msgid "" "``/usr/lib64/pythonX.Y/site-packages/``: C extension modules of third-party " "packages" msgstr "" -#: ../../library/sys.rst:1185 +#: ../../library/sys.rst:1165 msgid "" "A string giving the site-specific directory prefix where the platform " "independent Python files are installed; by default, this is the string ``'/" @@ -1697,14 +1672,14 @@ msgid "" "number of Python, for example ``3.2``." msgstr "" -#: ../../library/sys.rst:1194 +#: ../../library/sys.rst:1174 msgid "" "If a :ref:`virtual environment ` is in effect, this value will be " "changed in ``site.py`` to point to the virtual environment. The value for " "the Python installation will still be available, via :data:`base_prefix`." msgstr "" -#: ../../library/sys.rst:1209 +#: ../../library/sys.rst:1189 msgid "" "Strings specifying the primary and secondary prompt of the interpreter. " "These are only defined if the interpreter is in interactive mode. Their " @@ -1714,7 +1689,7 @@ msgid "" "used to implement a dynamic prompt." msgstr "" -#: ../../library/sys.rst:1219 +#: ../../library/sys.rst:1199 msgid "" "Set the flags used by the interpreter for :c:func:`dlopen` calls, such as " "when the interpreter loads extension modules. Among other things, this will " @@ -1725,7 +1700,7 @@ msgid "" "data:`os.RTLD_LAZY`)." msgstr "" -#: ../../library/sys.rst:1235 +#: ../../library/sys.rst:1215 msgid "" "Set the system's profile function, which allows you to implement a Python " "source code profiler in Python. See chapter :ref:`profile` for more " @@ -1740,7 +1715,7 @@ msgid "" "in the profile function will cause itself unset." msgstr "" -#: ../../library/sys.rst:1246 +#: ../../library/sys.rst:1226 msgid "" "Profile functions should have three arguments: *frame*, *event*, and *arg*. " "*frame* is the current stack frame. *event* is a string: ``'call'``, " @@ -1748,71 +1723,71 @@ msgid "" "depends on the event type." msgstr "" -#: ../../library/sys.rst:1251 +#: ../../library/sys.rst:1232 msgid "" "Raises an :ref:`auditing event ` ``sys.setprofile`` with no " "arguments." msgstr "" -#: ../../library/sys.rst:1253 ../../library/sys.rst:1334 +#: ../../library/sys.rst:1233 ../../library/sys.rst:1314 msgid "The events have the following meaning:" msgstr "" -#: ../../library/sys.rst:1257 ../../library/sys.rst:1339 +#: ../../library/sys.rst:1237 ../../library/sys.rst:1319 msgid "``'call'``" msgstr "" -#: ../../library/sys.rst:1256 +#: ../../library/sys.rst:1236 msgid "" "A function is called (or some other code block entered). The profile " "function is called; *arg* is ``None``." msgstr "" -#: ../../library/sys.rst:1262 ../../library/sys.rst:1354 +#: ../../library/sys.rst:1242 ../../library/sys.rst:1334 msgid "``'return'``" msgstr "" -#: ../../library/sys.rst:1260 +#: ../../library/sys.rst:1240 msgid "" "A function (or other code block) is about to return. The profile function " "is called; *arg* is the value that will be returned, or ``None`` if the " "event is caused by an exception being raised." msgstr "" -#: ../../library/sys.rst:1266 +#: ../../library/sys.rst:1246 msgid "``'c_call'``" msgstr "" -#: ../../library/sys.rst:1265 +#: ../../library/sys.rst:1245 msgid "" "A C function is about to be called. This may be an extension function or a " "built-in. *arg* is the C function object." msgstr "" -#: ../../library/sys.rst:1269 +#: ../../library/sys.rst:1249 msgid "``'c_return'``" msgstr "" -#: ../../library/sys.rst:1269 +#: ../../library/sys.rst:1249 msgid "A C function has returned. *arg* is the C function object." msgstr "" -#: ../../library/sys.rst:1271 +#: ../../library/sys.rst:1251 msgid "``'c_exception'``" msgstr "" -#: ../../library/sys.rst:1272 +#: ../../library/sys.rst:1252 msgid "A C function has raised an exception. *arg* is the C function object." msgstr "" -#: ../../library/sys.rst:1276 +#: ../../library/sys.rst:1256 msgid "" "Set the maximum depth of the Python interpreter stack to *limit*. This " "limit prevents infinite recursion from causing an overflow of the C stack " "and crashing Python." msgstr "" -#: ../../library/sys.rst:1280 +#: ../../library/sys.rst:1260 msgid "" "The highest possible limit is platform-dependent. A user may need to set " "the limit higher when they have a program that requires deep recursion and a " @@ -1820,19 +1795,19 @@ msgid "" "because a too-high limit can lead to a crash." msgstr "" -#: ../../library/sys.rst:1285 +#: ../../library/sys.rst:1265 msgid "" "If the new limit is too low at the current recursion depth, a :exc:" "`RecursionError` exception is raised." msgstr "" -#: ../../library/sys.rst:1288 +#: ../../library/sys.rst:1268 msgid "" "A :exc:`RecursionError` exception is now raised if the new limit is too low " "at the current recursion depth." msgstr "" -#: ../../library/sys.rst:1295 +#: ../../library/sys.rst:1275 msgid "" "Set the interpreter's thread switch interval (in seconds). This floating-" "point value determines the ideal duration of the \"timeslices\" allocated to " @@ -1843,7 +1818,7 @@ msgid "" "scheduler." msgstr "" -#: ../../library/sys.rst:1312 +#: ../../library/sys.rst:1292 msgid "" "Set the system's trace function, which allows you to implement a Python " "source code debugger in Python. The function is thread-specific; for a " @@ -1852,7 +1827,7 @@ msgid "" "`threading.settrace`." msgstr "" -#: ../../library/sys.rst:1317 +#: ../../library/sys.rst:1297 msgid "" "Trace functions should have three arguments: *frame*, *event*, and *arg*. " "*frame* is the current stack frame. *event* is a string: ``'call'``, " @@ -1860,7 +1835,7 @@ msgid "" "the event type." msgstr "" -#: ../../library/sys.rst:1322 +#: ../../library/sys.rst:1302 msgid "" "The trace function is invoked (with *event* set to ``'call'``) whenever a " "new local scope is entered; it should return a reference to a local trace " @@ -1868,31 +1843,31 @@ msgid "" "traced." msgstr "" -#: ../../library/sys.rst:1327 +#: ../../library/sys.rst:1307 msgid "" "The local trace function should return a reference to itself (or to another " "function for further tracing in that scope), or ``None`` to turn off tracing " "in that scope." msgstr "" -#: ../../library/sys.rst:1331 +#: ../../library/sys.rst:1311 msgid "" "If there is any error occurred in the trace function, it will be unset, just " "like ``settrace(None)`` is called." msgstr "" -#: ../../library/sys.rst:1337 +#: ../../library/sys.rst:1317 msgid "" "A function is called (or some other code block entered). The global trace " "function is called; *arg* is ``None``; the return value specifies the local " "trace function." msgstr "" -#: ../../library/sys.rst:1348 +#: ../../library/sys.rst:1328 msgid "``'line'``" msgstr "" -#: ../../library/sys.rst:1342 +#: ../../library/sys.rst:1322 msgid "" "The interpreter is about to execute a new line of code or re-execute the " "condition of a loop. The local trace function is called; *arg* is ``None``; " @@ -1902,7 +1877,7 @@ msgid "" "const:`False` on that frame." msgstr "" -#: ../../library/sys.rst:1351 +#: ../../library/sys.rst:1331 msgid "" "A function (or other code block) is about to return. The local trace " "function is called; *arg* is the value that will be returned, or ``None`` if " @@ -1910,22 +1885,22 @@ msgid "" "return value is ignored." msgstr "" -#: ../../library/sys.rst:1359 +#: ../../library/sys.rst:1339 msgid "``'exception'``" msgstr "" -#: ../../library/sys.rst:1357 +#: ../../library/sys.rst:1337 msgid "" "An exception has occurred. The local trace function is called; *arg* is a " "tuple ``(exception, value, traceback)``; the return value specifies the new " "local trace function." msgstr "" -#: ../../library/sys.rst:1367 +#: ../../library/sys.rst:1347 msgid "``'opcode'``" msgstr "" -#: ../../library/sys.rst:1362 +#: ../../library/sys.rst:1342 msgid "" "The interpreter is about to execute a new opcode (see :mod:`dis` for opcode " "details). The local trace function is called; *arg* is ``None``; the return " @@ -1934,13 +1909,13 @@ msgid "" "`f_trace_opcodes` to :const:`True` on the frame." msgstr "" -#: ../../library/sys.rst:1369 +#: ../../library/sys.rst:1349 msgid "" "Note that as an exception is propagated down the chain of callers, an " "``'exception'`` event is generated at each level." msgstr "" -#: ../../library/sys.rst:1372 +#: ../../library/sys.rst:1352 msgid "" "For more fine-grained usage, it's possible to set a trace function by " "assigning ``frame.f_trace = tracefunc`` explicitly, rather than relying on " @@ -1954,17 +1929,17 @@ msgid "" "on each frame)." msgstr "" -#: ../../library/sys.rst:1383 +#: ../../library/sys.rst:1363 msgid "For more information on code and frame objects, refer to :ref:`types`." msgstr "" -#: ../../library/sys.rst:1385 +#: ../../library/sys.rst:1366 msgid "" "Raises an :ref:`auditing event ` ``sys.settrace`` with no " "arguments." msgstr "" -#: ../../library/sys.rst:1389 +#: ../../library/sys.rst:1369 msgid "" "The :func:`settrace` function is intended only for implementing debuggers, " "profilers, coverage tools and the like. Its behavior is part of the " @@ -1972,13 +1947,13 @@ msgid "" "thus may not be available in all Python implementations." msgstr "" -#: ../../library/sys.rst:1396 +#: ../../library/sys.rst:1376 msgid "" "``'opcode'`` event type added; :attr:`f_trace_lines` and :attr:" "`f_trace_opcodes` attributes added to frames" msgstr "" -#: ../../library/sys.rst:1401 +#: ../../library/sys.rst:1381 msgid "" "Accepts two optional keyword arguments which are callables that accept an :" "term:`asynchronous generator iterator` as an argument. The *firstiter* " @@ -1987,32 +1962,32 @@ msgid "" "about to be garbage collected." msgstr "" -#: ../../library/sys.rst:1407 +#: ../../library/sys.rst:1388 msgid "" "Raises an :ref:`auditing event ` ``sys." "set_asyncgen_hooks_firstiter`` with no arguments." msgstr "" -#: ../../library/sys.rst:1409 +#: ../../library/sys.rst:1390 msgid "" "Raises an :ref:`auditing event ` ``sys." "set_asyncgen_hooks_finalizer`` with no arguments." msgstr "" -#: ../../library/sys.rst:1411 +#: ../../library/sys.rst:1391 msgid "" "Two auditing events are raised because the underlying API consists of two " "calls, each of which must raise its own event." msgstr "" -#: ../../library/sys.rst:1414 +#: ../../library/sys.rst:1394 msgid "" "See :pep:`525` for more details, and for a reference example of a " "*finalizer* method see the implementation of ``asyncio.Loop." "shutdown_asyncgens`` in :source:`Lib/asyncio/base_events.py`" msgstr "" -#: ../../library/sys.rst:1426 +#: ../../library/sys.rst:1406 msgid "" "Allows enabling or disabling coroutine origin tracking. When enabled, the " "``cr_origin`` attribute on coroutine objects will contain a tuple of " @@ -2021,68 +1996,68 @@ msgid "" "disabled, ``cr_origin`` will be None." msgstr "" -#: ../../library/sys.rst:1433 +#: ../../library/sys.rst:1413 msgid "" "To enable, pass a *depth* value greater than zero; this sets the number of " "frames whose information will be captured. To disable, pass set *depth* to " "zero." msgstr "" -#: ../../library/sys.rst:1437 +#: ../../library/sys.rst:1417 msgid "This setting is thread-specific." msgstr "" -#: ../../library/sys.rst:1447 +#: ../../library/sys.rst:1427 msgid "" "Changes the default filesystem encoding and errors mode to 'mbcs' and " "'replace' respectively, for consistency with versions of Python prior to 3.6." msgstr "" -#: ../../library/sys.rst:1450 +#: ../../library/sys.rst:1430 msgid "" "This is equivalent to defining the :envvar:`PYTHONLEGACYWINDOWSFSENCODING` " "environment variable before launching Python." msgstr "" -#: ../../library/sys.rst:1455 +#: ../../library/sys.rst:1435 msgid "See :pep:`529` for more details." msgstr "" -#: ../../library/sys.rst:1462 +#: ../../library/sys.rst:1442 msgid "" ":term:`File objects ` used by the interpreter for standard " "input, output and errors:" msgstr "" -#: ../../library/sys.rst:1465 +#: ../../library/sys.rst:1445 msgid "" "``stdin`` is used for all interactive input (including calls to :func:" "`input`);" msgstr "" -#: ../../library/sys.rst:1467 +#: ../../library/sys.rst:1447 msgid "" "``stdout`` is used for the output of :func:`print` and :term:`expression` " "statements and for the prompts of :func:`input`;" msgstr "" -#: ../../library/sys.rst:1469 +#: ../../library/sys.rst:1449 msgid "The interpreter's own prompts and its error messages go to ``stderr``." msgstr "" -#: ../../library/sys.rst:1471 +#: ../../library/sys.rst:1451 msgid "" "These streams are regular :term:`text files ` like those returned " "by the :func:`open` function. Their parameters are chosen as follows:" msgstr "" -#: ../../library/sys.rst:1475 +#: ../../library/sys.rst:1455 msgid "" "The character encoding is platform-dependent. Non-Windows platforms use the " "locale encoding (see :meth:`locale.getpreferredencoding()`)." msgstr "" -#: ../../library/sys.rst:1479 +#: ../../library/sys.rst:1459 msgid "" "On Windows, UTF-8 is used for the console device. Non-character devices " "such as disk files and pipes use the system locale encoding (i.e. the ANSI " @@ -2093,14 +2068,14 @@ msgid "" "attached to a console." msgstr "" -#: ../../library/sys.rst:1488 +#: ../../library/sys.rst:1468 msgid "" "The special behaviour of the console can be overridden by setting the " "environment variable PYTHONLEGACYWINDOWSSTDIO before starting Python. In " "that case, the console codepages are used as for any other character device." msgstr "" -#: ../../library/sys.rst:1493 +#: ../../library/sys.rst:1473 msgid "" "Under all platforms, you can override the character encoding by setting the :" "envvar:`PYTHONIOENCODING` environment variable before starting Python or by " @@ -2109,7 +2084,7 @@ msgid "" "only applies when :envvar:`PYTHONLEGACYWINDOWSSTDIO` is also set." msgstr "" -#: ../../library/sys.rst:1500 +#: ../../library/sys.rst:1480 msgid "" "When interactive, the ``stdout`` stream is line-buffered. Otherwise, it is " "block-buffered like regular text files. The ``stderr`` stream is line-" @@ -2118,19 +2093,19 @@ msgid "" "`PYTHONUNBUFFERED` environment variable." msgstr "" -#: ../../library/sys.rst:1506 +#: ../../library/sys.rst:1486 msgid "" "Non-interactive ``stderr`` is now line-buffered instead of fully buffered." msgstr "" -#: ../../library/sys.rst:1512 +#: ../../library/sys.rst:1492 msgid "" "To write or read binary data from/to the standard streams, use the " "underlying binary :data:`~io.TextIOBase.buffer` object. For example, to " "write bytes to :data:`stdout`, use ``sys.stdout.buffer.write(b'abc')``." msgstr "" -#: ../../library/sys.rst:1516 +#: ../../library/sys.rst:1496 msgid "" "However, if you are writing a library (and do not control in which context " "its code will be executed), be aware that the standard streams may be " @@ -2138,7 +2113,7 @@ msgid "" "support the :attr:`~io.BufferedIOBase.buffer` attribute." msgstr "" -#: ../../library/sys.rst:1526 +#: ../../library/sys.rst:1506 msgid "" "These objects contain the original values of ``stdin``, ``stderr`` and " "``stdout`` at the start of the program. They are used during finalization, " @@ -2146,7 +2121,7 @@ msgid "" "``sys.std*`` object has been redirected." msgstr "" -#: ../../library/sys.rst:1531 +#: ../../library/sys.rst:1511 msgid "" "It can also be used to restore the actual files to known working file " "objects in case they have been overwritten with a broken object. However, " @@ -2154,7 +2129,7 @@ msgid "" "before replacing it, and restore the saved object." msgstr "" -#: ../../library/sys.rst:1537 +#: ../../library/sys.rst:1517 msgid "" "Under some conditions ``stdin``, ``stdout`` and ``stderr`` as well as the " "original values ``__stdin__``, ``__stdout__`` and ``__stderr__`` can be " @@ -2162,62 +2137,62 @@ msgid "" "to a console and Python apps started with :program:`pythonw`." msgstr "" -#: ../../library/sys.rst:1545 +#: ../../library/sys.rst:1525 msgid "" "A :term:`named tuple` holding information about the thread implementation." msgstr "" -#: ../../library/sys.rst:1553 +#: ../../library/sys.rst:1533 msgid ":const:`name`" msgstr "" -#: ../../library/sys.rst:1553 +#: ../../library/sys.rst:1533 msgid "Name of the thread implementation:" msgstr "" -#: ../../library/sys.rst:1555 +#: ../../library/sys.rst:1535 msgid "``'nt'``: Windows threads" msgstr "" -#: ../../library/sys.rst:1556 +#: ../../library/sys.rst:1536 msgid "``'pthread'``: POSIX threads" msgstr "" -#: ../../library/sys.rst:1557 +#: ../../library/sys.rst:1537 msgid "``'solaris'``: Solaris threads" msgstr "" -#: ../../library/sys.rst:1559 +#: ../../library/sys.rst:1539 msgid ":const:`lock`" msgstr "" -#: ../../library/sys.rst:1559 +#: ../../library/sys.rst:1539 msgid "Name of the lock implementation:" msgstr "" -#: ../../library/sys.rst:1561 +#: ../../library/sys.rst:1541 msgid "``'semaphore'``: a lock uses a semaphore" msgstr "" -#: ../../library/sys.rst:1562 +#: ../../library/sys.rst:1542 msgid "``'mutex+cond'``: a lock uses a mutex and a condition variable" msgstr "" -#: ../../library/sys.rst:1564 +#: ../../library/sys.rst:1544 msgid "``None`` if this information is unknown" msgstr "" -#: ../../library/sys.rst:1566 +#: ../../library/sys.rst:1546 msgid ":const:`version`" msgstr "" -#: ../../library/sys.rst:1566 +#: ../../library/sys.rst:1546 msgid "" "Name and version of the thread library. It is a string, or ``None`` if this " "information is unknown." msgstr "" -#: ../../library/sys.rst:1575 +#: ../../library/sys.rst:1555 msgid "" "When this variable is set to an integer value, it determines the maximum " "number of levels of traceback information printed when an unhandled " @@ -2226,78 +2201,78 @@ msgid "" "are printed." msgstr "" -#: ../../library/sys.rst:1583 +#: ../../library/sys.rst:1563 msgid "Handle an unraisable exception." msgstr "" -#: ../../library/sys.rst:1585 +#: ../../library/sys.rst:1565 msgid "" "Called when an exception has occurred but there is no way for Python to " "handle it. For example, when a destructor raises an exception or during " "garbage collection (:func:`gc.collect`)." msgstr "" -#: ../../library/sys.rst:1589 +#: ../../library/sys.rst:1569 msgid "The *unraisable* argument has the following attributes:" msgstr "" -#: ../../library/sys.rst:1591 +#: ../../library/sys.rst:1571 msgid "*exc_type*: Exception type." msgstr "" -#: ../../library/sys.rst:1592 +#: ../../library/sys.rst:1572 msgid "*exc_value*: Exception value, can be ``None``." msgstr "" -#: ../../library/sys.rst:1593 +#: ../../library/sys.rst:1573 msgid "*exc_traceback*: Exception traceback, can be ``None``." msgstr "" -#: ../../library/sys.rst:1594 +#: ../../library/sys.rst:1574 msgid "*err_msg*: Error message, can be ``None``." msgstr "" -#: ../../library/sys.rst:1595 +#: ../../library/sys.rst:1575 msgid "*object*: Object causing the exception, can be ``None``." msgstr "" -#: ../../library/sys.rst:1597 +#: ../../library/sys.rst:1577 msgid "" "The default hook formats *err_msg* and *object* as: ``f'{err_msg}: {object!" "r}'``; use \"Exception ignored in\" error message if *err_msg* is ``None``." msgstr "" -#: ../../library/sys.rst:1601 +#: ../../library/sys.rst:1581 msgid "" ":func:`sys.unraisablehook` can be overridden to control how unraisable " "exceptions are handled." msgstr "" -#: ../../library/sys.rst:1604 +#: ../../library/sys.rst:1584 msgid "" "Storing *exc_value* using a custom hook can create a reference cycle. It " "should be cleared explicitly to break the reference cycle when the exception " "is no longer needed." msgstr "" -#: ../../library/sys.rst:1608 +#: ../../library/sys.rst:1588 msgid "" "Storing *object* using a custom hook can resurrect it if it is set to an " "object which is being finalized. Avoid storing *object* after the custom " "hook completes to avoid resurrecting objects." msgstr "" -#: ../../library/sys.rst:1612 +#: ../../library/sys.rst:1592 msgid "See also :func:`excepthook` which handles uncaught exceptions." msgstr "" -#: ../../library/sys.rst:1614 +#: ../../library/sys.rst:None msgid "" "Raises an :ref:`auditing event ` ``sys.unraisablehook`` with " "arguments ``hook``, ``unraisable``." msgstr "" -#: ../../library/sys.rst:1616 +#: ../../library/sys.rst:1596 msgid "" "Raise an auditing event ``sys.unraisablehook`` with arguments ``hook``, " "``unraisable`` when an exception that cannot be handled occurs. The " @@ -2305,7 +2280,7 @@ msgid "" "hook has been set, ``hook`` may be ``None``." msgstr "" -#: ../../library/sys.rst:1625 +#: ../../library/sys.rst:1605 msgid "" "A string containing the version number of the Python interpreter plus " "additional information on the build number and compiler used. This string " @@ -2314,13 +2289,13 @@ msgid "" "functions provided by the :mod:`platform` module." msgstr "" -#: ../../library/sys.rst:1634 +#: ../../library/sys.rst:1614 msgid "" "The C API version for this interpreter. Programmers may find this useful " "when debugging version conflicts between Python and extension modules." msgstr "" -#: ../../library/sys.rst:1640 +#: ../../library/sys.rst:1620 msgid "" "A tuple containing the five components of the version number: *major*, " "*minor*, *micro*, *releaselevel*, and *serial*. All values except " @@ -2331,18 +2306,18 @@ msgid "" "version_info.major`` and so on." msgstr "" -#: ../../library/sys.rst:1648 +#: ../../library/sys.rst:1628 msgid "Added named component attributes." msgstr "" -#: ../../library/sys.rst:1653 +#: ../../library/sys.rst:1633 msgid "" "This is an implementation detail of the warnings framework; do not modify " "this value. Refer to the :mod:`warnings` module for more information on the " "warnings framework." msgstr "" -#: ../../library/sys.rst:1660 +#: ../../library/sys.rst:1640 msgid "" "The version number used to form registry keys on Windows platforms. This is " "stored as string resource 1000 in the Python DLL. The value is normally the " @@ -2351,25 +2326,25 @@ msgid "" "on the registry keys used by Python." msgstr "" -#: ../../library/sys.rst:1671 +#: ../../library/sys.rst:1651 msgid "" "A dictionary of the various implementation-specific flags passed through " "the :option:`-X` command-line option. Option names are either mapped to " "their values, if given explicitly, or to :const:`True`. Example:" msgstr "" -#: ../../library/sys.rst:1687 +#: ../../library/sys.rst:1667 msgid "" "This is a CPython-specific way of accessing options passed through :option:`-" "X`. Other implementations may export them through other means, or not at " "all." msgstr "" -#: ../../library/sys.rst:1695 +#: ../../library/sys.rst:1675 msgid "Citations" msgstr "" -#: ../../library/sys.rst:1696 +#: ../../library/sys.rst:1676 msgid "" "ISO/IEC 9899:1999. \"Programming languages -- C.\" A public draft of this " "standard is available at http://www.open-std.org/jtc1/sc22/wg14/www/docs/" diff --git a/library/sysconfig.po b/library/sysconfig.po index 942e0676a3..29c2cb619e 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-07 06:52+0000\n" +"POT-Creation-Date: 2020-06-20 18:08+0800\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-" @@ -77,7 +77,7 @@ msgid "" "``get_config_vars().get(name)``." msgstr "" -#: ../../library/sysconfig.rst:51 +#: ../../library/sysconfig.rst:51 ../../library/sysconfig.rst:141 msgid "If *name* is not found, return ``None``." msgstr "" @@ -238,10 +238,6 @@ msgid "" "variables." msgstr "" -#: ../../library/sysconfig.rst:141 -msgid "If *name* is not found, raise a :exc:`KeyError`." -msgstr "" - #: ../../library/sysconfig.rst:146 msgid "" "Return a dictionary containing all installation paths corresponding to an " diff --git a/library/syslog.po b/library/syslog.po index a7689b2dcf..5b09a9f628 100644 --- a/library/syslog.po +++ b/library/syslog.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.7\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2021-09-07 06:52+0000\n" +"POT-Creation-Date: 2020-06-20 18:08+0800\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-" @@ -79,7 +79,7 @@ msgid "" "for messages which do not have a facility explicitly encoded." msgstr "" -#: ../../library/syslog.rst:50 +#: ../../library/syslog.rst:51 msgid "" "Raises an :ref:`auditing event ` ``syslog.openlog`` with arguments " "``ident``, ``logoption``, ``facility``." diff --git a/library/tarfile.po b/library/tarfile.po index 4b6596bdbc..4e233aed4a 100644 --- a/library/tarfile.po +++ b/library/tarfile.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.7\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2021-09-07 06:52+0000\n" +"POT-Creation-Date: 2020-06-20 18:08+0800\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-" @@ -236,12 +236,6 @@ msgstr "" #: ../../library/tarfile.rst:105 msgid "" -"For modes ``'w:xz'`` and ``'x:xz'``, :func:`tarfile.open` accepts the " -"keyword argument *preset* to specify the compression level of the file." -msgstr "" - -#: ../../library/tarfile.rst:108 -msgid "" "For special purposes, there is a second format for *mode*: ``'filemode|" "[compression]'``. :func:`tarfile.open` will return a :class:`TarFile` " "object that processes its data as a stream of blocks. No random seeking " @@ -254,222 +248,222 @@ msgid "" "possible modes:" msgstr "" -#: ../../library/tarfile.rst:120 +#: ../../library/tarfile.rst:117 msgid "Mode" msgstr "" -#: ../../library/tarfile.rst:120 +#: ../../library/tarfile.rst:117 msgid "Action" msgstr "" -#: ../../library/tarfile.rst:122 +#: ../../library/tarfile.rst:119 msgid "``'r|*'``" msgstr "" -#: ../../library/tarfile.rst:122 +#: ../../library/tarfile.rst:119 msgid "Open a *stream* of tar blocks for reading with transparent compression." msgstr "" -#: ../../library/tarfile.rst:125 +#: ../../library/tarfile.rst:122 msgid "``'r|'``" msgstr "" -#: ../../library/tarfile.rst:125 +#: ../../library/tarfile.rst:122 msgid "Open a *stream* of uncompressed tar blocks for reading." msgstr "" -#: ../../library/tarfile.rst:128 +#: ../../library/tarfile.rst:125 msgid "``'r|gz'``" msgstr "" -#: ../../library/tarfile.rst:128 +#: ../../library/tarfile.rst:125 msgid "Open a gzip compressed *stream* for reading." msgstr "" -#: ../../library/tarfile.rst:131 +#: ../../library/tarfile.rst:128 msgid "``'r|bz2'``" msgstr "" -#: ../../library/tarfile.rst:131 +#: ../../library/tarfile.rst:128 msgid "Open a bzip2 compressed *stream* for reading." msgstr "" -#: ../../library/tarfile.rst:134 +#: ../../library/tarfile.rst:131 msgid "``'r|xz'``" msgstr "" -#: ../../library/tarfile.rst:134 +#: ../../library/tarfile.rst:131 msgid "Open an lzma compressed *stream* for reading." msgstr "" -#: ../../library/tarfile.rst:137 +#: ../../library/tarfile.rst:134 msgid "``'w|'``" msgstr "" -#: ../../library/tarfile.rst:137 +#: ../../library/tarfile.rst:134 msgid "Open an uncompressed *stream* for writing." msgstr "" -#: ../../library/tarfile.rst:139 +#: ../../library/tarfile.rst:136 msgid "``'w|gz'``" msgstr "" -#: ../../library/tarfile.rst:139 +#: ../../library/tarfile.rst:136 msgid "Open a gzip compressed *stream* for writing." msgstr "" -#: ../../library/tarfile.rst:142 +#: ../../library/tarfile.rst:139 msgid "``'w|bz2'``" msgstr "" -#: ../../library/tarfile.rst:142 +#: ../../library/tarfile.rst:139 msgid "Open a bzip2 compressed *stream* for writing." msgstr "" -#: ../../library/tarfile.rst:145 +#: ../../library/tarfile.rst:142 msgid "``'w|xz'``" msgstr "" -#: ../../library/tarfile.rst:145 +#: ../../library/tarfile.rst:142 msgid "Open an lzma compressed *stream* for writing." msgstr "" -#: ../../library/tarfile.rst:149 ../../library/tarfile.rst:336 +#: ../../library/tarfile.rst:146 ../../library/tarfile.rst:332 msgid "The ``'x'`` (exclusive creation) mode was added." msgstr "" -#: ../../library/tarfile.rst:152 ../../library/tarfile.rst:339 -#: ../../library/tarfile.rst:508 +#: ../../library/tarfile.rst:149 ../../library/tarfile.rst:335 +#: ../../library/tarfile.rst:503 msgid "The *name* parameter accepts a :term:`path-like object`." msgstr "" -#: ../../library/tarfile.rst:159 +#: ../../library/tarfile.rst:155 msgid "" "Class for reading and writing tar archives. Do not use this class directly: " "use :func:`tarfile.open` instead. See :ref:`tarfile-objects`." msgstr "" -#: ../../library/tarfile.rst:165 +#: ../../library/tarfile.rst:161 msgid "" "Return :const:`True` if *name* is a tar archive file, that the :mod:" "`tarfile` module can read. *name* may be a :class:`str`, file, or file-like " "object." msgstr "" -#: ../../library/tarfile.rst:168 +#: ../../library/tarfile.rst:164 msgid "Support for file and file-like objects." msgstr "" -#: ../../library/tarfile.rst:172 +#: ../../library/tarfile.rst:168 msgid "The :mod:`tarfile` module defines the following exceptions:" msgstr "" -#: ../../library/tarfile.rst:177 +#: ../../library/tarfile.rst:173 msgid "Base class for all :mod:`tarfile` exceptions." msgstr "" -#: ../../library/tarfile.rst:182 +#: ../../library/tarfile.rst:178 msgid "" "Is raised when a tar archive is opened, that either cannot be handled by " "the :mod:`tarfile` module or is somehow invalid." msgstr "" -#: ../../library/tarfile.rst:188 +#: ../../library/tarfile.rst:184 msgid "" "Is raised when a compression method is not supported or when the data cannot " "be decoded properly." msgstr "" -#: ../../library/tarfile.rst:194 +#: ../../library/tarfile.rst:190 msgid "" "Is raised for the limitations that are typical for stream-like :class:" "`TarFile` objects." msgstr "" -#: ../../library/tarfile.rst:200 +#: ../../library/tarfile.rst:196 msgid "" "Is raised for *non-fatal* errors when using :meth:`TarFile.extract`, but " "only if :attr:`TarFile.errorlevel`\\ ``== 2``." msgstr "" -#: ../../library/tarfile.rst:206 +#: ../../library/tarfile.rst:202 msgid "Is raised by :meth:`TarInfo.frombuf` if the buffer it gets is invalid." msgstr "" -#: ../../library/tarfile.rst:209 +#: ../../library/tarfile.rst:205 msgid "The following constants are available at the module level:" msgstr "" -#: ../../library/tarfile.rst:213 +#: ../../library/tarfile.rst:209 msgid "" "The default character encoding: ``'utf-8'`` on Windows, the value returned " "by :func:`sys.getfilesystemencoding` otherwise." msgstr "" -#: ../../library/tarfile.rst:217 +#: ../../library/tarfile.rst:213 msgid "" "Each of the following constants defines a tar archive format that the :mod:" "`tarfile` module is able to create. See section :ref:`tar-formats` for " "details." msgstr "" -#: ../../library/tarfile.rst:224 +#: ../../library/tarfile.rst:220 msgid "POSIX.1-1988 (ustar) format." msgstr "" -#: ../../library/tarfile.rst:229 +#: ../../library/tarfile.rst:225 msgid "GNU tar format." msgstr "" -#: ../../library/tarfile.rst:234 +#: ../../library/tarfile.rst:230 msgid "POSIX.1-2001 (pax) format." msgstr "" -#: ../../library/tarfile.rst:239 +#: ../../library/tarfile.rst:235 msgid "" "The default format for creating archives. This is currently :const:" "`PAX_FORMAT`." msgstr "" -#: ../../library/tarfile.rst:241 +#: ../../library/tarfile.rst:237 msgid "" "The default format for new archives was changed to :const:`PAX_FORMAT` from :" "const:`GNU_FORMAT`." msgstr "" -#: ../../library/tarfile.rst:249 +#: ../../library/tarfile.rst:245 msgid "Module :mod:`zipfile`" msgstr "" -#: ../../library/tarfile.rst:249 +#: ../../library/tarfile.rst:245 msgid "Documentation of the :mod:`zipfile` standard module." msgstr "" -#: ../../library/tarfile.rst:253 +#: ../../library/tarfile.rst:249 msgid ":ref:`archiving-operations`" msgstr "" -#: ../../library/tarfile.rst:252 +#: ../../library/tarfile.rst:248 msgid "" "Documentation of the higher-level archiving facilities provided by the " "standard :mod:`shutil` module." msgstr "" -#: ../../library/tarfile.rst:255 +#: ../../library/tarfile.rst:251 msgid "" "`GNU tar manual, Basic Tar Format `_" msgstr "" -#: ../../library/tarfile.rst:256 +#: ../../library/tarfile.rst:252 msgid "Documentation for tar archive files, including GNU tar extensions." msgstr "" -#: ../../library/tarfile.rst:262 +#: ../../library/tarfile.rst:258 msgid "TarFile Objects" msgstr "" -#: ../../library/tarfile.rst:264 +#: ../../library/tarfile.rst:260 msgid "" "The :class:`TarFile` object provides an interface to a tar archive. A tar " "archive is a sequence of blocks. An archive member (a stored file) is made " @@ -478,7 +472,7 @@ msgid "" "class:`TarInfo` object, see :ref:`tarinfo-objects` for details." msgstr "" -#: ../../library/tarfile.rst:270 +#: ../../library/tarfile.rst:266 msgid "" "A :class:`TarFile` object can be used as a context manager in a :keyword:" "`with` statement. It will automatically be closed when the block is " @@ -487,24 +481,24 @@ msgid "" "be closed. See the :ref:`tar-examples` section for a use case." msgstr "" -#: ../../library/tarfile.rst:276 +#: ../../library/tarfile.rst:272 msgid "Added support for the context management protocol." msgstr "" -#: ../../library/tarfile.rst:281 +#: ../../library/tarfile.rst:277 msgid "" "All following arguments are optional and can be accessed as instance " "attributes as well." msgstr "" -#: ../../library/tarfile.rst:284 +#: ../../library/tarfile.rst:280 msgid "" "*name* is the pathname of the archive. *name* may be a :term:`path-like " "object`. It can be omitted if *fileobj* is given. In this case, the file " "object's :attr:`name` attribute is used if it exists." msgstr "" -#: ../../library/tarfile.rst:288 +#: ../../library/tarfile.rst:284 msgid "" "*mode* is either ``'r'`` to read from an existing archive, ``'a'`` to append " "data to an existing file, ``'w'`` to create a new file overwriting an " @@ -512,18 +506,18 @@ msgid "" "exist." msgstr "" -#: ../../library/tarfile.rst:292 +#: ../../library/tarfile.rst:288 msgid "" "If *fileobj* is given, it is used for reading or writing data. If it can be " "determined, *mode* is overridden by *fileobj*'s mode. *fileobj* will be used " "from position 0." msgstr "" -#: ../../library/tarfile.rst:298 +#: ../../library/tarfile.rst:294 msgid "*fileobj* is not closed, when :class:`TarFile` is closed." msgstr "" -#: ../../library/tarfile.rst:300 +#: ../../library/tarfile.rst:296 msgid "" "*format* controls the archive format for writing. It must be one of the " "constants :const:`USTAR_FORMAT`, :const:`GNU_FORMAT` or :const:`PAX_FORMAT` " @@ -531,20 +525,20 @@ msgid "" "detected, even if different formats are present in a single archive." msgstr "" -#: ../../library/tarfile.rst:305 +#: ../../library/tarfile.rst:301 msgid "" "The *tarinfo* argument can be used to replace the default :class:`TarInfo` " "class with a different one." msgstr "" -#: ../../library/tarfile.rst:308 +#: ../../library/tarfile.rst:304 msgid "" "If *dereference* is :const:`False`, add symbolic and hard links to the " "archive. If it is :const:`True`, add the content of the target files to the " "archive. This has no effect on systems that do not support symbolic links." msgstr "" -#: ../../library/tarfile.rst:312 +#: ../../library/tarfile.rst:308 msgid "" "If *ignore_zeros* is :const:`False`, treat an empty block as the end of the " "archive. If it is :const:`True`, skip empty (and invalid) blocks and try to " @@ -552,13 +546,13 @@ msgid "" "concatenated or damaged archives." msgstr "" -#: ../../library/tarfile.rst:316 +#: ../../library/tarfile.rst:312 msgid "" "*debug* can be set from ``0`` (no debug messages) up to ``3`` (all debug " "messages). The messages are written to ``sys.stderr``." msgstr "" -#: ../../library/tarfile.rst:319 +#: ../../library/tarfile.rst:315 msgid "" "If *errorlevel* is ``0``, all errors are ignored when using :meth:`TarFile." "extract`. Nevertheless, they appear as error messages in the debug output, " @@ -567,7 +561,7 @@ msgid "" "`TarError` exceptions as well." msgstr "" -#: ../../library/tarfile.rst:325 +#: ../../library/tarfile.rst:321 msgid "" "The *encoding* and *errors* arguments define the character encoding to be " "used for reading or writing the archive and how conversion errors are going " @@ -575,47 +569,47 @@ msgid "" "ref:`tar-unicode` for in-depth information." msgstr "" -#: ../../library/tarfile.rst:330 +#: ../../library/tarfile.rst:326 msgid "" "The *pax_headers* argument is an optional dictionary of strings which will " "be added as a pax global header if *format* is :const:`PAX_FORMAT`." msgstr "" -#: ../../library/tarfile.rst:333 ../../library/tarfile.rst:561 +#: ../../library/tarfile.rst:329 ../../library/tarfile.rst:556 msgid "Use ``'surrogateescape'`` as the default for the *errors* argument." msgstr "" -#: ../../library/tarfile.rst:345 +#: ../../library/tarfile.rst:341 msgid "" "Alternative constructor. The :func:`tarfile.open` function is actually a " "shortcut to this classmethod." msgstr "" -#: ../../library/tarfile.rst:351 +#: ../../library/tarfile.rst:347 msgid "" "Return a :class:`TarInfo` object for member *name*. If *name* can not be " "found in the archive, :exc:`KeyError` is raised." msgstr "" -#: ../../library/tarfile.rst:356 +#: ../../library/tarfile.rst:352 msgid "" "If a member occurs more than once in the archive, its last occurrence is " "assumed to be the most up-to-date version." msgstr "" -#: ../../library/tarfile.rst:362 +#: ../../library/tarfile.rst:358 msgid "" "Return the members of the archive as a list of :class:`TarInfo` objects. The " "list has the same order as the members in the archive." msgstr "" -#: ../../library/tarfile.rst:368 +#: ../../library/tarfile.rst:364 msgid "" "Return the members as a list of their names. It has the same order as the " "list returned by :meth:`getmembers`." msgstr "" -#: ../../library/tarfile.rst:374 +#: ../../library/tarfile.rst:370 msgid "" "Print a table of contents to ``sys.stdout``. If *verbose* is :const:`False`, " "only the names of the members are printed. If it is :const:`True`, output " @@ -623,18 +617,18 @@ msgid "" "given, it must be a subset of the list returned by :meth:`getmembers`." msgstr "" -#: ../../library/tarfile.rst:379 +#: ../../library/tarfile.rst:375 msgid "Added the *members* parameter." msgstr "" -#: ../../library/tarfile.rst:385 +#: ../../library/tarfile.rst:381 msgid "" "Return the next member of the archive as a :class:`TarInfo` object, when :" "class:`TarFile` is opened for reading. Return :const:`None` if there is no " "more available." msgstr "" -#: ../../library/tarfile.rst:392 +#: ../../library/tarfile.rst:388 msgid "" "Extract all members from the archive to the current working directory or " "directory *path*. If optional *members* is given, it must be a subset of the " @@ -646,14 +640,14 @@ msgid "" "fail." msgstr "" -#: ../../library/tarfile.rst:400 ../../library/tarfile.rst:426 +#: ../../library/tarfile.rst:396 ../../library/tarfile.rst:422 msgid "" "If *numeric_owner* is :const:`True`, the uid and gid numbers from the " "tarfile are used to set the owner/group for the extracted files. Otherwise, " "the named values from the tarfile are used." msgstr "" -#: ../../library/tarfile.rst:406 +#: ../../library/tarfile.rst:402 msgid "" "Never extract archives from untrusted sources without prior inspection. It " "is possible that files are created outside of *path*, e.g. members that have " @@ -661,15 +655,15 @@ msgid "" "\"``." msgstr "" -#: ../../library/tarfile.rst:411 ../../library/tarfile.rst:442 +#: ../../library/tarfile.rst:407 ../../library/tarfile.rst:438 msgid "Added the *numeric_owner* parameter." msgstr "" -#: ../../library/tarfile.rst:414 ../../library/tarfile.rst:445 +#: ../../library/tarfile.rst:410 ../../library/tarfile.rst:441 msgid "The *path* parameter accepts a :term:`path-like object`." msgstr "" -#: ../../library/tarfile.rst:420 +#: ../../library/tarfile.rst:416 msgid "" "Extract a member from the archive to the current working directory, using " "its full name. Its file information is extracted as accurately as possible. " @@ -678,34 +672,33 @@ msgid "" "File attributes (owner, mtime, mode) are set unless *set_attrs* is false." msgstr "" -#: ../../library/tarfile.rst:432 +#: ../../library/tarfile.rst:428 msgid "" "The :meth:`extract` method does not take care of several extraction issues. " "In most cases you should consider using the :meth:`extractall` method." msgstr "" -#: ../../library/tarfile.rst:437 +#: ../../library/tarfile.rst:433 msgid "See the warning for :meth:`extractall`." msgstr "" -#: ../../library/tarfile.rst:439 +#: ../../library/tarfile.rst:435 msgid "Added the *set_attrs* parameter." msgstr "" -#: ../../library/tarfile.rst:451 +#: ../../library/tarfile.rst:447 msgid "" "Extract a member from the archive as a file object. *member* may be a " "filename or a :class:`TarInfo` object. If *member* is a regular file or a " -"link, an :class:`io.BufferedReader` object is returned. For all other " -"existing members, :const:`None` is returned. If *member* does not appear in " -"the archive, :exc:`KeyError` is raised." +"link, an :class:`io.BufferedReader` object is returned. Otherwise, :const:" +"`None` is returned." msgstr "" -#: ../../library/tarfile.rst:457 +#: ../../library/tarfile.rst:452 msgid "Return an :class:`io.BufferedReader` object." msgstr "" -#: ../../library/tarfile.rst:463 +#: ../../library/tarfile.rst:458 msgid "" "Add the file *name* to the archive. *name* may be any type of file " "(directory, fifo, symbolic link, etc.). If given, *arcname* specifies an " @@ -718,15 +711,15 @@ msgid "" "ref:`tar-examples` for an example." msgstr "" -#: ../../library/tarfile.rst:474 +#: ../../library/tarfile.rst:469 msgid "Added the *filter* parameter." msgstr "" -#: ../../library/tarfile.rst:477 +#: ../../library/tarfile.rst:472 msgid "Recursion adds entries in sorted order." msgstr "" -#: ../../library/tarfile.rst:483 +#: ../../library/tarfile.rst:478 msgid "" "Add the :class:`TarInfo` object *tarinfo* to the archive. If *fileobj* is " "given, it should be a :term:`binary file`, and ``tarinfo.size`` bytes are " @@ -734,7 +727,7 @@ msgid "" "objects directly, or by using :meth:`gettarinfo`." msgstr "" -#: ../../library/tarfile.rst:491 +#: ../../library/tarfile.rst:486 msgid "" "Create a :class:`TarInfo` object from the result of :func:`os.stat` or " "equivalent on an existing file. The file is either named by *name*, or " @@ -745,7 +738,7 @@ msgid "" "The name should be a text string." msgstr "" -#: ../../library/tarfile.rst:500 +#: ../../library/tarfile.rst:495 msgid "" "You can modify some of the :class:`TarInfo`’s attributes before you add it " "using :meth:`addfile`. If the file object is not an ordinary file object " @@ -755,21 +748,21 @@ msgid "" "case *arcname* could be a dummy string." msgstr "" -#: ../../library/tarfile.rst:514 +#: ../../library/tarfile.rst:509 msgid "" "Close the :class:`TarFile`. In write mode, two finishing zero blocks are " "appended to the archive." msgstr "" -#: ../../library/tarfile.rst:520 +#: ../../library/tarfile.rst:515 msgid "A dictionary containing key-value pairs of pax global headers." msgstr "" -#: ../../library/tarfile.rst:527 +#: ../../library/tarfile.rst:522 msgid "TarInfo Objects" msgstr "" -#: ../../library/tarfile.rst:529 +#: ../../library/tarfile.rst:524 msgid "" "A :class:`TarInfo` object represents one member in a :class:`TarFile`. Aside " "from storing all required attributes of a file (like file type, size, time, " @@ -777,57 +770,57 @@ msgid "" "type. It does *not* contain the file's data itself." msgstr "" -#: ../../library/tarfile.rst:534 +#: ../../library/tarfile.rst:529 msgid "" ":class:`TarInfo` objects are returned by :class:`TarFile`'s methods :meth:" "`getmember`, :meth:`getmembers` and :meth:`gettarinfo`." msgstr "" -#: ../../library/tarfile.rst:540 +#: ../../library/tarfile.rst:535 msgid "Create a :class:`TarInfo` object." msgstr "" -#: ../../library/tarfile.rst:545 +#: ../../library/tarfile.rst:540 msgid "Create and return a :class:`TarInfo` object from string buffer *buf*." msgstr "" -#: ../../library/tarfile.rst:547 +#: ../../library/tarfile.rst:542 msgid "Raises :exc:`HeaderError` if the buffer is invalid." msgstr "" -#: ../../library/tarfile.rst:552 +#: ../../library/tarfile.rst:547 msgid "" "Read the next member from the :class:`TarFile` object *tarfile* and return " "it as a :class:`TarInfo` object." msgstr "" -#: ../../library/tarfile.rst:558 +#: ../../library/tarfile.rst:553 msgid "" "Create a string buffer from a :class:`TarInfo` object. For information on " "the arguments see the constructor of the :class:`TarFile` class." msgstr "" -#: ../../library/tarfile.rst:565 +#: ../../library/tarfile.rst:560 msgid "A ``TarInfo`` object has the following public data attributes:" msgstr "" -#: ../../library/tarfile.rst:570 +#: ../../library/tarfile.rst:565 msgid "Name of the archive member." msgstr "" -#: ../../library/tarfile.rst:575 +#: ../../library/tarfile.rst:570 msgid "Size in bytes." msgstr "" -#: ../../library/tarfile.rst:580 +#: ../../library/tarfile.rst:575 msgid "Time of last modification." msgstr "" -#: ../../library/tarfile.rst:585 +#: ../../library/tarfile.rst:580 msgid "Permission bits." msgstr "" -#: ../../library/tarfile.rst:590 +#: ../../library/tarfile.rst:585 msgid "" "File type. *type* is usually one of these constants: :const:`REGTYPE`, :" "const:`AREGTYPE`, :const:`LNKTYPE`, :const:`SYMTYPE`, :const:`DIRTYPE`, :" @@ -836,180 +829,180 @@ msgid "" "more conveniently, use the ``is*()`` methods below." msgstr "" -#: ../../library/tarfile.rst:599 +#: ../../library/tarfile.rst:594 msgid "" "Name of the target file name, which is only present in :class:`TarInfo` " "objects of type :const:`LNKTYPE` and :const:`SYMTYPE`." msgstr "" -#: ../../library/tarfile.rst:605 +#: ../../library/tarfile.rst:600 msgid "User ID of the user who originally stored this member." msgstr "" -#: ../../library/tarfile.rst:610 +#: ../../library/tarfile.rst:605 msgid "Group ID of the user who originally stored this member." msgstr "" -#: ../../library/tarfile.rst:615 +#: ../../library/tarfile.rst:610 msgid "User name." msgstr "" -#: ../../library/tarfile.rst:620 +#: ../../library/tarfile.rst:615 msgid "Group name." msgstr "" -#: ../../library/tarfile.rst:625 +#: ../../library/tarfile.rst:620 msgid "" "A dictionary containing key-value pairs of an associated pax extended header." msgstr "" -#: ../../library/tarfile.rst:628 +#: ../../library/tarfile.rst:623 msgid "A :class:`TarInfo` object also provides some convenient query methods:" msgstr "" -#: ../../library/tarfile.rst:633 +#: ../../library/tarfile.rst:628 msgid "Return :const:`True` if the :class:`Tarinfo` object is a regular file." msgstr "" -#: ../../library/tarfile.rst:638 +#: ../../library/tarfile.rst:633 msgid "Same as :meth:`isfile`." msgstr "" -#: ../../library/tarfile.rst:643 +#: ../../library/tarfile.rst:638 msgid "Return :const:`True` if it is a directory." msgstr "" -#: ../../library/tarfile.rst:648 +#: ../../library/tarfile.rst:643 msgid "Return :const:`True` if it is a symbolic link." msgstr "" -#: ../../library/tarfile.rst:653 +#: ../../library/tarfile.rst:648 msgid "Return :const:`True` if it is a hard link." msgstr "" -#: ../../library/tarfile.rst:658 +#: ../../library/tarfile.rst:653 msgid "Return :const:`True` if it is a character device." msgstr "" -#: ../../library/tarfile.rst:663 +#: ../../library/tarfile.rst:658 msgid "Return :const:`True` if it is a block device." msgstr "" -#: ../../library/tarfile.rst:668 +#: ../../library/tarfile.rst:663 msgid "Return :const:`True` if it is a FIFO." msgstr "" -#: ../../library/tarfile.rst:673 +#: ../../library/tarfile.rst:668 msgid "" "Return :const:`True` if it is one of character device, block device or FIFO." msgstr "" -#: ../../library/tarfile.rst:680 +#: ../../library/tarfile.rst:675 msgid "Command-Line Interface" msgstr "" -#: ../../library/tarfile.rst:684 +#: ../../library/tarfile.rst:679 msgid "" "The :mod:`tarfile` module provides a simple command-line interface to " "interact with tar archives." msgstr "" -#: ../../library/tarfile.rst:687 +#: ../../library/tarfile.rst:682 msgid "" "If you want to create a new tar archive, specify its name after the :option:" "`-c` option and then list the filename(s) that should be included:" msgstr "" -#: ../../library/tarfile.rst:694 +#: ../../library/tarfile.rst:689 msgid "Passing a directory is also acceptable:" msgstr "" -#: ../../library/tarfile.rst:700 +#: ../../library/tarfile.rst:695 msgid "" "If you want to extract a tar archive into the current directory, use the :" "option:`-e` option:" msgstr "" -#: ../../library/tarfile.rst:707 +#: ../../library/tarfile.rst:702 msgid "" "You can also extract a tar archive into a different directory by passing the " "directory's name:" msgstr "" -#: ../../library/tarfile.rst:714 +#: ../../library/tarfile.rst:709 msgid "For a list of the files in a tar archive, use the :option:`-l` option:" msgstr "" -#: ../../library/tarfile.rst:722 +#: ../../library/tarfile.rst:717 msgid "Command-line options" msgstr "" -#: ../../library/tarfile.rst:727 +#: ../../library/tarfile.rst:722 msgid "List files in a tarfile." msgstr "" -#: ../../library/tarfile.rst:732 +#: ../../library/tarfile.rst:727 msgid "Create tarfile from source files." msgstr "" -#: ../../library/tarfile.rst:737 +#: ../../library/tarfile.rst:732 msgid "" "Extract tarfile into the current directory if *output_dir* is not specified." msgstr "" -#: ../../library/tarfile.rst:742 +#: ../../library/tarfile.rst:737 msgid "Test whether the tarfile is valid or not." msgstr "" -#: ../../library/tarfile.rst:746 +#: ../../library/tarfile.rst:741 msgid "Verbose output." msgstr "" -#: ../../library/tarfile.rst:751 +#: ../../library/tarfile.rst:746 msgid "Examples" msgstr "" -#: ../../library/tarfile.rst:753 +#: ../../library/tarfile.rst:748 msgid "How to extract an entire tar archive to the current working directory::" msgstr "" -#: ../../library/tarfile.rst:760 +#: ../../library/tarfile.rst:755 msgid "" "How to extract a subset of a tar archive with :meth:`TarFile.extractall` " "using a generator function instead of a list::" msgstr "" -#: ../../library/tarfile.rst:775 +#: ../../library/tarfile.rst:770 msgid "How to create an uncompressed tar archive from a list of filenames::" msgstr "" -#: ../../library/tarfile.rst:783 +#: ../../library/tarfile.rst:778 msgid "The same example using the :keyword:`with` statement::" msgstr "" -#: ../../library/tarfile.rst:790 +#: ../../library/tarfile.rst:785 msgid "" "How to read a gzip compressed tar archive and display some member " "information::" msgstr "" -#: ../../library/tarfile.rst:804 +#: ../../library/tarfile.rst:799 msgid "" "How to create an archive and reset the user information using the *filter* " "parameter in :meth:`TarFile.add`::" msgstr "" -#: ../../library/tarfile.rst:820 +#: ../../library/tarfile.rst:815 msgid "Supported tar formats" msgstr "" -#: ../../library/tarfile.rst:822 +#: ../../library/tarfile.rst:817 msgid "" "There are three tar formats that can be created with the :mod:`tarfile` " "module:" msgstr "" -#: ../../library/tarfile.rst:824 +#: ../../library/tarfile.rst:819 msgid "" "The POSIX.1-1988 ustar format (:const:`USTAR_FORMAT`). It supports filenames " "up to a length of at best 256 characters and linknames up to 100 characters. " @@ -1017,7 +1010,7 @@ msgid "" "supported format." msgstr "" -#: ../../library/tarfile.rst:829 +#: ../../library/tarfile.rst:824 msgid "" "The GNU tar format (:const:`GNU_FORMAT`). It supports long filenames and " "linknames, files bigger than 8 GiB and sparse files. It is the de facto " @@ -1025,7 +1018,7 @@ msgid "" "extensions for long names, sparse file support is read-only." msgstr "" -#: ../../library/tarfile.rst:834 +#: ../../library/tarfile.rst:829 msgid "" "The POSIX.1-2001 pax format (:const:`PAX_FORMAT`). It is the most flexible " "format with virtually no limits. It supports long filenames and linknames, " @@ -1036,7 +1029,7 @@ msgid "" "*ustar* format. It is the current default format for new archives." msgstr "" -#: ../../library/tarfile.rst:842 +#: ../../library/tarfile.rst:837 msgid "" "It extends the existing *ustar* format with extra headers for information " "that cannot be stored otherwise. There are two flavours of pax headers: " @@ -1045,13 +1038,13 @@ msgid "" "in a pax header is encoded in *UTF-8* for portability reasons." msgstr "" -#: ../../library/tarfile.rst:848 +#: ../../library/tarfile.rst:843 msgid "" "There are some more variants of the tar format which can be read, but not " "created:" msgstr "" -#: ../../library/tarfile.rst:851 +#: ../../library/tarfile.rst:846 msgid "" "The ancient V7 format. This is the first tar format from Unix Seventh " "Edition, storing only regular files and directories. Names must not be " @@ -1060,17 +1053,17 @@ msgid "" "ASCII characters." msgstr "" -#: ../../library/tarfile.rst:856 +#: ../../library/tarfile.rst:851 msgid "" "The SunOS tar extended format. This format is a variant of the POSIX.1-2001 " "pax format, but is not compatible." msgstr "" -#: ../../library/tarfile.rst:862 +#: ../../library/tarfile.rst:857 msgid "Unicode issues" msgstr "" -#: ../../library/tarfile.rst:864 +#: ../../library/tarfile.rst:859 msgid "" "The tar format was originally conceived to make backups on tape drives with " "the main focus on preserving file system information. Nowadays tar archives " @@ -1085,13 +1078,13 @@ msgid "" "It stores non-ASCII metadata using the universal character encoding *UTF-8*." msgstr "" -#: ../../library/tarfile.rst:876 +#: ../../library/tarfile.rst:871 msgid "" "The details of character conversion in :mod:`tarfile` are controlled by the " "*encoding* and *errors* keyword arguments of the :class:`TarFile` class." msgstr "" -#: ../../library/tarfile.rst:879 +#: ../../library/tarfile.rst:874 msgid "" "*encoding* defines the character encoding to use for the metadata in the " "archive. The default value is :func:`sys.getfilesystemencoding` or " @@ -1100,7 +1093,7 @@ msgid "" "not set appropriately, this conversion may fail." msgstr "" -#: ../../library/tarfile.rst:885 +#: ../../library/tarfile.rst:880 msgid "" "The *errors* argument defines how characters are treated that cannot be " "converted. Possible values are listed in section :ref:`error-handlers`. The " @@ -1108,7 +1101,7 @@ msgid "" "system calls, see :ref:`os-filenames`." msgstr "" -#: ../../library/tarfile.rst:890 +#: ../../library/tarfile.rst:885 msgid "" "For :const:`PAX_FORMAT` archives (the default), *encoding* is generally not " "needed because all the metadata is stored using *UTF-8*. *encoding* is only " diff --git a/library/telnetlib.po b/library/telnetlib.po index afe16351fb..c821c8ef81 100644 --- a/library/telnetlib.po +++ b/library/telnetlib.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.7\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2021-09-07 06:52+0000\n" +"POT-Creation-Date: 2020-06-20 18:08+0800\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-" @@ -212,7 +212,7 @@ msgid "" "connection is closed." msgstr "" -#: ../../library/telnetlib.rst:181 +#: ../../library/telnetlib.rst:182 msgid "" "Raises an :ref:`auditing event ` ``telnetlib.Telnet.write`` with " "arguments ``self``, ``buffer``." diff --git a/library/tempfile.po b/library/tempfile.po index 0005126dcb..217172fb49 100644 --- a/library/tempfile.po +++ b/library/tempfile.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.7\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2021-09-07 06:52+0000\n" +"POT-Creation-Date: 2020-06-20 18:08+0800\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-" @@ -98,8 +98,8 @@ msgid "" "specific, requires Linux kernel 3.11 or later)." msgstr "" -#: ../../library/tempfile.rst:65 ../../library/tempfile.rst:90 -#: ../../library/tempfile.rst:185 +#: ../../library/tempfile.rst:66 ../../library/tempfile.rst:91 +#: ../../library/tempfile.rst:187 msgid "" "Raises an :ref:`auditing event ` ``tempfile.mkstemp`` with " "argument ``fullpath``." @@ -179,7 +179,7 @@ msgid "" "method." msgstr "" -#: ../../library/tempfile.rst:137 ../../library/tempfile.rst:211 +#: ../../library/tempfile.rst:138 ../../library/tempfile.rst:213 msgid "" "Raises an :ref:`auditing event ` ``tempfile.mkdtemp`` with " "argument ``fullpath``." @@ -238,18 +238,18 @@ msgstr "" #: ../../library/tempfile.rst:178 msgid "" -"If *text* is specified and true, the file is opened in text mode. Otherwise, " -"(the default) the file is opened in binary mode." +"If *text* is specified, it indicates whether to open the file in binary mode " +"(the default) or text mode. On some platforms, this makes no difference." msgstr "" -#: ../../library/tempfile.rst:181 +#: ../../library/tempfile.rst:182 msgid "" ":func:`mkstemp` returns a tuple containing an OS-level handle to an open " "file (as would be returned by :func:`os.open`) and the absolute pathname of " "that file, in that order." msgstr "" -#: ../../library/tempfile.rst:187 ../../library/tempfile.rst:213 +#: ../../library/tempfile.rst:188 ../../library/tempfile.rst:214 msgid "" "*suffix*, *prefix*, and *dir* may now be supplied in bytes in order to " "obtain a bytes return value. Prior to this, only str was allowed. *suffix* " @@ -257,98 +257,98 @@ msgid "" "default value to be used." msgstr "" -#: ../../library/tempfile.rst:193 ../../library/tempfile.rst:219 +#: ../../library/tempfile.rst:194 ../../library/tempfile.rst:220 msgid "The *dir* parameter now accepts a :term:`path-like object`." msgstr "" -#: ../../library/tempfile.rst:199 +#: ../../library/tempfile.rst:200 msgid "" "Creates a temporary directory in the most secure manner possible. There are " "no race conditions in the directory's creation. The directory is readable, " "writable, and searchable only by the creating user ID." msgstr "" -#: ../../library/tempfile.rst:203 +#: ../../library/tempfile.rst:204 msgid "" "The user of :func:`mkdtemp` is responsible for deleting the temporary " "directory and its contents when done with it." msgstr "" -#: ../../library/tempfile.rst:206 +#: ../../library/tempfile.rst:207 msgid "" "The *prefix*, *suffix*, and *dir* arguments are the same as for :func:" "`mkstemp`." msgstr "" -#: ../../library/tempfile.rst:209 +#: ../../library/tempfile.rst:210 msgid ":func:`mkdtemp` returns the absolute pathname of the new directory." msgstr "" -#: ../../library/tempfile.rst:225 +#: ../../library/tempfile.rst:226 msgid "" "Return the name of the directory used for temporary files. This defines the " "default value for the *dir* argument to all functions in this module." msgstr "" -#: ../../library/tempfile.rst:229 +#: ../../library/tempfile.rst:230 msgid "" "Python searches a standard list of directories to find one which the calling " "user can create files in. The list is:" msgstr "" -#: ../../library/tempfile.rst:232 +#: ../../library/tempfile.rst:233 msgid "The directory named by the :envvar:`TMPDIR` environment variable." msgstr "" -#: ../../library/tempfile.rst:234 +#: ../../library/tempfile.rst:235 msgid "The directory named by the :envvar:`TEMP` environment variable." msgstr "" -#: ../../library/tempfile.rst:236 +#: ../../library/tempfile.rst:237 msgid "The directory named by the :envvar:`TMP` environment variable." msgstr "" -#: ../../library/tempfile.rst:238 +#: ../../library/tempfile.rst:239 msgid "A platform-specific location:" msgstr "" -#: ../../library/tempfile.rst:240 +#: ../../library/tempfile.rst:241 msgid "" "On Windows, the directories :file:`C:\\\\TEMP`, :file:`C:\\\\TMP`, :file:`\\" "\\TEMP`, and :file:`\\\\TMP`, in that order." msgstr "" -#: ../../library/tempfile.rst:243 +#: ../../library/tempfile.rst:244 msgid "" "On all other platforms, the directories :file:`/tmp`, :file:`/var/tmp`, and :" "file:`/usr/tmp`, in that order." msgstr "" -#: ../../library/tempfile.rst:246 +#: ../../library/tempfile.rst:247 msgid "As a last resort, the current working directory." msgstr "" -#: ../../library/tempfile.rst:248 +#: ../../library/tempfile.rst:249 msgid "" "The result of this search is cached, see the description of :data:`tempdir` " "below." msgstr "" -#: ../../library/tempfile.rst:253 +#: ../../library/tempfile.rst:254 msgid "Same as :func:`gettempdir` but the return value is in bytes." msgstr "" -#: ../../library/tempfile.rst:259 +#: ../../library/tempfile.rst:260 msgid "" "Return the filename prefix used to create temporary files. This does not " "contain the directory component." msgstr "" -#: ../../library/tempfile.rst:264 +#: ../../library/tempfile.rst:265 msgid "Same as :func:`gettempprefix` but the return value is in bytes." msgstr "" -#: ../../library/tempfile.rst:268 +#: ../../library/tempfile.rst:269 msgid "" "The module uses a global variable to store the name of the directory used " "for temporary files returned by :func:`gettempdir`. It can be set directly " @@ -357,24 +357,24 @@ msgid "" "and this is the recommended approach." msgstr "" -#: ../../library/tempfile.rst:276 +#: ../../library/tempfile.rst:277 msgid "" "When set to a value other than ``None``, this variable defines the default " "value for the *dir* argument to the functions defined in this module." msgstr "" -#: ../../library/tempfile.rst:280 +#: ../../library/tempfile.rst:281 msgid "" "If ``tempdir`` is ``None`` (the default) at any call to any of the above " "functions except :func:`gettempprefix` it is initialized following the " "algorithm described in :func:`gettempdir`." msgstr "" -#: ../../library/tempfile.rst:287 +#: ../../library/tempfile.rst:288 msgid "Examples" msgstr "" -#: ../../library/tempfile.rst:289 +#: ../../library/tempfile.rst:290 msgid "Here are some examples of typical usage of the :mod:`tempfile` module::" msgstr "" diff --git a/library/test.po b/library/test.po index f365e7998e..8839fcf847 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-07 06:52+0000\n" +"POT-Creation-Date: 2020-06-20 18:08+0800\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-" @@ -1655,23 +1655,23 @@ msgid "" "and inspecting bytecode generation." msgstr "" -#: ../../library/test.rst:1614 +#: ../../library/test.rst:1612 msgid "The module defines the following class:" msgstr "" -#: ../../library/test.rst:1618 +#: ../../library/test.rst:1616 msgid "This class has custom assertion methods for inspecting bytecode." msgstr "" -#: ../../library/test.rst:1622 +#: ../../library/test.rst:1620 msgid "Return the disassembly of *co* as string." msgstr "" -#: ../../library/test.rst:1627 +#: ../../library/test.rst:1625 msgid "" "Return instr if *opname* is found, otherwise throws :exc:`AssertionError`." msgstr "" -#: ../../library/test.rst:1632 +#: ../../library/test.rst:1630 msgid "Throws :exc:`AssertionError` if *opname* is found." msgstr "" diff --git a/library/textwrap.po b/library/textwrap.po index 10e7a4f05c..5e644f03e7 100644 --- a/library/textwrap.po +++ b/library/textwrap.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.7\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2021-09-07 06:52+0000\n" +"POT-Creation-Date: 2020-06-20 18:08+0800\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-" @@ -35,42 +35,42 @@ msgid "" "`TextWrapper` for efficiency." msgstr "" -#: ../../library/textwrap.rst:26 +#: ../../library/textwrap.rst:22 msgid "" "Wraps the single paragraph in *text* (a string) so every line is at most " "*width* characters long. Returns a list of output lines, without final " "newlines." msgstr "" -#: ../../library/textwrap.rst:30 +#: ../../library/textwrap.rst:26 msgid "" "Optional keyword arguments correspond to the instance attributes of :class:" -"`TextWrapper`, documented below." +"`TextWrapper`, documented below. *width* defaults to ``70``." msgstr "" -#: ../../library/textwrap.rst:33 +#: ../../library/textwrap.rst:29 msgid "" "See the :meth:`TextWrapper.wrap` method for additional details on how :func:" "`wrap` behaves." msgstr "" -#: ../../library/textwrap.rst:44 +#: ../../library/textwrap.rst:35 msgid "" "Wraps the single paragraph in *text*, and returns a single string containing " "the wrapped paragraph. :func:`fill` is shorthand for ::" msgstr "" -#: ../../library/textwrap.rst:49 +#: ../../library/textwrap.rst:40 msgid "" "In particular, :func:`fill` accepts exactly the same keyword arguments as :" "func:`wrap`." msgstr "" -#: ../../library/textwrap.rst:57 +#: ../../library/textwrap.rst:46 msgid "Collapse and truncate the given *text* to fit in the given *width*." msgstr "" -#: ../../library/textwrap.rst:59 +#: ../../library/textwrap.rst:48 msgid "" "First the whitespace in *text* is collapsed (all whitespace is replaced by " "single spaces). If the result fits in the *width*, it is returned. " @@ -78,7 +78,7 @@ msgid "" "plus the :attr:`placeholder` fit within :attr:`width`::" msgstr "" -#: ../../library/textwrap.rst:71 +#: ../../library/textwrap.rst:60 msgid "" "Optional keyword arguments correspond to the instance attributes of :class:" "`TextWrapper`, documented below. Note that the whitespace is collapsed " @@ -87,55 +87,55 @@ msgid "" "drop_whitespace`, and :attr:`.replace_whitespace` will have no effect." msgstr "" -#: ../../library/textwrap.rst:81 +#: ../../library/textwrap.rst:71 msgid "Remove any common leading whitespace from every line in *text*." msgstr "" -#: ../../library/textwrap.rst:83 +#: ../../library/textwrap.rst:73 msgid "" "This can be used to make triple-quoted strings line up with the left edge of " "the display, while still presenting them in the source code in indented form." msgstr "" -#: ../../library/textwrap.rst:86 +#: ../../library/textwrap.rst:76 msgid "" "Note that tabs and spaces are both treated as whitespace, but they are not " "equal: the lines ``\" hello\"`` and ``\"\\thello\"`` are considered to have " "no common leading whitespace." msgstr "" -#: ../../library/textwrap.rst:90 +#: ../../library/textwrap.rst:80 msgid "" "Lines containing only whitespace are ignored in the input and normalized to " "a single newline character in the output." msgstr "" -#: ../../library/textwrap.rst:93 ../../library/textwrap.rst:114 +#: ../../library/textwrap.rst:83 ../../library/textwrap.rst:104 msgid "For example::" msgstr "" -#: ../../library/textwrap.rst:107 +#: ../../library/textwrap.rst:97 msgid "Add *prefix* to the beginning of selected lines in *text*." msgstr "" -#: ../../library/textwrap.rst:109 +#: ../../library/textwrap.rst:99 msgid "Lines are separated by calling ``text.splitlines(True)``." msgstr "" -#: ../../library/textwrap.rst:111 +#: ../../library/textwrap.rst:101 msgid "" "By default, *prefix* is added to all lines that do not consist solely of " "whitespace (including any line endings)." msgstr "" -#: ../../library/textwrap.rst:120 +#: ../../library/textwrap.rst:110 msgid "" "The optional *predicate* argument can be used to control which lines are " "indented. For example, it is easy to add *prefix* to even empty and " "whitespace-only lines::" msgstr "" -#: ../../library/textwrap.rst:133 +#: ../../library/textwrap.rst:123 msgid "" ":func:`wrap`, :func:`fill` and :func:`shorten` work by creating a :class:" "`TextWrapper` instance and calling a single method on it. That instance is " @@ -144,38 +144,38 @@ msgid "" "class:`TextWrapper` object." msgstr "" -#: ../../library/textwrap.rst:139 +#: ../../library/textwrap.rst:129 msgid "" "Text is preferably wrapped on whitespaces and right after the hyphens in " "hyphenated words; only then will long words be broken if necessary, unless :" "attr:`TextWrapper.break_long_words` is set to false." msgstr "" -#: ../../library/textwrap.rst:145 +#: ../../library/textwrap.rst:135 msgid "" "The :class:`TextWrapper` constructor accepts a number of optional keyword " "arguments. Each keyword argument corresponds to an instance attribute, so " "for example ::" msgstr "" -#: ../../library/textwrap.rst:151 +#: ../../library/textwrap.rst:141 msgid "is the same as ::" msgstr "" -#: ../../library/textwrap.rst:156 +#: ../../library/textwrap.rst:146 msgid "" "You can re-use the same :class:`TextWrapper` object many times, and you can " "change any of its options through direct assignment to instance attributes " "between uses." msgstr "" -#: ../../library/textwrap.rst:160 +#: ../../library/textwrap.rst:150 msgid "" "The :class:`TextWrapper` instance attributes (and keyword arguments to the " "constructor) are as follows:" msgstr "" -#: ../../library/textwrap.rst:166 +#: ../../library/textwrap.rst:156 msgid "" "(default: ``70``) The maximum length of wrapped lines. As long as there are " "no individual words in the input text longer than :attr:`width`, :class:" @@ -183,20 +183,20 @@ msgid "" "`width` characters." msgstr "" -#: ../../library/textwrap.rst:174 +#: ../../library/textwrap.rst:164 msgid "" "(default: ``True``) If true, then all tab characters in *text* will be " "expanded to spaces using the :meth:`expandtabs` method of *text*." msgstr "" -#: ../../library/textwrap.rst:180 +#: ../../library/textwrap.rst:170 msgid "" "(default: ``8``) If :attr:`expand_tabs` is true, then all tab characters in " "*text* will be expanded to zero or more spaces, depending on the current " "column and the given tab size." msgstr "" -#: ../../library/textwrap.rst:189 +#: ../../library/textwrap.rst:179 msgid "" "(default: ``True``) If true, after tab expansion but before wrapping, the :" "meth:`wrap` method will replace each whitespace character with a single " @@ -204,14 +204,14 @@ msgid "" "vertical tab, formfeed, and carriage return (``'\\t\\n\\v\\f\\r'``)." msgstr "" -#: ../../library/textwrap.rst:197 +#: ../../library/textwrap.rst:187 msgid "" "If :attr:`expand_tabs` is false and :attr:`replace_whitespace` is true, each " "tab character will be replaced by a single space, which is *not* the same as " "tab expansion." msgstr "" -#: ../../library/textwrap.rst:203 +#: ../../library/textwrap.rst:193 msgid "" "If :attr:`replace_whitespace` is false, newlines may appear in the middle of " "a line and cause strange output. For this reason, text should be split into " @@ -219,7 +219,7 @@ msgid "" "separately." msgstr "" -#: ../../library/textwrap.rst:211 +#: ../../library/textwrap.rst:201 msgid "" "(default: ``True``) If true, whitespace at the beginning and ending of every " "line (after wrapping but before indenting) is dropped. Whitespace at the " @@ -228,21 +228,21 @@ msgid "" "line is dropped." msgstr "" -#: ../../library/textwrap.rst:220 +#: ../../library/textwrap.rst:210 msgid "" "(default: ``''``) String that will be prepended to the first line of wrapped " "output. Counts towards the length of the first line. The empty string is " "not indented." msgstr "" -#: ../../library/textwrap.rst:227 +#: ../../library/textwrap.rst:217 msgid "" "(default: ``''``) String that will be prepended to all lines of wrapped " "output except the first. Counts towards the length of each line except the " "first." msgstr "" -#: ../../library/textwrap.rst:234 +#: ../../library/textwrap.rst:224 msgid "" "(default: ``False``) If true, :class:`TextWrapper` attempts to detect " "sentence endings and ensure that sentences are always separated by exactly " @@ -254,15 +254,15 @@ msgid "" "unable to detect the difference between \"Dr.\" in ::" msgstr "" -#: ../../library/textwrap.rst:245 +#: ../../library/textwrap.rst:235 msgid "and \"Spot.\" in ::" msgstr "" -#: ../../library/textwrap.rst:249 +#: ../../library/textwrap.rst:239 msgid ":attr:`fix_sentence_endings` is false by default." msgstr "" -#: ../../library/textwrap.rst:251 +#: ../../library/textwrap.rst:241 msgid "" "Since the sentence detection algorithm relies on ``string.lowercase`` for " "the definition of \"lowercase letter\", and a convention of using two spaces " @@ -270,7 +270,7 @@ msgid "" "English-language texts." msgstr "" -#: ../../library/textwrap.rst:259 +#: ../../library/textwrap.rst:249 msgid "" "(default: ``True``) If true, then words longer than :attr:`width` will be " "broken in order to ensure that no lines are longer than :attr:`width`. If " @@ -279,7 +279,7 @@ msgid "" "order to minimize the amount by which :attr:`width` is exceeded.)" msgstr "" -#: ../../library/textwrap.rst:268 +#: ../../library/textwrap.rst:258 msgid "" "(default: ``True``) If true, wrapping will occur preferably on whitespaces " "and right after hyphens in compound words, as it is customary in English. If " @@ -289,25 +289,25 @@ msgid "" "always allow breaking hyphenated words." msgstr "" -#: ../../library/textwrap.rst:278 +#: ../../library/textwrap.rst:268 msgid "" "(default: ``None``) If not ``None``, then the output will contain at most " "*max_lines* lines, with *placeholder* appearing at the end of the output." msgstr "" -#: ../../library/textwrap.rst:288 +#: ../../library/textwrap.rst:278 msgid "" "(default: ``' [...]'``) String that will appear at the end of the output " "text if it has been truncated." msgstr "" -#: ../../library/textwrap.rst:294 +#: ../../library/textwrap.rst:284 msgid "" ":class:`TextWrapper` also provides some public methods, analogous to the " "module-level convenience functions:" msgstr "" -#: ../../library/textwrap.rst:299 +#: ../../library/textwrap.rst:289 msgid "" "Wraps the single paragraph in *text* (a string) so every line is at most :" "attr:`width` characters long. All wrapping options are taken from instance " @@ -316,7 +316,7 @@ msgid "" "returned list is empty." msgstr "" -#: ../../library/textwrap.rst:308 +#: ../../library/textwrap.rst:298 msgid "" "Wraps the single paragraph in *text*, and returns a single string containing " "the wrapped paragraph." diff --git a/library/threading.po b/library/threading.po index 49423e0a21..2a1fb38c6a 100644 --- a/library/threading.po +++ b/library/threading.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.7\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2021-09-07 06:52+0000\n" +"POT-Creation-Date: 2020-06-20 18:08+0800\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-" @@ -43,28 +43,17 @@ msgid "" "supported by this module." msgstr "" -#: ../../library/threading.rst:26 -msgid "" -"In CPython, due to the :term:`Global Interpreter Lock `, only one thread can execute Python code at once (even though certain " -"performance-oriented libraries might overcome this limitation). If you want " -"your application to make better use of the computational resources of multi-" -"core machines, you are advised to use :mod:`multiprocessing` or :class:" -"`concurrent.futures.ProcessPoolExecutor`. However, threading is still an " -"appropriate model if you want to run multiple I/O-bound tasks simultaneously." -msgstr "" - -#: ../../library/threading.rst:37 +#: ../../library/threading.rst:24 msgid "This module defines the following functions:" msgstr "" -#: ../../library/threading.rst:42 +#: ../../library/threading.rst:29 msgid "" "Return the number of :class:`Thread` objects currently alive. The returned " "count is equal to the length of the list returned by :func:`.enumerate`." msgstr "" -#: ../../library/threading.rst:48 +#: ../../library/threading.rst:35 msgid "" "Return the current :class:`Thread` object, corresponding to the caller's " "thread of control. If the caller's thread of control was not created " @@ -72,67 +61,67 @@ msgid "" "functionality is returned." msgstr "" -#: ../../library/threading.rst:56 +#: ../../library/threading.rst:43 msgid "Handle uncaught exception raised by :func:`Thread.run`." msgstr "" -#: ../../library/threading.rst:58 +#: ../../library/threading.rst:45 msgid "The *args* argument has the following attributes:" msgstr "" -#: ../../library/threading.rst:60 +#: ../../library/threading.rst:47 msgid "*exc_type*: Exception type." msgstr "" -#: ../../library/threading.rst:61 +#: ../../library/threading.rst:48 msgid "*exc_value*: Exception value, can be ``None``." msgstr "" -#: ../../library/threading.rst:62 +#: ../../library/threading.rst:49 msgid "*exc_traceback*: Exception traceback, can be ``None``." msgstr "" -#: ../../library/threading.rst:63 +#: ../../library/threading.rst:50 msgid "*thread*: Thread which raised the exception, can be ``None``." msgstr "" -#: ../../library/threading.rst:65 +#: ../../library/threading.rst:52 msgid "" "If *exc_type* is :exc:`SystemExit`, the exception is silently ignored. " "Otherwise, the exception is printed out on :data:`sys.stderr`." msgstr "" -#: ../../library/threading.rst:68 +#: ../../library/threading.rst:55 msgid "" "If this function raises an exception, :func:`sys.excepthook` is called to " "handle it." msgstr "" -#: ../../library/threading.rst:71 +#: ../../library/threading.rst:58 msgid "" ":func:`threading.excepthook` can be overridden to control how uncaught " "exceptions raised by :func:`Thread.run` are handled." msgstr "" -#: ../../library/threading.rst:74 +#: ../../library/threading.rst:61 msgid "" "Storing *exc_value* using a custom hook can create a reference cycle. It " "should be cleared explicitly to break the reference cycle when the exception " "is no longer needed." msgstr "" -#: ../../library/threading.rst:78 +#: ../../library/threading.rst:65 msgid "" "Storing *thread* using a custom hook can resurrect it if it is set to an " "object which is being finalized. Avoid storing *thread* after the custom " "hook completes to avoid resurrecting objects." msgstr "" -#: ../../library/threading.rst:83 +#: ../../library/threading.rst:70 msgid ":func:`sys.excepthook` handles uncaught exceptions." msgstr "" -#: ../../library/threading.rst:90 +#: ../../library/threading.rst:77 msgid "" "Return the 'thread identifier' of the current thread. This is a nonzero " "integer. Its value has no direct meaning; it is intended as a magic cookie " @@ -141,7 +130,7 @@ msgid "" "created." msgstr "" -#: ../../library/threading.rst:101 +#: ../../library/threading.rst:88 msgid "" "Return the native integral Thread ID of the current thread assigned by the " "kernel. This is a non-negative integer. Its value may be used to uniquely " @@ -149,42 +138,41 @@ msgid "" "after which the value may be recycled by the OS)." msgstr "" -#: ../../library/threading.rst:107 +#: ../../library/threading.rst:94 msgid "" ":ref:`Availability `: Windows, FreeBSD, Linux, macOS, OpenBSD, " "NetBSD, AIX." msgstr "" -#: ../../library/threading.rst:113 +#: ../../library/threading.rst:100 msgid "" -"Return a list of all :class:`Thread` objects currently active. The list " -"includes daemonic threads and dummy thread objects created by :func:" -"`current_thread`. It excludes terminated threads and threads that have not " -"yet been started. However, the main thread is always part of the result, " -"even when terminated." +"Return a list of all :class:`Thread` objects currently alive. The list " +"includes daemonic threads, dummy thread objects created by :func:" +"`current_thread`, and the main thread. It excludes terminated threads and " +"threads that have not yet been started." msgstr "" -#: ../../library/threading.rst:122 +#: ../../library/threading.rst:108 msgid "" "Return the main :class:`Thread` object. In normal conditions, the main " "thread is the thread from which the Python interpreter was started." msgstr "" -#: ../../library/threading.rst:133 +#: ../../library/threading.rst:119 msgid "" "Set a trace function for all threads started from the :mod:`threading` " "module. The *func* will be passed to :func:`sys.settrace` for each thread, " "before its :meth:`~Thread.run` method is called." msgstr "" -#: ../../library/threading.rst:142 +#: ../../library/threading.rst:128 msgid "" "Set a profile function for all threads started from the :mod:`threading` " "module. The *func* will be passed to :func:`sys.setprofile` for each " "thread, before its :meth:`~Thread.run` method is called." msgstr "" -#: ../../library/threading.rst:149 +#: ../../library/threading.rst:135 msgid "" "Return the thread stack size used when creating new threads. The optional " "*size* argument specifies the stack size to be used for subsequently created " @@ -203,16 +191,16 @@ msgid "" "information)." msgstr "" -#: ../../library/threading.rst:164 +#: ../../library/threading.rst:150 msgid "" ":ref:`Availability `: Windows, systems with POSIX threads." msgstr "" -#: ../../library/threading.rst:167 +#: ../../library/threading.rst:153 msgid "This module also defines the following constant:" msgstr "" -#: ../../library/threading.rst:171 +#: ../../library/threading.rst:157 msgid "" "The maximum value allowed for the *timeout* parameter of blocking functions " "(:meth:`Lock.acquire`, :meth:`RLock.acquire`, :meth:`Condition.wait`, etc.). " @@ -220,13 +208,13 @@ msgid "" "`OverflowError`." msgstr "" -#: ../../library/threading.rst:179 +#: ../../library/threading.rst:165 msgid "" "This module defines a number of classes, which are detailed in the sections " "below." msgstr "" -#: ../../library/threading.rst:182 +#: ../../library/threading.rst:168 msgid "" "The design of this module is loosely based on Java's threading model. " "However, where Java makes locks and condition variables basic behavior of " @@ -237,40 +225,40 @@ msgid "" "Thread class, when implemented, are mapped to module-level functions." msgstr "" -#: ../../library/threading.rst:190 +#: ../../library/threading.rst:176 msgid "All of the methods described below are executed atomically." msgstr "" -#: ../../library/threading.rst:194 +#: ../../library/threading.rst:180 msgid "Thread-Local Data" msgstr "" -#: ../../library/threading.rst:196 +#: ../../library/threading.rst:182 msgid "" "Thread-local data is data whose values are thread specific. To manage " "thread-local data, just create an instance of :class:`local` (or a subclass) " "and store attributes on it::" msgstr "" -#: ../../library/threading.rst:203 +#: ../../library/threading.rst:189 msgid "The instance's values will be different for separate threads." msgstr "" -#: ../../library/threading.rst:208 +#: ../../library/threading.rst:194 msgid "A class that represents thread-local data." msgstr "" -#: ../../library/threading.rst:210 +#: ../../library/threading.rst:196 msgid "" "For more details and extensive examples, see the documentation string of " "the :mod:`_threading_local` module." msgstr "" -#: ../../library/threading.rst:217 +#: ../../library/threading.rst:203 msgid "Thread Objects" msgstr "" -#: ../../library/threading.rst:219 +#: ../../library/threading.rst:205 msgid "" "The :class:`Thread` class represents an activity that is run in a separate " "thread of control. There are two ways to specify the activity: by passing a " @@ -280,14 +268,14 @@ msgid "" "`~Thread.__init__` and :meth:`~Thread.run` methods of this class." msgstr "" -#: ../../library/threading.rst:226 +#: ../../library/threading.rst:212 msgid "" "Once a thread object is created, its activity must be started by calling the " "thread's :meth:`~Thread.start` method. This invokes the :meth:`~Thread.run` " "method in a separate thread of control." msgstr "" -#: ../../library/threading.rst:230 +#: ../../library/threading.rst:216 msgid "" "Once the thread's activity is started, the thread is considered 'alive'. It " "stops being alive when its :meth:`~Thread.run` method terminates -- either " @@ -295,27 +283,27 @@ msgid "" "is_alive` method tests whether the thread is alive." msgstr "" -#: ../../library/threading.rst:235 +#: ../../library/threading.rst:221 msgid "" "Other threads can call a thread's :meth:`~Thread.join` method. This blocks " "the calling thread until the thread whose :meth:`~Thread.join` method is " "called is terminated." msgstr "" -#: ../../library/threading.rst:239 +#: ../../library/threading.rst:225 msgid "" "A thread has a name. The name can be passed to the constructor, and read or " "changed through the :attr:`~Thread.name` attribute." msgstr "" -#: ../../library/threading.rst:242 +#: ../../library/threading.rst:228 msgid "" "If the :meth:`~Thread.run` method raises an exception, :func:`threading." "excepthook` is called to handle it. By default, :func:`threading.excepthook` " "ignores silently :exc:`SystemExit`." msgstr "" -#: ../../library/threading.rst:246 +#: ../../library/threading.rst:232 msgid "" "A thread can be flagged as a \"daemon thread\". The significance of this " "flag is that the entire Python program exits when only daemon threads are " @@ -324,7 +312,7 @@ msgid "" "constructor argument." msgstr "" -#: ../../library/threading.rst:253 +#: ../../library/threading.rst:239 msgid "" "Daemon threads are abruptly stopped at shutdown. Their resources (such as " "open files, database transactions, etc.) may not be released properly. If " @@ -332,13 +320,13 @@ msgid "" "suitable signalling mechanism such as an :class:`Event`." msgstr "" -#: ../../library/threading.rst:258 +#: ../../library/threading.rst:244 msgid "" "There is a \"main thread\" object; this corresponds to the initial thread of " "control in the Python program. It is not a daemon thread." msgstr "" -#: ../../library/threading.rst:261 +#: ../../library/threading.rst:247 msgid "" "There is the possibility that \"dummy thread objects\" are created. These " "are thread objects corresponding to \"alien threads\", which are threads of " @@ -348,81 +336,81 @@ msgid "" "deleted, since it is impossible to detect the termination of alien threads." msgstr "" -#: ../../library/threading.rst:272 +#: ../../library/threading.rst:258 msgid "" "This constructor should always be called with keyword arguments. Arguments " "are:" msgstr "" -#: ../../library/threading.rst:275 +#: ../../library/threading.rst:261 msgid "" "*group* should be ``None``; reserved for future extension when a :class:" "`ThreadGroup` class is implemented." msgstr "" -#: ../../library/threading.rst:278 +#: ../../library/threading.rst:264 msgid "" "*target* is the callable object to be invoked by the :meth:`run` method. " "Defaults to ``None``, meaning nothing is called." msgstr "" -#: ../../library/threading.rst:281 +#: ../../library/threading.rst:267 msgid "" "*name* is the thread name. By default, a unique name is constructed of the " "form \"Thread-*N*\" where *N* is a small decimal number." msgstr "" -#: ../../library/threading.rst:284 +#: ../../library/threading.rst:270 msgid "" "*args* is the argument tuple for the target invocation. Defaults to ``()``." msgstr "" -#: ../../library/threading.rst:286 +#: ../../library/threading.rst:272 msgid "" "*kwargs* is a dictionary of keyword arguments for the target invocation. " "Defaults to ``{}``." msgstr "" -#: ../../library/threading.rst:289 +#: ../../library/threading.rst:275 msgid "" "If not ``None``, *daemon* explicitly sets whether the thread is daemonic. If " "``None`` (the default), the daemonic property is inherited from the current " "thread." msgstr "" -#: ../../library/threading.rst:293 +#: ../../library/threading.rst:279 msgid "" "If the subclass overrides the constructor, it must make sure to invoke the " "base class constructor (``Thread.__init__()``) before doing anything else to " "the thread." msgstr "" -#: ../../library/threading.rst:297 +#: ../../library/threading.rst:283 msgid "Added the *daemon* argument." msgstr "" -#: ../../library/threading.rst:302 +#: ../../library/threading.rst:288 msgid "Start the thread's activity." msgstr "" -#: ../../library/threading.rst:304 +#: ../../library/threading.rst:290 msgid "" "It must be called at most once per thread object. It arranges for the " "object's :meth:`~Thread.run` method to be invoked in a separate thread of " "control." msgstr "" -#: ../../library/threading.rst:308 +#: ../../library/threading.rst:294 msgid "" "This method will raise a :exc:`RuntimeError` if called more than once on the " "same thread object." msgstr "" -#: ../../library/threading.rst:313 +#: ../../library/threading.rst:299 msgid "Method representing the thread's activity." msgstr "" -#: ../../library/threading.rst:315 +#: ../../library/threading.rst:301 msgid "" "You may override this method in a subclass. The standard :meth:`run` method " "invokes the callable object passed to the object's constructor as the " @@ -430,7 +418,7 @@ msgid "" "the *args* and *kwargs* arguments, respectively." msgstr "" -#: ../../library/threading.rst:322 +#: ../../library/threading.rst:308 msgid "" "Wait until the thread terminates. This blocks the calling thread until the " "thread whose :meth:`~Thread.join` method is called terminates -- either " @@ -438,7 +426,7 @@ msgid "" "occurs." msgstr "" -#: ../../library/threading.rst:327 +#: ../../library/threading.rst:313 msgid "" "When the *timeout* argument is present and not ``None``, it should be a " "floating point number specifying a timeout for the operation in seconds (or " @@ -448,17 +436,17 @@ msgid "" "`~Thread.join` call timed out." msgstr "" -#: ../../library/threading.rst:334 +#: ../../library/threading.rst:320 msgid "" "When the *timeout* argument is not present or ``None``, the operation will " "block until the thread terminates." msgstr "" -#: ../../library/threading.rst:337 +#: ../../library/threading.rst:323 msgid "A thread can be :meth:`~Thread.join`\\ ed many times." msgstr "" -#: ../../library/threading.rst:339 +#: ../../library/threading.rst:325 msgid "" ":meth:`~Thread.join` raises a :exc:`RuntimeError` if an attempt is made to " "join the current thread as that would cause a deadlock. It is also an error " @@ -466,20 +454,20 @@ msgid "" "do so raise the same exception." msgstr "" -#: ../../library/threading.rst:346 +#: ../../library/threading.rst:332 msgid "" "A string used for identification purposes only. It has no semantics. " "Multiple threads may be given the same name. The initial name is set by the " "constructor." msgstr "" -#: ../../library/threading.rst:353 +#: ../../library/threading.rst:339 msgid "" "Old getter/setter API for :attr:`~Thread.name`; use it directly as a " "property instead." msgstr "" -#: ../../library/threading.rst:358 +#: ../../library/threading.rst:344 msgid "" "The 'thread identifier' of this thread or ``None`` if the thread has not " "been started. This is a nonzero integer. See the :func:`get_ident` " @@ -488,7 +476,7 @@ msgid "" "thread has exited." msgstr "" -#: ../../library/threading.rst:366 +#: ../../library/threading.rst:352 msgid "" "The native integral thread ID of this thread. This is a non-negative " "integer, or ``None`` if the thread has not been started. See the :func:" @@ -498,30 +486,30 @@ msgid "" "terminates, after which the value may be recycled by the OS)." msgstr "" -#: ../../library/threading.rst:376 +#: ../../library/threading.rst:362 msgid "" "Similar to Process IDs, Thread IDs are only valid (guaranteed unique system-" "wide) from the time the thread is created until the thread has been " "terminated." msgstr "" -#: ../../library/threading.rst:381 +#: ../../library/threading.rst:367 msgid "" ":ref:`Availability `: Requires :func:`get_native_id` function." msgstr "" -#: ../../library/threading.rst:386 +#: ../../library/threading.rst:372 msgid "Return whether the thread is alive." msgstr "" -#: ../../library/threading.rst:388 +#: ../../library/threading.rst:374 msgid "" "This method returns ``True`` just before the :meth:`~Thread.run` method " "starts until just after the :meth:`~Thread.run` method terminates. The " "module function :func:`.enumerate` returns a list of all alive threads." msgstr "" -#: ../../library/threading.rst:394 +#: ../../library/threading.rst:380 msgid "" "A boolean value indicating whether this thread is a daemon thread (True) or " "not (False). This must be set before :meth:`~Thread.start` is called, " @@ -531,22 +519,33 @@ msgid "" "daemon` = ``False``." msgstr "" -#: ../../library/threading.rst:401 +#: ../../library/threading.rst:387 msgid "" "The entire Python program exits when no alive non-daemon threads are left." msgstr "" -#: ../../library/threading.rst:406 +#: ../../library/threading.rst:392 msgid "" "Old getter/setter API for :attr:`~Thread.daemon`; use it directly as a " "property instead." msgstr "" -#: ../../library/threading.rst:413 +#: ../../library/threading.rst:398 +msgid "" +"In CPython, due to the :term:`Global Interpreter Lock`, only one thread can " +"execute Python code at once (even though certain performance-oriented " +"libraries might overcome this limitation). If you want your application to " +"make better use of the computational resources of multi-core machines, you " +"are advised to use :mod:`multiprocessing` or :class:`concurrent.futures." +"ProcessPoolExecutor`. However, threading is still an appropriate model if " +"you want to run multiple I/O-bound tasks simultaneously." +msgstr "" + +#: ../../library/threading.rst:411 msgid "Lock Objects" msgstr "" -#: ../../library/threading.rst:415 +#: ../../library/threading.rst:413 msgid "" "A primitive lock is a synchronization primitive that is not owned by a " "particular thread when locked. In Python, it is currently the lowest level " @@ -554,7 +553,7 @@ msgid "" "`_thread` extension module." msgstr "" -#: ../../library/threading.rst:420 +#: ../../library/threading.rst:418 msgid "" "A primitive lock is in one of two states, \"locked\" or \"unlocked\". It is " "created in the unlocked state. It has two basic methods, :meth:`~Lock." @@ -568,11 +567,11 @@ msgid "" "an unlocked lock, a :exc:`RuntimeError` will be raised." msgstr "" -#: ../../library/threading.rst:431 +#: ../../library/threading.rst:429 msgid "Locks also support the :ref:`context management protocol `." msgstr "" -#: ../../library/threading.rst:433 +#: ../../library/threading.rst:431 msgid "" "When more than one thread is blocked in :meth:`~Lock.acquire` waiting for " "the state to turn to unlocked, only one thread proceeds when a :meth:`~Lock." @@ -580,42 +579,42 @@ msgid "" "proceeds is not defined, and may vary across implementations." msgstr "" -#: ../../library/threading.rst:438 +#: ../../library/threading.rst:436 msgid "All methods are executed atomically." msgstr "" -#: ../../library/threading.rst:443 +#: ../../library/threading.rst:441 msgid "" "The class implementing primitive lock objects. Once a thread has acquired a " "lock, subsequent attempts to acquire it block, until it is released; any " "thread may release it." msgstr "" -#: ../../library/threading.rst:447 +#: ../../library/threading.rst:445 msgid "" "Note that ``Lock`` is actually a factory function which returns an instance " "of the most efficient version of the concrete Lock class that is supported " "by the platform." msgstr "" -#: ../../library/threading.rst:454 ../../library/threading.rst:534 +#: ../../library/threading.rst:452 ../../library/threading.rst:532 msgid "Acquire a lock, blocking or non-blocking." msgstr "" -#: ../../library/threading.rst:456 +#: ../../library/threading.rst:454 msgid "" "When invoked with the *blocking* argument set to ``True`` (the default), " "block until the lock is unlocked, then set it to locked and return ``True``." msgstr "" -#: ../../library/threading.rst:459 +#: ../../library/threading.rst:457 msgid "" "When invoked with the *blocking* argument set to ``False``, do not block. If " "a call with *blocking* set to ``True`` would block, return ``False`` " "immediately; otherwise, set the lock to locked and return ``True``." msgstr "" -#: ../../library/threading.rst:463 +#: ../../library/threading.rst:461 msgid "" "When invoked with the floating-point *timeout* argument set to a positive " "value, block for at most the number of seconds specified by *timeout* and as " @@ -624,53 +623,53 @@ msgid "" "*blocking* is false." msgstr "" -#: ../../library/threading.rst:469 +#: ../../library/threading.rst:467 msgid "" "The return value is ``True`` if the lock is acquired successfully, ``False`` " "if not (for example if the *timeout* expired)." msgstr "" -#: ../../library/threading.rst:472 ../../library/threading.rst:556 -#: ../../library/threading.rst:801 +#: ../../library/threading.rst:470 ../../library/threading.rst:554 +#: ../../library/threading.rst:799 msgid "The *timeout* parameter is new." msgstr "" -#: ../../library/threading.rst:475 +#: ../../library/threading.rst:473 msgid "" "Lock acquisition can now be interrupted by signals on POSIX if the " "underlying threading implementation supports it." msgstr "" -#: ../../library/threading.rst:482 +#: ../../library/threading.rst:480 msgid "" "Release a lock. This can be called from any thread, not only the thread " "which has acquired the lock." msgstr "" -#: ../../library/threading.rst:485 +#: ../../library/threading.rst:483 msgid "" "When the lock is locked, reset it to unlocked, and return. If any other " "threads are blocked waiting for the lock to become unlocked, allow exactly " "one of them to proceed." msgstr "" -#: ../../library/threading.rst:489 +#: ../../library/threading.rst:487 msgid "When invoked on an unlocked lock, a :exc:`RuntimeError` is raised." msgstr "" -#: ../../library/threading.rst:491 ../../library/threading.rst:572 +#: ../../library/threading.rst:489 ../../library/threading.rst:570 msgid "There is no return value." msgstr "" -#: ../../library/threading.rst:495 +#: ../../library/threading.rst:493 msgid "Return true if the lock is acquired." msgstr "" -#: ../../library/threading.rst:502 +#: ../../library/threading.rst:500 msgid "RLock Objects" msgstr "" -#: ../../library/threading.rst:504 +#: ../../library/threading.rst:502 msgid "" "A reentrant lock is a synchronization primitive that may be acquired " "multiple times by the same thread. Internally, it uses the concepts of " @@ -679,7 +678,7 @@ msgid "" "lock; in the unlocked state, no thread owns it." msgstr "" -#: ../../library/threading.rst:510 +#: ../../library/threading.rst:508 msgid "" "To lock the lock, a thread calls its :meth:`~RLock.acquire` method; this " "returns once the thread owns the lock. To unlock the lock, a thread calls " @@ -690,13 +689,13 @@ msgid "" "proceed." msgstr "" -#: ../../library/threading.rst:517 +#: ../../library/threading.rst:515 msgid "" "Reentrant locks also support the :ref:`context management protocol `." msgstr "" -#: ../../library/threading.rst:522 +#: ../../library/threading.rst:520 msgid "" "This class implements reentrant lock objects. A reentrant lock must be " "released by the thread that acquired it. Once a thread has acquired a " @@ -704,14 +703,14 @@ msgid "" "thread must release it once for each time it has acquired it." msgstr "" -#: ../../library/threading.rst:527 +#: ../../library/threading.rst:525 msgid "" "Note that ``RLock`` is actually a factory function which returns an instance " "of the most efficient version of the concrete RLock class that is supported " "by the platform." msgstr "" -#: ../../library/threading.rst:536 +#: ../../library/threading.rst:534 msgid "" "When invoked without arguments: if this thread already owns the lock, " "increment the recursion level by one, and return immediately. Otherwise, if " @@ -722,13 +721,13 @@ msgid "" "ownership of the lock. There is no return value in this case." msgstr "" -#: ../../library/threading.rst:544 +#: ../../library/threading.rst:542 msgid "" "When invoked with the *blocking* argument set to true, do the same thing as " "when called without arguments, and return ``True``." msgstr "" -#: ../../library/threading.rst:547 +#: ../../library/threading.rst:545 msgid "" "When invoked with the *blocking* argument set to false, do not block. If a " "call without an argument would block, return ``False`` immediately; " @@ -736,7 +735,7 @@ msgid "" "``True``." msgstr "" -#: ../../library/threading.rst:551 +#: ../../library/threading.rst:549 msgid "" "When invoked with the floating-point *timeout* argument set to a positive " "value, block for at most the number of seconds specified by *timeout* and as " @@ -744,7 +743,7 @@ msgid "" "acquired, false if the timeout has elapsed." msgstr "" -#: ../../library/threading.rst:562 +#: ../../library/threading.rst:560 msgid "" "Release a lock, decrementing the recursion level. If after the decrement it " "is zero, reset the lock to unlocked (not owned by any thread), and if any " @@ -753,17 +752,17 @@ msgid "" "is still nonzero, the lock remains locked and owned by the calling thread." msgstr "" -#: ../../library/threading.rst:568 +#: ../../library/threading.rst:566 msgid "" "Only call this method when the calling thread owns the lock. A :exc:" "`RuntimeError` is raised if this method is called when the lock is unlocked." msgstr "" -#: ../../library/threading.rst:578 +#: ../../library/threading.rst:576 msgid "Condition Objects" msgstr "" -#: ../../library/threading.rst:580 +#: ../../library/threading.rst:578 msgid "" "A condition variable is always associated with some kind of lock; this can " "be passed in or one will be created by default. Passing one in is useful " @@ -771,7 +770,7 @@ msgid "" "of the condition object: you don't have to track it separately." msgstr "" -#: ../../library/threading.rst:585 +#: ../../library/threading.rst:583 msgid "" "A condition variable obeys the :ref:`context management protocol `: using the ``with`` statement acquires the associated lock for the " @@ -780,7 +779,7 @@ msgid "" "associated lock." msgstr "" -#: ../../library/threading.rst:591 +#: ../../library/threading.rst:589 msgid "" "Other methods must be called with the associated lock held. The :meth:" "`~Condition.wait` method releases the lock, and then blocks until another " @@ -789,14 +788,14 @@ msgid "" "and returns. It is also possible to specify a timeout." msgstr "" -#: ../../library/threading.rst:597 +#: ../../library/threading.rst:595 msgid "" "The :meth:`~Condition.notify` method wakes up one of the threads waiting for " "the condition variable, if any are waiting. The :meth:`~Condition." "notify_all` method wakes up all threads waiting for the condition variable." msgstr "" -#: ../../library/threading.rst:601 +#: ../../library/threading.rst:599 msgid "" "Note: the :meth:`~Condition.notify` and :meth:`~Condition.notify_all` " "methods don't release the lock; this means that the thread or threads " @@ -805,7 +804,7 @@ msgid "" "or :meth:`~Condition.notify_all` finally relinquishes ownership of the lock." msgstr "" -#: ../../library/threading.rst:607 +#: ../../library/threading.rst:605 msgid "" "The typical programming style using condition variables uses the lock to " "synchronize access to some shared state; threads that are interested in a " @@ -817,7 +816,7 @@ msgid "" "situation with unlimited buffer capacity::" msgstr "" -#: ../../library/threading.rst:627 +#: ../../library/threading.rst:625 msgid "" "The ``while`` loop checking for the application's condition is necessary " "because :meth:`~Condition.wait` can return after an arbitrary long time, and " @@ -827,7 +826,7 @@ msgid "" "checking, and eases the computation of timeouts::" msgstr "" -#: ../../library/threading.rst:639 +#: ../../library/threading.rst:637 msgid "" "To choose between :meth:`~Condition.notify` and :meth:`~Condition." "notify_all`, consider whether one state change can be interesting for only " @@ -836,45 +835,45 @@ msgid "" "thread." msgstr "" -#: ../../library/threading.rst:647 +#: ../../library/threading.rst:645 msgid "" "This class implements condition variable objects. A condition variable " "allows one or more threads to wait until they are notified by another thread." msgstr "" -#: ../../library/threading.rst:650 +#: ../../library/threading.rst:648 msgid "" "If the *lock* argument is given and not ``None``, it must be a :class:`Lock` " "or :class:`RLock` object, and it is used as the underlying lock. Otherwise, " "a new :class:`RLock` object is created and used as the underlying lock." msgstr "" -#: ../../library/threading.rst:654 ../../library/threading.rst:776 -#: ../../library/threading.rst:822 ../../library/threading.rst:874 -#: ../../library/threading.rst:943 +#: ../../library/threading.rst:652 ../../library/threading.rst:774 +#: ../../library/threading.rst:820 ../../library/threading.rst:872 +#: ../../library/threading.rst:941 msgid "changed from a factory function to a class." msgstr "" -#: ../../library/threading.rst:659 +#: ../../library/threading.rst:657 msgid "" "Acquire the underlying lock. This method calls the corresponding method on " "the underlying lock; the return value is whatever that method returns." msgstr "" -#: ../../library/threading.rst:664 +#: ../../library/threading.rst:662 msgid "" "Release the underlying lock. This method calls the corresponding method on " "the underlying lock; there is no return value." msgstr "" -#: ../../library/threading.rst:669 +#: ../../library/threading.rst:667 msgid "" "Wait until notified or until a timeout occurs. If the calling thread has not " "acquired the lock when this method is called, a :exc:`RuntimeError` is " "raised." msgstr "" -#: ../../library/threading.rst:673 +#: ../../library/threading.rst:671 msgid "" "This method releases the underlying lock, and then blocks until it is " "awakened by a :meth:`notify` or :meth:`notify_all` call for the same " @@ -882,14 +881,14 @@ msgid "" "Once awakened or timed out, it re-acquires the lock and returns." msgstr "" -#: ../../library/threading.rst:678 +#: ../../library/threading.rst:676 msgid "" "When the *timeout* argument is present and not ``None``, it should be a " "floating point number specifying a timeout for the operation in seconds (or " "fractions thereof)." msgstr "" -#: ../../library/threading.rst:682 +#: ../../library/threading.rst:680 msgid "" "When the underlying lock is an :class:`RLock`, it is not released using its :" "meth:`release` method, since this may not actually unlock the lock when it " @@ -899,24 +898,24 @@ msgid "" "used to restore the recursion level when the lock is reacquired." msgstr "" -#: ../../library/threading.rst:690 +#: ../../library/threading.rst:688 msgid "" "The return value is ``True`` unless a given *timeout* expired, in which case " "it is ``False``." msgstr "" -#: ../../library/threading.rst:693 ../../library/threading.rst:908 +#: ../../library/threading.rst:691 ../../library/threading.rst:906 msgid "Previously, the method always returned ``None``." msgstr "" -#: ../../library/threading.rst:698 +#: ../../library/threading.rst:696 msgid "" "Wait until a condition evaluates to true. *predicate* should be a callable " "which result will be interpreted as a boolean value. A *timeout* may be " "provided giving the maximum time to wait." msgstr "" -#: ../../library/threading.rst:702 +#: ../../library/threading.rst:700 msgid "" "This utility method may call :meth:`wait` repeatedly until the predicate is " "satisfied, or until a timeout occurs. The return value is the last return " @@ -924,33 +923,33 @@ msgid "" "out." msgstr "" -#: ../../library/threading.rst:707 +#: ../../library/threading.rst:705 msgid "" "Ignoring the timeout feature, calling this method is roughly equivalent to " "writing::" msgstr "" -#: ../../library/threading.rst:713 +#: ../../library/threading.rst:711 msgid "" "Therefore, the same rules apply as with :meth:`wait`: The lock must be held " "when called and is re-acquired on return. The predicate is evaluated with " "the lock held." msgstr "" -#: ../../library/threading.rst:721 +#: ../../library/threading.rst:719 msgid "" "By default, wake up one thread waiting on this condition, if any. If the " "calling thread has not acquired the lock when this method is called, a :exc:" "`RuntimeError` is raised." msgstr "" -#: ../../library/threading.rst:725 +#: ../../library/threading.rst:723 msgid "" "This method wakes up at most *n* of the threads waiting for the condition " "variable; it is a no-op if no threads are waiting." msgstr "" -#: ../../library/threading.rst:728 +#: ../../library/threading.rst:726 msgid "" "The current implementation wakes up exactly *n* threads, if at least *n* " "threads are waiting. However, it's not safe to rely on this behavior. A " @@ -958,14 +957,14 @@ msgid "" "threads." msgstr "" -#: ../../library/threading.rst:733 +#: ../../library/threading.rst:731 msgid "" "Note: an awakened thread does not actually return from its :meth:`wait` call " "until it can reacquire the lock. Since :meth:`notify` does not release the " "lock, its caller should." msgstr "" -#: ../../library/threading.rst:739 +#: ../../library/threading.rst:737 msgid "" "Wake up all threads waiting on this condition. This method acts like :meth:" "`notify`, but wakes up all waiting threads instead of one. If the calling " @@ -973,11 +972,11 @@ msgid "" "`RuntimeError` is raised." msgstr "" -#: ../../library/threading.rst:748 +#: ../../library/threading.rst:746 msgid "Semaphore Objects" msgstr "" -#: ../../library/threading.rst:750 +#: ../../library/threading.rst:748 msgid "" "This is one of the oldest synchronization primitives in the history of " "computer science, invented by the early Dutch computer scientist Edsger W. " @@ -985,7 +984,7 @@ msgid "" "acquire` and :meth:`~Semaphore.release`)." msgstr "" -#: ../../library/threading.rst:755 +#: ../../library/threading.rst:753 msgid "" "A semaphore manages an internal counter which is decremented by each :meth:" "`~Semaphore.acquire` call and incremented by each :meth:`~Semaphore.release` " @@ -994,12 +993,12 @@ msgid "" "meth:`~Semaphore.release`." msgstr "" -#: ../../library/threading.rst:761 +#: ../../library/threading.rst:759 msgid "" "Semaphores also support the :ref:`context management protocol `." msgstr "" -#: ../../library/threading.rst:766 +#: ../../library/threading.rst:764 msgid "" "This class implements semaphore objects. A semaphore manages an atomic " "counter representing the number of :meth:`release` calls minus the number " @@ -1008,28 +1007,28 @@ msgid "" "If not given, *value* defaults to 1." msgstr "" -#: ../../library/threading.rst:772 +#: ../../library/threading.rst:770 msgid "" "The optional argument gives the initial *value* for the internal counter; it " "defaults to ``1``. If the *value* given is less than 0, :exc:`ValueError` is " "raised." msgstr "" -#: ../../library/threading.rst:781 +#: ../../library/threading.rst:779 msgid "Acquire a semaphore." msgstr "" -#: ../../library/threading.rst:783 +#: ../../library/threading.rst:781 msgid "When invoked without arguments:" msgstr "" -#: ../../library/threading.rst:785 +#: ../../library/threading.rst:783 msgid "" "If the internal counter is larger than zero on entry, decrement it by one " "and return ``True`` immediately." msgstr "" -#: ../../library/threading.rst:787 +#: ../../library/threading.rst:785 msgid "" "If the internal counter is zero on entry, block until awoken by a call to :" "meth:`~Semaphore.release`. Once awoken (and the counter is greater than 0), " @@ -1038,32 +1037,32 @@ msgid "" "threads are awoken should not be relied on." msgstr "" -#: ../../library/threading.rst:793 +#: ../../library/threading.rst:791 msgid "" "When invoked with *blocking* set to false, do not block. If a call without " "an argument would block, return ``False`` immediately; otherwise, do the " "same thing as when called without arguments, and return ``True``." msgstr "" -#: ../../library/threading.rst:797 +#: ../../library/threading.rst:795 msgid "" "When invoked with a *timeout* other than ``None``, it will block for at most " "*timeout* seconds. If acquire does not complete successfully in that " "interval, return ``False``. Return ``True`` otherwise." msgstr "" -#: ../../library/threading.rst:806 +#: ../../library/threading.rst:804 msgid "" "Release a semaphore, incrementing the internal counter by *n*. When it was " "zero on entry and other threads are waiting for it to become larger than " "zero again, wake up *n* of those threads." msgstr "" -#: ../../library/threading.rst:810 +#: ../../library/threading.rst:808 msgid "Added the *n* parameter to release multiple waiting threads at once." msgstr "" -#: ../../library/threading.rst:816 +#: ../../library/threading.rst:814 msgid "" "Class implementing bounded semaphore objects. A bounded semaphore checks to " "make sure its current value doesn't exceed its initial value. If it does, :" @@ -1072,11 +1071,11 @@ msgid "" "times it's a sign of a bug. If not given, *value* defaults to 1." msgstr "" -#: ../../library/threading.rst:829 +#: ../../library/threading.rst:827 msgid ":class:`Semaphore` Example" msgstr "" -#: ../../library/threading.rst:831 +#: ../../library/threading.rst:829 msgid "" "Semaphores are often used to guard resources with limited capacity, for " "example, a database server. In any situation where the size of the resource " @@ -1084,37 +1083,37 @@ msgid "" "threads, your main thread would initialize the semaphore::" msgstr "" -#: ../../library/threading.rst:840 +#: ../../library/threading.rst:838 msgid "" "Once spawned, worker threads call the semaphore's acquire and release " "methods when they need to connect to the server::" msgstr "" -#: ../../library/threading.rst:850 +#: ../../library/threading.rst:848 msgid "" "The use of a bounded semaphore reduces the chance that a programming error " "which causes the semaphore to be released more than it's acquired will go " "undetected." msgstr "" -#: ../../library/threading.rst:857 +#: ../../library/threading.rst:855 msgid "Event Objects" msgstr "" -#: ../../library/threading.rst:859 +#: ../../library/threading.rst:857 msgid "" "This is one of the simplest mechanisms for communication between threads: " "one thread signals an event and other threads wait for it." msgstr "" -#: ../../library/threading.rst:862 +#: ../../library/threading.rst:860 msgid "" "An event object manages an internal flag that can be set to true with the :" "meth:`~Event.set` method and reset to false with the :meth:`~Event.clear` " "method. The :meth:`~Event.wait` method blocks until the flag is true." msgstr "" -#: ../../library/threading.rst:869 +#: ../../library/threading.rst:867 msgid "" "Class implementing event objects. An event manages a flag that can be set " "to true with the :meth:`~Event.set` method and reset to false with the :meth:" @@ -1122,39 +1121,39 @@ msgid "" "flag is initially false." msgstr "" -#: ../../library/threading.rst:879 +#: ../../library/threading.rst:877 msgid "Return ``True`` if and only if the internal flag is true." msgstr "" -#: ../../library/threading.rst:883 +#: ../../library/threading.rst:881 msgid "" "Set the internal flag to true. All threads waiting for it to become true are " "awakened. Threads that call :meth:`wait` once the flag is true will not " "block at all." msgstr "" -#: ../../library/threading.rst:889 +#: ../../library/threading.rst:887 msgid "" "Reset the internal flag to false. Subsequently, threads calling :meth:`wait` " "will block until :meth:`.set` is called to set the internal flag to true " "again." msgstr "" -#: ../../library/threading.rst:895 +#: ../../library/threading.rst:893 msgid "" "Block until the internal flag is true. If the internal flag is true on " "entry, return immediately. Otherwise, block until another thread calls :" "meth:`.set` to set the flag to true, or until the optional timeout occurs." msgstr "" -#: ../../library/threading.rst:899 +#: ../../library/threading.rst:897 msgid "" "When the timeout argument is present and not ``None``, it should be a " "floating point number specifying a timeout for the operation in seconds (or " "fractions thereof)." msgstr "" -#: ../../library/threading.rst:903 +#: ../../library/threading.rst:901 msgid "" "This method returns ``True`` if and only if the internal flag has been set " "to true, either before the wait call or after the wait starts, so it will " @@ -1162,11 +1161,11 @@ msgid "" "out." msgstr "" -#: ../../library/threading.rst:915 +#: ../../library/threading.rst:913 msgid "Timer Objects" msgstr "" -#: ../../library/threading.rst:917 +#: ../../library/threading.rst:915 msgid "" "This class represents an action that should be run only after a certain " "amount of time has passed --- a timer. :class:`Timer` is a subclass of :" @@ -1174,7 +1173,7 @@ msgid "" "threads." msgstr "" -#: ../../library/threading.rst:921 +#: ../../library/threading.rst:919 msgid "" "Timers are started, as with threads, by calling their :meth:`~Timer.start` " "method. The timer can be stopped (before its action has begun) by calling " @@ -1183,11 +1182,11 @@ msgid "" "by the user." msgstr "" -#: ../../library/threading.rst:927 +#: ../../library/threading.rst:925 msgid "For example::" msgstr "" -#: ../../library/threading.rst:938 +#: ../../library/threading.rst:936 msgid "" "Create a timer that will run *function* with arguments *args* and keyword " "arguments *kwargs*, after *interval* seconds have passed. If *args* is " @@ -1195,17 +1194,17 @@ msgid "" "``None`` (the default) then an empty dict will be used." msgstr "" -#: ../../library/threading.rst:948 +#: ../../library/threading.rst:946 msgid "" "Stop the timer, and cancel the execution of the timer's action. This will " "only work if the timer is still in its waiting stage." msgstr "" -#: ../../library/threading.rst:953 +#: ../../library/threading.rst:951 msgid "Barrier Objects" msgstr "" -#: ../../library/threading.rst:957 +#: ../../library/threading.rst:955 msgid "" "This class provides a simple synchronization primitive for use by a fixed " "number of threads that need to wait for each other. Each of the threads " @@ -1214,18 +1213,18 @@ msgid "" "calls. At this point, the threads are released simultaneously." msgstr "" -#: ../../library/threading.rst:963 +#: ../../library/threading.rst:961 msgid "" "The barrier can be reused any number of times for the same number of threads." msgstr "" -#: ../../library/threading.rst:965 +#: ../../library/threading.rst:963 msgid "" "As an example, here is a simple way to synchronize a client and server " "thread::" msgstr "" -#: ../../library/threading.rst:985 +#: ../../library/threading.rst:983 msgid "" "Create a barrier object for *parties* number of threads. An *action*, when " "provided, is a callable to be called by one of the threads when they are " @@ -1233,7 +1232,7 @@ msgid "" "the :meth:`wait` method." msgstr "" -#: ../../library/threading.rst:992 +#: ../../library/threading.rst:990 msgid "" "Pass the barrier. When all the threads party to the barrier have called " "this function, they are all released simultaneously. If a *timeout* is " @@ -1241,44 +1240,44 @@ msgid "" "constructor." msgstr "" -#: ../../library/threading.rst:997 +#: ../../library/threading.rst:995 msgid "" "The return value is an integer in the range 0 to *parties* -- 1, different " "for each thread. This can be used to select a thread to do some special " "housekeeping, e.g.::" msgstr "" -#: ../../library/threading.rst:1006 +#: ../../library/threading.rst:1004 msgid "" "If an *action* was provided to the constructor, one of the threads will have " "called it prior to being released. Should this call raise an error, the " "barrier is put into the broken state." msgstr "" -#: ../../library/threading.rst:1010 +#: ../../library/threading.rst:1008 msgid "If the call times out, the barrier is put into the broken state." msgstr "" -#: ../../library/threading.rst:1012 +#: ../../library/threading.rst:1010 msgid "" "This method may raise a :class:`BrokenBarrierError` exception if the barrier " "is broken or reset while a thread is waiting." msgstr "" -#: ../../library/threading.rst:1017 +#: ../../library/threading.rst:1015 msgid "" "Return the barrier to the default, empty state. Any threads waiting on it " "will receive the :class:`BrokenBarrierError` exception." msgstr "" -#: ../../library/threading.rst:1020 +#: ../../library/threading.rst:1018 msgid "" "Note that using this function may require some external synchronization if " "there are other threads whose state is unknown. If a barrier is broken it " "may be better to just leave it and create a new one." msgstr "" -#: ../../library/threading.rst:1026 +#: ../../library/threading.rst:1024 msgid "" "Put the barrier into a broken state. This causes any active or future calls " "to :meth:`wait` to fail with the :class:`BrokenBarrierError`. Use this for " @@ -1286,36 +1285,36 @@ msgid "" "application." msgstr "" -#: ../../library/threading.rst:1031 +#: ../../library/threading.rst:1029 msgid "" "It may be preferable to simply create the barrier with a sensible *timeout* " "value to automatically guard against one of the threads going awry." msgstr "" -#: ../../library/threading.rst:1037 +#: ../../library/threading.rst:1035 msgid "The number of threads required to pass the barrier." msgstr "" -#: ../../library/threading.rst:1041 +#: ../../library/threading.rst:1039 msgid "The number of threads currently waiting in the barrier." msgstr "" -#: ../../library/threading.rst:1045 +#: ../../library/threading.rst:1043 msgid "A boolean that is ``True`` if the barrier is in the broken state." msgstr "" -#: ../../library/threading.rst:1050 +#: ../../library/threading.rst:1048 msgid "" "This exception, a subclass of :exc:`RuntimeError`, is raised when the :class:" "`Barrier` object is reset or broken." msgstr "" -#: ../../library/threading.rst:1057 +#: ../../library/threading.rst:1055 msgid "" "Using locks, conditions, and semaphores in the :keyword:`!with` statement" msgstr "" -#: ../../library/threading.rst:1059 +#: ../../library/threading.rst:1057 msgid "" "All of the objects provided by this module that have :meth:`acquire` and :" "meth:`release` methods can be used as context managers for a :keyword:`with` " @@ -1324,11 +1323,11 @@ msgid "" "Hence, the following snippet::" msgstr "" -#: ../../library/threading.rst:1068 +#: ../../library/threading.rst:1066 msgid "is equivalent to::" msgstr "" -#: ../../library/threading.rst:1076 +#: ../../library/threading.rst:1074 msgid "" "Currently, :class:`Lock`, :class:`RLock`, :class:`Condition`, :class:" "`Semaphore`, and :class:`BoundedSemaphore` objects may be used as :keyword:" diff --git a/library/time.po b/library/time.po index cdcdf3d409..c598f74d4f 100644 --- a/library/time.po +++ b/library/time.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.7\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2021-09-07 06:52+0000\n" +"POT-Creation-Date: 2020-06-20 18:08+0800\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-" @@ -359,7 +359,7 @@ msgid "" "Return the value (in fractional seconds) of a monotonic clock, i.e. a clock " "that cannot go backwards. The clock is not affected by system clock " "updates. The reference point of the returned value is undefined, so that " -"only the difference between the results of two calls is valid." +"only the difference between the results of consecutive calls is valid." msgstr "" #: ../../library/time.rst:277 @@ -376,7 +376,7 @@ msgid "" "clock with the highest available resolution to measure a short duration. It " "does include time elapsed during sleep and is system-wide. The reference " "point of the returned value is undefined, so that only the difference " -"between the results of two calls is valid." +"between the results of consecutive calls is valid." msgstr "" #: ../../library/time.rst:302 @@ -389,7 +389,7 @@ msgid "" "CPU time of the current process. It does not include time elapsed during " "sleep. It is process-wide by definition. The reference point of the " "returned value is undefined, so that only the difference between the results " -"of two calls is valid." +"of consecutive calls is valid." msgstr "" #: ../../library/time.rst:324 @@ -942,7 +942,7 @@ msgid "" "CPU time of the current thread. It does not include time elapsed during " "sleep. It is thread-specific by definition. The reference point of the " "returned value is undefined, so that only the difference between the results " -"of two calls in the same thread is valid." +"of consecutive calls in the same thread is valid." msgstr "" #: ../../library/time.rst:600 diff --git a/library/timeit.po b/library/timeit.po index 9112c9515c..f3da0d891a 100644 --- a/library/timeit.po +++ b/library/timeit.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.7\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2021-09-07 06:52+0000\n" +"POT-Creation-Date: 2020-06-20 18:08+0800\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-" @@ -32,7 +32,7 @@ msgid "" "both a :ref:`timeit-command-line-interface` as well as a :ref:`callable " "` one. It avoids a number of common traps for measuring " "execution times. See also Tim Peters' introduction to the \"Algorithms\" " -"chapter in the second edition of *Python Cookbook*, published by O'Reilly." +"chapter in the *Python Cookbook*, published by O'Reilly." msgstr "" #: ../../library/timeit.rst:23 diff --git a/library/tk.po b/library/tk.po index 8968b6bdfc..1a31fde2bc 100644 --- a/library/tk.po +++ b/library/tk.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.7\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2021-09-07 06:52+0000\n" +"POT-Creation-Date: 2018-06-26 18:54+0800\n" "PO-Revision-Date: 2017-09-22 18:27+0000\n" "Last-Translator: Leon H.\n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -37,17 +37,17 @@ msgid "" "To use :mod:`tkinter`, you don't need to write Tcl code, but you will need " "to consult the Tk documentation, and occasionally the Tcl documentation. :" "mod:`tkinter` is a set of wrappers that implement the Tk widgets as Python " -"classes." +"classes. In addition, the internal module :mod:`_tkinter` provides a " +"threadsafe mechanism which allows Python and Tcl to interact." msgstr "" -#: ../../library/tk.rst:24 +#: ../../library/tk.rst:25 msgid "" ":mod:`tkinter`'s chief virtues are that it is fast, and that it usually " "comes bundled with Python. Although its standard documentation is weak, good " "material is available, which includes: references, tutorials, a book and " "others. :mod:`tkinter` is also famous for having an outdated look and feel, " "which has been vastly improved in Tk 8.5. Nevertheless, there are many other " -"GUI libraries that you could be interested in. The Python wiki lists several " -"alternative `GUI frameworks and tools `_." +"GUI libraries that you could be interested in. For more information about " +"alternatives, see the :ref:`other-gui-packages` section." msgstr "" diff --git a/library/tkinter.colorchooser.po b/library/tkinter.colorchooser.po index a3499e7bdd..75e47c3b45 100644 --- a/library/tkinter.colorchooser.po +++ b/library/tkinter.colorchooser.po @@ -8,11 +8,10 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.9\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2021-09-07 06:52+0000\n" +"POT-Creation-Date: 2020-06-20 18:08+0800\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" -"Language: \n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" diff --git a/library/tkinter.dnd.po b/library/tkinter.dnd.po index 0c8949cbbe..ce30630b97 100644 --- a/library/tkinter.dnd.po +++ b/library/tkinter.dnd.po @@ -8,11 +8,10 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.9\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2021-09-07 06:52+0000\n" +"POT-Creation-Date: 2020-06-20 18:08+0800\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" -"Language: \n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" diff --git a/library/tkinter.font.po b/library/tkinter.font.po index 614abfd8e7..f12bae2eed 100644 --- a/library/tkinter.font.po +++ b/library/tkinter.font.po @@ -8,11 +8,10 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.9\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2021-09-07 06:52+0000\n" +"POT-Creation-Date: 2020-06-20 18:08+0800\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" -"Language: \n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" @@ -77,11 +76,9 @@ msgid "If *size* is positive it is interpreted as size in points." msgstr "" #: ../../library/tkinter.font.rst:0 -msgid "If *size* is a negative number its absolute value is treated" -msgstr "" - -#: ../../library/tkinter.font.rst:0 -msgid "as size in pixels." +msgid "" +"If *size* is a negative number its absolute value is treated as as size in " +"pixels." msgstr "" #: ../../library/tkinter.font.rst:0 diff --git a/library/tkinter.messagebox.po b/library/tkinter.messagebox.po index e21acd3f42..e91d15bd29 100644 --- a/library/tkinter.messagebox.po +++ b/library/tkinter.messagebox.po @@ -8,11 +8,10 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.9\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2021-09-07 06:52+0000\n" +"POT-Creation-Date: 2020-06-20 18:08+0800\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" -"Language: \n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" diff --git a/library/tkinter.po b/library/tkinter.po index 515b8ebb3c..3b13d868cf 100644 --- a/library/tkinter.po +++ b/library/tkinter.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.7\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2021-09-07 06:52+0000\n" +"POT-Creation-Date: 2020-06-20 18:08+0800\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-" @@ -29,12 +29,12 @@ msgstr "" #: ../../library/tkinter.rst:13 msgid "" "The :mod:`tkinter` package (\"Tk interface\") is the standard Python " -"interface to the Tcl/Tk GUI toolkit. Both Tk and :mod:`tkinter` are " -"available on most Unix platforms, including macOS, as well as on Windows " -"systems." +"interface to the Tk GUI toolkit. Both Tk and :mod:`tkinter` are available " +"on most Unix platforms, as well as on Windows systems. (Tk itself is not " +"part of Python; it is maintained at ActiveState.)" msgstr "" -#: ../../library/tkinter.rst:17 +#: ../../library/tkinter.rst:18 msgid "" "Running ``python -m tkinter`` from the command line should open a window " "demonstrating a simple Tk interface, letting you know that :mod:`tkinter` is " @@ -43,111 +43,160 @@ msgid "" "version." msgstr "" -#: ../../library/tkinter.rst:26 -msgid "`TkDocs `_" -msgstr "" - #: ../../library/tkinter.rst:25 -msgid "" -"Extensive tutorial on creating user interfaces with Tkinter. Explains key " -"concepts, and illustrates recommended approaches using the modern API." +msgid "Tkinter documentation:" msgstr "" #: ../../library/tkinter.rst:29 -msgid "" -"`Tkinter 8.5 reference: a GUI for Python `_" +msgid "`Python Tkinter Resources `_" msgstr "" -#: ../../library/tkinter.rst:29 +#: ../../library/tkinter.rst:28 msgid "" -"Reference documentation for Tkinter 8.5 detailing available classes, " -"methods, and options." +"The Python Tkinter Topic Guide provides a great deal of information on using " +"Tk from Python and links to other sources of information on Tk." msgstr "" -#: ../../library/tkinter.rst:31 -msgid "Tcl/Tk Resources:" +#: ../../library/tkinter.rst:32 +msgid "`TKDocs `_" msgstr "" -#: ../../library/tkinter.rst:34 -msgid "`Tk commands `_" +#: ../../library/tkinter.rst:32 +msgid "" +"Extensive tutorial plus friendlier widget pages for some of the widgets." msgstr "" -#: ../../library/tkinter.rst:34 +#: ../../library/tkinter.rst:35 msgid "" -"Comprehensive reference to each of the underlying Tcl/Tk commands used by " -"Tkinter." +"`Tkinter 8.5 reference: a GUI for Python `_" msgstr "" -#: ../../library/tkinter.rst:37 -msgid "`Tcl/Tk Home Page `_" +#: ../../library/tkinter.rst:35 +msgid "On-line reference material." msgstr "" -#: ../../library/tkinter.rst:37 -msgid "Additional documentation, and links to Tcl/Tk core development." +#: ../../library/tkinter.rst:38 +msgid "`Tkinter docs from effbot `_" msgstr "" -#: ../../library/tkinter.rst:39 -msgid "Books:" +#: ../../library/tkinter.rst:38 +msgid "Online reference for tkinter supported by effbot.org." msgstr "" -#: ../../library/tkinter.rst:42 +#: ../../library/tkinter.rst:41 +msgid "`Programming Python `_" +msgstr "" + +#: ../../library/tkinter.rst:41 +msgid "Book by Mark Lutz, has excellent coverage of Tkinter." +msgstr "" + +#: ../../library/tkinter.rst:44 msgid "" -"`Modern Tkinter for Busy Python Developers `_" +"`Modern Tkinter for Busy Python Developers `_" msgstr "" -#: ../../library/tkinter.rst:42 -msgid "By Mark Roseman. (ISBN 978-1999149567)" +#: ../../library/tkinter.rst:44 +msgid "" +"Book by Mark Roseman about building attractive and modern graphical user " +"interfaces with Python and Tkinter." msgstr "" -#: ../../library/tkinter.rst:45 +#: ../../library/tkinter.rst:47 msgid "" -"`Python and Tkinter Programming `_" +"`Python and Tkinter Programming `_" msgstr "" -#: ../../library/tkinter.rst:45 -msgid "By Alan Moore. (ISBN 978-1788835886)" +#: ../../library/tkinter.rst:47 +msgid "Book by John Grayson (ISBN 1-884777-81-3)." msgstr "" -#: ../../library/tkinter.rst:48 -msgid "`Programming Python `_" +#: ../../library/tkinter.rst:49 +msgid "Tcl/Tk documentation:" msgstr "" -#: ../../library/tkinter.rst:48 -msgid "By Mark Lutz; has excellent coverage of Tkinter. (ISBN 978-0596158101)" +#: ../../library/tkinter.rst:53 +msgid "`Tk commands `_" msgstr "" -#: ../../library/tkinter.rst:50 +#: ../../library/tkinter.rst:52 msgid "" -"`Tcl and the Tk Toolkit (2nd edition) `_" +"Most commands are available as :mod:`tkinter` or :mod:`tkinter.ttk` classes. " +"Change '8.6' to match the version of your Tcl/Tk installation." msgstr "" -#: ../../library/tkinter.rst:51 +#: ../../library/tkinter.rst:56 +msgid "`Tcl/Tk recent man pages `_" +msgstr "" + +#: ../../library/tkinter.rst:56 +msgid "Recent Tcl/Tk manuals on www.tcl.tk." +msgstr "" + +#: ../../library/tkinter.rst:59 +msgid "`ActiveState Tcl Home Page `_" +msgstr "" + +#: ../../library/tkinter.rst:59 +msgid "The Tk/Tcl development is largely taking place at ActiveState." +msgstr "" + +#: ../../library/tkinter.rst:62 msgid "" -"By John Ousterhout, inventor of Tcl/Tk, and Ken Jones; does not cover " -"Tkinter. (ISBN 978-0321336330)" +"`Tcl and the Tk Toolkit `_" +msgstr "" + +#: ../../library/tkinter.rst:62 +msgid "Book by John Ousterhout, the inventor of Tcl." +msgstr "" + +#: ../../library/tkinter.rst:64 +msgid "`Practical Programming in Tcl and Tk `_" +msgstr "" + +#: ../../library/tkinter.rst:65 +msgid "Brent Welch's encyclopedic book." msgstr "" -#: ../../library/tkinter.rst:55 +#: ../../library/tkinter.rst:69 msgid "Tkinter Modules" msgstr "" -#: ../../library/tkinter.rst:57 +#: ../../library/tkinter.rst:71 msgid "" -"Support for Tkinter is spread across several modules. Most applications will " -"need the main :mod:`tkinter` module, as well as the :mod:`tkinter.ttk` " -"module, which provides the modern themed widget set and API::" +"Most of the time, :mod:`tkinter` is all you really need, but a number of " +"additional modules are available as well. The Tk interface is located in a " +"binary module named :mod:`_tkinter`. This module contains the low-level " +"interface to Tk, and should never be used directly by application " +"programmers. It is usually a shared library (or DLL), but might in some " +"cases be statically linked with the Python interpreter." msgstr "" -#: ../../library/tkinter.rst:68 +#: ../../library/tkinter.rst:78 +msgid "" +"In addition to the Tk interface module, :mod:`tkinter` includes a number of " +"Python modules, :mod:`tkinter.constants` being one of the most important. " +"Importing :mod:`tkinter` will automatically import :mod:`tkinter.constants`, " +"so, usually, to use Tkinter all you need is a simple import statement::" +msgstr "" + +#: ../../library/tkinter.rst:85 +msgid "Or, more often::" +msgstr "" + +#: ../../library/tkinter.rst:92 msgid "" "The :class:`Tk` class is instantiated without arguments. This creates a " "toplevel widget of Tk which usually is the main window of an application. " "Each instance has its own associated Tcl interpreter." msgstr "" -#: ../../library/tkinter.rst:77 +#: ../../library/tkinter.rst:101 msgid "" "The :func:`Tcl` function is a factory function which creates an object much " "like that created by the :class:`Tk` class, except that it does not " @@ -159,208 +208,142 @@ msgid "" "`loadtk` method." msgstr "" -#: ../../library/tkinter.rst:86 -msgid "The modules that provide Tk support include:" -msgstr "" - -#: ../../library/tkinter.rst:89 -msgid ":mod:`tkinter`" -msgstr "" - -#: ../../library/tkinter.rst:89 -msgid "Main Tkinter module." +#: ../../library/tkinter.rst:110 +msgid "Other modules that provide Tk support include:" msgstr "" -#: ../../library/tkinter.rst:92 +#: ../../library/tkinter.rst:113 msgid ":mod:`tkinter.colorchooser`" msgstr "" -#: ../../library/tkinter.rst:92 +#: ../../library/tkinter.rst:113 msgid "Dialog to let the user choose a color." msgstr "" -#: ../../library/tkinter.rst:95 +#: ../../library/tkinter.rst:116 msgid ":mod:`tkinter.commondialog`" msgstr "" -#: ../../library/tkinter.rst:95 +#: ../../library/tkinter.rst:116 msgid "Base class for the dialogs defined in the other modules listed here." msgstr "" -#: ../../library/tkinter.rst:98 +#: ../../library/tkinter.rst:119 msgid ":mod:`tkinter.filedialog`" msgstr "" -#: ../../library/tkinter.rst:98 +#: ../../library/tkinter.rst:119 msgid "Common dialogs to allow the user to specify a file to open or save." msgstr "" -#: ../../library/tkinter.rst:101 +#: ../../library/tkinter.rst:122 msgid ":mod:`tkinter.font`" msgstr "" -#: ../../library/tkinter.rst:101 +#: ../../library/tkinter.rst:122 msgid "Utilities to help work with fonts." msgstr "" -#: ../../library/tkinter.rst:104 +#: ../../library/tkinter.rst:125 msgid ":mod:`tkinter.messagebox`" msgstr "" -#: ../../library/tkinter.rst:104 +#: ../../library/tkinter.rst:125 msgid "Access to standard Tk dialog boxes." msgstr "" -#: ../../library/tkinter.rst:107 +#: ../../library/tkinter.rst:128 msgid ":mod:`tkinter.scrolledtext`" msgstr "" -#: ../../library/tkinter.rst:107 +#: ../../library/tkinter.rst:128 msgid "Text widget with a vertical scroll bar built in." msgstr "" -#: ../../library/tkinter.rst:110 +#: ../../library/tkinter.rst:131 msgid ":mod:`tkinter.simpledialog`" msgstr "" -#: ../../library/tkinter.rst:110 +#: ../../library/tkinter.rst:131 msgid "Basic dialogs and convenience functions." msgstr "" -#: ../../library/tkinter.rst:114 -msgid ":mod:`tkinter.ttk`" -msgstr "" - -#: ../../library/tkinter.rst:113 -msgid "" -"Themed widget set introduced in Tk 8.5, providing modern alternatives for " -"many of the classic widgets in the main :mod:`tkinter` module." -msgstr "" - -#: ../../library/tkinter.rst:116 -msgid "Additional modules:" -msgstr "" - -#: ../../library/tkinter.rst:123 -msgid ":mod:`_tkinter`" -msgstr "" - -#: ../../library/tkinter.rst:119 -msgid "" -"A binary module that contains the low-level interface to Tcl/Tk. It is " -"automatically imported by the main :mod:`tkinter` module, and should never " -"be used directly by application programmers. It is usually a shared library " -"(or DLL), but might in some cases be statically linked with the Python " -"interpreter." -msgstr "" - -#: ../../library/tkinter.rst:127 -msgid ":mod:`idlelib`" -msgstr "" - -#: ../../library/tkinter.rst:126 -msgid "" -"Python's Integrated Development and Learning Environment (IDLE). Based on :" -"mod:`tkinter`." -msgstr "" - -#: ../../library/tkinter.rst:132 -msgid ":mod:`tkinter.constants`" -msgstr "" - -#: ../../library/tkinter.rst:130 -msgid "" -"Symbolic constants that can be used in place of strings when passing various " -"parameters to Tkinter calls. Automatically imported by the main :mod:" -"`tkinter` module." -msgstr "" - -#: ../../library/tkinter.rst:136 +#: ../../library/tkinter.rst:135 msgid ":mod:`tkinter.dnd`" msgstr "" -#: ../../library/tkinter.rst:135 +#: ../../library/tkinter.rst:134 msgid "" -"(experimental) Drag-and-drop support for :mod:`tkinter`. This will become " -"deprecated when it is replaced with the Tk DND." -msgstr "" - -#: ../../library/tkinter.rst:140 -msgid ":mod:`tkinter.tix`" +"Drag-and-drop support for :mod:`tkinter`. This is experimental and should " +"become deprecated when it is replaced with the Tk DND." msgstr "" #: ../../library/tkinter.rst:139 -msgid "" -"(deprecated) An older third-party Tcl/Tk package that adds several new " -"widgets. Better alternatives for most can be found in :mod:`tkinter.ttk`." -msgstr "" - -#: ../../library/tkinter.rst:144 msgid ":mod:`turtle`" msgstr "" -#: ../../library/tkinter.rst:143 +#: ../../library/tkinter.rst:138 msgid "Turtle graphics in a Tk window." msgstr "" -#: ../../library/tkinter.rst:147 +#: ../../library/tkinter.rst:142 msgid "Tkinter Life Preserver" msgstr "" -#: ../../library/tkinter.rst:152 +#: ../../library/tkinter.rst:147 msgid "" "This section is not designed to be an exhaustive tutorial on either Tk or " "Tkinter. Rather, it is intended as a stop gap, providing some introductory " "orientation on the system." msgstr "" -#: ../../library/tkinter.rst:156 +#: ../../library/tkinter.rst:151 msgid "Credits:" msgstr "" -#: ../../library/tkinter.rst:158 +#: ../../library/tkinter.rst:153 msgid "Tk was written by John Ousterhout while at Berkeley." msgstr "" -#: ../../library/tkinter.rst:160 +#: ../../library/tkinter.rst:155 msgid "Tkinter was written by Steen Lumholt and Guido van Rossum." msgstr "" -#: ../../library/tkinter.rst:162 +#: ../../library/tkinter.rst:157 msgid "" "This Life Preserver was written by Matt Conway at the University of Virginia." msgstr "" -#: ../../library/tkinter.rst:164 +#: ../../library/tkinter.rst:159 msgid "" "The HTML rendering, and some liberal editing, was produced from a FrameMaker " "version by Ken Manheimer." msgstr "" -#: ../../library/tkinter.rst:167 +#: ../../library/tkinter.rst:162 msgid "" "Fredrik Lundh elaborated and revised the class interface descriptions, to " "get them current with Tk 4.2." msgstr "" -#: ../../library/tkinter.rst:170 +#: ../../library/tkinter.rst:165 msgid "" "Mike Clarkson converted the documentation to LaTeX, and compiled the User " "Interface chapter of the reference manual." msgstr "" -#: ../../library/tkinter.rst:175 +#: ../../library/tkinter.rst:170 msgid "How To Use This Section" msgstr "" -#: ../../library/tkinter.rst:177 +#: ../../library/tkinter.rst:172 msgid "" "This section is designed in two parts: the first half (roughly) covers " "background material, while the second half can be taken to the keyboard as a " "handy reference." msgstr "" -#: ../../library/tkinter.rst:181 +#: ../../library/tkinter.rst:176 msgid "" "When trying to answer questions of the form \"how do I do blah\", it is " "often best to find out how to do \"blah\" in straight Tk, and then convert " @@ -372,7 +355,7 @@ msgid "" "some hints:" msgstr "" -#: ../../library/tkinter.rst:189 +#: ../../library/tkinter.rst:184 msgid "" "The authors strongly suggest getting a copy of the Tk man pages. " "Specifically, the man pages in the ``manN`` directory are most useful. The " @@ -380,7 +363,7 @@ msgid "" "not especially helpful for script writers." msgstr "" -#: ../../library/tkinter.rst:194 +#: ../../library/tkinter.rst:189 msgid "" "Addison-Wesley publishes a book called Tcl and the Tk Toolkit by John " "Ousterhout (ISBN 0-201-63337-X) which is a good introduction to Tcl and Tk " @@ -388,52 +371,52 @@ msgid "" "to the man pages." msgstr "" -#: ../../library/tkinter.rst:199 +#: ../../library/tkinter.rst:194 msgid "" ":file:`tkinter/__init__.py` is a last resort for most, but can be a good " "place to go when nothing else makes sense." msgstr "" -#: ../../library/tkinter.rst:204 +#: ../../library/tkinter.rst:199 msgid "A Simple Hello World Program" msgstr "" -#: ../../library/tkinter.rst:236 +#: ../../library/tkinter.rst:231 msgid "A (Very) Quick Look at Tcl/Tk" msgstr "" -#: ../../library/tkinter.rst:238 +#: ../../library/tkinter.rst:233 msgid "" "The class hierarchy looks complicated, but in actual practice, application " "programmers almost always refer to the classes at the very bottom of the " "hierarchy." msgstr "" -#: ../../library/tkinter.rst:242 +#: ../../library/tkinter.rst:237 msgid "Notes:" msgstr "註解:" -#: ../../library/tkinter.rst:244 +#: ../../library/tkinter.rst:239 msgid "" "These classes are provided for the purposes of organizing certain functions " "under one namespace. They aren't meant to be instantiated independently." msgstr "" -#: ../../library/tkinter.rst:247 +#: ../../library/tkinter.rst:242 msgid "" "The :class:`Tk` class is meant to be instantiated only once in an " "application. Application programmers need not instantiate one explicitly, " "the system creates one whenever any of the other classes are instantiated." msgstr "" -#: ../../library/tkinter.rst:251 +#: ../../library/tkinter.rst:246 msgid "" "The :class:`Widget` class is not meant to be instantiated, it is meant only " "for subclassing to make \"real\" widgets (in C++, this is called an " "'abstract class')." msgstr "" -#: ../../library/tkinter.rst:255 +#: ../../library/tkinter.rst:250 msgid "" "To make use of this reference material, there will be times when you will " "need to know how to read short passages of Tk and how to identify the " @@ -441,7 +424,7 @@ msgid "" "for the :mod:`tkinter` equivalents of what's below.)" msgstr "" -#: ../../library/tkinter.rst:260 +#: ../../library/tkinter.rst:255 msgid "" "Tk scripts are Tcl programs. Like all Tcl programs, Tk scripts are just " "lists of tokens separated by spaces. A Tk widget is just its *class*, the " @@ -449,23 +432,23 @@ msgid "" "things." msgstr "" -#: ../../library/tkinter.rst:264 +#: ../../library/tkinter.rst:259 msgid "To make a widget in Tk, the command is always of the form::" msgstr "" -#: ../../library/tkinter.rst:269 +#: ../../library/tkinter.rst:264 msgid "*classCommand*" msgstr "" -#: ../../library/tkinter.rst:269 +#: ../../library/tkinter.rst:264 msgid "denotes which kind of widget to make (a button, a label, a menu...)" msgstr "" -#: ../../library/tkinter.rst:278 +#: ../../library/tkinter.rst:273 msgid "*newPathname*" msgstr "" -#: ../../library/tkinter.rst:274 +#: ../../library/tkinter.rst:269 msgid "" "is the new name for this widget. All names in Tk must be unique. To help " "enforce this, widgets in Tk are named with *pathnames*, just like files in a " @@ -474,11 +457,11 @@ msgid "" "okButton`` might be the name of a widget." msgstr "" -#: ../../library/tkinter.rst:284 +#: ../../library/tkinter.rst:279 msgid "*options*" msgstr "" -#: ../../library/tkinter.rst:281 +#: ../../library/tkinter.rst:276 msgid "" "configure the widget's appearance and in some cases, its behavior. The " "options come in the form of a list of flags and values. Flags are preceded " @@ -486,12 +469,12 @@ msgid "" "they are more than one word." msgstr "" -#: ../../library/tkinter.rst:286 ../../library/tkinter.rst:547 -#: ../../library/tkinter.rst:726 +#: ../../library/tkinter.rst:281 ../../library/tkinter.rst:543 +#: ../../library/tkinter.rst:718 msgid "For example::" msgstr "" -#: ../../library/tkinter.rst:294 +#: ../../library/tkinter.rst:289 msgid "" "Once created, the pathname to the widget becomes a new command. This new " "*widget command* is the programmer's handle for getting the new widget to " @@ -500,11 +483,11 @@ msgid "" "someAction(someOptions), and in Tk, you say::" msgstr "" -#: ../../library/tkinter.rst:302 +#: ../../library/tkinter.rst:297 msgid "Note that the object name, ``.fred``, starts with a dot." msgstr "" -#: ../../library/tkinter.rst:304 +#: ../../library/tkinter.rst:299 msgid "" "As you'd expect, the legal values for *someAction* will depend on the " "widget's class: ``.fred disable`` works if fred is a button (fred gets " @@ -512,7 +495,7 @@ msgid "" "not supported in Tk)." msgstr "" -#: ../../library/tkinter.rst:308 +#: ../../library/tkinter.rst:303 msgid "" "The legal values of *someOptions* is action dependent. Some actions, like " "``disable``, require no arguments, others, like a text-entry box's " @@ -520,21 +503,21 @@ msgid "" "delete." msgstr "" -#: ../../library/tkinter.rst:316 +#: ../../library/tkinter.rst:311 msgid "Mapping Basic Tk into Tkinter" msgstr "" -#: ../../library/tkinter.rst:318 +#: ../../library/tkinter.rst:313 msgid "Class commands in Tk correspond to class constructors in Tkinter. ::" msgstr "" -#: ../../library/tkinter.rst:322 +#: ../../library/tkinter.rst:317 msgid "" "The master of an object is implicit in the new name given to it at creation " "time. In Tkinter, masters are specified explicitly. ::" msgstr "" -#: ../../library/tkinter.rst:327 +#: ../../library/tkinter.rst:322 msgid "" "The configuration options in Tk are given in lists of hyphened tags followed " "by values. In Tkinter, options are specified as keyword-arguments in the " @@ -543,7 +526,7 @@ msgid "" "`tkinter-setting-options` on setting options. ::" msgstr "" -#: ../../library/tkinter.rst:337 +#: ../../library/tkinter.rst:332 msgid "" "In Tk, to perform an action on a widget, use the widget name as a command, " "and follow it with an action name, possibly with arguments (options). In " @@ -552,7 +535,7 @@ msgid "" "in :file:`tkinter/__init__.py`. ::" msgstr "" -#: ../../library/tkinter.rst:345 +#: ../../library/tkinter.rst:340 msgid "" "To give a widget to the packer (geometry manager), you call pack with " "optional arguments. In Tkinter, the Pack class holds all this " @@ -562,27 +545,27 @@ msgid "" "documentation for additional information on the Form geometry manager. ::" msgstr "" -#: ../../library/tkinter.rst:356 +#: ../../library/tkinter.rst:351 msgid "How Tk and Tkinter are Related" msgstr "" -#: ../../library/tkinter.rst:358 +#: ../../library/tkinter.rst:353 msgid "From the top down:" msgstr "" -#: ../../library/tkinter.rst:361 +#: ../../library/tkinter.rst:356 msgid "Your App Here (Python)" msgstr "" -#: ../../library/tkinter.rst:361 +#: ../../library/tkinter.rst:356 msgid "A Python application makes a :mod:`tkinter` call." msgstr "" -#: ../../library/tkinter.rst:368 +#: ../../library/tkinter.rst:363 msgid "tkinter (Python Package)" msgstr "" -#: ../../library/tkinter.rst:364 +#: ../../library/tkinter.rst:359 msgid "" "This call (say, for example, creating a button widget), is implemented in " "the :mod:`tkinter` package, which is written in Python. This Python " @@ -591,21 +574,21 @@ msgid "" "Python script." msgstr "" -#: ../../library/tkinter.rst:372 +#: ../../library/tkinter.rst:367 msgid "_tkinter (C)" msgstr "" -#: ../../library/tkinter.rst:371 +#: ../../library/tkinter.rst:366 msgid "" "These commands and their arguments will be passed to a C function in the :" "mod:`_tkinter` - note the underscore - extension module." msgstr "" -#: ../../library/tkinter.rst:379 +#: ../../library/tkinter.rst:374 msgid "Tk Widgets (C and Tcl)" msgstr "" -#: ../../library/tkinter.rst:375 +#: ../../library/tkinter.rst:370 msgid "" "This C function is able to make calls into other C modules, including the C " "functions that make up the Tk library. Tk is implemented in C and some Tcl. " @@ -614,57 +597,57 @@ msgid "" "package is imported. (The user never sees this stage)." msgstr "" -#: ../../library/tkinter.rst:382 +#: ../../library/tkinter.rst:377 msgid "Tk (C)" msgstr "" -#: ../../library/tkinter.rst:382 +#: ../../library/tkinter.rst:377 msgid "The Tk part of the Tk Widgets implement the final mapping to ..." msgstr "" -#: ../../library/tkinter.rst:386 +#: ../../library/tkinter.rst:381 msgid "Xlib (C)" msgstr "" -#: ../../library/tkinter.rst:385 +#: ../../library/tkinter.rst:380 msgid "the Xlib library to draw graphics on the screen." msgstr "" -#: ../../library/tkinter.rst:389 +#: ../../library/tkinter.rst:384 msgid "Handy Reference" msgstr "" -#: ../../library/tkinter.rst:395 +#: ../../library/tkinter.rst:390 msgid "Setting Options" msgstr "" -#: ../../library/tkinter.rst:397 +#: ../../library/tkinter.rst:392 msgid "" "Options control things like the color and border width of a widget. Options " "can be set in three ways:" msgstr "" -#: ../../library/tkinter.rst:403 +#: ../../library/tkinter.rst:398 msgid "At object creation time, using keyword arguments" msgstr "" -#: ../../library/tkinter.rst:409 +#: ../../library/tkinter.rst:404 msgid "After object creation, treating the option name like a dictionary index" msgstr "" -#: ../../library/tkinter.rst:414 +#: ../../library/tkinter.rst:409 msgid "" "Use the config() method to update multiple attrs subsequent to object " "creation" msgstr "" -#: ../../library/tkinter.rst:416 +#: ../../library/tkinter.rst:411 msgid "" "For a complete explanation of a given option and its behavior, see the Tk " "man pages for the widget in question." msgstr "" -#: ../../library/tkinter.rst:419 +#: ../../library/tkinter.rst:414 msgid "" "Note that the man pages list \"STANDARD OPTIONS\" and \"WIDGET SPECIFIC " "OPTIONS\" for each widget. The former is a list of options that are common " @@ -673,7 +656,7 @@ msgid "" "`options(3)` man page." msgstr "" -#: ../../library/tkinter.rst:425 +#: ../../library/tkinter.rst:420 msgid "" "No distinction between standard and widget-specific options is made in this " "document. Some options don't apply to some kinds of widgets. Whether a " @@ -681,7 +664,7 @@ msgid "" "widget; buttons have a ``command`` option, labels do not." msgstr "" -#: ../../library/tkinter.rst:430 +#: ../../library/tkinter.rst:425 msgid "" "The options supported by a given widget are listed in that widget's man " "page, or can be queried at runtime by calling the :meth:`config` method " @@ -690,7 +673,7 @@ msgid "" "option as a string (for example, ``'relief'``) and whose values are 5-tuples." msgstr "" -#: ../../library/tkinter.rst:436 +#: ../../library/tkinter.rst:431 msgid "" "Some options, like ``bg`` are synonyms for common options with long names " "(``bg`` is shorthand for \"background\"). Passing the ``config()`` method " @@ -699,100 +682,100 @@ msgid "" "option (such as ``('bg', 'background')``)." msgstr "" -#: ../../library/tkinter.rst:443 +#: ../../library/tkinter.rst:438 msgid "Index" msgstr "" -#: ../../library/tkinter.rst:443 +#: ../../library/tkinter.rst:438 msgid "Meaning" msgstr "" -#: ../../library/tkinter.rst:443 +#: ../../library/tkinter.rst:438 msgid "Example" msgstr "" -#: ../../library/tkinter.rst:445 +#: ../../library/tkinter.rst:440 msgid "0" msgstr "0" -#: ../../library/tkinter.rst:445 +#: ../../library/tkinter.rst:440 msgid "option name" msgstr "" -#: ../../library/tkinter.rst:445 ../../library/tkinter.rst:447 +#: ../../library/tkinter.rst:440 ../../library/tkinter.rst:442 msgid "``'relief'``" msgstr "" -#: ../../library/tkinter.rst:447 +#: ../../library/tkinter.rst:442 msgid "1" msgstr "1" -#: ../../library/tkinter.rst:447 +#: ../../library/tkinter.rst:442 msgid "option name for database lookup" msgstr "" -#: ../../library/tkinter.rst:449 +#: ../../library/tkinter.rst:444 msgid "2" msgstr "2" -#: ../../library/tkinter.rst:449 +#: ../../library/tkinter.rst:444 msgid "option class for database lookup" msgstr "" -#: ../../library/tkinter.rst:449 +#: ../../library/tkinter.rst:444 msgid "``'Relief'``" msgstr "" -#: ../../library/tkinter.rst:452 +#: ../../library/tkinter.rst:447 msgid "3" msgstr "" -#: ../../library/tkinter.rst:452 +#: ../../library/tkinter.rst:447 msgid "default value" msgstr "" -#: ../../library/tkinter.rst:452 +#: ../../library/tkinter.rst:447 msgid "``'raised'``" msgstr "" -#: ../../library/tkinter.rst:454 +#: ../../library/tkinter.rst:449 msgid "4" msgstr "4" -#: ../../library/tkinter.rst:454 +#: ../../library/tkinter.rst:449 msgid "current value" msgstr "" -#: ../../library/tkinter.rst:454 +#: ../../library/tkinter.rst:449 msgid "``'groove'``" msgstr "" -#: ../../library/tkinter.rst:457 +#: ../../library/tkinter.rst:452 msgid "Example::" msgstr "" -#: ../../library/tkinter.rst:462 +#: ../../library/tkinter.rst:457 msgid "" "Of course, the dictionary printed will include all the options available and " "their values. This is meant only as an example." msgstr "" -#: ../../library/tkinter.rst:467 +#: ../../library/tkinter.rst:462 msgid "The Packer" msgstr "" -#: ../../library/tkinter.rst:471 +#: ../../library/tkinter.rst:466 msgid "" "The packer is one of Tk's geometry-management mechanisms. Geometry " -"managers are used to specify the relative positioning of widgets within " -"their container - their mutual *master*. In contrast to the more cumbersome " -"*placer* (which is used less commonly, and we do not cover here), the packer " -"takes qualitative relationship specification - *above*, *to the left of*, " -"*filling*, etc - and works everything out to determine the exact placement " -"coordinates for you." +"managers are used to specify the relative positioning of the positioning of " +"widgets within their container - their mutual *master*. In contrast to the " +"more cumbersome *placer* (which is used less commonly, and we do not cover " +"here), the packer takes qualitative relationship specification - *above*, " +"*to the left of*, *filling*, etc - and works everything out to determine the " +"exact placement coordinates for you." msgstr "" -#: ../../library/tkinter.rst:478 +#: ../../library/tkinter.rst:474 msgid "" "The size of any *master* widget is determined by the size of the \"slave " "widgets\" inside. The packer is used to control where slave widgets appear " @@ -802,7 +785,7 @@ msgid "" "accommodate incremental changes to the configuration, once it is packed." msgstr "" -#: ../../library/tkinter.rst:485 +#: ../../library/tkinter.rst:481 msgid "" "Note that widgets do not appear until they have had their geometry specified " "with a geometry manager. It's a common early mistake to leave out the " @@ -811,79 +794,79 @@ msgid "" "the packer's :meth:`pack` method applied to it." msgstr "" -#: ../../library/tkinter.rst:491 +#: ../../library/tkinter.rst:487 msgid "" "The pack() method can be called with keyword-option/value pairs that control " "where the widget is to appear within its container, and how it is to behave " "when the main application window is resized. Here are some examples::" msgstr "" -#: ../../library/tkinter.rst:501 +#: ../../library/tkinter.rst:497 msgid "Packer Options" msgstr "" -#: ../../library/tkinter.rst:503 +#: ../../library/tkinter.rst:499 msgid "" "For more extensive information on the packer and the options that it can " "take, see the man pages and page 183 of John Ousterhout's book." msgstr "" -#: ../../library/tkinter.rst:507 ../../library/tkinter.rst:627 +#: ../../library/tkinter.rst:503 ../../library/tkinter.rst:619 msgid "anchor" msgstr "" -#: ../../library/tkinter.rst:507 +#: ../../library/tkinter.rst:503 msgid "" "Anchor type. Denotes where the packer is to place each slave in its parcel." msgstr "" -#: ../../library/tkinter.rst:510 +#: ../../library/tkinter.rst:506 msgid "expand" msgstr "" -#: ../../library/tkinter.rst:510 +#: ../../library/tkinter.rst:506 msgid "Boolean, ``0`` or ``1``." msgstr "" -#: ../../library/tkinter.rst:513 +#: ../../library/tkinter.rst:509 msgid "fill" msgstr "" -#: ../../library/tkinter.rst:513 +#: ../../library/tkinter.rst:509 msgid "Legal values: ``'x'``, ``'y'``, ``'both'``, ``'none'``." msgstr "" -#: ../../library/tkinter.rst:516 +#: ../../library/tkinter.rst:512 msgid "ipadx and ipady" msgstr "" -#: ../../library/tkinter.rst:516 +#: ../../library/tkinter.rst:512 msgid "" "A distance - designating internal padding on each side of the slave widget." msgstr "" -#: ../../library/tkinter.rst:519 +#: ../../library/tkinter.rst:515 msgid "padx and pady" msgstr "" -#: ../../library/tkinter.rst:519 +#: ../../library/tkinter.rst:515 msgid "" "A distance - designating external padding on each side of the slave widget." msgstr "" -#: ../../library/tkinter.rst:523 +#: ../../library/tkinter.rst:519 msgid "side" msgstr "" -#: ../../library/tkinter.rst:522 +#: ../../library/tkinter.rst:518 msgid "Legal values are: ``'left'``, ``'right'``, ``'top'``, ``'bottom'``." msgstr "" -#: ../../library/tkinter.rst:526 +#: ../../library/tkinter.rst:522 msgid "Coupling Widget Variables" msgstr "" -#: ../../library/tkinter.rst:528 +#: ../../library/tkinter.rst:524 msgid "" "The current-value setting of some widgets (like text entry widgets) can be " "connected directly to application variables by using special options. These " @@ -893,7 +876,7 @@ msgid "" "value." msgstr "" -#: ../../library/tkinter.rst:534 +#: ../../library/tkinter.rst:530 msgid "" "Unfortunately, in the current implementation of :mod:`tkinter` it is not " "possible to hand over an arbitrary Python variable to a widget through a " @@ -902,7 +885,7 @@ msgid "" "Variable, defined in :mod:`tkinter`." msgstr "" -#: ../../library/tkinter.rst:540 +#: ../../library/tkinter.rst:536 msgid "" "There are many useful subclasses of Variable already defined: :class:" "`StringVar`, :class:`IntVar`, :class:`DoubleVar`, and :class:`BooleanVar`. " @@ -912,11 +895,11 @@ msgid "" "no further intervention on your part." msgstr "" -#: ../../library/tkinter.rst:580 +#: ../../library/tkinter.rst:572 msgid "The Window Manager" msgstr "" -#: ../../library/tkinter.rst:584 +#: ../../library/tkinter.rst:576 msgid "" "In Tk, there is a utility command, ``wm``, for interacting with the window " "manager. Options to the ``wm`` command allow you to control things like " @@ -926,7 +909,7 @@ msgid "" "the :class:`Wm` methods directly." msgstr "" -#: ../../library/tkinter.rst:591 +#: ../../library/tkinter.rst:583 msgid "" "To get at the toplevel window that contains a given widget, you can often " "just refer to the widget's master. Of course if the widget has been packed " @@ -937,26 +920,26 @@ msgid "" "to Tk functionality." msgstr "" -#: ../../library/tkinter.rst:598 +#: ../../library/tkinter.rst:590 msgid "Here are some examples of typical usage::" msgstr "" -#: ../../library/tkinter.rst:621 +#: ../../library/tkinter.rst:613 msgid "Tk Option Data Types" msgstr "" -#: ../../library/tkinter.rst:626 +#: ../../library/tkinter.rst:618 msgid "" "Legal values are points of the compass: ``\"n\"``, ``\"ne\"``, ``\"e\"``, ``" "\"se\"``, ``\"s\"``, ``\"sw\"``, ``\"w\"``, ``\"nw\"``, and also ``\"center" "\"``." msgstr "" -#: ../../library/tkinter.rst:633 +#: ../../library/tkinter.rst:625 msgid "bitmap" msgstr "" -#: ../../library/tkinter.rst:630 +#: ../../library/tkinter.rst:622 msgid "" "There are eight built-in, named bitmaps: ``'error'``, ``'gray25'``, " "``'gray50'``, ``'hourglass'``, ``'info'``, ``'questhead'``, ``'question'``, " @@ -964,27 +947,27 @@ msgid "" "file, preceded with an ``@``, as in ``\"@/usr/contrib/bitmap/gumby.bit\"``." msgstr "" -#: ../../library/tkinter.rst:636 +#: ../../library/tkinter.rst:628 msgid "boolean" msgstr "" -#: ../../library/tkinter.rst:636 +#: ../../library/tkinter.rst:628 msgid "You can pass integers 0 or 1 or the strings ``\"yes\"`` or ``\"no\"``." msgstr "" -#: ../../library/tkinter.rst:643 +#: ../../library/tkinter.rst:635 msgid "callback" msgstr "" -#: ../../library/tkinter.rst:639 +#: ../../library/tkinter.rst:631 msgid "This is any Python function that takes no arguments. For example::" msgstr "" -#: ../../library/tkinter.rst:649 +#: ../../library/tkinter.rst:641 msgid "color" msgstr "" -#: ../../library/tkinter.rst:646 +#: ../../library/tkinter.rst:638 msgid "" "Colors can be given as the names of X colors in the rgb.txt file, or as " "strings representing RGB values in 4 bit: ``\"#RGB\"``, 8 bit: ``\"#RRGGBB" @@ -993,11 +976,11 @@ msgid "" "Ousterhout's book for details." msgstr "" -#: ../../library/tkinter.rst:655 +#: ../../library/tkinter.rst:647 msgid "cursor" msgstr "" -#: ../../library/tkinter.rst:652 +#: ../../library/tkinter.rst:644 msgid "" "The standard X cursor names from :file:`cursorfont.h` can be used, without " "the ``XC_`` prefix. For example to get a hand cursor (:const:`XC_hand2`), " @@ -1005,11 +988,11 @@ msgid "" "of your own. See page 179 of Ousterhout's book." msgstr "" -#: ../../library/tkinter.rst:662 +#: ../../library/tkinter.rst:654 msgid "distance" msgstr "" -#: ../../library/tkinter.rst:658 +#: ../../library/tkinter.rst:650 msgid "" "Screen distances can be specified in either pixels or absolute distances. " "Pixels are given as numbers and absolute distances as strings, with the " @@ -1018,119 +1001,119 @@ msgid "" "is expressed as ``\"3.5i\"``." msgstr "" -#: ../../library/tkinter.rst:667 +#: ../../library/tkinter.rst:659 msgid "font" msgstr "" -#: ../../library/tkinter.rst:665 +#: ../../library/tkinter.rst:657 msgid "" "Tk uses a list font name format, such as ``{courier 10 bold}``. Font sizes " "with positive numbers are measured in points; sizes with negative numbers " "are measured in pixels." msgstr "" -#: ../../library/tkinter.rst:672 +#: ../../library/tkinter.rst:664 msgid "geometry" msgstr "" -#: ../../library/tkinter.rst:670 +#: ../../library/tkinter.rst:662 msgid "" "This is a string of the form ``widthxheight``, where width and height are " "measured in pixels for most widgets (in characters for widgets displaying " "text). For example: ``fred[\"geometry\"] = \"200x100\"``." msgstr "" -#: ../../library/tkinter.rst:676 +#: ../../library/tkinter.rst:668 msgid "justify" msgstr "" -#: ../../library/tkinter.rst:675 +#: ../../library/tkinter.rst:667 msgid "" "Legal values are the strings: ``\"left\"``, ``\"center\"``, ``\"right\"``, " "and ``\"fill\"``." msgstr "" -#: ../../library/tkinter.rst:681 +#: ../../library/tkinter.rst:673 msgid "region" msgstr "" -#: ../../library/tkinter.rst:679 +#: ../../library/tkinter.rst:671 msgid "" "This is a string with four space-delimited elements, each of which is a " "legal distance (see above). For example: ``\"2 3 4 5\"`` and ``\"3i 2i 4.5i " "2i\"`` and ``\"3c 2c 4c 10.43c\"`` are all legal regions." msgstr "" -#: ../../library/tkinter.rst:685 +#: ../../library/tkinter.rst:677 msgid "relief" msgstr "" -#: ../../library/tkinter.rst:684 +#: ../../library/tkinter.rst:676 msgid "" "Determines what the border style of a widget will be. Legal values are: ``" "\"raised\"``, ``\"sunken\"``, ``\"flat\"``, ``\"groove\"``, and ``\"ridge" "\"``." msgstr "" -#: ../../library/tkinter.rst:689 +#: ../../library/tkinter.rst:681 msgid "scrollcommand" msgstr "" -#: ../../library/tkinter.rst:688 +#: ../../library/tkinter.rst:680 msgid "" "This is almost always the :meth:`!set` method of some scrollbar widget, but " "can be any widget method that takes a single argument." msgstr "" -#: ../../library/tkinter.rst:692 +#: ../../library/tkinter.rst:684 msgid "wrap" msgstr "" -#: ../../library/tkinter.rst:692 +#: ../../library/tkinter.rst:684 msgid "Must be one of: ``\"none\"``, ``\"char\"``, or ``\"word\"``." msgstr "" -#: ../../library/tkinter.rst:697 +#: ../../library/tkinter.rst:689 msgid "Bindings and Events" msgstr "" -#: ../../library/tkinter.rst:703 +#: ../../library/tkinter.rst:695 msgid "" "The bind method from the widget command allows you to watch for certain " "events and to have a callback function trigger when that event type occurs. " "The form of the bind method is::" msgstr "" -#: ../../library/tkinter.rst:709 +#: ../../library/tkinter.rst:701 msgid "where:" msgstr "" -#: ../../library/tkinter.rst:713 +#: ../../library/tkinter.rst:705 msgid "sequence" msgstr "" -#: ../../library/tkinter.rst:712 +#: ../../library/tkinter.rst:704 msgid "" "is a string that denotes the target kind of event. (See the bind man page " "and page 201 of John Ousterhout's book for details)." msgstr "" -#: ../../library/tkinter.rst:718 +#: ../../library/tkinter.rst:710 msgid "func" msgstr "" -#: ../../library/tkinter.rst:716 +#: ../../library/tkinter.rst:708 msgid "" "is a Python function, taking one argument, to be invoked when the event " "occurs. An Event instance will be passed as the argument. (Functions " "deployed this way are commonly known as *callbacks*.)" msgstr "" -#: ../../library/tkinter.rst:724 +#: ../../library/tkinter.rst:716 msgid "add" msgstr "" -#: ../../library/tkinter.rst:721 +#: ../../library/tkinter.rst:713 msgid "" "is optional, either ``''`` or ``'+'``. Passing an empty string denotes that " "this binding is to replace any other bindings that this event is associated " @@ -1138,7 +1121,7 @@ msgid "" "of functions bound to this event type." msgstr "" -#: ../../library/tkinter.rst:733 +#: ../../library/tkinter.rst:725 msgid "" "Notice how the widget field of the event is being accessed in the " "``turn_red()`` callback. This field contains the widget that caught the X " @@ -1147,213 +1130,213 @@ msgid "" "pages." msgstr "" -#: ../../library/tkinter.rst:739 +#: ../../library/tkinter.rst:731 msgid "Tk" msgstr "" -#: ../../library/tkinter.rst:739 +#: ../../library/tkinter.rst:731 msgid "Tkinter Event Field" msgstr "" -#: ../../library/tkinter.rst:741 +#: ../../library/tkinter.rst:733 msgid "%f" msgstr "" -#: ../../library/tkinter.rst:741 +#: ../../library/tkinter.rst:733 msgid "focus" msgstr "" -#: ../../library/tkinter.rst:741 +#: ../../library/tkinter.rst:733 msgid "%A" msgstr "" -#: ../../library/tkinter.rst:741 +#: ../../library/tkinter.rst:733 msgid "char" msgstr "" -#: ../../library/tkinter.rst:743 +#: ../../library/tkinter.rst:735 msgid "%h" msgstr "" -#: ../../library/tkinter.rst:743 +#: ../../library/tkinter.rst:735 msgid "height" msgstr "" -#: ../../library/tkinter.rst:743 +#: ../../library/tkinter.rst:735 msgid "%E" msgstr "" -#: ../../library/tkinter.rst:743 +#: ../../library/tkinter.rst:735 msgid "send_event" msgstr "" -#: ../../library/tkinter.rst:745 +#: ../../library/tkinter.rst:737 msgid "%k" msgstr "" -#: ../../library/tkinter.rst:745 +#: ../../library/tkinter.rst:737 msgid "keycode" msgstr "" -#: ../../library/tkinter.rst:745 +#: ../../library/tkinter.rst:737 msgid "%K" msgstr "" -#: ../../library/tkinter.rst:745 +#: ../../library/tkinter.rst:737 msgid "keysym" msgstr "" -#: ../../library/tkinter.rst:747 +#: ../../library/tkinter.rst:739 msgid "%s" msgstr "" -#: ../../library/tkinter.rst:747 +#: ../../library/tkinter.rst:739 msgid "state" msgstr "" -#: ../../library/tkinter.rst:747 +#: ../../library/tkinter.rst:739 msgid "%N" msgstr "" -#: ../../library/tkinter.rst:747 +#: ../../library/tkinter.rst:739 msgid "keysym_num" msgstr "" -#: ../../library/tkinter.rst:749 +#: ../../library/tkinter.rst:741 msgid "%t" msgstr "" -#: ../../library/tkinter.rst:749 +#: ../../library/tkinter.rst:741 msgid "time" msgstr "" -#: ../../library/tkinter.rst:749 +#: ../../library/tkinter.rst:741 msgid "%T" msgstr "" -#: ../../library/tkinter.rst:749 +#: ../../library/tkinter.rst:741 msgid "type" msgstr "" -#: ../../library/tkinter.rst:751 +#: ../../library/tkinter.rst:743 msgid "%w" msgstr "" -#: ../../library/tkinter.rst:751 +#: ../../library/tkinter.rst:743 msgid "width" msgstr "" -#: ../../library/tkinter.rst:751 +#: ../../library/tkinter.rst:743 msgid "%W" msgstr "" -#: ../../library/tkinter.rst:751 +#: ../../library/tkinter.rst:743 msgid "widget" msgstr "" -#: ../../library/tkinter.rst:753 +#: ../../library/tkinter.rst:745 msgid "%x" msgstr "" -#: ../../library/tkinter.rst:753 +#: ../../library/tkinter.rst:745 msgid "x" msgstr "" -#: ../../library/tkinter.rst:753 +#: ../../library/tkinter.rst:745 msgid "%X" msgstr "" -#: ../../library/tkinter.rst:753 +#: ../../library/tkinter.rst:745 msgid "x_root" msgstr "" -#: ../../library/tkinter.rst:755 +#: ../../library/tkinter.rst:747 msgid "%y" msgstr "" -#: ../../library/tkinter.rst:755 +#: ../../library/tkinter.rst:747 msgid "y" msgstr "" -#: ../../library/tkinter.rst:755 +#: ../../library/tkinter.rst:747 msgid "%Y" msgstr "" -#: ../../library/tkinter.rst:755 +#: ../../library/tkinter.rst:747 msgid "y_root" msgstr "" -#: ../../library/tkinter.rst:760 +#: ../../library/tkinter.rst:752 msgid "The index Parameter" msgstr "" -#: ../../library/tkinter.rst:762 +#: ../../library/tkinter.rst:754 msgid "" "A number of widgets require \"index\" parameters to be passed. These are " "used to point at a specific place in a Text widget, or to particular " "characters in an Entry widget, or to particular menu items in a Menu widget." msgstr "" -#: ../../library/tkinter.rst:769 +#: ../../library/tkinter.rst:761 msgid "Entry widget indexes (index, view index, etc.)" msgstr "" -#: ../../library/tkinter.rst:767 +#: ../../library/tkinter.rst:759 msgid "" "Entry widgets have options that refer to character positions in the text " "being displayed. You can use these :mod:`tkinter` functions to access these " "special points in text widgets:" msgstr "" -#: ../../library/tkinter.rst:773 +#: ../../library/tkinter.rst:765 msgid "Text widget indexes" msgstr "" -#: ../../library/tkinter.rst:772 +#: ../../library/tkinter.rst:764 msgid "" "The index notation for Text widgets is very rich and is best described in " "the Tk man pages." msgstr "" -#: ../../library/tkinter.rst:798 +#: ../../library/tkinter.rst:790 msgid "Menu indexes (menu.invoke(), menu.entryconfig(), etc.)" msgstr "" -#: ../../library/tkinter.rst:776 +#: ../../library/tkinter.rst:768 msgid "" "Some options and methods for menus manipulate specific menu entries. Anytime " "a menu index is needed for an option or a parameter, you may pass in:" msgstr "" -#: ../../library/tkinter.rst:779 +#: ../../library/tkinter.rst:771 msgid "" "an integer which refers to the numeric position of the entry in the widget, " "counted from the top, starting with 0;" msgstr "" -#: ../../library/tkinter.rst:782 +#: ../../library/tkinter.rst:774 msgid "" "the string ``\"active\"``, which refers to the menu position that is " "currently under the cursor;" msgstr "" -#: ../../library/tkinter.rst:785 +#: ../../library/tkinter.rst:777 msgid "the string ``\"last\"`` which refers to the last menu item;" msgstr "" -#: ../../library/tkinter.rst:787 +#: ../../library/tkinter.rst:779 msgid "" "An integer preceded by ``@``, as in ``@6``, where the integer is interpreted " "as a y pixel coordinate in the menu's coordinate system;" msgstr "" -#: ../../library/tkinter.rst:790 +#: ../../library/tkinter.rst:782 msgid "" "the string ``\"none\"``, which indicates no menu entry at all, most often " "used with menu.activate() to deactivate all entries, and finally," msgstr "" -#: ../../library/tkinter.rst:793 +#: ../../library/tkinter.rst:785 msgid "" "a text string that is pattern matched against the label of the menu entry, " "as scanned from the top of the menu to the bottom. Note that this index " @@ -1362,33 +1345,33 @@ msgid "" "above literals, instead." msgstr "" -#: ../../library/tkinter.rst:801 +#: ../../library/tkinter.rst:793 msgid "Images" msgstr "" -#: ../../library/tkinter.rst:803 +#: ../../library/tkinter.rst:795 msgid "" "Images of different formats can be created through the corresponding " "subclass of :class:`tkinter.Image`:" msgstr "" -#: ../../library/tkinter.rst:806 +#: ../../library/tkinter.rst:798 msgid ":class:`BitmapImage` for images in XBM format." msgstr "" -#: ../../library/tkinter.rst:808 +#: ../../library/tkinter.rst:800 msgid "" ":class:`PhotoImage` for images in PGM, PPM, GIF and PNG formats. The latter " "is supported starting with Tk 8.6." msgstr "" -#: ../../library/tkinter.rst:811 +#: ../../library/tkinter.rst:803 msgid "" "Either type of image is created through either the ``file`` or the ``data`` " "option (other options are available as well)." msgstr "" -#: ../../library/tkinter.rst:814 +#: ../../library/tkinter.rst:806 msgid "" "The image object can then be used wherever an ``image`` option is supported " "by some widget (e.g. labels, buttons, menus). In these cases, Tk will not " @@ -1397,28 +1380,28 @@ msgid "" "empty box wherever the image was used." msgstr "" -#: ../../library/tkinter.rst:822 +#: ../../library/tkinter.rst:814 msgid "" "The `Pillow `_ package adds support for formats " "such as BMP, JPEG, TIFF, and WebP, among others." msgstr "" -#: ../../library/tkinter.rst:828 +#: ../../library/tkinter.rst:820 msgid "File Handlers" msgstr "" -#: ../../library/tkinter.rst:830 +#: ../../library/tkinter.rst:822 msgid "" "Tk allows you to register and unregister a callback function which will be " "called from the Tk mainloop when I/O is possible on a file descriptor. Only " "one handler may be registered per file descriptor. Example code::" msgstr "" -#: ../../library/tkinter.rst:841 +#: ../../library/tkinter.rst:833 msgid "This feature is not available on Windows." msgstr "" -#: ../../library/tkinter.rst:843 +#: ../../library/tkinter.rst:835 msgid "" "Since you don't know how many bytes are available for reading, you may not " "want to use the :class:`~io.BufferedIOBase` or :class:`~io.TextIOBase` :meth:" @@ -1429,7 +1412,7 @@ msgid "" "maxbytecount)``." msgstr "" -#: ../../library/tkinter.rst:854 +#: ../../library/tkinter.rst:846 msgid "" "Registers the file handler callback function *func*. The *file* argument may " "either be an object with a :meth:`~io.IOBase.fileno` method (such as a file " @@ -1438,10 +1421,10 @@ msgid "" "as follows::" msgstr "" -#: ../../library/tkinter.rst:865 +#: ../../library/tkinter.rst:857 msgid "Unregisters a file handler." msgstr "" -#: ../../library/tkinter.rst:872 +#: ../../library/tkinter.rst:864 msgid "Constants used in the *mask* arguments." msgstr "" diff --git a/library/token.po b/library/token.po index 4a58662446..2a1b968fb0 100644 --- a/library/token.po +++ b/library/token.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.7\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2021-09-07 06:52+0000\n" +"POT-Creation-Date: 2020-06-20 18:08+0800\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-" @@ -277,28 +277,28 @@ msgid "" "an ``ENCODING`` token." msgstr "" -#: ../../library/token.rst:75 +#: ../../library/token.rst:74 msgid "" "Token value indicating that a type comment was recognized. Such tokens are " "only produced when :func:`ast.parse()` is invoked with " "``type_comments=True``." msgstr "" -#: ../../library/token.rst:80 +#: ../../library/token.rst:79 msgid "Added :data:`AWAIT` and :data:`ASYNC` tokens." msgstr "" -#: ../../library/token.rst:83 +#: ../../library/token.rst:82 msgid "Added :data:`COMMENT`, :data:`NL` and :data:`ENCODING` tokens." msgstr "" -#: ../../library/token.rst:86 +#: ../../library/token.rst:85 msgid "" "Removed :data:`AWAIT` and :data:`ASYNC` tokens. \"async\" and \"await\" are " "now tokenized as :data:`NAME` tokens." msgstr "" -#: ../../library/token.rst:90 +#: ../../library/token.rst:89 msgid "" "Added :data:`TYPE_COMMENT`, :data:`TYPE_IGNORE`, :data:`COLONEQUAL`. Added :" "data:`AWAIT` and :data:`ASYNC` tokens back (they're needed to support " diff --git a/library/turtle.po b/library/turtle.po index 141466a258..7d63cafa0e 100644 --- a/library/turtle.po +++ b/library/turtle.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.7\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2021-09-07 06:52+0000\n" +"POT-Creation-Date: 2020-06-20 18:08+0800\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-" @@ -209,7 +209,7 @@ msgstr "" msgid ":func:`home`" msgstr "" -#: ../../library/turtle.rst:0 ../../library/turtle.rst:2463 +#: ../../library/turtle.rst:0 ../../library/turtle.rst:2456 msgid ":func:`circle`" msgstr "" @@ -217,7 +217,7 @@ msgstr "" msgid ":func:`dot`" msgstr "" -#: ../../library/turtle.rst:0 ../../library/turtle.rst:2441 +#: ../../library/turtle.rst:0 ../../library/turtle.rst:2434 msgid ":func:`stamp`" msgstr "" @@ -417,7 +417,7 @@ msgstr "" msgid "Using events" msgstr "" -#: ../../library/turtle.rst:0 ../../library/turtle.rst:2435 +#: ../../library/turtle.rst:0 ../../library/turtle.rst:2428 msgid ":func:`onclick`" msgstr "" @@ -425,11 +425,11 @@ msgstr "" msgid ":func:`onrelease`" msgstr "" -#: ../../library/turtle.rst:0 ../../library/turtle.rst:2418 +#: ../../library/turtle.rst:0 ../../library/turtle.rst:2411 msgid ":func:`ondrag`" msgstr "" -#: ../../library/turtle.rst:188 ../../library/turtle.rst:1436 +#: ../../library/turtle.rst:188 ../../library/turtle.rst:1435 msgid "Special Turtle methods" msgstr "" @@ -445,7 +445,7 @@ msgstr "" msgid ":func:`get_poly`" msgstr "" -#: ../../library/turtle.rst:0 ../../library/turtle.rst:2454 +#: ../../library/turtle.rst:0 ../../library/turtle.rst:2447 msgid ":func:`clone`" msgstr "" @@ -469,7 +469,7 @@ msgstr "" msgid "Methods of TurtleScreen/Screen" msgstr "" -#: ../../library/turtle.rst:199 ../../library/turtle.rst:1590 +#: ../../library/turtle.rst:199 ../../library/turtle.rst:1589 msgid "Window control" msgstr "" @@ -482,11 +482,11 @@ msgid ":func:`bgpic`" msgstr "" #: ../../library/turtle.rst:0 -msgid ":func:`clearscreen`" +msgid ":func:`clear` | :func:`clearscreen`" msgstr "" #: ../../library/turtle.rst:0 -msgid ":func:`resetscreen`" +msgid ":func:`reset` | :func:`resetscreen`" msgstr "" #: ../../library/turtle.rst:0 @@ -497,7 +497,7 @@ msgstr "" msgid ":func:`setworldcoordinates`" msgstr "" -#: ../../library/turtle.rst:204 ../../library/turtle.rst:1713 +#: ../../library/turtle.rst:204 ../../library/turtle.rst:1706 msgid "Animation control" msgstr "" @@ -513,7 +513,7 @@ msgstr "" msgid ":func:`update`" msgstr "" -#: ../../library/turtle.rst:212 ../../library/turtle.rst:1766 +#: ../../library/turtle.rst:212 ../../library/turtle.rst:1759 msgid "Using screen events" msgstr "" @@ -541,7 +541,7 @@ msgstr "" msgid ":func:`mainloop` | :func:`done`" msgstr "" -#: ../../library/turtle.rst:222 ../../library/turtle.rst:1911 +#: ../../library/turtle.rst:222 ../../library/turtle.rst:1904 msgid "Settings and special methods" msgstr "" @@ -577,7 +577,7 @@ msgstr "" msgid ":func:`window_width`" msgstr "" -#: ../../library/turtle.rst:226 ../../library/turtle.rst:1875 +#: ../../library/turtle.rst:226 ../../library/turtle.rst:1868 msgid "Input methods" msgstr "" @@ -877,7 +877,7 @@ msgid "" "Return the angle between the line from turtle position to position specified " "by (x,y), the vector or the other turtle. This depends on the turtle's " "start orientation which depends on the mode - \"standard\"/\"world\" or " -"\"logo\"." +"\"logo\")." msgstr "" #: ../../library/turtle.rst:677 @@ -1040,7 +1040,7 @@ msgid "" "colormode is either 1.0 or 255 (see :func:`colormode`)." msgstr "" -#: ../../library/turtle.rst:914 +#: ../../library/turtle.rst:917 msgid "``pencolor(r, g, b)``" msgstr "" @@ -1092,7 +1092,7 @@ msgid "" "colormode is either 1.0 or 255 (see :func:`colormode`)." msgstr "" -#: ../../library/turtle.rst:963 +#: ../../library/turtle.rst:966 msgid "``fillcolor(r, g, b)``" msgstr "" @@ -1138,7 +1138,7 @@ msgid "" "given value." msgstr "" -#: ../../library/turtle.rst:1002 +#: ../../library/turtle.rst:1005 msgid "" "``color(colorstring1, colorstring2)``, ``color((r1,g1,b1), (r2,g2,b2))``" msgstr "" @@ -1211,9 +1211,9 @@ msgstr "" #: ../../library/turtle.rst:1105 msgid "" "Write text - the string representation of *arg* - at the current turtle " -"position according to *align* (\"left\", \"center\" or \"right\") and with " -"the given font. If *move* is true, the pen is moved to the bottom-right " -"corner of the text. By default, *move* is ``False``." +"position according to *align* (\"left\", \"center\" or right\") and with the " +"given font. If *move* is true, the pen is moved to the bottom-right corner " +"of the text. By default, *move* is ``False``." msgstr "" #: ../../library/turtle.rst:1123 @@ -1273,8 +1273,7 @@ msgstr "" #: ../../library/turtle.rst:1193 msgid "" -"``resizemode(\"user\")`` is called by :func:`shapesize` when used with " -"arguments." +"resizemode(\"user\") is called by :func:`shapesize` when used with arguments." msgstr "" #: ../../library/turtle.rst:1208 ../../library/turtle.rst:1209 @@ -1292,8 +1291,8 @@ msgid "" "determines the width of the shapes's outline." msgstr "" -#: ../../library/turtle.rst:1235 ../../library/turtle.rst:1894 -#: ../../library/turtle.rst:1895 ../../library/turtle.rst:1896 +#: ../../library/turtle.rst:1235 ../../library/turtle.rst:1887 +#: ../../library/turtle.rst:1888 ../../library/turtle.rst:1889 msgid "number (optional)" msgstr "" @@ -1344,7 +1343,7 @@ msgid "" "If none of the matrix elements are given, return the transformation matrix " "as a tuple of 4 elements. Otherwise set the given elements and transform the " "turtleshape according to the matrix consisting of first row t11, t12 and " -"second row t21, t22. The determinant t11 * t22 - t12 * t21 must not be zero, " +"second row t21, 22. The determinant t11 * t22 - t12 * t21 must not be zero, " "otherwise an error is raised. Modify stretchfactor, shearfactor and " "tiltangle according to the given matrix." msgstr "" @@ -1355,167 +1354,167 @@ msgid "" "used to define a new shape or components of a compound shape." msgstr "" -#: ../../library/turtle.rst:1367 ../../library/turtle.rst:1389 -#: ../../library/turtle.rst:1414 ../../library/turtle.rst:1818 +#: ../../library/turtle.rst:1366 ../../library/turtle.rst:1388 +#: ../../library/turtle.rst:1413 ../../library/turtle.rst:1811 msgid "" "a function with two arguments which will be called with the coordinates of " "the clicked point on the canvas" msgstr "" -#: ../../library/turtle.rst:1369 ../../library/turtle.rst:1391 -#: ../../library/turtle.rst:1416 ../../library/turtle.rst:1820 +#: ../../library/turtle.rst:1368 ../../library/turtle.rst:1390 +#: ../../library/turtle.rst:1415 ../../library/turtle.rst:1813 msgid "number of the mouse-button, defaults to 1 (left mouse button)" msgstr "" -#: ../../library/turtle.rst:1370 ../../library/turtle.rst:1392 -#: ../../library/turtle.rst:1417 ../../library/turtle.rst:1821 +#: ../../library/turtle.rst:1369 ../../library/turtle.rst:1391 +#: ../../library/turtle.rst:1416 ../../library/turtle.rst:1814 msgid "" "``True`` or ``False`` -- if ``True``, a new binding will be added, otherwise " "it will replace a former binding" msgstr "" -#: ../../library/turtle.rst:1373 +#: ../../library/turtle.rst:1372 msgid "" "Bind *fun* to mouse-click events on this turtle. If *fun* is ``None``, " "existing bindings are removed. Example for the anonymous turtle, i.e. the " "procedural way:" msgstr "" -#: ../../library/turtle.rst:1395 +#: ../../library/turtle.rst:1394 msgid "" "Bind *fun* to mouse-button-release events on this turtle. If *fun* is " "``None``, existing bindings are removed." msgstr "" -#: ../../library/turtle.rst:1420 +#: ../../library/turtle.rst:1419 msgid "" "Bind *fun* to mouse-move events on this turtle. If *fun* is ``None``, " "existing bindings are removed." msgstr "" -#: ../../library/turtle.rst:1423 +#: ../../library/turtle.rst:1422 msgid "" "Remark: Every sequence of mouse-move-events on a turtle is preceded by a " "mouse-click event on that turtle." msgstr "" -#: ../../library/turtle.rst:1431 +#: ../../library/turtle.rst:1430 msgid "" "Subsequently, clicking and dragging the Turtle will move it across the " "screen thereby producing handdrawings (if pen is down)." msgstr "" -#: ../../library/turtle.rst:1440 +#: ../../library/turtle.rst:1439 msgid "" "Start recording the vertices of a polygon. Current turtle position is first " "vertex of polygon." msgstr "" -#: ../../library/turtle.rst:1446 +#: ../../library/turtle.rst:1445 msgid "" "Stop recording the vertices of a polygon. Current turtle position is last " "vertex of polygon. This will be connected with the first vertex." msgstr "" -#: ../../library/turtle.rst:1452 +#: ../../library/turtle.rst:1451 msgid "Return the last recorded polygon." msgstr "" -#: ../../library/turtle.rst:1471 +#: ../../library/turtle.rst:1470 msgid "" "Create and return a clone of the turtle with same position, heading and " "turtle properties." msgstr "" -#: ../../library/turtle.rst:1484 +#: ../../library/turtle.rst:1483 msgid "" "Return the Turtle object itself. Only reasonable use: as a function to " "return the \"anonymous turtle\":" msgstr "" -#: ../../library/turtle.rst:1498 +#: ../../library/turtle.rst:1497 msgid "" "Return the :class:`TurtleScreen` object the turtle is drawing on. " "TurtleScreen methods can then be called for that object." msgstr "" -#: ../../library/turtle.rst:1512 +#: ../../library/turtle.rst:1511 msgid "an integer or ``None``" msgstr "" -#: ../../library/turtle.rst:1514 +#: ../../library/turtle.rst:1513 msgid "" -"Set or disable undobuffer. If *size* is an integer, an empty undobuffer of " +"Set or disable undobuffer. If *size* is an integer an empty undobuffer of " "given size is installed. *size* gives the maximum number of turtle actions " "that can be undone by the :func:`undo` method/function. If *size* is " "``None``, the undobuffer is disabled." msgstr "" -#: ../../library/turtle.rst:1527 +#: ../../library/turtle.rst:1526 msgid "Return number of entries in the undobuffer." msgstr "" -#: ../../library/turtle.rst:1540 +#: ../../library/turtle.rst:1539 msgid "Compound shapes" msgstr "" -#: ../../library/turtle.rst:1542 +#: ../../library/turtle.rst:1541 msgid "" "To use compound turtle shapes, which consist of several polygons of " "different color, you must use the helper class :class:`Shape` explicitly as " "described below:" msgstr "" -#: ../../library/turtle.rst:1546 +#: ../../library/turtle.rst:1545 msgid "Create an empty Shape object of type \"compound\"." msgstr "" -#: ../../library/turtle.rst:1547 +#: ../../library/turtle.rst:1546 msgid "" "Add as many components to this object as desired, using the :meth:" "`addcomponent` method." msgstr "" -#: ../../library/turtle.rst:1550 +#: ../../library/turtle.rst:1549 msgid "For example:" msgstr "" -#: ../../library/turtle.rst:1561 +#: ../../library/turtle.rst:1560 msgid "Now add the Shape to the Screen's shapelist and use it:" msgstr "" -#: ../../library/turtle.rst:1572 +#: ../../library/turtle.rst:1571 msgid "" "The :class:`Shape` class is used internally by the :func:`register_shape` " "method in different ways. The application programmer has to deal with the " "Shape class *only* when using compound shapes like shown above!" msgstr "" -#: ../../library/turtle.rst:1578 +#: ../../library/turtle.rst:1577 msgid "Methods of TurtleScreen/Screen and corresponding functions" msgstr "" -#: ../../library/turtle.rst:1580 +#: ../../library/turtle.rst:1579 msgid "" "Most of the examples in this section refer to a TurtleScreen instance called " "``screen``." msgstr "" -#: ../../library/turtle.rst:1594 +#: ../../library/turtle.rst:1593 msgid "" "a color string or three numbers in the range 0..colormode or a 3-tuple of " "such numbers" msgstr "" -#: ../../library/turtle.rst:1598 +#: ../../library/turtle.rst:1597 msgid "Set or return background color of the TurtleScreen." msgstr "" -#: ../../library/turtle.rst:1613 +#: ../../library/turtle.rst:1612 msgid "a string, name of a gif-file or ``\"nopic\"``, or ``None``" msgstr "" -#: ../../library/turtle.rst:1615 +#: ../../library/turtle.rst:1614 msgid "" "Set background image or return name of current backgroundimage. If " "*picname* is a filename, set the corresponding image as background. If " @@ -1523,44 +1522,44 @@ msgid "" "*picname* is ``None``, return the filename of the current backgroundimage. ::" msgstr "" -#: ../../library/turtle.rst:1631 +#: ../../library/turtle.rst:1629 +msgid "" +"Delete all drawings and all turtles from the TurtleScreen. Reset the now " +"empty TurtleScreen to its initial state: white background, no background " +"image, no event bindings and tracing on." +msgstr "" + +#: ../../library/turtle.rst:1634 msgid "" "This TurtleScreen method is available as a global function only under the " "name ``clearscreen``. The global function ``clear`` is a different one " "derived from the Turtle method ``clear``." msgstr "" -#: ../../library/turtle.rst:1638 -msgid "" -"Delete all drawings and all turtles from the TurtleScreen. Reset the now " -"empty TurtleScreen to its initial state: white background, no background " -"image, no event bindings and tracing on." +#: ../../library/turtle.rst:1642 +msgid "Reset all Turtles on the Screen to their initial state." msgstr "" -#: ../../library/turtle.rst:1647 +#: ../../library/turtle.rst:1645 msgid "" "This TurtleScreen method is available as a global function only under the " "name ``resetscreen``. The global function ``reset`` is another one derived " "from the Turtle method ``reset``." msgstr "" -#: ../../library/turtle.rst:1654 -msgid "Reset all Turtles on the Screen to their initial state." -msgstr "" - -#: ../../library/turtle.rst:1659 +#: ../../library/turtle.rst:1652 msgid "positive integer, new width of canvas in pixels" msgstr "" -#: ../../library/turtle.rst:1660 +#: ../../library/turtle.rst:1653 msgid "positive integer, new height of canvas in pixels" msgstr "" -#: ../../library/turtle.rst:1661 +#: ../../library/turtle.rst:1654 msgid "colorstring or color-tuple, new background color" msgstr "" -#: ../../library/turtle.rst:1663 +#: ../../library/turtle.rst:1656 msgid "" "If no arguments are given, return current (canvaswidth, canvasheight). Else " "resize the canvas the turtles are drawing on. Do not alter the drawing " @@ -1569,59 +1568,59 @@ msgid "" "outside the canvas before." msgstr "" -#: ../../library/turtle.rst:1675 +#: ../../library/turtle.rst:1668 msgid "e.g. to search for an erroneously escaped turtle ;-)" msgstr "" -#: ../../library/turtle.rst:1680 +#: ../../library/turtle.rst:1673 msgid "a number, x-coordinate of lower left corner of canvas" msgstr "" -#: ../../library/turtle.rst:1681 +#: ../../library/turtle.rst:1674 msgid "a number, y-coordinate of lower left corner of canvas" msgstr "" -#: ../../library/turtle.rst:1682 +#: ../../library/turtle.rst:1675 msgid "a number, x-coordinate of upper right corner of canvas" msgstr "" -#: ../../library/turtle.rst:1683 +#: ../../library/turtle.rst:1676 msgid "a number, y-coordinate of upper right corner of canvas" msgstr "" -#: ../../library/turtle.rst:1685 +#: ../../library/turtle.rst:1678 msgid "" "Set up user-defined coordinate system and switch to mode \"world\" if " "necessary. This performs a ``screen.reset()``. If mode \"world\" is " "already active, all drawings are redrawn according to the new coordinates." msgstr "" -#: ../../library/turtle.rst:1689 +#: ../../library/turtle.rst:1682 msgid "" "**ATTENTION**: in user-defined coordinate systems angles may appear " "distorted." msgstr "" -#: ../../library/turtle.rst:1717 +#: ../../library/turtle.rst:1710 msgid "positive integer" msgstr "" -#: ../../library/turtle.rst:1719 +#: ../../library/turtle.rst:1712 msgid "" "Set or return the drawing *delay* in milliseconds. (This is approximately " "the time interval between two consecutive canvas updates.) The longer the " "drawing delay, the slower the animation." msgstr "" -#: ../../library/turtle.rst:1723 +#: ../../library/turtle.rst:1716 msgid "Optional argument:" msgstr "" -#: ../../library/turtle.rst:1737 ../../library/turtle.rst:1738 +#: ../../library/turtle.rst:1730 ../../library/turtle.rst:1731 msgid "nonnegative integer" msgstr "" -#: ../../library/turtle.rst:1740 +#: ../../library/turtle.rst:1733 msgid "" "Turn turtle animation on/off and set delay for update drawings. If *n* is " "given, only each n-th regular screen update is really performed. (Can be " @@ -1630,75 +1629,75 @@ msgid "" "delay value (see :func:`delay`)." msgstr "" -#: ../../library/turtle.rst:1760 +#: ../../library/turtle.rst:1753 msgid "Perform a TurtleScreen update. To be used when tracer is turned off." msgstr "" -#: ../../library/turtle.rst:1762 +#: ../../library/turtle.rst:1755 msgid "See also the RawTurtle/Turtle method :func:`speed`." msgstr "" -#: ../../library/turtle.rst:1770 +#: ../../library/turtle.rst:1763 msgid "" "Set focus on TurtleScreen (in order to collect key-events). Dummy arguments " "are provided in order to be able to pass :func:`listen` to the onclick " "method." msgstr "" -#: ../../library/turtle.rst:1777 ../../library/turtle.rst:1797 +#: ../../library/turtle.rst:1770 ../../library/turtle.rst:1790 msgid "a function with no arguments or ``None``" msgstr "" -#: ../../library/turtle.rst:1778 ../../library/turtle.rst:1798 +#: ../../library/turtle.rst:1771 ../../library/turtle.rst:1791 msgid "a string: key (e.g. \"a\") or key-symbol (e.g. \"space\")" msgstr "" -#: ../../library/turtle.rst:1780 +#: ../../library/turtle.rst:1773 msgid "" "Bind *fun* to key-release event of key. If *fun* is ``None``, event " "bindings are removed. Remark: in order to be able to register key-events, " "TurtleScreen must have the focus. (See method :func:`listen`.)" msgstr "" -#: ../../library/turtle.rst:1800 +#: ../../library/turtle.rst:1793 msgid "" "Bind *fun* to key-press event of key if key is given, or to any key-press-" "event if no key is given. Remark: in order to be able to register key-" "events, TurtleScreen must have focus. (See method :func:`listen`.)" msgstr "" -#: ../../library/turtle.rst:1824 +#: ../../library/turtle.rst:1817 msgid "" "Bind *fun* to mouse-click events on this screen. If *fun* is ``None``, " "existing bindings are removed." msgstr "" -#: ../../library/turtle.rst:1827 +#: ../../library/turtle.rst:1820 msgid "" "Example for a TurtleScreen instance named ``screen`` and a Turtle instance " -"named ``turtle``:" +"named turtle:" msgstr "" -#: ../../library/turtle.rst:1838 +#: ../../library/turtle.rst:1831 msgid "" "This TurtleScreen method is available as a global function only under the " "name ``onscreenclick``. The global function ``onclick`` is another one " "derived from the Turtle method ``onclick``." msgstr "" -#: ../../library/turtle.rst:1845 +#: ../../library/turtle.rst:1838 msgid "a function with no arguments" msgstr "" -#: ../../library/turtle.rst:1846 +#: ../../library/turtle.rst:1839 msgid "a number >= 0" msgstr "" -#: ../../library/turtle.rst:1848 +#: ../../library/turtle.rst:1841 msgid "Install a timer that calls *fun* after *t* milliseconds." msgstr "" -#: ../../library/turtle.rst:1866 +#: ../../library/turtle.rst:1859 msgid "" "Starts event loop - calling Tkinter's mainloop function. Must be the last " "statement in a turtle graphics program. Must *not* be used if a script is " @@ -1706,12 +1705,12 @@ msgid "" "turtle graphics. ::" msgstr "" -#: ../../library/turtle.rst:1879 ../../library/turtle.rst:1880 -#: ../../library/turtle.rst:1892 ../../library/turtle.rst:1893 +#: ../../library/turtle.rst:1872 ../../library/turtle.rst:1873 +#: ../../library/turtle.rst:1885 ../../library/turtle.rst:1886 msgid "string" msgstr "" -#: ../../library/turtle.rst:1882 +#: ../../library/turtle.rst:1875 msgid "" "Pop up a dialog window for input of a string. Parameter title is the title " "of the dialog window, prompt is a text mostly describing what information to " @@ -1719,7 +1718,7 @@ msgid "" "``None``. ::" msgstr "" -#: ../../library/turtle.rst:1898 +#: ../../library/turtle.rst:1891 msgid "" "Pop up a dialog window for input of a number. title is the title of the " "dialog window, prompt is a text mostly describing what numerical information " @@ -1730,17 +1729,17 @@ msgid "" "return ``None``. ::" msgstr "" -#: ../../library/turtle.rst:1915 +#: ../../library/turtle.rst:1908 msgid "one of the strings \"standard\", \"logo\" or \"world\"" msgstr "" -#: ../../library/turtle.rst:1917 +#: ../../library/turtle.rst:1910 msgid "" "Set turtle mode (\"standard\", \"logo\" or \"world\") and perform reset. If " "mode is not given, current mode is returned." msgstr "" -#: ../../library/turtle.rst:1920 +#: ../../library/turtle.rst:1913 msgid "" "Mode \"standard\" is compatible with old :mod:`turtle`. Mode \"logo\" is " "compatible with most Logo turtle graphics. Mode \"world\" uses user-defined " @@ -1748,121 +1747,121 @@ msgid "" "if ``x/y`` unit-ratio doesn't equal 1." msgstr "" -#: ../../library/turtle.rst:1926 +#: ../../library/turtle.rst:1919 msgid "Mode" msgstr "" -#: ../../library/turtle.rst:1926 +#: ../../library/turtle.rst:1919 msgid "Initial turtle heading" msgstr "" -#: ../../library/turtle.rst:1926 +#: ../../library/turtle.rst:1919 msgid "positive angles" msgstr "" -#: ../../library/turtle.rst:1928 +#: ../../library/turtle.rst:1921 msgid "\"standard\"" msgstr "" -#: ../../library/turtle.rst:1928 +#: ../../library/turtle.rst:1921 msgid "to the right (east)" msgstr "" -#: ../../library/turtle.rst:1928 +#: ../../library/turtle.rst:1921 msgid "counterclockwise" msgstr "" -#: ../../library/turtle.rst:1929 +#: ../../library/turtle.rst:1922 msgid "\"logo\"" msgstr "" -#: ../../library/turtle.rst:1929 +#: ../../library/turtle.rst:1922 msgid "upward (north)" msgstr "" -#: ../../library/turtle.rst:1929 +#: ../../library/turtle.rst:1922 msgid "clockwise" msgstr "" -#: ../../library/turtle.rst:1942 +#: ../../library/turtle.rst:1935 msgid "one of the values 1.0 or 255" msgstr "" -#: ../../library/turtle.rst:1944 +#: ../../library/turtle.rst:1937 msgid "" "Return the colormode or set it to 1.0 or 255. Subsequently *r*, *g*, *b* " "values of color triples have to be in the range 0..\\ *cmode*." msgstr "" -#: ../../library/turtle.rst:1965 +#: ../../library/turtle.rst:1958 msgid "" "Return the Canvas of this TurtleScreen. Useful for insiders who know what " "to do with a Tkinter Canvas." msgstr "" -#: ../../library/turtle.rst:1978 +#: ../../library/turtle.rst:1971 msgid "Return a list of names of all currently available turtle shapes." msgstr "" -#: ../../library/turtle.rst:1990 +#: ../../library/turtle.rst:1983 msgid "There are three different ways to call this function:" msgstr "" -#: ../../library/turtle.rst:1992 +#: ../../library/turtle.rst:1985 msgid "" "*name* is the name of a gif-file and *shape* is ``None``: Install the " "corresponding image shape. ::" msgstr "" -#: ../../library/turtle.rst:1998 +#: ../../library/turtle.rst:1991 msgid "" "Image shapes *do not* rotate when turning the turtle, so they do not display " "the heading of the turtle!" msgstr "" -#: ../../library/turtle.rst:2001 +#: ../../library/turtle.rst:1994 msgid "" "*name* is an arbitrary string and *shape* is a tuple of pairs of " "coordinates: Install the corresponding polygon shape." msgstr "" -#: ../../library/turtle.rst:2009 +#: ../../library/turtle.rst:2002 msgid "" "*name* is an arbitrary string and shape is a (compound) :class:`Shape` " "object: Install the corresponding compound shape." msgstr "" -#: ../../library/turtle.rst:2012 +#: ../../library/turtle.rst:2005 msgid "" "Add a turtle shape to TurtleScreen's shapelist. Only thusly registered " "shapes can be used by issuing the command ``shape(shapename)``." msgstr "" -#: ../../library/turtle.rst:2018 +#: ../../library/turtle.rst:2011 msgid "Return the list of turtles on the screen." msgstr "" -#: ../../library/turtle.rst:2029 +#: ../../library/turtle.rst:2022 msgid "Return the height of the turtle window. ::" msgstr "" -#: ../../library/turtle.rst:2037 +#: ../../library/turtle.rst:2030 msgid "Return the width of the turtle window. ::" msgstr "" -#: ../../library/turtle.rst:2046 +#: ../../library/turtle.rst:2039 msgid "Methods specific to Screen, not inherited from TurtleScreen" msgstr "" -#: ../../library/turtle.rst:2050 +#: ../../library/turtle.rst:2043 msgid "Shut the turtlegraphics window." msgstr "" -#: ../../library/turtle.rst:2055 -msgid "Bind ``bye()`` method to mouse clicks on the Screen." +#: ../../library/turtle.rst:2048 +msgid "Bind bye() method to mouse clicks on the Screen." msgstr "" -#: ../../library/turtle.rst:2058 +#: ../../library/turtle.rst:2051 msgid "" "If the value \"using_IDLE\" in the configuration dictionary is ``False`` " "(default value), also enter mainloop. Remark: If IDLE with the ``-n`` " @@ -1871,246 +1870,246 @@ msgid "" "client script." msgstr "" -#: ../../library/turtle.rst:2067 +#: ../../library/turtle.rst:2060 msgid "" "Set the size and position of the main window. Default values of arguments " "are stored in the configuration dictionary and can be changed via a :file:" "`turtle.cfg` file." msgstr "" -#: ../../library/turtle.rst:2071 +#: ../../library/turtle.rst:2064 msgid "" "if an integer, a size in pixels, if a float, a fraction of the screen; " "default is 50% of screen" msgstr "" -#: ../../library/turtle.rst:2073 +#: ../../library/turtle.rst:2066 msgid "" "if an integer, the height in pixels, if a float, a fraction of the screen; " "default is 75% of screen" msgstr "" -#: ../../library/turtle.rst:2075 +#: ../../library/turtle.rst:2068 msgid "" "if positive, starting position in pixels from the left edge of the screen, " "if negative from the right edge, if ``None``, center window horizontally" msgstr "" -#: ../../library/turtle.rst:2078 +#: ../../library/turtle.rst:2071 msgid "" "if positive, starting position in pixels from the top edge of the screen, if " "negative from the bottom edge, if ``None``, center window vertically" msgstr "" -#: ../../library/turtle.rst:2093 +#: ../../library/turtle.rst:2086 msgid "a string that is shown in the titlebar of the turtle graphics window" msgstr "" -#: ../../library/turtle.rst:2096 +#: ../../library/turtle.rst:2089 msgid "Set title of turtle window to *titlestring*." msgstr "" -#: ../../library/turtle.rst:2105 +#: ../../library/turtle.rst:2098 msgid "Public classes" msgstr "" -#: ../../library/turtle.rst:2111 +#: ../../library/turtle.rst:2104 msgid "" "a :class:`tkinter.Canvas`, a :class:`ScrolledCanvas` or a :class:" "`TurtleScreen`" msgstr "" -#: ../../library/turtle.rst:2114 +#: ../../library/turtle.rst:2107 msgid "" "Create a turtle. The turtle has all methods described above as \"methods of " "Turtle/RawTurtle\"." msgstr "" -#: ../../library/turtle.rst:2120 +#: ../../library/turtle.rst:2113 msgid "" "Subclass of RawTurtle, has the same interface but draws on a default :class:" "`Screen` object created automatically when needed for the first time." msgstr "" -#: ../../library/turtle.rst:2126 +#: ../../library/turtle.rst:2119 msgid "a :class:`tkinter.Canvas`" msgstr "" -#: ../../library/turtle.rst:2128 +#: ../../library/turtle.rst:2121 msgid "" "Provides screen oriented methods like :func:`setbg` etc. that are described " "above." msgstr "" -#: ../../library/turtle.rst:2133 +#: ../../library/turtle.rst:2126 msgid "" "Subclass of TurtleScreen, with :ref:`four methods added `." msgstr "" -#: ../../library/turtle.rst:2138 +#: ../../library/turtle.rst:2131 msgid "" "some Tkinter widget to contain the ScrolledCanvas, i.e. a Tkinter-canvas " "with scrollbars added" msgstr "" -#: ../../library/turtle.rst:2141 +#: ../../library/turtle.rst:2134 msgid "" "Used by class Screen, which thus automatically provides a ScrolledCanvas as " "playground for the turtles." msgstr "" -#: ../../library/turtle.rst:2146 +#: ../../library/turtle.rst:2139 msgid "one of the strings \"polygon\", \"image\", \"compound\"" msgstr "" -#: ../../library/turtle.rst:2148 +#: ../../library/turtle.rst:2141 msgid "" "Data structure modeling shapes. The pair ``(type_, data)`` must follow this " "specification:" msgstr "" -#: ../../library/turtle.rst:2153 +#: ../../library/turtle.rst:2146 msgid "*type_*" msgstr "" -#: ../../library/turtle.rst:2153 +#: ../../library/turtle.rst:2146 msgid "*data*" msgstr "" -#: ../../library/turtle.rst:2155 +#: ../../library/turtle.rst:2148 msgid "\"polygon\"" msgstr "" -#: ../../library/turtle.rst:2155 +#: ../../library/turtle.rst:2148 msgid "a polygon-tuple, i.e. a tuple of pairs of coordinates" msgstr "" -#: ../../library/turtle.rst:2156 +#: ../../library/turtle.rst:2149 msgid "\"image\"" msgstr "" -#: ../../library/turtle.rst:2156 +#: ../../library/turtle.rst:2149 msgid "an image (in this form only used internally!)" msgstr "" -#: ../../library/turtle.rst:2157 +#: ../../library/turtle.rst:2150 msgid "\"compound\"" msgstr "" -#: ../../library/turtle.rst:2157 +#: ../../library/turtle.rst:2150 msgid "" "``None`` (a compound shape has to be constructed using the :meth:" "`addcomponent` method)" msgstr "" -#: ../../library/turtle.rst:2163 +#: ../../library/turtle.rst:2156 msgid "a polygon, i.e. a tuple of pairs of numbers" msgstr "" -#: ../../library/turtle.rst:2164 +#: ../../library/turtle.rst:2157 msgid "a color the *poly* will be filled with" msgstr "" -#: ../../library/turtle.rst:2165 +#: ../../library/turtle.rst:2158 msgid "a color for the poly's outline (if given)" msgstr "" -#: ../../library/turtle.rst:2167 +#: ../../library/turtle.rst:2160 msgid "Example:" msgstr "" -#: ../../library/turtle.rst:2177 +#: ../../library/turtle.rst:2170 msgid "See :ref:`compoundshapes`." msgstr "" -#: ../../library/turtle.rst:2182 +#: ../../library/turtle.rst:2175 msgid "" "A two-dimensional vector class, used as a helper class for implementing " "turtle graphics. May be useful for turtle graphics programs too. Derived " "from tuple, so a vector is a tuple!" msgstr "" -#: ../../library/turtle.rst:2186 +#: ../../library/turtle.rst:2179 msgid "Provides (for *a*, *b* vectors, *k* number):" msgstr "" -#: ../../library/turtle.rst:2188 +#: ../../library/turtle.rst:2181 msgid "``a + b`` vector addition" msgstr "" -#: ../../library/turtle.rst:2189 +#: ../../library/turtle.rst:2182 msgid "``a - b`` vector subtraction" msgstr "" -#: ../../library/turtle.rst:2190 +#: ../../library/turtle.rst:2183 msgid "``a * b`` inner product" msgstr "" -#: ../../library/turtle.rst:2191 +#: ../../library/turtle.rst:2184 msgid "``k * a`` and ``a * k`` multiplication with scalar" msgstr "" -#: ../../library/turtle.rst:2192 +#: ../../library/turtle.rst:2185 msgid "``abs(a)`` absolute value of a" msgstr "" -#: ../../library/turtle.rst:2193 +#: ../../library/turtle.rst:2186 msgid "``a.rotate(angle)`` rotation" msgstr "" -#: ../../library/turtle.rst:2197 +#: ../../library/turtle.rst:2190 msgid "Help and configuration" msgstr "" -#: ../../library/turtle.rst:2200 +#: ../../library/turtle.rst:2193 msgid "How to use help" msgstr "" -#: ../../library/turtle.rst:2202 +#: ../../library/turtle.rst:2195 msgid "" "The public methods of the Screen and Turtle classes are documented " "extensively via docstrings. So these can be used as online-help via the " "Python help facilities:" msgstr "" -#: ../../library/turtle.rst:2206 +#: ../../library/turtle.rst:2199 msgid "" "When using IDLE, tooltips show the signatures and first lines of the " "docstrings of typed in function-/method calls." msgstr "" -#: ../../library/turtle.rst:2209 +#: ../../library/turtle.rst:2202 msgid "Calling :func:`help` on methods or functions displays the docstrings::" msgstr "" -#: ../../library/turtle.rst:2240 +#: ../../library/turtle.rst:2233 msgid "" "The docstrings of the functions which are derived from methods have a " "modified form::" msgstr "" -#: ../../library/turtle.rst:2274 +#: ../../library/turtle.rst:2267 msgid "" "These modified docstrings are created automatically together with the " "function definitions that are derived from the methods at import time." msgstr "" -#: ../../library/turtle.rst:2279 +#: ../../library/turtle.rst:2272 msgid "Translation of docstrings into different languages" msgstr "" -#: ../../library/turtle.rst:2281 +#: ../../library/turtle.rst:2274 msgid "" "There is a utility to create a dictionary the keys of which are the method " "names and the values of which are the docstrings of the public methods of " "the classes Screen and Turtle." msgstr "" -#: ../../library/turtle.rst:2287 +#: ../../library/turtle.rst:2280 msgid "a string, used as filename" msgstr "" -#: ../../library/turtle.rst:2289 +#: ../../library/turtle.rst:2282 msgid "" "Create and write docstring-dictionary to a Python script with the given " "filename. This function has to be called explicitly (it is not used by the " @@ -2119,37 +2118,37 @@ msgid "" "for translation of the docstrings into different languages." msgstr "" -#: ../../library/turtle.rst:2295 +#: ../../library/turtle.rst:2288 msgid "" "If you (or your students) want to use :mod:`turtle` with online help in your " "native language, you have to translate the docstrings and save the resulting " "file as e.g. :file:`turtle_docstringdict_german.py`." msgstr "" -#: ../../library/turtle.rst:2299 +#: ../../library/turtle.rst:2292 msgid "" "If you have an appropriate entry in your :file:`turtle.cfg` file this " "dictionary will be read in at import time and will replace the original " "English docstrings." msgstr "" -#: ../../library/turtle.rst:2302 +#: ../../library/turtle.rst:2295 msgid "" "At the time of this writing there are docstring dictionaries in German and " "in Italian. (Requests please to glingl@aon.at.)" msgstr "" -#: ../../library/turtle.rst:2308 +#: ../../library/turtle.rst:2301 msgid "How to configure Screen and Turtles" msgstr "" -#: ../../library/turtle.rst:2310 +#: ../../library/turtle.rst:2303 msgid "" "The built-in default configuration mimics the appearance and behaviour of " "the old turtle module in order to retain best possible compatibility with it." msgstr "" -#: ../../library/turtle.rst:2313 +#: ../../library/turtle.rst:2306 msgid "" "If you want to use a different configuration which better reflects the " "features of this module or which better fits to your needs, e.g. for use in " @@ -2158,54 +2157,54 @@ msgid "" "settings." msgstr "" -#: ../../library/turtle.rst:2318 +#: ../../library/turtle.rst:2311 msgid "" "The built in configuration would correspond to the following turtle.cfg::" msgstr "" -#: ../../library/turtle.rst:2341 +#: ../../library/turtle.rst:2334 msgid "Short explanation of selected entries:" msgstr "" -#: ../../library/turtle.rst:2343 +#: ../../library/turtle.rst:2336 msgid "" "The first four lines correspond to the arguments of the :meth:`Screen.setup` " "method." msgstr "" -#: ../../library/turtle.rst:2345 +#: ../../library/turtle.rst:2338 msgid "" "Line 5 and 6 correspond to the arguments of the method :meth:`Screen." "screensize`." msgstr "" -#: ../../library/turtle.rst:2347 +#: ../../library/turtle.rst:2340 msgid "" "*shape* can be any of the built-in shapes, e.g: arrow, turtle, etc. For " "more info try ``help(shape)``." msgstr "" -#: ../../library/turtle.rst:2349 +#: ../../library/turtle.rst:2342 msgid "" "If you want to use no fillcolor (i.e. make the turtle transparent), you have " "to write ``fillcolor = \"\"`` (but all nonempty strings must not have quotes " "in the cfg-file)." msgstr "" -#: ../../library/turtle.rst:2352 +#: ../../library/turtle.rst:2345 msgid "" "If you want to reflect the turtle its state, you have to use ``resizemode = " "auto``." msgstr "" -#: ../../library/turtle.rst:2354 +#: ../../library/turtle.rst:2347 msgid "" "If you set e.g. ``language = italian`` the docstringdict :file:" "`turtle_docstringdict_italian.py` will be loaded at import time (if present " "on the import path, e.g. in the same directory as :mod:`turtle`." msgstr "" -#: ../../library/turtle.rst:2357 +#: ../../library/turtle.rst:2350 msgid "" "The entries *exampleturtle* and *examplescreen* define the names of these " "objects as they occur in the docstrings. The transformation of method-" @@ -2213,301 +2212,301 @@ msgid "" "docstrings." msgstr "" -#: ../../library/turtle.rst:2361 +#: ../../library/turtle.rst:2354 msgid "" "*using_IDLE*: Set this to ``True`` if you regularly work with IDLE and its -" "n switch (\"no subprocess\"). This will prevent :func:`exitonclick` to " "enter the mainloop." msgstr "" -#: ../../library/turtle.rst:2365 +#: ../../library/turtle.rst:2358 msgid "" "There can be a :file:`turtle.cfg` file in the directory where :mod:`turtle` " "is stored and an additional one in the current working directory. The " "latter will override the settings of the first one." msgstr "" -#: ../../library/turtle.rst:2369 +#: ../../library/turtle.rst:2362 msgid "" "The :file:`Lib/turtledemo` directory contains a :file:`turtle.cfg` file. " "You can study it as an example and see its effects when running the demos " "(preferably not from within the demo-viewer)." msgstr "" -#: ../../library/turtle.rst:2375 +#: ../../library/turtle.rst:2368 msgid ":mod:`turtledemo` --- Demo scripts" msgstr "" -#: ../../library/turtle.rst:2380 +#: ../../library/turtle.rst:2373 msgid "" "The :mod:`turtledemo` package includes a set of demo scripts. These scripts " "can be run and viewed using the supplied demo viewer as follows::" msgstr "" -#: ../../library/turtle.rst:2385 +#: ../../library/turtle.rst:2378 msgid "" "Alternatively, you can run the demo scripts individually. For example, ::" msgstr "" -#: ../../library/turtle.rst:2389 +#: ../../library/turtle.rst:2382 msgid "The :mod:`turtledemo` package directory contains:" msgstr "" -#: ../../library/turtle.rst:2391 +#: ../../library/turtle.rst:2384 msgid "" "A demo viewer :file:`__main__.py` which can be used to view the sourcecode " "of the scripts and run them at the same time." msgstr "" -#: ../../library/turtle.rst:2393 +#: ../../library/turtle.rst:2386 msgid "" "Multiple scripts demonstrating different features of the :mod:`turtle` " "module. Examples can be accessed via the Examples menu. They can also be " "run standalone." msgstr "" -#: ../../library/turtle.rst:2396 +#: ../../library/turtle.rst:2389 msgid "" "A :file:`turtle.cfg` file which serves as an example of how to write and use " "such files." msgstr "" -#: ../../library/turtle.rst:2399 +#: ../../library/turtle.rst:2392 msgid "The demo scripts are:" msgstr "" -#: ../../library/turtle.rst:2404 +#: ../../library/turtle.rst:2397 msgid "Name" msgstr "" -#: ../../library/turtle.rst:2404 +#: ../../library/turtle.rst:2397 msgid "Description" msgstr "描述" -#: ../../library/turtle.rst:2404 +#: ../../library/turtle.rst:2397 msgid "Features" msgstr "" -#: ../../library/turtle.rst:2406 +#: ../../library/turtle.rst:2399 msgid "bytedesign" msgstr "" -#: ../../library/turtle.rst:2406 +#: ../../library/turtle.rst:2399 msgid "complex classical turtle graphics pattern" msgstr "" -#: ../../library/turtle.rst:2406 +#: ../../library/turtle.rst:2399 msgid ":func:`tracer`, delay, :func:`update`" msgstr "" -#: ../../library/turtle.rst:2409 +#: ../../library/turtle.rst:2402 msgid "chaos" msgstr "" -#: ../../library/turtle.rst:2409 +#: ../../library/turtle.rst:2402 msgid "" "graphs Verhulst dynamics, shows that computer's computations can generate " "results sometimes against the common sense expectations" msgstr "" -#: ../../library/turtle.rst:2409 +#: ../../library/turtle.rst:2402 msgid "world coordinates" msgstr "" -#: ../../library/turtle.rst:2415 +#: ../../library/turtle.rst:2408 msgid "clock" msgstr "" -#: ../../library/turtle.rst:2415 +#: ../../library/turtle.rst:2408 msgid "analog clock showing time of your computer" msgstr "" -#: ../../library/turtle.rst:2415 +#: ../../library/turtle.rst:2408 msgid "turtles as clock's hands, ontimer" msgstr "" -#: ../../library/turtle.rst:2418 +#: ../../library/turtle.rst:2411 msgid "colormixer" msgstr "" -#: ../../library/turtle.rst:2418 +#: ../../library/turtle.rst:2411 msgid "experiment with r, g, b" msgstr "" -#: ../../library/turtle.rst:2420 +#: ../../library/turtle.rst:2413 msgid "forest" msgstr "" -#: ../../library/turtle.rst:2420 +#: ../../library/turtle.rst:2413 msgid "3 breadth-first trees" msgstr "" -#: ../../library/turtle.rst:2420 +#: ../../library/turtle.rst:2413 msgid "randomization" msgstr "" -#: ../../library/turtle.rst:2422 +#: ../../library/turtle.rst:2415 msgid "fractalcurves" msgstr "" -#: ../../library/turtle.rst:2422 +#: ../../library/turtle.rst:2415 msgid "Hilbert & Koch curves" msgstr "" -#: ../../library/turtle.rst:2422 +#: ../../library/turtle.rst:2415 msgid "recursion" msgstr "" -#: ../../library/turtle.rst:2424 +#: ../../library/turtle.rst:2417 msgid "lindenmayer" msgstr "" -#: ../../library/turtle.rst:2424 +#: ../../library/turtle.rst:2417 msgid "ethnomathematics (indian kolams)" msgstr "" -#: ../../library/turtle.rst:2424 +#: ../../library/turtle.rst:2417 msgid "L-System" msgstr "" -#: ../../library/turtle.rst:2427 +#: ../../library/turtle.rst:2420 msgid "minimal_hanoi" msgstr "" -#: ../../library/turtle.rst:2427 +#: ../../library/turtle.rst:2420 msgid "Towers of Hanoi" msgstr "" -#: ../../library/turtle.rst:2427 +#: ../../library/turtle.rst:2420 msgid "Rectangular Turtles as Hanoi discs (shape, shapesize)" msgstr "" -#: ../../library/turtle.rst:2431 +#: ../../library/turtle.rst:2424 msgid "nim" msgstr "" -#: ../../library/turtle.rst:2431 +#: ../../library/turtle.rst:2424 msgid "" "play the classical nim game with three heaps of sticks against the computer." msgstr "" -#: ../../library/turtle.rst:2431 +#: ../../library/turtle.rst:2424 msgid "turtles as nimsticks, event driven (mouse, keyboard)" msgstr "" -#: ../../library/turtle.rst:2435 +#: ../../library/turtle.rst:2428 msgid "paint" msgstr "" -#: ../../library/turtle.rst:2435 +#: ../../library/turtle.rst:2428 msgid "super minimalistic drawing program" msgstr "" -#: ../../library/turtle.rst:2438 +#: ../../library/turtle.rst:2431 msgid "peace" msgstr "" -#: ../../library/turtle.rst:2438 +#: ../../library/turtle.rst:2431 msgid "elementary" msgstr "" -#: ../../library/turtle.rst:2438 +#: ../../library/turtle.rst:2431 msgid "turtle: appearance and animation" msgstr "" -#: ../../library/turtle.rst:2441 +#: ../../library/turtle.rst:2434 msgid "penrose" msgstr "" -#: ../../library/turtle.rst:2441 +#: ../../library/turtle.rst:2434 msgid "aperiodic tiling with kites and darts" msgstr "" -#: ../../library/turtle.rst:2444 +#: ../../library/turtle.rst:2437 msgid "planet_and_moon" msgstr "" -#: ../../library/turtle.rst:2444 +#: ../../library/turtle.rst:2437 msgid "simulation of gravitational system" msgstr "" -#: ../../library/turtle.rst:2444 +#: ../../library/turtle.rst:2437 msgid "compound shapes, :class:`Vec2D`" msgstr "" -#: ../../library/turtle.rst:2447 +#: ../../library/turtle.rst:2440 msgid "round_dance" msgstr "" -#: ../../library/turtle.rst:2447 +#: ../../library/turtle.rst:2440 msgid "dancing turtles rotating pairwise in opposite direction" msgstr "" -#: ../../library/turtle.rst:2447 +#: ../../library/turtle.rst:2440 msgid "compound shapes, clone shapesize, tilt, get_shapepoly, update" msgstr "" -#: ../../library/turtle.rst:2451 +#: ../../library/turtle.rst:2444 msgid "sorting_animate" msgstr "" -#: ../../library/turtle.rst:2451 +#: ../../library/turtle.rst:2444 msgid "visual demonstration of different sorting methods" msgstr "" -#: ../../library/turtle.rst:2451 +#: ../../library/turtle.rst:2444 msgid "simple alignment, randomization" msgstr "" -#: ../../library/turtle.rst:2454 +#: ../../library/turtle.rst:2447 msgid "tree" msgstr "" -#: ../../library/turtle.rst:2454 +#: ../../library/turtle.rst:2447 msgid "a (graphical) breadth first tree (using generators)" msgstr "" -#: ../../library/turtle.rst:2457 +#: ../../library/turtle.rst:2450 msgid "two_canvases" msgstr "" -#: ../../library/turtle.rst:2457 +#: ../../library/turtle.rst:2450 msgid "simple design" msgstr "" -#: ../../library/turtle.rst:2457 +#: ../../library/turtle.rst:2450 msgid "turtles on two canvases" msgstr "" -#: ../../library/turtle.rst:2460 +#: ../../library/turtle.rst:2453 msgid "wikipedia" msgstr "" -#: ../../library/turtle.rst:2460 +#: ../../library/turtle.rst:2453 msgid "a pattern from the wikipedia article on turtle graphics" msgstr "" -#: ../../library/turtle.rst:2460 +#: ../../library/turtle.rst:2453 msgid ":func:`clone`, :func:`undo`" msgstr "" -#: ../../library/turtle.rst:2463 +#: ../../library/turtle.rst:2456 msgid "yinyang" msgstr "" -#: ../../library/turtle.rst:2463 +#: ../../library/turtle.rst:2456 msgid "another elementary example" msgstr "" -#: ../../library/turtle.rst:2466 +#: ../../library/turtle.rst:2459 msgid "Have fun!" msgstr "" -#: ../../library/turtle.rst:2470 +#: ../../library/turtle.rst:2463 msgid "Changes since Python 2.6" msgstr "" -#: ../../library/turtle.rst:2472 +#: ../../library/turtle.rst:2465 msgid "" "The methods :meth:`Turtle.tracer`, :meth:`Turtle.window_width` and :meth:" "`Turtle.window_height` have been eliminated. Methods with these names and " @@ -2517,25 +2516,25 @@ msgid "" "`TurtleScreen`/:class:`Screen`-methods.)" msgstr "" -#: ../../library/turtle.rst:2480 +#: ../../library/turtle.rst:2473 msgid "" "The method :meth:`Turtle.fill` has been eliminated. The behaviour of :meth:" "`begin_fill` and :meth:`end_fill` have changed slightly: now every filling-" "process must be completed with an ``end_fill()`` call." msgstr "" -#: ../../library/turtle.rst:2485 +#: ../../library/turtle.rst:2478 msgid "" "A method :meth:`Turtle.filling` has been added. It returns a boolean value: " "``True`` if a filling process is under way, ``False`` otherwise. This " "behaviour corresponds to a ``fill()`` call without arguments in Python 2.6." msgstr "" -#: ../../library/turtle.rst:2491 +#: ../../library/turtle.rst:2484 msgid "Changes since Python 3.0" msgstr "" -#: ../../library/turtle.rst:2493 +#: ../../library/turtle.rst:2486 msgid "" "The methods :meth:`Turtle.shearfactor`, :meth:`Turtle.shapetransform` and :" "meth:`Turtle.get_shapepoly` have been added. Thus the full range of regular " @@ -2544,28 +2543,28 @@ msgid "" "get or set the tiltangle. :meth:`Turtle.settiltangle` has been deprecated." msgstr "" -#: ../../library/turtle.rst:2500 +#: ../../library/turtle.rst:2493 msgid "" "The method :meth:`Screen.onkeypress` has been added as a complement to :meth:" "`Screen.onkey` which in fact binds actions to the keyrelease event. " "Accordingly the latter has got an alias: :meth:`Screen.onkeyrelease`." msgstr "" -#: ../../library/turtle.rst:2504 +#: ../../library/turtle.rst:2497 msgid "" "The method :meth:`Screen.mainloop` has been added. So when working only " "with Screen and Turtle objects one must not additionally import :func:" "`mainloop` anymore." msgstr "" -#: ../../library/turtle.rst:2508 +#: ../../library/turtle.rst:2501 msgid "" "Two input methods has been added :meth:`Screen.textinput` and :meth:`Screen." "numinput`. These popup input dialogs and return strings and numbers " "respectively." msgstr "" -#: ../../library/turtle.rst:2512 +#: ../../library/turtle.rst:2505 msgid "" "Two example scripts :file:`tdemo_nim.py` and :file:`tdemo_round_dance.py` " "have been added to the :file:`Lib/turtledemo` directory." diff --git a/library/types.po b/library/types.po index 4ee2ef1935..db3a7f5991 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-07 06:52+0000\n" +"POT-Creation-Date: 2020-06-20 18:08+0800\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-" @@ -65,8 +65,7 @@ msgid "" "The *exec_body* argument is a callback that is used to populate the freshly " "created class namespace. It should accept the class namespace as its sole " "argument and update the namespace directly with the class contents. If no " -"callback is provided, it has the same effect as passing in ``lambda ns: " -"None``." +"callback is provided, it has the same effect as passing in ``lambda ns: ns``." msgstr "" #: ../../library/types.rst:43 @@ -167,144 +166,115 @@ msgid "" "`lambda` expressions." msgstr "" -#: ../../library/types.rst:112 -msgid "" -"Raises an :ref:`auditing event ` ``function.__new__`` with " -"argument ``code``." -msgstr "" - -#: ../../library/types.rst:114 -msgid "" -"The audit event only occurs for direct instantiation of function objects, " -"and is not raised for normal compilation." -msgstr "" - -#: ../../library/types.rst:120 +#: ../../library/types.rst:115 msgid "" "The type of :term:`generator`-iterator objects, created by generator " "functions." msgstr "" -#: ../../library/types.rst:126 +#: ../../library/types.rst:121 msgid "" "The type of :term:`coroutine` objects, created by :keyword:`async def` " "functions." msgstr "" -#: ../../library/types.rst:134 +#: ../../library/types.rst:129 msgid "" "The type of :term:`asynchronous generator`-iterator objects, created by " "asynchronous generator functions." msgstr "" -#: ../../library/types.rst:144 +#: ../../library/types.rst:139 msgid "The type for code objects such as returned by :func:`compile`." msgstr "" -#: ../../library/types.rst:146 +#: ../../library/types.rst:142 msgid "" "Raises an :ref:`auditing event ` ``code.__new__`` with arguments " "``code``, ``filename``, ``name``, ``argcount``, ``posonlyargcount``, " "``kwonlyargcount``, ``nlocals``, ``stacksize``, ``flags``." msgstr "" -#: ../../library/types.rst:148 +#: ../../library/types.rst:143 msgid "" "Note that the audited arguments may not match the names or positions " -"required by the initializer. The audit event only occurs for direct " -"instantiation of code objects, and is not raised for normal compilation." +"required by the initializer." msgstr "" -#: ../../library/types.rst:154 +#: ../../library/types.rst:148 msgid "" "Return a copy of the code object with new values for the specified fields." msgstr "" -#: ../../library/types.rst:160 +#: ../../library/types.rst:154 msgid "" "The type for cell objects: such objects are used as containers for a " "function's free variables." msgstr "" -#: ../../library/types.rst:168 +#: ../../library/types.rst:162 msgid "The type of methods of user-defined class instances." msgstr "" -#: ../../library/types.rst:174 +#: ../../library/types.rst:168 msgid "" "The type of built-in functions like :func:`len` or :func:`sys.exit`, and " "methods of built-in classes. (Here, the term \"built-in\" means \"written " "in C\".)" msgstr "" -#: ../../library/types.rst:181 +#: ../../library/types.rst:175 msgid "" "The type of methods of some built-in data types and base classes such as :" "meth:`object.__init__` or :meth:`object.__lt__`." msgstr "" -#: ../../library/types.rst:189 +#: ../../library/types.rst:183 msgid "" "The type of *bound* methods of some built-in data types and base classes. " "For example it is the type of :code:`object().__str__`." msgstr "" -#: ../../library/types.rst:197 +#: ../../library/types.rst:191 msgid "" "The type of methods of some built-in data types such as :meth:`str.join`." msgstr "" -#: ../../library/types.rst:204 +#: ../../library/types.rst:198 msgid "" "The type of *unbound* class methods of some built-in data types such as " "``dict.__dict__['fromkeys']``." msgstr "" -#: ../../library/types.rst:212 +#: ../../library/types.rst:206 msgid "" -"The type of :term:`modules `. The constructor takes the name of the " +"The type of :term:`modules `. Constructor takes the name of the " "module to be created and optionally its :term:`docstring`." msgstr "" -#: ../../library/types.rst:216 +#: ../../library/types.rst:210 msgid "" "Use :func:`importlib.util.module_from_spec` to create a new module if you " "wish to set the various import-controlled attributes." msgstr "" -#: ../../library/types.rst:221 +#: ../../library/types.rst:215 msgid "The :term:`docstring` of the module. Defaults to ``None``." msgstr "" -#: ../../library/types.rst:225 +#: ../../library/types.rst:219 msgid "The :term:`loader` which loaded the module. Defaults to ``None``." msgstr "" -#: ../../library/types.rst:227 -msgid "" -"This attribute is to match :attr:`importlib.machinery.ModuleSpec.loader` as " -"stored in the attr:`__spec__` object." -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:" -"`__spec__` attribute instead or use ``getattr(module, \"__loader__\", " -"None)`` if you explicitly need to use this attribute." -msgstr "" - -#: ../../library/types.rst:237 ../../library/types.rst:262 +#: ../../library/types.rst:221 ../../library/types.rst:235 msgid "Defaults to ``None``. Previously the attribute was optional." msgstr "" -#: ../../library/types.rst:242 -msgid "" -"The name of the module. Expected to match :attr:`importlib.machinery." -"ModuleSpec.name`." +#: ../../library/types.rst:226 +msgid "The name of the module." msgstr "" -#: ../../library/types.rst:247 +#: ../../library/types.rst:230 msgid "" "Which :term:`package` a module belongs to. If the module is top-level (i.e. " "not a part of any specific package) then the attribute should be set to " @@ -312,67 +282,30 @@ msgid "" "`__name__` if the module is a package itself). Defaults to ``None``." msgstr "" -#: ../../library/types.rst:252 -msgid "" -"This attribute is to match :attr:`importlib.machinery.ModuleSpec.parent` as " -"stored in the attr:`__spec__` object." -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:" -"`__spec__` attribute instead or use ``getattr(module, \"__package__\", " -"None)`` if you explicitly need to use this attribute." -msgstr "" - -#: ../../library/types.rst:267 -msgid "" -"A record of the module's import-system-related state. Expected to be an " -"instance of :class:`importlib.machinery.ModuleSpec`." -msgstr "" - -#: ../../library/types.rst:275 -msgid "" -"The type of :ref:`parameterized generics ` such as " -"``list[int]``." -msgstr "" - -#: ../../library/types.rst:278 -msgid "" -"``t_origin`` should be a non-parameterized generic class, such as ``list``, " -"``tuple`` or ``dict``. ``t_args`` should be a :class:`tuple` (possibly of " -"length 1) of types which parameterize ``t_origin``::" -msgstr "" - -#: ../../library/types.rst:291 -msgid "This type can now be subclassed." -msgstr "" - -#: ../../library/types.rst:297 +#: ../../library/types.rst:241 msgid "The type of traceback objects such as found in ``sys.exc_info()[2]``." msgstr "" -#: ../../library/types.rst:299 +#: ../../library/types.rst:243 msgid "" "See :ref:`the language reference ` for details of the " "available attributes and operations, and guidance on creating tracebacks " "dynamically." msgstr "" -#: ../../library/types.rst:306 +#: ../../library/types.rst:250 msgid "" "The type of frame objects such as found in ``tb.tb_frame`` if ``tb`` is a " "traceback object." msgstr "" -#: ../../library/types.rst:309 +#: ../../library/types.rst:253 msgid "" "See :ref:`the language reference ` for details of the " "available attributes and operations." msgstr "" -#: ../../library/types.rst:315 +#: ../../library/types.rst:259 msgid "" "The type of objects defined in extension modules with ``PyGetSetDef``, such " "as ``FrameType.f_locals`` or ``array.array.typecode``. This type is used as " @@ -380,7 +313,7 @@ msgid "" "`property` type, but for classes defined in extension modules." msgstr "" -#: ../../library/types.rst:323 +#: ../../library/types.rst:267 msgid "" "The type of objects defined in extension modules with ``PyMemberDef``, such " "as ``datetime.timedelta.days``. This type is used as descriptor for simple " @@ -389,113 +322,113 @@ msgid "" "modules." msgstr "" -#: ../../library/types.rst:330 +#: ../../library/types.rst:274 msgid "" "In other implementations of Python, this type may be identical to " "``GetSetDescriptorType``." msgstr "" -#: ../../library/types.rst:335 +#: ../../library/types.rst:279 msgid "" "Read-only proxy of a mapping. It provides a dynamic view on the mapping's " "entries, which means that when the mapping changes, the view reflects these " "changes." msgstr "" -#: ../../library/types.rst:343 +#: ../../library/types.rst:287 msgid "" "Updated to support the new union (``|``) operator from :pep:`584`, which " "simply delegates to the underlying mapping." msgstr "" -#: ../../library/types.rst:348 +#: ../../library/types.rst:292 msgid "" "Return ``True`` if the underlying mapping has a key *key*, else ``False``." msgstr "" -#: ../../library/types.rst:353 +#: ../../library/types.rst:297 msgid "" "Return the item of the underlying mapping with key *key*. Raises a :exc:" "`KeyError` if *key* is not in the underlying mapping." msgstr "" -#: ../../library/types.rst:358 +#: ../../library/types.rst:302 msgid "" "Return an iterator over the keys of the underlying mapping. This is a " "shortcut for ``iter(proxy.keys())``." msgstr "" -#: ../../library/types.rst:363 +#: ../../library/types.rst:307 msgid "Return the number of items in the underlying mapping." msgstr "" -#: ../../library/types.rst:367 +#: ../../library/types.rst:311 msgid "Return a shallow copy of the underlying mapping." msgstr "" -#: ../../library/types.rst:371 +#: ../../library/types.rst:315 msgid "" "Return the value for *key* if *key* is in the underlying mapping, else " "*default*. If *default* is not given, it defaults to ``None``, so that this " "method never raises a :exc:`KeyError`." msgstr "" -#: ../../library/types.rst:377 +#: ../../library/types.rst:321 msgid "" "Return a new view of the underlying mapping's items (``(key, value)`` pairs)." msgstr "" -#: ../../library/types.rst:382 +#: ../../library/types.rst:326 msgid "Return a new view of the underlying mapping's keys." msgstr "" -#: ../../library/types.rst:386 +#: ../../library/types.rst:330 msgid "Return a new view of the underlying mapping's values." msgstr "" -#: ../../library/types.rst:390 +#: ../../library/types.rst:334 msgid "Return a reverse iterator over the keys of the underlying mapping." msgstr "" -#: ../../library/types.rst:396 +#: ../../library/types.rst:340 msgid "Additional Utility Classes and Functions" msgstr "" -#: ../../library/types.rst:400 +#: ../../library/types.rst:344 msgid "" "A simple :class:`object` subclass that provides attribute access to its " "namespace, as well as a meaningful repr." msgstr "" -#: ../../library/types.rst:403 +#: ../../library/types.rst:347 msgid "" "Unlike :class:`object`, with ``SimpleNamespace`` you can add and remove " "attributes. If a ``SimpleNamespace`` object is initialized with keyword " "arguments, those are directly added to the underlying namespace." msgstr "" -#: ../../library/types.rst:407 +#: ../../library/types.rst:351 msgid "The type is roughly equivalent to the following code::" msgstr "" -#: ../../library/types.rst:422 +#: ../../library/types.rst:364 msgid "" "``SimpleNamespace`` may be useful as a replacement for ``class NS: pass``. " "However, for a structured record type use :func:`~collections.namedtuple` " "instead." msgstr "" -#: ../../library/types.rst:428 +#: ../../library/types.rst:370 msgid "" "Attribute order in the repr changed from alphabetical to insertion (like " "``dict``)." msgstr "" -#: ../../library/types.rst:434 +#: ../../library/types.rst:376 msgid "Route attribute access on a class to __getattr__." msgstr "" -#: ../../library/types.rst:436 +#: ../../library/types.rst:378 msgid "" "This is a descriptor, used to define attributes that act differently when " "accessed through an instance and through a class. Instance access remains " @@ -503,18 +436,18 @@ msgid "" "class's __getattr__ method; this is done by raising AttributeError." msgstr "" -#: ../../library/types.rst:441 +#: ../../library/types.rst:383 msgid "" "This allows one to have properties active on an instance, and have virtual " "attributes on the class with the same name (see :class:`enum.Enum` for an " "example)." msgstr "" -#: ../../library/types.rst:448 +#: ../../library/types.rst:390 msgid "Coroutine Utility Functions" msgstr "" -#: ../../library/types.rst:452 +#: ../../library/types.rst:394 msgid "" "This function transforms a :term:`generator` function into a :term:" "`coroutine function` which returns a generator-based coroutine. The " @@ -523,11 +456,11 @@ msgid "" "However, it may not necessarily implement the :meth:`__await__` method." msgstr "" -#: ../../library/types.rst:459 +#: ../../library/types.rst:401 msgid "If *gen_func* is a generator function, it will be modified in-place." msgstr "" -#: ../../library/types.rst:461 +#: ../../library/types.rst:403 msgid "" "If *gen_func* is not a generator function, it will be wrapped. If it returns " "an instance of :class:`collections.abc.Generator`, the instance will be " diff --git a/library/typing.po b/library/typing.po index ad384abf08..2b88f86f2e 100644 --- a/library/typing.po +++ b/library/typing.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.7\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2021-09-07 06:52+0000\n" +"POT-Creation-Date: 2020-06-20 18:08+0800\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-" @@ -18,22 +18,22 @@ msgstr "" "Content-Transfer-Encoding: 8bit\n" "Plural-Forms: nplurals=1; plural=0;\n" -#: ../../library/typing.rst:3 +#: ../../library/typing.rst:2 msgid ":mod:`typing` --- Support for type hints" msgstr "" -#: ../../library/typing.rst:10 +#: ../../library/typing.rst:9 msgid "**Source code:** :source:`Lib/typing.py`" msgstr "" -#: ../../library/typing.rst:14 +#: ../../library/typing.rst:13 msgid "" "The Python runtime does not enforce function and variable type annotations. " "They can be used by third party tools such as type checkers, IDEs, linters, " "etc." msgstr "" -#: ../../library/typing.rst:20 +#: ../../library/typing.rst:19 msgid "" "This module provides runtime support for type hints as specified by :pep:" "`484`, :pep:`526`, :pep:`544`, :pep:`586`, :pep:`589`, and :pep:`591`. The " @@ -43,26 +43,26 @@ msgid "" "type hints see :pep:`483`." msgstr "" -#: ../../library/typing.rst:28 +#: ../../library/typing.rst:27 msgid "" "The function below takes and returns a string and is annotated as follows::" msgstr "" -#: ../../library/typing.rst:33 +#: ../../library/typing.rst:32 msgid "" "In the function ``greeting``, the argument ``name`` is expected to be of " "type :class:`str` and the return type :class:`str`. Subtypes are accepted as " "arguments." msgstr "" -#: ../../library/typing.rst:38 +#: ../../library/typing.rst:37 msgid "Type aliases" msgstr "" -#: ../../library/typing.rst:40 +#: ../../library/typing.rst:39 msgid "" "A type alias is defined by assigning the type to the alias. In this example, " -"``Vector`` and ``list[float]`` will be treated as interchangeable synonyms::" +"``Vector`` and ``List[float]`` will be treated as interchangeable synonyms::" msgstr "" #: ../../library/typing.rst:51 @@ -190,68 +190,68 @@ msgid "" "called :class:`TypeVar`." msgstr "" -#: ../../library/typing.rst:203 +#: ../../library/typing.rst:202 msgid "User-defined generic types" msgstr "" -#: ../../library/typing.rst:205 +#: ../../library/typing.rst:204 msgid "A user-defined class can be defined as a generic class." msgstr "" -#: ../../library/typing.rst:231 +#: ../../library/typing.rst:230 msgid "" "``Generic[T]`` as a base class defines that the class ``LoggedVar`` takes a " "single type parameter ``T`` . This also makes ``T`` valid as a type within " "the class body." msgstr "" -#: ../../library/typing.rst:235 +#: ../../library/typing.rst:234 msgid "" "The :class:`Generic` base class defines :meth:`__class_getitem__` so that " "``LoggedVar[t]`` is valid as a type::" msgstr "" -#: ../../library/typing.rst:244 +#: ../../library/typing.rst:243 msgid "" "A generic type can have any number of type variables, and type variables may " "be constrained::" msgstr "" -#: ../../library/typing.rst:256 +#: ../../library/typing.rst:255 msgid "" "Each type variable argument to :class:`Generic` must be distinct. This is " "thus invalid::" msgstr "" -#: ../../library/typing.rst:267 +#: ../../library/typing.rst:266 msgid "You can use multiple inheritance with :class:`Generic`::" msgstr "" -#: ../../library/typing.rst:277 +#: ../../library/typing.rst:275 msgid "" "When inheriting from generic classes, some type variables could be fixed::" msgstr "" -#: ../../library/typing.rst:287 +#: ../../library/typing.rst:284 msgid "In this case ``MyDict`` has a single parameter, ``T``." msgstr "" -#: ../../library/typing.rst:289 +#: ../../library/typing.rst:286 msgid "" "Using a generic class without specifying type parameters assumes :data:`Any` " "for each position. In the following example, ``MyIterable`` is not generic " "but implicitly inherits from ``Iterable[Any]``::" msgstr "" -#: ../../library/typing.rst:297 +#: ../../library/typing.rst:294 msgid "User defined generic type aliases are also supported. Examples::" msgstr "" -#: ../../library/typing.rst:314 +#: ../../library/typing.rst:310 msgid ":class:`Generic` no longer has a custom metaclass." msgstr "" -#: ../../library/typing.rst:317 +#: ../../library/typing.rst:313 msgid "" "A user-defined generic class can have ABCs as base classes without a " "metaclass conflict. Generic metaclasses are not supported. The outcome of " @@ -259,24 +259,24 @@ msgid "" "hashable and comparable for equality." msgstr "" -#: ../../library/typing.rst:324 +#: ../../library/typing.rst:320 msgid "The :data:`Any` type" msgstr "" -#: ../../library/typing.rst:326 +#: ../../library/typing.rst:322 msgid "" "A special kind of type is :data:`Any`. A static type checker will treat " "every type as being compatible with :data:`Any` and :data:`Any` as being " "compatible with every type." msgstr "" -#: ../../library/typing.rst:330 +#: ../../library/typing.rst:326 msgid "" "This means that it is possible to perform any operation or method call on a " -"value of type :data:`Any` and assign it to any variable::" +"value of type on :data:`Any` and assign it to any variable::" msgstr "" -#: ../../library/typing.rst:348 +#: ../../library/typing.rst:344 msgid "" "Notice that no typechecking is performed when assigning a value of type :" "data:`Any` to a more precise type. For example, the static type checker did " @@ -285,19 +285,19 @@ msgid "" "runtime!" msgstr "" -#: ../../library/typing.rst:354 +#: ../../library/typing.rst:350 msgid "" "Furthermore, all functions without a return type or parameter types will " "implicitly default to using :data:`Any`::" msgstr "" -#: ../../library/typing.rst:367 +#: ../../library/typing.rst:363 msgid "" "This behavior allows :data:`Any` to be used as an *escape hatch* when you " "need to mix dynamically and statically typed code." msgstr "" -#: ../../library/typing.rst:370 +#: ../../library/typing.rst:366 msgid "" "Contrast the behavior of :data:`Any` with the behavior of :class:`object`. " "Similar to :data:`Any`, every type is a subtype of :class:`object`. However, " @@ -305,7 +305,7 @@ msgid "" "subtype of every other type." msgstr "" -#: ../../library/typing.rst:375 +#: ../../library/typing.rst:371 msgid "" "That means when the type of a value is :class:`object`, a type checker will " "reject almost all operations on it, and assigning it to a variable (or using " @@ -313,33 +313,33 @@ msgid "" "example::" msgstr "" -#: ../../library/typing.rst:397 +#: ../../library/typing.rst:393 msgid "" "Use :class:`object` to indicate that a value could be any type in a typesafe " "manner. Use :data:`Any` to indicate that a value is dynamically typed." msgstr "" -#: ../../library/typing.rst:402 +#: ../../library/typing.rst:398 msgid "Nominal vs structural subtyping" msgstr "" -#: ../../library/typing.rst:404 +#: ../../library/typing.rst:400 msgid "" "Initially :pep:`484` defined Python static type system as using *nominal " "subtyping*. This means that a class ``A`` is allowed where a class ``B`` is " "expected if and only if ``A`` is a subclass of ``B``." msgstr "" -#: ../../library/typing.rst:408 +#: ../../library/typing.rst:404 msgid "" "This requirement previously also applied to abstract base classes, such as :" -"class:`~collections.abc.Iterable`. The problem with this approach is that a " -"class had to be explicitly marked to support them, which is unpythonic and " -"unlike what one would normally do in idiomatic dynamically typed Python " -"code. For example, this conforms to :pep:`484`::" +"class:`Iterable`. The problem with this approach is that a class had to be " +"explicitly marked to support them, which is unpythonic and unlike what one " +"would normally do in idiomatic dynamically typed Python code. For example, " +"this conforms to the :pep:`484`::" msgstr "" -#: ../../library/typing.rst:421 +#: ../../library/typing.rst:417 msgid "" ":pep:`544` allows to solve this problem by allowing users to write the above " "code without explicit base classes in the class definition, allowing " @@ -348,545 +348,427 @@ msgid "" "subtyping* (or static duck-typing)::" msgstr "" -#: ../../library/typing.rst:437 +#: ../../library/typing.rst:433 msgid "" "Moreover, by subclassing a special class :class:`Protocol`, a user can " "define new custom protocols to fully enjoy structural subtyping (see " "examples below)." msgstr "" -#: ../../library/typing.rst:442 -msgid "Module contents" +#: ../../library/typing.rst:439 +msgid "Classes, functions, and decorators" msgstr "" -#: ../../library/typing.rst:444 -msgid "The module defines the following classes, functions and decorators." +#: ../../library/typing.rst:441 +msgid "The module defines the following classes, functions and decorators:" msgstr "" -#: ../../library/typing.rst:448 -msgid "" -"This module defines several types that are subclasses of pre-existing " -"standard library classes which also extend :class:`Generic` to support type " -"variables inside ``[]``. These types became redundant in Python 3.9 when the " -"corresponding pre-existing classes were enhanced to support ``[]``." +#: ../../library/typing.rst:445 +msgid "Type variable." msgstr "" -#: ../../library/typing.rst:454 -msgid "" -"The redundant types are deprecated as of Python 3.9 but no deprecation " -"warnings will be issued by the interpreter. It is expected that type " -"checkers will flag the deprecated types when the checked program targets " -"Python 3.9 or newer." +#: ../../library/typing.rst:447 ../../library/typing.rst:915 +msgid "Usage::" msgstr "" -#: ../../library/typing.rst:459 +#: ../../library/typing.rst:452 msgid "" -"The deprecated types will be removed from the :mod:`typing` module in the " -"first Python version released 5 years after the release of Python 3.9.0. See " -"details in :pep:`585`—*Type Hinting Generics In Standard Collections*." +"Type variables exist primarily for the benefit of static type checkers. " +"They serve as the parameters for generic types as well as for generic " +"function definitions. See class Generic for more information on generic " +"types. Generic functions work as follows::" msgstr "" #: ../../library/typing.rst:465 -msgid "Special typing primitives" -msgstr "" - -#: ../../library/typing.rst:468 -msgid "Special types" +msgid "" +"The latter example's signature is essentially the overloading of ``(str, " +"str) -> str`` and ``(bytes, bytes) -> bytes``. Also note that if the " +"arguments are instances of some subclass of :class:`str`, the return type is " +"still plain :class:`str`." msgstr "" #: ../../library/typing.rst:470 -msgid "These can be used as types in annotations and do not support ``[]``." -msgstr "" - -#: ../../library/typing.rst:474 -msgid "Special type indicating an unconstrained type." +msgid "" +"At runtime, ``isinstance(x, T)`` will raise :exc:`TypeError`. In general, :" +"func:`isinstance` and :func:`issubclass` should not be used with types." msgstr "" -#: ../../library/typing.rst:476 -msgid "Every type is compatible with :data:`Any`." +#: ../../library/typing.rst:473 +msgid "" +"Type variables may be marked covariant or contravariant by passing " +"``covariant=True`` or ``contravariant=True``. See :pep:`484` for more " +"details. By default type variables are invariant. Alternatively, a type " +"variable may specify an upper bound using ``bound=``. This means that " +"an actual type substituted (explicitly or implicitly) for the type variable " +"must be a subclass of the boundary type, see :pep:`484`." msgstr "" -#: ../../library/typing.rst:477 -msgid ":data:`Any` is compatible with every type." +#: ../../library/typing.rst:483 +msgid "Abstract base class for generic types." msgstr "" -#: ../../library/typing.rst:481 -msgid "Special type indicating that a function never returns. For example::" +#: ../../library/typing.rst:485 +msgid "" +"A generic type is typically declared by inheriting from an instantiation of " +"this class with one or more type variables. For example, a generic mapping " +"type might be defined as::" msgstr "" -#: ../../library/typing.rst:493 -msgid "Special forms" +#: ../../library/typing.rst:494 +msgid "This class can then be used as follows::" msgstr "" -#: ../../library/typing.rst:495 +#: ../../library/typing.rst:507 msgid "" -"These can be used as types in annotations using ``[]``, each having a unique " -"syntax." +"Base class for protocol classes. Protocol classes are defined like this::" msgstr "" -#: ../../library/typing.rst:499 +#: ../../library/typing.rst:513 msgid "" -"Tuple type; ``Tuple[X, Y]`` is the type of a tuple of two items with the " -"first item of type X and the second of type Y. The type of the empty tuple " -"can be written as ``Tuple[()]``." +"Such classes are primarily used with static type checkers that recognize " +"structural subtyping (static duck-typing), for example::" msgstr "" -#: ../../library/typing.rst:503 +#: ../../library/typing.rst:525 msgid "" -"Example: ``Tuple[T1, T2]`` is a tuple of two elements corresponding to type " -"variables T1 and T2. ``Tuple[int, float, str]`` is a tuple of an int, a " -"float and a string." +"See :pep:`544` for details. Protocol classes decorated with :func:" +"`runtime_checkable` (described later) act as simple-minded runtime protocols " +"that check only the presence of given attributes, ignoring their type " +"signatures." msgstr "" -#: ../../library/typing.rst:507 -msgid "" -"To specify a variable-length tuple of homogeneous type, use literal " -"ellipsis, e.g. ``Tuple[int, ...]``. A plain :data:`Tuple` is equivalent to " -"``Tuple[Any, ...]``, and in turn to :class:`tuple`." +#: ../../library/typing.rst:530 +msgid "Protocol classes can be generic, for example::" msgstr "" -#: ../../library/typing.rst:511 +#: ../../library/typing.rst:540 msgid "" -":class:`builtins.tuple ` now supports ``[]``. See :pep:`585` and :ref:" -"`types-genericalias`." -msgstr "" - -#: ../../library/typing.rst:517 -msgid "Union type; ``Union[X, Y]`` means either X or Y." +"A variable annotated with ``C`` may accept a value of type ``C``. In " +"contrast, a variable annotated with ``Type[C]`` may accept values that are " +"classes themselves -- specifically, it will accept the *class object* of " +"``C``. For example::" msgstr "" -#: ../../library/typing.rst:519 -msgid "To define a union, use e.g. ``Union[int, str]``. Details:" +#: ../../library/typing.rst:549 +msgid "Note that ``Type[C]`` is covariant::" msgstr "" -#: ../../library/typing.rst:521 -msgid "The arguments must be types and there must be at least one." +#: ../../library/typing.rst:561 +msgid "" +"The fact that ``Type[C]`` is covariant implies that all subclasses of ``C`` " +"should implement the same constructor signature and class method signatures " +"as ``C``. The type checker should flag violations of this, but should also " +"allow constructor calls in subclasses that match the constructor calls in " +"the indicated base class. How the type checker is required to handle this " +"particular case may change in future revisions of :pep:`484`." msgstr "" -#: ../../library/typing.rst:523 -msgid "Unions of unions are flattened, e.g.::" +#: ../../library/typing.rst:569 +msgid "" +"The only legal parameters for :class:`Type` are classes, :data:`Any`, :ref:" +"`type variables `, and unions of any of these types. For example::" msgstr "" -#: ../../library/typing.rst:527 -msgid "Unions of a single argument vanish, e.g.::" +#: ../../library/typing.rst:575 +msgid "" +"``Type[Any]`` is equivalent to ``Type`` which in turn is equivalent to " +"``type``, which is the root of Python's metaclass hierarchy." msgstr "" -#: ../../library/typing.rst:531 -msgid "Redundant arguments are skipped, e.g.::" +#: ../../library/typing.rst:582 +msgid "A generic version of :class:`collections.abc.Iterable`." msgstr "" -#: ../../library/typing.rst:535 -msgid "When comparing unions, the argument order is ignored, e.g.::" +#: ../../library/typing.rst:586 +msgid "A generic version of :class:`collections.abc.Iterator`." msgstr "" -#: ../../library/typing.rst:539 -msgid "You cannot subclass or instantiate a union." +#: ../../library/typing.rst:590 +msgid "A generic version of :class:`collections.abc.Reversible`." msgstr "" -#: ../../library/typing.rst:541 -msgid "You cannot write ``Union[X][Y]``." +#: ../../library/typing.rst:594 +msgid "An ABC with one abstract method ``__int__``." msgstr "" -#: ../../library/typing.rst:543 -msgid "You can use ``Optional[X]`` as a shorthand for ``Union[X, None]``." +#: ../../library/typing.rst:598 +msgid "An ABC with one abstract method ``__float__``." msgstr "" -#: ../../library/typing.rst:545 -msgid "Don't remove explicit subclasses from unions at runtime." +#: ../../library/typing.rst:602 +msgid "An ABC with one abstract method ``__complex__``." msgstr "" -#: ../../library/typing.rst:550 -msgid "Optional type." +#: ../../library/typing.rst:606 +msgid "An ABC with one abstract method ``__bytes__``." msgstr "" -#: ../../library/typing.rst:552 -msgid "``Optional[X]`` is equivalent to ``Union[X, None]``." +#: ../../library/typing.rst:610 +msgid "An ABC with one abstract method ``__index__``." msgstr "" -#: ../../library/typing.rst:554 +#: ../../library/typing.rst:616 msgid "" -"Note that this is not the same concept as an optional argument, which is one " -"that has a default. An optional argument with a default does not require " -"the ``Optional`` qualifier on its type annotation just because it is " -"optional. For example::" +"An ABC with one abstract method ``__abs__`` that is covariant in its return " +"type." msgstr "" -#: ../../library/typing.rst:562 +#: ../../library/typing.rst:621 msgid "" -"On the other hand, if an explicit value of ``None`` is allowed, the use of " -"``Optional`` is appropriate, whether the argument is optional or not. For " -"example::" +"An ABC with one abstract method ``__round__`` that is covariant in its " +"return type." msgstr "" -#: ../../library/typing.rst:571 -msgid "Callable type; ``Callable[[int], str]`` is a function of (int) -> str." +#: ../../library/typing.rst:626 +msgid "A generic version of :class:`collections.abc.Container`." msgstr "" -#: ../../library/typing.rst:573 -msgid "" -"The subscription syntax must always be used with exactly two values: the " -"argument list and the return type. The argument list must be a list of " -"types or an ellipsis; the return type must be a single type." +#: ../../library/typing.rst:630 +msgid "An alias to :class:`collections.abc.Hashable`" msgstr "" -#: ../../library/typing.rst:578 -msgid "" -"There is no syntax to indicate optional or keyword arguments; such function " -"types are rarely used as callback types. ``Callable[..., ReturnType]`` " -"(literal ellipsis) can be used to type hint a callable taking any number of " -"arguments and returning ``ReturnType``. A plain :data:`Callable` is " -"equivalent to ``Callable[..., Any]``, and in turn to :class:`collections.abc." -"Callable`." +#: ../../library/typing.rst:634 +msgid "An alias to :class:`collections.abc.Sized`" msgstr "" -#: ../../library/typing.rst:586 -msgid "" -":class:`collections.abc.Callable` now supports ``[]``. See :pep:`585` and :" -"ref:`types-genericalias`." +#: ../../library/typing.rst:638 +msgid "A generic version of :class:`collections.abc.Collection`" msgstr "" -#: ../../library/typing.rst:592 -msgid "" -"A variable annotated with ``C`` may accept a value of type ``C``. In " -"contrast, a variable annotated with ``Type[C]`` may accept values that are " -"classes themselves -- specifically, it will accept the *class object* of " -"``C``. For example::" +#: ../../library/typing.rst:644 +msgid "A generic version of :class:`collections.abc.Set`." msgstr "" -#: ../../library/typing.rst:601 -msgid "Note that ``Type[C]`` is covariant::" +#: ../../library/typing.rst:648 +msgid "A generic version of :class:`collections.abc.MutableSet`." msgstr "" -#: ../../library/typing.rst:613 +#: ../../library/typing.rst:652 msgid "" -"The fact that ``Type[C]`` is covariant implies that all subclasses of ``C`` " -"should implement the same constructor signature and class method signatures " -"as ``C``. The type checker should flag violations of this, but should also " -"allow constructor calls in subclasses that match the constructor calls in " -"the indicated base class. How the type checker is required to handle this " -"particular case may change in future revisions of :pep:`484`." +"A generic version of :class:`collections.abc.Mapping`. This type can be used " +"as follows::" msgstr "" -#: ../../library/typing.rst:621 -msgid "" -"The only legal parameters for :class:`Type` are classes, :data:`Any`, :ref:" -"`type variables `, and unions of any of these types. For example::" +#: ../../library/typing.rst:660 +msgid "A generic version of :class:`collections.abc.MutableMapping`." msgstr "" -#: ../../library/typing.rst:627 -msgid "" -"``Type[Any]`` is equivalent to ``Type`` which in turn is equivalent to " -"``type``, which is the root of Python's metaclass hierarchy." +#: ../../library/typing.rst:664 +msgid "A generic version of :class:`collections.abc.Sequence`." msgstr "" -#: ../../library/typing.rst:632 -msgid "" -":class:`builtins.type ` now supports ``[]``. See :pep:`585` and :ref:" -"`types-genericalias`." +#: ../../library/typing.rst:668 +msgid "A generic version of :class:`collections.abc.MutableSequence`." msgstr "" -#: ../../library/typing.rst:638 -msgid "" -"A type that can be used to indicate to type checkers that the corresponding " -"variable or function parameter has a value equivalent to the provided " -"literal (or one of several literals). For example::" +#: ../../library/typing.rst:672 +msgid "A generic version of :class:`collections.abc.ByteString`." msgstr "" -#: ../../library/typing.rst:652 +#: ../../library/typing.rst:674 msgid "" -"``Literal[...]`` cannot be subclassed. At runtime, an arbitrary value is " -"allowed as type argument to ``Literal[...]``, but type checkers may impose " -"restrictions. See :pep:`586` for more details about literal types." +"This type represents the types :class:`bytes`, :class:`bytearray`, and :" +"class:`memoryview`." msgstr "" -#: ../../library/typing.rst:658 +#: ../../library/typing.rst:677 msgid "" -"``Literal`` now de-duplicates parameters. Equality comparisons of " -"``Literal`` objects are no longer order dependent. ``Literal`` objects will " -"now raise a :exc:`TypeError` exception during equality comparisons if one of " -"their parameters are not :term:`hashable`." +"As a shorthand for this type, :class:`bytes` can be used to annotate " +"arguments of any of the types mentioned above." msgstr "" -#: ../../library/typing.rst:666 -msgid "Special type construct to mark class variables." +#: ../../library/typing.rst:682 +msgid "A generic version of :class:`collections.deque`." msgstr "" -#: ../../library/typing.rst:668 +#: ../../library/typing.rst:689 msgid "" -"As introduced in :pep:`526`, a variable annotation wrapped in ClassVar " -"indicates that a given attribute is intended to be used as a class variable " -"and should not be set on instances of that class. Usage::" +"Generic version of :class:`list`. Useful for annotating return types. To " +"annotate arguments it is preferred to use an abstract collection type such " +"as :class:`Sequence` or :class:`Iterable`." msgstr "" -#: ../../library/typing.rst:676 -msgid ":data:`ClassVar` accepts only types and cannot be further subscribed." +#: ../../library/typing.rst:694 +msgid "This type may be used as follows::" msgstr "" -#: ../../library/typing.rst:678 +#: ../../library/typing.rst:706 msgid "" -":data:`ClassVar` is not a class itself, and should not be used with :func:" -"`isinstance` or :func:`issubclass`. :data:`ClassVar` does not change Python " -"runtime behavior, but it can be used by third-party type checkers. For " -"example, a type checker might flag the following code as an error::" +"A generic version of :class:`builtins.set `. Useful for annotating " +"return types. To annotate arguments it is preferred to use an abstract " +"collection type such as :class:`AbstractSet`." msgstr "" -#: ../../library/typing.rst:692 -msgid "" -"A special typing construct to indicate to type checkers that a name cannot " -"be re-assigned or overridden in a subclass. For example::" +#: ../../library/typing.rst:712 +msgid "A generic version of :class:`builtins.frozenset `." msgstr "" -#: ../../library/typing.rst:704 ../../library/typing.rst:1624 -msgid "" -"There is no runtime checking of these properties. See :pep:`591` for more " -"details." +#: ../../library/typing.rst:716 +msgid "A generic version of :class:`collections.abc.MappingView`." msgstr "" -#: ../../library/typing.rst:711 -msgid "" -"A type, introduced in :pep:`593` (``Flexible function and variable " -"annotations``), to decorate existing types with context-specific metadata " -"(possibly multiple pieces of it, as ``Annotated`` is variadic). " -"Specifically, a type ``T`` can be annotated with metadata ``x`` via the " -"typehint ``Annotated[T, x]``. This metadata can be used for either static " -"analysis or at runtime. If a library (or tool) encounters a typehint " -"``Annotated[T, x]`` and has no special logic for metadata ``x``, it should " -"ignore it and simply treat the type as ``T``. Unlike the ``no_type_check`` " -"functionality that currently exists in the ``typing`` module which " -"completely disables typechecking annotations on a function or a class, the " -"``Annotated`` type allows for both static typechecking of ``T`` (e.g., via " -"mypy or Pyre, which can safely ignore ``x``) together with runtime access to " -"``x`` within a specific application." +#: ../../library/typing.rst:720 +msgid "A generic version of :class:`collections.abc.KeysView`." msgstr "" -#: ../../library/typing.rst:725 -msgid "" -"Ultimately, the responsibility of how to interpret the annotations (if at " -"all) is the responsibility of the tool or library encountering the " -"``Annotated`` type. A tool or library encountering an ``Annotated`` type can " -"scan through the annotations to determine if they are of interest (e.g., " -"using ``isinstance()``)." +#: ../../library/typing.rst:724 +msgid "A generic version of :class:`collections.abc.ItemsView`." msgstr "" -#: ../../library/typing.rst:731 -msgid "" -"When a tool or a library does not support annotations or encounters an " -"unknown annotation it should just ignore it and treat annotated type as the " -"underlying type." +#: ../../library/typing.rst:728 +msgid "A generic version of :class:`collections.abc.ValuesView`." msgstr "" -#: ../../library/typing.rst:735 -msgid "" -"It's up to the tool consuming the annotations to decide whether the client " -"is allowed to have several annotations on one type and how to merge those " -"annotations." +#: ../../library/typing.rst:732 +msgid "A generic version of :class:`collections.abc.Awaitable`." msgstr "" -#: ../../library/typing.rst:739 +#: ../../library/typing.rst:738 msgid "" -"Since the ``Annotated`` type allows you to put several annotations of the " -"same (or different) type(s) on any node, the tools or libraries consuming " -"those annotations are in charge of dealing with potential duplicates. For " -"example, if you are doing value range analysis you might allow this::" +"A generic version of :class:`collections.abc.Coroutine`. The variance and " +"order of type variables correspond to those of :class:`Generator`, for " +"example::" msgstr "" -#: ../../library/typing.rst:748 -msgid "" -"Passing ``include_extras=True`` to :func:`get_type_hints` lets one access " -"the extra annotations at runtime." +#: ../../library/typing.rst:753 +msgid "A generic version of :class:`collections.abc.AsyncIterable`." msgstr "" -#: ../../library/typing.rst:751 -msgid "The details of the syntax:" +#: ../../library/typing.rst:759 +msgid "A generic version of :class:`collections.abc.AsyncIterator`." msgstr "" -#: ../../library/typing.rst:753 -msgid "The first argument to ``Annotated`` must be a valid type" +#: ../../library/typing.rst:765 +msgid "A generic version of :class:`contextlib.AbstractContextManager`." msgstr "" -#: ../../library/typing.rst:755 -msgid "" -"Multiple type annotations are supported (``Annotated`` supports variadic " -"arguments)::" +#: ../../library/typing.rst:772 +msgid "A generic version of :class:`contextlib.AbstractAsyncContextManager`." msgstr "" -#: ../../library/typing.rst:760 +#: ../../library/typing.rst:779 msgid "" -"``Annotated`` must be called with at least two arguments " -"( ``Annotated[int]`` is not valid)" -msgstr "" - -#: ../../library/typing.rst:763 -msgid "" -"The order of the annotations is preserved and matters for equality checks::" -msgstr "" - -#: ../../library/typing.rst:770 -msgid "" -"Nested ``Annotated`` types are flattened, with metadata ordered starting " -"with the innermost annotation::" -msgstr "" - -#: ../../library/typing.rst:777 -msgid "Duplicated annotations are not removed::" +"A generic version of :class:`dict`. Useful for annotating return types. To " +"annotate arguments it is preferred to use an abstract collection type such " +"as :class:`Mapping`." msgstr "" #: ../../library/typing.rst:783 -msgid "``Annotated`` can be used with nested and generic aliases::" +msgid "This type can be used as follows::" msgstr "" -#: ../../library/typing.rst:794 -msgid "Building generic types" +#: ../../library/typing.rst:790 +msgid "A generic version of :class:`collections.defaultdict`." msgstr "" #: ../../library/typing.rst:796 -msgid "" -"These are not used in annotations. They are building blocks for creating " -"generic types." -msgstr "" - -#: ../../library/typing.rst:800 -msgid "Abstract base class for generic types." +msgid "A generic version of :class:`collections.OrderedDict`." msgstr "" #: ../../library/typing.rst:802 -msgid "" -"A generic type is typically declared by inheriting from an instantiation of " -"this class with one or more type variables. For example, a generic mapping " -"type might be defined as::" -msgstr "" - -#: ../../library/typing.rst:811 -msgid "This class can then be used as follows::" -msgstr "" - -#: ../../library/typing.rst:824 -msgid "Type variable." +msgid "A generic version of :class:`collections.Counter`." msgstr "" -#: ../../library/typing.rst:826 ../../library/typing.rst:942 -msgid "Usage::" +#: ../../library/typing.rst:809 +msgid "A generic version of :class:`collections.ChainMap`." msgstr "" -#: ../../library/typing.rst:831 +#: ../../library/typing.rst:816 msgid "" -"Type variables exist primarily for the benefit of static type checkers. " -"They serve as the parameters for generic types as well as for generic " -"function definitions. See :class:`Generic` for more information on generic " -"types. Generic functions work as follows::" +"A generator can be annotated by the generic type ``Generator[YieldType, " +"SendType, ReturnType]``. For example::" msgstr "" -#: ../../library/typing.rst:844 +#: ../../library/typing.rst:825 msgid "" -"The latter example's signature is essentially the overloading of ``(str, " -"str) -> str`` and ``(bytes, bytes) -> bytes``. Also note that if the " -"arguments are instances of some subclass of :class:`str`, the return type is " -"still plain :class:`str`." +"Note that unlike many other generics in the typing module, the ``SendType`` " +"of :class:`Generator` behaves contravariantly, not covariantly or " +"invariantly." msgstr "" -#: ../../library/typing.rst:849 +#: ../../library/typing.rst:829 msgid "" -"At runtime, ``isinstance(x, T)`` will raise :exc:`TypeError`. In general, :" -"func:`isinstance` and :func:`issubclass` should not be used with types." +"If your generator will only yield values, set the ``SendType`` and " +"``ReturnType`` to ``None``::" msgstr "" -#: ../../library/typing.rst:852 +#: ../../library/typing.rst:837 msgid "" -"Type variables may be marked covariant or contravariant by passing " -"``covariant=True`` or ``contravariant=True``. See :pep:`484` for more " -"details. By default type variables are invariant. Alternatively, a type " -"variable may specify an upper bound using ``bound=``. This means that " -"an actual type substituted (explicitly or implicitly) for the type variable " -"must be a subclass of the boundary type, see :pep:`484`." +"Alternatively, annotate your generator as having a return type of either " +"``Iterable[YieldType]`` or ``Iterator[YieldType]``::" msgstr "" -#: ../../library/typing.rst:862 +#: ../../library/typing.rst:847 msgid "" -"``AnyStr`` is a type variable defined as ``AnyStr = TypeVar('AnyStr', str, " -"bytes)``." +"An async generator can be annotated by the generic type " +"``AsyncGenerator[YieldType, SendType]``. For example::" msgstr "" -#: ../../library/typing.rst:865 +#: ../../library/typing.rst:856 msgid "" -"It is meant to be used for functions that may accept any kind of string " -"without allowing different kinds of strings to mix. For example::" +"Unlike normal generators, async generators cannot return a value, so there " +"is no ``ReturnType`` type parameter. As with :class:`Generator`, the " +"``SendType`` behaves contravariantly." msgstr "" -#: ../../library/typing.rst:877 +#: ../../library/typing.rst:860 msgid "" -"Base class for protocol classes. Protocol classes are defined like this::" +"If your generator will only yield values, set the ``SendType`` to ``None``::" msgstr "" -#: ../../library/typing.rst:883 +#: ../../library/typing.rst:868 msgid "" -"Such classes are primarily used with static type checkers that recognize " -"structural subtyping (static duck-typing), for example::" +"Alternatively, annotate your generator as having a return type of either " +"``AsyncIterable[YieldType]`` or ``AsyncIterator[YieldType]``::" msgstr "" -#: ../../library/typing.rst:895 +#: ../../library/typing.rst:880 msgid "" -"See :pep:`544` for details. Protocol classes decorated with :func:" -"`runtime_checkable` (described later) act as simple-minded runtime protocols " -"that check only the presence of given attributes, ignoring their type " -"signatures." -msgstr "" - -#: ../../library/typing.rst:900 -msgid "Protocol classes can be generic, for example::" -msgstr "" - -#: ../../library/typing.rst:910 -msgid "Mark a protocol class as a runtime protocol." +"``Text`` is an alias for ``str``. It is provided to supply a forward " +"compatible path for Python 2 code: in Python 2, ``Text`` is an alias for " +"``unicode``." msgstr "" -#: ../../library/typing.rst:912 +#: ../../library/typing.rst:884 msgid "" -"Such a protocol can be used with :func:`isinstance` and :func:`issubclass`. " -"This raises :exc:`TypeError` when applied to a non-protocol class. This " -"allows a simple-minded structural check, very similar to \"one trick ponies" -"\" in :mod:`collections.abc` such as :class:`~collections.abc.Iterable`. " -"For example::" +"Use ``Text`` to indicate that a value must contain a unicode string in a " +"manner that is compatible with both Python 2 and Python 3::" msgstr "" -#: ../../library/typing.rst:925 +#: ../../library/typing.rst:896 msgid "" -":func:`runtime_checkable` will check only the presence of the required " -"methods, not their type signatures! For example, :class:`builtins.complex " -"` implements :func:`__float__`, therefore it passes an :func:" -"`issubclass` check against :class:`SupportsFloat`. However, the ``complex." -"__float__`` method exists only to raise a :class:`TypeError` with a more " -"informative message." -msgstr "" - -#: ../../library/typing.rst:934 -msgid "Other special directives" +"Generic type ``IO[AnyStr]`` and its subclasses ``TextIO(IO[str])`` and " +"``BinaryIO(IO[bytes])`` represent the types of I/O streams such as returned " +"by :func:`open`." msgstr "" -#: ../../library/typing.rst:936 +#: ../../library/typing.rst:904 msgid "" -"These are not used in annotations. They are building blocks for declaring " -"types." +"These type aliases correspond to the return types from :func:`re.compile` " +"and :func:`re.match`. These types (and the corresponding functions) are " +"generic in ``AnyStr`` and can be made specific by writing ``Pattern[str]``, " +"``Pattern[bytes]``, ``Match[str]``, or ``Match[bytes]``." msgstr "" -#: ../../library/typing.rst:940 +#: ../../library/typing.rst:913 msgid "Typed version of :func:`collections.namedtuple`." msgstr "" -#: ../../library/typing.rst:948 +#: ../../library/typing.rst:921 msgid "This is equivalent to::" msgstr "" -#: ../../library/typing.rst:952 +#: ../../library/typing.rst:925 msgid "" "To give a field a default value, you can assign to it in the class body::" msgstr "" -#: ../../library/typing.rst:961 +#: ../../library/typing.rst:934 msgid "" "Fields with a default value must come after any fields without a default." msgstr "" -#: ../../library/typing.rst:963 +#: ../../library/typing.rst:936 msgid "" "The resulting class has an extra attribute ``__annotations__`` giving a dict " "that maps the field names to the field types. (The field names are in the " @@ -894,56 +776,49 @@ msgid "" "attribute both of which are part of the namedtuple API.)" msgstr "" -#: ../../library/typing.rst:969 +#: ../../library/typing.rst:942 msgid "``NamedTuple`` subclasses can also have docstrings and methods::" msgstr "" -#: ../../library/typing.rst:979 +#: ../../library/typing.rst:952 msgid "Backward-compatible usage::" msgstr "" -#: ../../library/typing.rst:983 +#: ../../library/typing.rst:956 msgid "Added support for :pep:`526` variable annotation syntax." msgstr "" -#: ../../library/typing.rst:986 +#: ../../library/typing.rst:959 msgid "Added support for default values, methods, and docstrings." msgstr "" -#: ../../library/typing.rst:989 +#: ../../library/typing.rst:962 msgid "" "The ``_field_types`` and ``__annotations__`` attributes are now regular " "dictionaries instead of instances of ``OrderedDict``." msgstr "" -#: ../../library/typing.rst:993 +#: ../../library/typing.rst:966 msgid "" "Removed the ``_field_types`` attribute in favor of the more standard " "``__annotations__`` attribute which has the same information." msgstr "" -#: ../../library/typing.rst:999 -msgid "" -"A helper function to indicate a distinct type to a typechecker, see :ref:" -"`distinct`. At runtime it returns a function that returns its argument. " -"Usage::" -msgstr "" - -#: ../../library/typing.rst:1010 +#: ../../library/typing.rst:973 msgid "" -"Special construct to add type hints to a dictionary. At runtime it is a " -"plain :class:`dict`." +"A simple typed namespace. At runtime it is equivalent to a plain :class:" +"`dict`." msgstr "" -#: ../../library/typing.rst:1013 +#: ../../library/typing.rst:976 msgid "" -"``TypedDict`` declares a dictionary type that expects all of its instances " -"to have a certain set of keys, where each key is associated with a value of " -"a consistent type. This expectation is not checked at runtime but is only " +"``TypedDict`` creates a dictionary type that expects all of its instances to " +"have a certain set of keys, where each key is associated with a value of a " +"consistent type. This expectation is not checked at runtime but is only " "enforced by type checkers. Usage::" msgstr "" -#: ../../library/typing.rst:1029 +#: ../../library/typing.rst:992 msgid "" "The type info for introspection can be accessed via ``Point2D." "__annotations__`` and ``Point2D.__total__``. To allow using this feature " @@ -951,13 +826,13 @@ msgid "" "supports two additional equivalent syntactic forms::" msgstr "" -#: ../../library/typing.rst:1037 +#: ../../library/typing.rst:1000 msgid "" "By default, all keys must be present in a TypedDict. It is possible to " "override this by specifying totality. Usage::" msgstr "" -#: ../../library/typing.rst:1045 +#: ../../library/typing.rst:1008 msgid "" "This means that a point2D TypedDict can have any of the keys omitted. A type " "checker is only expected to support a literal False or True as the value of " @@ -965,715 +840,450 @@ msgid "" "class body be required." msgstr "" -#: ../../library/typing.rst:1050 +#: ../../library/typing.rst:1013 msgid "" "See :pep:`589` for more examples and detailed rules of using ``TypedDict``." msgstr "" -#: ../../library/typing.rst:1055 -msgid "Generic concrete collections" -msgstr "" - -#: ../../library/typing.rst:1058 -msgid "Corresponding to built-in types" +#: ../../library/typing.rst:1019 +msgid "" +"A class used for internal typing representation of string forward " +"references. For example, ``List[\"SomeClass\"]`` is implicitly transformed " +"into ``List[ForwardRef(\"SomeClass\")]``. This class should not be " +"instantiated by a user, but may be used by introspection tools." msgstr "" -#: ../../library/typing.rst:1062 +#: ../../library/typing.rst:1026 msgid "" -"A generic version of :class:`dict`. Useful for annotating return types. To " -"annotate arguments it is preferred to use an abstract collection type such " -"as :class:`Mapping`." +"A helper function to indicate a distinct type to a typechecker, see :ref:" +"`distinct`. At runtime it returns a function that returns its argument. " +"Usage::" msgstr "" -#: ../../library/typing.rst:1066 -msgid "This type can be used as follows::" +#: ../../library/typing.rst:1037 +msgid "Cast a value to a type." msgstr "" -#: ../../library/typing.rst:1071 +#: ../../library/typing.rst:1039 msgid "" -":class:`builtins.dict ` now supports ``[]``. See :pep:`585` and :ref:" -"`types-genericalias`." +"This returns the value unchanged. To the type checker this signals that the " +"return value has the designated type, but at runtime we intentionally don't " +"check anything (we want this to be as fast as possible)." msgstr "" -#: ../../library/typing.rst:1077 +#: ../../library/typing.rst:1046 msgid "" -"Generic version of :class:`list`. Useful for annotating return types. To " -"annotate arguments it is preferred to use an abstract collection type such " -"as :class:`Sequence` or :class:`Iterable`." -msgstr "" - -#: ../../library/typing.rst:1082 -msgid "This type may be used as follows::" +"Return a dictionary containing type hints for a function, method, module or " +"class object." msgstr "" -#: ../../library/typing.rst:1092 +#: ../../library/typing.rst:1049 msgid "" -":class:`builtins.list ` now supports ``[]``. See :pep:`585` and :ref:" -"`types-genericalias`." +"This is often the same as ``obj.__annotations__``. In addition, forward " +"references encoded as string literals are handled by evaluating them in " +"``globals`` and ``locals`` namespaces. If necessary, ``Optional[t]`` is " +"added for function and method annotations if a default value equal to " +"``None`` is set. For a class ``C``, return a dictionary constructed by " +"merging all the ``__annotations__`` along ``C.__mro__`` in reverse order." msgstr "" -#: ../../library/typing.rst:1098 +#: ../../library/typing.rst:1057 msgid "" -"A generic version of :class:`builtins.set `. Useful for annotating " -"return types. To annotate arguments it is preferred to use an abstract " -"collection type such as :class:`AbstractSet`." +"The function recursively replaces all ``Annotated[T, ...]`` with ``T``, " +"unless ``include_extras`` is set to ``True`` (see :class:`Annotated` for " +"more information). For example::" msgstr "" -#: ../../library/typing.rst:1102 -msgid "" -":class:`builtins.set ` now supports ``[]``. See :pep:`585` and :ref:" -"`types-genericalias`." +#: ../../library/typing.rst:1070 +msgid "Added ``include_extras`` parameter as part of :pep:`593`." msgstr "" -#: ../../library/typing.rst:1108 -msgid "A generic version of :class:`builtins.frozenset `." +#: ../../library/typing.rst:1076 +msgid "Provide basic introspection for generic types and special typing forms." msgstr "" -#: ../../library/typing.rst:1110 +#: ../../library/typing.rst:1078 msgid "" -":class:`builtins.frozenset ` now supports ``[]``. See :pep:`585` " -"and :ref:`types-genericalias`." -msgstr "" - -#: ../../library/typing.rst:1114 -msgid ":data:`Tuple` is a special form." +"For a typing object of the form ``X[Y, Z, ...]`` these functions return " +"``X`` and ``(Y, Z, ...)``. If ``X`` is a generic alias for a builtin or :mod:" +"`collections` class, it gets normalized to the original class. For " +"unsupported objects return ``None`` and ``()`` correspondingly. Examples::" msgstr "" -#: ../../library/typing.rst:1117 -msgid "Corresponding to types in :mod:`collections`" +#: ../../library/typing.rst:1094 +msgid "" +"The ``@overload`` decorator allows describing functions and methods that " +"support multiple different combinations of argument types. A series of " +"``@overload``-decorated definitions must be followed by exactly one non-" +"``@overload``-decorated definition (for the same function/method). The " +"``@overload``-decorated definitions are for the benefit of the type checker " +"only, since they will be overwritten by the non-``@overload``-decorated " +"definition, while the latter is used at runtime but should be ignored by a " +"type checker. At runtime, calling a ``@overload``-decorated function " +"directly will raise :exc:`NotImplementedError`. An example of overload that " +"gives a more precise type than can be expressed using a union or a type " +"variable::" msgstr "" -#: ../../library/typing.rst:1121 -msgid "A generic version of :class:`collections.defaultdict`." +#: ../../library/typing.rst:1118 +msgid "See :pep:`484` for details and comparison with other typing semantics." msgstr "" -#: ../../library/typing.rst:1125 +#: ../../library/typing.rst:1122 msgid "" -":class:`collections.defaultdict` now supports ``[]``. See :pep:`585` and :" -"ref:`types-genericalias`." -msgstr "" - -#: ../../library/typing.rst:1131 -msgid "A generic version of :class:`collections.OrderedDict`." +"A decorator to indicate to type checkers that the decorated method cannot be " +"overridden, and the decorated class cannot be subclassed. For example::" msgstr "" -#: ../../library/typing.rst:1135 +#: ../../library/typing.rst:1140 ../../library/typing.rst:1367 msgid "" -":class:`collections.OrderedDict` now supports ``[]``. See :pep:`585` and :" -"ref:`types-genericalias`." +"There is no runtime checking of these properties. See :pep:`591` for more " +"details." msgstr "" -#: ../../library/typing.rst:1141 -msgid "A generic version of :class:`collections.ChainMap`." +#: ../../library/typing.rst:1147 +msgid "Decorator to indicate that annotations are not type hints." msgstr "" -#: ../../library/typing.rst:1146 +#: ../../library/typing.rst:1149 msgid "" -":class:`collections.ChainMap` now supports ``[]``. See :pep:`585` and :ref:" -"`types-genericalias`." +"This works as class or function :term:`decorator`. With a class, it applies " +"recursively to all methods defined in that class (but not to methods defined " +"in its superclasses or subclasses)." msgstr "" -#: ../../library/typing.rst:1152 -msgid "A generic version of :class:`collections.Counter`." +#: ../../library/typing.rst:1153 +msgid "This mutates the function(s) in place." msgstr "" #: ../../library/typing.rst:1157 -msgid "" -":class:`collections.Counter` now supports ``[]``. See :pep:`585` and :ref:" -"`types-genericalias`." -msgstr "" - -#: ../../library/typing.rst:1163 -msgid "A generic version of :class:`collections.deque`." +msgid "Decorator to give another decorator the :func:`no_type_check` effect." msgstr "" -#: ../../library/typing.rst:1168 +#: ../../library/typing.rst:1159 msgid "" -":class:`collections.deque` now supports ``[]``. See :pep:`585` and :ref:" -"`types-genericalias`." +"This wraps the decorator with something that wraps the decorated function " +"in :func:`no_type_check`." msgstr "" -#: ../../library/typing.rst:1173 -msgid "Other concrete types" +#: ../../library/typing.rst:1164 +msgid "Decorator to mark a class or function to be unavailable at runtime." msgstr "" -#: ../../library/typing.rst:1179 +#: ../../library/typing.rst:1166 msgid "" -"Generic type ``IO[AnyStr]`` and its subclasses ``TextIO(IO[str])`` and " -"``BinaryIO(IO[bytes])`` represent the types of I/O streams such as returned " -"by :func:`open`." +"This decorator is itself not available at runtime. It is mainly intended to " +"mark classes that are defined in type stub files if an implementation " +"returns an instance of a private class::" msgstr "" -#: ../../library/typing.rst:1186 +#: ../../library/typing.rst:1177 msgid "" -"These types are also in the ``typing.io`` namespace, which was never " -"supported by type checkers and will be removed." +"Note that returning instances of private classes is not recommended. It is " +"usually preferable to make such classes public." +msgstr "" + +#: ../../library/typing.rst:1182 +msgid "Mark a protocol class as a runtime protocol." msgstr "" -#: ../../library/typing.rst:1191 +#: ../../library/typing.rst:1184 msgid "" -"These type aliases correspond to the return types from :func:`re.compile` " -"and :func:`re.match`. These types (and the corresponding functions) are " -"generic in ``AnyStr`` and can be made specific by writing ``Pattern[str]``, " -"``Pattern[bytes]``, ``Match[str]``, or ``Match[bytes]``." +"Such a protocol can be used with :func:`isinstance` and :func:`issubclass`. " +"This raises :exc:`TypeError` when applied to a non-protocol class. This " +"allows a simple-minded structural check, very similar to \"one trick ponies" +"\" in :mod:`collections.abc` such as :class:`Iterable`. For example::" msgstr "" -#: ../../library/typing.rst:1201 +#: ../../library/typing.rst:1195 msgid "" -"These types are also in the ``typing.re`` namespace, which was never " -"supported by type checkers and will be removed." +"**Warning:** this will check only the presence of the required methods, not " +"their type signatures!" msgstr "" #: ../../library/typing.rst:1202 -msgid "" -"Classes ``Pattern`` and ``Match`` from :mod:`re` now support ``[]``. See :" -"pep:`585` and :ref:`types-genericalias`." +msgid "Special type indicating an unconstrained type." msgstr "" -#: ../../library/typing.rst:1208 -msgid "" -"``Text`` is an alias for ``str``. It is provided to supply a forward " -"compatible path for Python 2 code: in Python 2, ``Text`` is an alias for " -"``unicode``." +#: ../../library/typing.rst:1204 +msgid "Every type is compatible with :data:`Any`." msgstr "" -#: ../../library/typing.rst:1212 -msgid "" -"Use ``Text`` to indicate that a value must contain a unicode string in a " -"manner that is compatible with both Python 2 and Python 3::" +#: ../../library/typing.rst:1205 +msgid ":data:`Any` is compatible with every type." +msgstr "" + +#: ../../library/typing.rst:1209 +msgid "Special type indicating that a function never returns. For example::" msgstr "" -#: ../../library/typing.rst:1221 -msgid "Abstract Base Classes" +#: ../../library/typing.rst:1222 +msgid "Union type; ``Union[X, Y]`` means either X or Y." msgstr "" #: ../../library/typing.rst:1224 -msgid "Corresponding to collections in :mod:`collections.abc`" +msgid "To define a union, use e.g. ``Union[int, str]``. Details:" +msgstr "" + +#: ../../library/typing.rst:1226 +msgid "The arguments must be types and there must be at least one." msgstr "" #: ../../library/typing.rst:1228 -msgid "A generic version of :class:`collections.abc.Set`." +msgid "Unions of unions are flattened, e.g.::" msgstr "" -#: ../../library/typing.rst:1230 -msgid "" -":class:`collections.abc.Set` now supports ``[]``. See :pep:`585` and :ref:" -"`types-genericalias`." +#: ../../library/typing.rst:1232 +msgid "Unions of a single argument vanish, e.g.::" msgstr "" #: ../../library/typing.rst:1236 -msgid "A generic version of :class:`collections.abc.ByteString`." +msgid "Redundant arguments are skipped, e.g.::" msgstr "" -#: ../../library/typing.rst:1238 -msgid "" -"This type represents the types :class:`bytes`, :class:`bytearray`, and :" -"class:`memoryview` of byte sequences." +#: ../../library/typing.rst:1240 +msgid "When comparing unions, the argument order is ignored, e.g.::" msgstr "" -#: ../../library/typing.rst:1241 -msgid "" -"As a shorthand for this type, :class:`bytes` can be used to annotate " -"arguments of any of the types mentioned above." +#: ../../library/typing.rst:1244 +msgid "You cannot subclass or instantiate a union." msgstr "" -#: ../../library/typing.rst:1244 -msgid "" -":class:`collections.abc.ByteString` now supports ``[]``. See :pep:`585` and :" -"ref:`types-genericalias`." +#: ../../library/typing.rst:1246 +msgid "You cannot write ``Union[X][Y]``." msgstr "" -#: ../../library/typing.rst:1250 -msgid "A generic version of :class:`collections.abc.Collection`" +#: ../../library/typing.rst:1248 +msgid "You can use ``Optional[X]`` as a shorthand for ``Union[X, None]``." msgstr "" -#: ../../library/typing.rst:1254 -msgid "" -":class:`collections.abc.Collection` now supports ``[]``. See :pep:`585` and :" -"ref:`types-genericalias`." +#: ../../library/typing.rst:1250 +msgid "Don't remove explicit subclasses from unions at runtime." msgstr "" -#: ../../library/typing.rst:1260 -msgid "A generic version of :class:`collections.abc.Container`." +#: ../../library/typing.rst:1255 +msgid "Optional type." msgstr "" -#: ../../library/typing.rst:1262 -msgid "" -":class:`collections.abc.Container` now supports ``[]``. See :pep:`585` and :" -"ref:`types-genericalias`." +#: ../../library/typing.rst:1257 +msgid "``Optional[X]`` is equivalent to ``Union[X, None]``." msgstr "" -#: ../../library/typing.rst:1268 -msgid "A generic version of :class:`collections.abc.ItemsView`." +#: ../../library/typing.rst:1259 +msgid "" +"Note that this is not the same concept as an optional argument, which is one " +"that has a default. An optional argument with a default does not require " +"the ``Optional`` qualifier on its type annotation just because it is " +"optional. For example::" msgstr "" -#: ../../library/typing.rst:1270 +#: ../../library/typing.rst:1267 msgid "" -":class:`collections.abc.ItemsView` now supports ``[]``. See :pep:`585` and :" -"ref:`types-genericalias`." +"On the other hand, if an explicit value of ``None`` is allowed, the use of " +"``Optional`` is appropriate, whether the argument is optional or not. For " +"example::" msgstr "" #: ../../library/typing.rst:1276 -msgid "A generic version of :class:`collections.abc.KeysView`." +msgid "" +"Tuple type; ``Tuple[X, Y]`` is the type of a tuple of two items with the " +"first item of type X and the second of type Y. The type of the empty tuple " +"can be written as ``Tuple[()]``." msgstr "" -#: ../../library/typing.rst:1278 +#: ../../library/typing.rst:1280 msgid "" -":class:`collections.abc.KeysView` now supports ``[]``. See :pep:`585` and :" -"ref:`types-genericalias`." +"Example: ``Tuple[T1, T2]`` is a tuple of two elements corresponding to type " +"variables T1 and T2. ``Tuple[int, float, str]`` is a tuple of an int, a " +"float and a string." msgstr "" #: ../../library/typing.rst:1284 msgid "" -"A generic version of :class:`collections.abc.Mapping`. This type can be used " -"as follows::" +"To specify a variable-length tuple of homogeneous type, use literal " +"ellipsis, e.g. ``Tuple[int, ...]``. A plain :data:`Tuple` is equivalent to " +"``Tuple[Any, ...]``, and in turn to :class:`tuple`." msgstr "" #: ../../library/typing.rst:1290 -msgid "" -":class:`collections.abc.Mapping` now supports ``[]``. See :pep:`585` and :" -"ref:`types-genericalias`." -msgstr "" - -#: ../../library/typing.rst:1296 -msgid "A generic version of :class:`collections.abc.MappingView`." -msgstr "" - -#: ../../library/typing.rst:1298 -msgid "" -":class:`collections.abc.MappingView` now supports ``[]``. See :pep:`585` " -"and :ref:`types-genericalias`." -msgstr "" - -#: ../../library/typing.rst:1304 -msgid "A generic version of :class:`collections.abc.MutableMapping`." +msgid "Callable type; ``Callable[[int], str]`` is a function of (int) -> str." msgstr "" -#: ../../library/typing.rst:1306 +#: ../../library/typing.rst:1292 msgid "" -":class:`collections.abc.MutableMapping` now supports ``[]``. See :pep:`585` " -"and :ref:`types-genericalias`." -msgstr "" - -#: ../../library/typing.rst:1312 -msgid "A generic version of :class:`collections.abc.MutableSequence`." +"The subscription syntax must always be used with exactly two values: the " +"argument list and the return type. The argument list must be a list of " +"types or an ellipsis; the return type must be a single type." msgstr "" -#: ../../library/typing.rst:1314 +#: ../../library/typing.rst:1297 msgid "" -":class:`collections.abc.MutableSequence` now supports ``[]``. See :pep:`585` " -"and :ref:`types-genericalias`." -msgstr "" - -#: ../../library/typing.rst:1320 -msgid "A generic version of :class:`collections.abc.MutableSet`." +"There is no syntax to indicate optional or keyword arguments; such function " +"types are rarely used as callback types. ``Callable[..., ReturnType]`` " +"(literal ellipsis) can be used to type hint a callable taking any number of " +"arguments and returning ``ReturnType``. A plain :data:`Callable` is " +"equivalent to ``Callable[..., Any]``, and in turn to :class:`collections.abc." +"Callable`." msgstr "" -#: ../../library/typing.rst:1322 +#: ../../library/typing.rst:1307 msgid "" -":class:`collections.abc.MutableSet` now supports ``[]``. See :pep:`585` and :" -"ref:`types-genericalias`." -msgstr "" - -#: ../../library/typing.rst:1328 -msgid "A generic version of :class:`collections.abc.Sequence`." +"A type that can be used to indicate to type checkers that the corresponding " +"variable or function parameter has a value equivalent to the provided " +"literal (or one of several literals). For example::" msgstr "" -#: ../../library/typing.rst:1330 +#: ../../library/typing.rst:1321 msgid "" -":class:`collections.abc.Sequence` now supports ``[]``. See :pep:`585` and :" -"ref:`types-genericalias`." +"``Literal[...]`` cannot be subclassed. At runtime, an arbitrary value is " +"allowed as type argument to ``Literal[...]``, but type checkers may impose " +"restrictions. See :pep:`586` for more details about literal types." msgstr "" -#: ../../library/typing.rst:1336 -msgid "A generic version of :class:`collections.abc.ValuesView`." +#: ../../library/typing.rst:1329 +msgid "Special type construct to mark class variables." msgstr "" -#: ../../library/typing.rst:1338 +#: ../../library/typing.rst:1331 msgid "" -":class:`collections.abc.ValuesView` now supports ``[]``. See :pep:`585` and :" -"ref:`types-genericalias`." -msgstr "" - -#: ../../library/typing.rst:1343 -msgid "Corresponding to other types in :mod:`collections.abc`" +"As introduced in :pep:`526`, a variable annotation wrapped in ClassVar " +"indicates that a given attribute is intended to be used as a class variable " +"and should not be set on instances of that class. Usage::" msgstr "" -#: ../../library/typing.rst:1347 -msgid "A generic version of :class:`collections.abc.Iterable`." +#: ../../library/typing.rst:1339 +msgid ":data:`ClassVar` accepts only types and cannot be further subscribed." msgstr "" -#: ../../library/typing.rst:1349 +#: ../../library/typing.rst:1341 msgid "" -":class:`collections.abc.Iterable` now supports ``[]``. See :pep:`585` and :" -"ref:`types-genericalias`." +":data:`ClassVar` is not a class itself, and should not be used with :func:" +"`isinstance` or :func:`issubclass`. :data:`ClassVar` does not change Python " +"runtime behavior, but it can be used by third-party type checkers. For " +"example, a type checker might flag the following code as an error::" msgstr "" #: ../../library/typing.rst:1355 -msgid "A generic version of :class:`collections.abc.Iterator`." -msgstr "" - -#: ../../library/typing.rst:1357 -msgid "" -":class:`collections.abc.Iterator` now supports ``[]``. See :pep:`585` and :" -"ref:`types-genericalias`." -msgstr "" - -#: ../../library/typing.rst:1363 -msgid "" -"A generator can be annotated by the generic type ``Generator[YieldType, " -"SendType, ReturnType]``. For example::" -msgstr "" - -#: ../../library/typing.rst:1372 msgid "" -"Note that unlike many other generics in the typing module, the ``SendType`` " -"of :class:`Generator` behaves contravariantly, not covariantly or " -"invariantly." +"A special typing construct to indicate to type checkers that a name cannot " +"be re-assigned or overridden in a subclass. For example::" msgstr "" -#: ../../library/typing.rst:1376 +#: ../../library/typing.rst:1374 msgid "" -"If your generator will only yield values, set the ``SendType`` and " -"``ReturnType`` to ``None``::" +"``AnyStr`` is a type variable defined as ``AnyStr = TypeVar('AnyStr', str, " +"bytes)``." msgstr "" -#: ../../library/typing.rst:1384 +#: ../../library/typing.rst:1377 msgid "" -"Alternatively, annotate your generator as having a return type of either " -"``Iterable[YieldType]`` or ``Iterator[YieldType]``::" +"It is meant to be used for functions that may accept any kind of string " +"without allowing different kinds of strings to mix. For example::" msgstr "" -#: ../../library/typing.rst:1392 +#: ../../library/typing.rst:1389 msgid "" -":class:`collections.abc.Generator` now supports ``[]``. See :pep:`585` and :" -"ref:`types-genericalias`." +"A special constant that is assumed to be ``True`` by 3rd party static type " +"checkers. It is ``False`` at runtime. Usage::" msgstr "" #: ../../library/typing.rst:1398 -msgid "An alias to :class:`collections.abc.Hashable`" -msgstr "" - -#: ../../library/typing.rst:1402 -msgid "A generic version of :class:`collections.abc.Reversible`." -msgstr "" - -#: ../../library/typing.rst:1404 -msgid "" -":class:`collections.abc.Reversible` now supports ``[]``. See :pep:`585` and :" -"ref:`types-genericalias`." -msgstr "" - -#: ../../library/typing.rst:1410 -msgid "An alias to :class:`collections.abc.Sized`" -msgstr "" - -#: ../../library/typing.rst:1413 -msgid "Asynchronous programming" -msgstr "" - -#: ../../library/typing.rst:1417 -msgid "" -"A generic version of :class:`collections.abc.Coroutine`. The variance and " -"order of type variables correspond to those of :class:`Generator`, for " -"example::" -msgstr "" - -#: ../../library/typing.rst:1430 -msgid "" -":class:`collections.abc.Coroutine` now supports ``[]``. See :pep:`585` and :" -"ref:`types-genericalias`." -msgstr "" - -#: ../../library/typing.rst:1436 -msgid "" -"An async generator can be annotated by the generic type " -"``AsyncGenerator[YieldType, SendType]``. For example::" -msgstr "" - -#: ../../library/typing.rst:1445 -msgid "" -"Unlike normal generators, async generators cannot return a value, so there " -"is no ``ReturnType`` type parameter. As with :class:`Generator`, the " -"``SendType`` behaves contravariantly." -msgstr "" - -#: ../../library/typing.rst:1449 -msgid "" -"If your generator will only yield values, set the ``SendType`` to ``None``::" -msgstr "" - -#: ../../library/typing.rst:1457 -msgid "" -"Alternatively, annotate your generator as having a return type of either " -"``AsyncIterable[YieldType]`` or ``AsyncIterator[YieldType]``::" -msgstr "" - -#: ../../library/typing.rst:1467 -msgid "" -":class:`collections.abc.AsyncGenerator` now supports ``[]``. See :pep:`585` " -"and :ref:`types-genericalias`." -msgstr "" - -#: ../../library/typing.rst:1473 -msgid "A generic version of :class:`collections.abc.AsyncIterable`." -msgstr "" - -#: ../../library/typing.rst:1477 -msgid "" -":class:`collections.abc.AsyncIterable` now supports ``[]``. See :pep:`585` " -"and :ref:`types-genericalias`." -msgstr "" - -#: ../../library/typing.rst:1483 -msgid "A generic version of :class:`collections.abc.AsyncIterator`." -msgstr "" - -#: ../../library/typing.rst:1487 -msgid "" -":class:`collections.abc.AsyncIterator` now supports ``[]``. See :pep:`585` " -"and :ref:`types-genericalias`." -msgstr "" - -#: ../../library/typing.rst:1493 -msgid "A generic version of :class:`collections.abc.Awaitable`." -msgstr "" - -#: ../../library/typing.rst:1497 -msgid "" -":class:`collections.abc.Awaitable` now supports ``[]``. See :pep:`585` and :" -"ref:`types-genericalias`." -msgstr "" - -#: ../../library/typing.rst:1503 -msgid "Context manager types" -msgstr "" - -#: ../../library/typing.rst:1507 -msgid "A generic version of :class:`contextlib.AbstractContextManager`." -msgstr "" - -#: ../../library/typing.rst:1512 -msgid "" -":class:`contextlib.AbstractContextManager` now supports ``[]``. See :pep:" -"`585` and :ref:`types-genericalias`." -msgstr "" - -#: ../../library/typing.rst:1518 -msgid "A generic version of :class:`contextlib.AbstractAsyncContextManager`." -msgstr "" - -#: ../../library/typing.rst:1523 msgid "" -":class:`contextlib.AbstractAsyncContextManager` now supports ``[]``. See :" -"pep:`585` and :ref:`types-genericalias`." -msgstr "" - -#: ../../library/typing.rst:1528 -msgid "Protocols" -msgstr "" - -#: ../../library/typing.rst:1530 -msgid "These protocols are decorated with :func:`runtime_checkable`." -msgstr "" - -#: ../../library/typing.rst:1534 -msgid "" -"An ABC with one abstract method ``__abs__`` that is covariant in its return " -"type." -msgstr "" - -#: ../../library/typing.rst:1539 -msgid "An ABC with one abstract method ``__bytes__``." -msgstr "" - -#: ../../library/typing.rst:1543 -msgid "An ABC with one abstract method ``__complex__``." -msgstr "" - -#: ../../library/typing.rst:1547 -msgid "An ABC with one abstract method ``__float__``." -msgstr "" - -#: ../../library/typing.rst:1551 -msgid "An ABC with one abstract method ``__index__``." -msgstr "" - -#: ../../library/typing.rst:1557 -msgid "An ABC with one abstract method ``__int__``." -msgstr "" - -#: ../../library/typing.rst:1561 -msgid "" -"An ABC with one abstract method ``__round__`` that is covariant in its " -"return type." -msgstr "" - -#: ../../library/typing.rst:1565 -msgid "Functions and decorators" -msgstr "" - -#: ../../library/typing.rst:1569 -msgid "Cast a value to a type." -msgstr "" - -#: ../../library/typing.rst:1571 -msgid "" -"This returns the value unchanged. To the type checker this signals that the " -"return value has the designated type, but at runtime we intentionally don't " -"check anything (we want this to be as fast as possible)." -msgstr "" - -#: ../../library/typing.rst:1578 -msgid "" -"The ``@overload`` decorator allows describing functions and methods that " -"support multiple different combinations of argument types. A series of " -"``@overload``-decorated definitions must be followed by exactly one non-" -"``@overload``-decorated definition (for the same function/method). The " -"``@overload``-decorated definitions are for the benefit of the type checker " -"only, since they will be overwritten by the non-``@overload``-decorated " -"definition, while the latter is used at runtime but should be ignored by a " -"type checker. At runtime, calling a ``@overload``-decorated function " -"directly will raise :exc:`NotImplementedError`. An example of overload that " -"gives a more precise type than can be expressed using a union or a type " -"variable::" -msgstr "" - -#: ../../library/typing.rst:1602 -msgid "See :pep:`484` for details and comparison with other typing semantics." -msgstr "" - -#: ../../library/typing.rst:1606 -msgid "" -"A decorator to indicate to type checkers that the decorated method cannot be " -"overridden, and the decorated class cannot be subclassed. For example::" -msgstr "" - -#: ../../library/typing.rst:1631 -msgid "Decorator to indicate that annotations are not type hints." -msgstr "" - -#: ../../library/typing.rst:1633 -msgid "" -"This works as class or function :term:`decorator`. With a class, it applies " -"recursively to all methods defined in that class (but not to methods defined " -"in its superclasses or subclasses)." -msgstr "" - -#: ../../library/typing.rst:1637 -msgid "This mutates the function(s) in place." -msgstr "" - -#: ../../library/typing.rst:1641 -msgid "Decorator to give another decorator the :func:`no_type_check` effect." +"Note that the first type annotation must be enclosed in quotes, making it a " +"\"forward reference\", to hide the ``expensive_mod`` reference from the " +"interpreter runtime. Type annotations for local variables are not " +"evaluated, so the second annotation does not need to be enclosed in quotes." msgstr "" -#: ../../library/typing.rst:1643 +#: ../../library/typing.rst:1407 msgid "" -"This wraps the decorator with something that wraps the decorated function " -"in :func:`no_type_check`." -msgstr "" - -#: ../../library/typing.rst:1648 -msgid "Decorator to mark a class or function to be unavailable at runtime." +"A type, introduced in :pep:`593` (``Flexible function and variable " +"annotations``), to decorate existing types with context-specific metadata " +"(possibly multiple pieces of it, as ``Annotated`` is variadic). " +"Specifically, a type ``T`` can be annotated with metadata ``x`` via the " +"typehint ``Annotated[T, x]``. This metadata can be used for either static " +"analysis or at runtime. If a library (or tool) encounters a typehint " +"``Annotated[T, x]`` and has no special logic for metadata ``x``, it should " +"ignore it and simply treat the type as ``T``. Unlike the ``no_type_check`` " +"functionality that currently exists in the ``typing`` module which " +"completely disables typechecking annotations on a function or a class, the " +"``Annotated`` type allows for both static typechecking of ``T`` (e.g., via " +"mypy or Pyre, which can safely ignore ``x``) together with runtime access to " +"``x`` within a specific application." msgstr "" -#: ../../library/typing.rst:1650 +#: ../../library/typing.rst:1421 msgid "" -"This decorator is itself not available at runtime. It is mainly intended to " -"mark classes that are defined in type stub files if an implementation " -"returns an instance of a private class::" +"Ultimately, the responsibility of how to interpret the annotations (if at " +"all) is the responsibility of the tool or library encountering the " +"``Annotated`` type. A tool or library encountering an ``Annotated`` type can " +"scan through the annotations to determine if they are of interest (e.g., " +"using ``isinstance()``)." msgstr "" -#: ../../library/typing.rst:1661 +#: ../../library/typing.rst:1427 msgid "" -"Note that returning instances of private classes is not recommended. It is " -"usually preferable to make such classes public." -msgstr "" - -#: ../../library/typing.rst:1665 -msgid "Introspection helpers" +"When a tool or a library does not support annotations or encounters an " +"unknown annotation it should just ignore it and treat annotated type as the " +"underlying type." msgstr "" -#: ../../library/typing.rst:1669 +#: ../../library/typing.rst:1431 msgid "" -"Return a dictionary containing type hints for a function, method, module or " -"class object." +"It's up to the tool consuming the annotations to decide whether the client " +"is allowed to have several annotations on one type and how to merge those " +"annotations." msgstr "" -#: ../../library/typing.rst:1672 +#: ../../library/typing.rst:1435 msgid "" -"This is often the same as ``obj.__annotations__``. In addition, forward " -"references encoded as string literals are handled by evaluating them in " -"``globals`` and ``locals`` namespaces. If necessary, ``Optional[t]`` is " -"added for function and method annotations if a default value equal to " -"``None`` is set. For a class ``C``, return a dictionary constructed by " -"merging all the ``__annotations__`` along ``C.__mro__`` in reverse order." +"Since the ``Annotated`` type allows you to put several annotations of the " +"same (or different) type(s) on any node, the tools or libraries consuming " +"those annotations are in charge of dealing with potential duplicates. For " +"example, if you are doing value range analysis you might allow this::" msgstr "" -#: ../../library/typing.rst:1680 +#: ../../library/typing.rst:1444 msgid "" -"The function recursively replaces all ``Annotated[T, ...]`` with ``T``, " -"unless ``include_extras`` is set to ``True`` (see :class:`Annotated` for " -"more information). For example::" +"Passing ``include_extras=True`` to :func:`get_type_hints` lets one access " +"the extra annotations at runtime." msgstr "" -#: ../../library/typing.rst:1693 -msgid "Added ``include_extras`` parameter as part of :pep:`593`." +#: ../../library/typing.rst:1447 +msgid "The details of the syntax:" msgstr "" -#: ../../library/typing.rst:1699 -msgid "Provide basic introspection for generic types and special typing forms." +#: ../../library/typing.rst:1449 +msgid "The first argument to ``Annotated`` must be a valid type" msgstr "" -#: ../../library/typing.rst:1701 +#: ../../library/typing.rst:1451 msgid "" -"For a typing object of the form ``X[Y, Z, ...]`` these functions return " -"``X`` and ``(Y, Z, ...)``. If ``X`` is a generic alias for a builtin or :mod:" -"`collections` class, it gets normalized to the original class. If ``X`` is " -"a :class:`Union` or :class:`Literal` contained in another generic type, the " -"order of ``(Y, Z, ...)`` may be different from the order of the original " -"arguments ``[Y, Z, ...]`` due to type caching. For unsupported objects " -"return ``None`` and ``()`` correspondingly. Examples::" +"Multiple type annotations are supported (``Annotated`` supports variadic " +"arguments)::" msgstr "" -#: ../../library/typing.rst:1720 +#: ../../library/typing.rst:1456 msgid "" -"A class used for internal typing representation of string forward " -"references. For example, ``List[\"SomeClass\"]`` is implicitly transformed " -"into ``List[ForwardRef(\"SomeClass\")]``. This class should not be " -"instantiated by a user, but may be used by introspection tools." +"``Annotated`` must be called with at least two arguments " +"( ``Annotated[int]`` is not valid)" msgstr "" -#: ../../library/typing.rst:1726 +#: ../../library/typing.rst:1459 msgid "" -":pep:`585` generic types such as ``list[\"SomeClass\"]`` will not be " -"implicitly transformed into ``list[ForwardRef(\"SomeClass\")]`` and thus " -"will not automatically resolve to ``list[SomeClass]``." -msgstr "" - -#: ../../library/typing.rst:1733 -msgid "Constant" +"The order of the annotations is preserved and matters for equality checks::" msgstr "" -#: ../../library/typing.rst:1737 +#: ../../library/typing.rst:1466 msgid "" -"A special constant that is assumed to be ``True`` by 3rd party static type " -"checkers. It is ``False`` at runtime. Usage::" +"Nested ``Annotated`` types are flattened, with metadata ordered starting " +"with the innermost annotation::" msgstr "" -#: ../../library/typing.rst:1746 -msgid "" -"The first type annotation must be enclosed in quotes, making it a \"forward " -"reference\", to hide the ``expensive_mod`` reference from the interpreter " -"runtime. Type annotations for local variables are not evaluated, so the " -"second annotation does not need to be enclosed in quotes." +#: ../../library/typing.rst:1473 +msgid "Duplicated annotations are not removed::" msgstr "" -#: ../../library/typing.rst:1753 -msgid "" -"If ``from __future__ import annotations`` is used in Python 3.7 or later, " -"annotations are not evaluated at function definition time. Instead, they are " -"stored as strings in ``__annotations__``, This makes it unnecessary to use " -"quotes around the annotation. (see :pep:`563`)." +#: ../../library/typing.rst:1479 +msgid "``Annotated`` can be used with nested and generic aliases::" msgstr "" diff --git a/library/unittest.mock.po b/library/unittest.mock.po index 639cbb1add..3b1be07bde 100644 --- a/library/unittest.mock.po +++ b/library/unittest.mock.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.7\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2021-09-07 06:52+0000\n" +"POT-Creation-Date: 2020-06-20 18:08+0800\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-" @@ -53,9 +53,9 @@ msgstr "" #: ../../library/unittest.mock.rst:33 msgid "" -"Mock is designed for use with :mod:`unittest` and is based on the 'action -> " -"assertion' pattern instead of 'record -> replay' used by many mocking " -"frameworks." +"Mock is very easy to use and is designed for use with :mod:`unittest`. Mock " +"is based on the 'action -> assertion' pattern instead of 'record -> replay' " +"used by many mocking frameworks." msgstr "" #: ../../library/unittest.mock.rst:37 @@ -313,7 +313,7 @@ msgstr "" #: ../../library/unittest.mock.rst:330 msgid "" -"Assert that the mock was called exactly once and that call was with the " +"Assert that the mock was called exactly once and that that call was with the " "specified arguments." msgstr "" @@ -523,11 +523,7 @@ msgid "" "make more complex assertions. See :ref:`calls as tuples `." msgstr "" -#: ../../library/unittest.mock.rst:650 -msgid "Added ``args`` and ``kwargs`` properties." -msgstr "" - -#: ../../library/unittest.mock.rst:656 +#: ../../library/unittest.mock.rst:653 msgid "" "This is a list of all the calls made to the mock object in sequence (so the " "length of the list is the number of times it has been called). Before any " @@ -536,47 +532,47 @@ msgid "" "`call_args_list`." msgstr "" -#: ../../library/unittest.mock.rst:672 +#: ../../library/unittest.mock.rst:669 msgid "" "Members of :attr:`call_args_list` are :data:`call` objects. These can be " "unpacked as tuples to get at the individual arguments. See :ref:`calls as " "tuples `." msgstr "" -#: ../../library/unittest.mock.rst:679 +#: ../../library/unittest.mock.rst:676 msgid "" "As well as tracking calls to themselves, mocks also track calls to methods " "and attributes, and *their* methods and attributes:" msgstr "" -#: ../../library/unittest.mock.rst:690 +#: ../../library/unittest.mock.rst:687 msgid "" "Members of :attr:`method_calls` are :data:`call` objects. These can be " "unpacked as tuples to get at the individual arguments. See :ref:`calls as " "tuples `." msgstr "" -#: ../../library/unittest.mock.rst:697 +#: ../../library/unittest.mock.rst:694 msgid "" ":attr:`mock_calls` records *all* calls to the mock object, its methods, " "magic methods *and* return value mocks." msgstr "" -#: ../../library/unittest.mock.rst:715 +#: ../../library/unittest.mock.rst:712 msgid "" "Members of :attr:`mock_calls` are :data:`call` objects. These can be " "unpacked as tuples to get at the individual arguments. See :ref:`calls as " "tuples `." msgstr "" -#: ../../library/unittest.mock.rst:721 +#: ../../library/unittest.mock.rst:718 msgid "" "The way :attr:`mock_calls` are recorded means that where nested calls are " "made, the parameters of ancestor calls are not recorded and so will always " "compare equal:" msgstr "" -#: ../../library/unittest.mock.rst:735 +#: ../../library/unittest.mock.rst:732 msgid "" "Normally the :attr:`__class__` attribute of an object will return its type. " "For a mock object with a :attr:`spec`, ``__class__`` returns the spec class " @@ -584,32 +580,32 @@ msgid "" "object they are replacing / masquerading as:" msgstr "" -#: ../../library/unittest.mock.rst:744 +#: ../../library/unittest.mock.rst:741 msgid "" ":attr:`__class__` is assignable to, this allows a mock to pass an :func:" "`isinstance` check without forcing you to use a spec:" msgstr "" -#: ../../library/unittest.mock.rst:754 +#: ../../library/unittest.mock.rst:751 msgid "" "A non-callable version of :class:`Mock`. The constructor parameters have the " "same meaning of :class:`Mock`, with the exception of *return_value* and " "*side_effect* which have no meaning on a non-callable mock." msgstr "" -#: ../../library/unittest.mock.rst:758 +#: ../../library/unittest.mock.rst:755 msgid "" "Mock objects that use a class or an instance as a :attr:`spec` or :attr:" "`spec_set` are able to pass :func:`isinstance` tests:" msgstr "" -#: ../../library/unittest.mock.rst:768 +#: ../../library/unittest.mock.rst:765 msgid "" "The :class:`Mock` classes have support for mocking magic methods. See :ref:" "`magic methods ` for the full details." msgstr "" -#: ../../library/unittest.mock.rst:771 +#: ../../library/unittest.mock.rst:768 msgid "" "The mock classes and the :func:`patch` decorators all take arbitrary keyword " "arguments for configuration. For the :func:`patch` decorators the keywords " @@ -617,14 +613,14 @@ msgid "" "arguments are for configuring attributes of the mock:" msgstr "" -#: ../../library/unittest.mock.rst:782 +#: ../../library/unittest.mock.rst:779 msgid "" "The return value and side effect of child mocks can be set in the same way, " "using dotted notation. As you can't use dotted names directly in a call you " "have to create a dictionary and unpack it using ``**``:" msgstr "" -#: ../../library/unittest.mock.rst:797 +#: ../../library/unittest.mock.rst:794 msgid "" "A callable mock which was created with a *spec* (or a *spec_set*) will " "introspect the specification object's signature when matching calls to the " @@ -632,7 +628,7 @@ msgid "" "whether they were passed positionally or by name::" msgstr "" -#: ../../library/unittest.mock.rst:810 +#: ../../library/unittest.mock.rst:807 msgid "" "This applies to :meth:`~Mock.assert_called_with`, :meth:`~Mock." "assert_called_once_with`, :meth:`~Mock.assert_has_calls` and :meth:`~Mock." @@ -640,76 +636,76 @@ msgid "" "calls on the mock object." msgstr "" -#: ../../library/unittest.mock.rst:815 +#: ../../library/unittest.mock.rst:812 msgid "Added signature introspection on specced and autospecced mock objects." msgstr "" -#: ../../library/unittest.mock.rst:821 +#: ../../library/unittest.mock.rst:818 msgid "" "A mock intended to be used as a property, or other descriptor, on a class. :" "class:`PropertyMock` provides :meth:`__get__` and :meth:`__set__` methods so " "you can specify a return value when it is fetched." msgstr "" -#: ../../library/unittest.mock.rst:825 +#: ../../library/unittest.mock.rst:822 msgid "" "Fetching a :class:`PropertyMock` instance from an object calls the mock, " "with no args. Setting it calls the mock with the value being set. ::" msgstr "" -#: ../../library/unittest.mock.rst:846 +#: ../../library/unittest.mock.rst:843 msgid "" "Because of the way mock attributes are stored you can't directly attach a :" "class:`PropertyMock` to a mock object. Instead you can attach it to the mock " "type object::" msgstr "" -#: ../../library/unittest.mock.rst:860 +#: ../../library/unittest.mock.rst:857 msgid "" "An asynchronous version of :class:`MagicMock`. The :class:`AsyncMock` object " "will behave so the object is recognized as an async function, and the result " "of a call is an awaitable." msgstr "" -#: ../../library/unittest.mock.rst:870 +#: ../../library/unittest.mock.rst:867 msgid "" "The result of ``mock()`` is an async function which will have the outcome of " "``side_effect`` or ``return_value`` after it has been awaited:" msgstr "" -#: ../../library/unittest.mock.rst:873 +#: ../../library/unittest.mock.rst:870 msgid "" "if ``side_effect`` is a function, the async function will return the result " "of that function," msgstr "" -#: ../../library/unittest.mock.rst:875 +#: ../../library/unittest.mock.rst:872 msgid "" "if ``side_effect`` is an exception, the async function will raise the " "exception," msgstr "" -#: ../../library/unittest.mock.rst:877 +#: ../../library/unittest.mock.rst:874 msgid "" "if ``side_effect`` is an iterable, the async function will return the next " "value of the iterable, however, if the sequence of result is exhausted, " "``StopAsyncIteration`` is raised immediately," msgstr "" -#: ../../library/unittest.mock.rst:880 +#: ../../library/unittest.mock.rst:877 msgid "" "if ``side_effect`` is not defined, the async function will return the value " "defined by ``return_value``, hence, by default, the async function returns a " "new :class:`AsyncMock` object." msgstr "" -#: ../../library/unittest.mock.rst:885 +#: ../../library/unittest.mock.rst:882 msgid "" "Setting the *spec* of a :class:`Mock` or :class:`MagicMock` to an async " "function will result in a coroutine object being returned after calling." msgstr "" -#: ../../library/unittest.mock.rst:897 +#: ../../library/unittest.mock.rst:894 msgid "" "Setting the *spec* of a :class:`Mock`, :class:`MagicMock`, or :class:" "`AsyncMock` to a class with asynchronous and synchronous functions will " @@ -719,82 +715,82 @@ msgid "" "functions will be :class:`AsyncMock`." msgstr "" -#: ../../library/unittest.mock.rst:925 +#: ../../library/unittest.mock.rst:922 msgid "" "Assert that the mock was awaited at least once. Note that this is separate " "from the object having been called, the ``await`` keyword must be used:" msgstr "" -#: ../../library/unittest.mock.rst:944 +#: ../../library/unittest.mock.rst:941 msgid "Assert that the mock was awaited exactly once." msgstr "" -#: ../../library/unittest.mock.rst:960 +#: ../../library/unittest.mock.rst:957 msgid "Assert that the last await was with the specified arguments." msgstr "" -#: ../../library/unittest.mock.rst:977 +#: ../../library/unittest.mock.rst:974 msgid "" "Assert that the mock was awaited exactly once and with the specified " "arguments." msgstr "" -#: ../../library/unittest.mock.rst:994 +#: ../../library/unittest.mock.rst:991 msgid "Assert the mock has ever been awaited with the specified arguments." msgstr "" -#: ../../library/unittest.mock.rst:1010 +#: ../../library/unittest.mock.rst:1007 msgid "" "Assert the mock has been awaited with the specified calls. The :attr:" "`await_args_list` list is checked for the awaits." msgstr "" -#: ../../library/unittest.mock.rst:1013 +#: ../../library/unittest.mock.rst:1010 msgid "" "If *any_order* is false then the awaits must be sequential. There can be " "extra calls before or after the specified awaits." msgstr "" -#: ../../library/unittest.mock.rst:1017 +#: ../../library/unittest.mock.rst:1014 msgid "" "If *any_order* is true then the awaits can be in any order, but they must " "all appear in :attr:`await_args_list`." msgstr "" -#: ../../library/unittest.mock.rst:1037 +#: ../../library/unittest.mock.rst:1034 msgid "Assert that the mock was never awaited." msgstr "" -#: ../../library/unittest.mock.rst:1044 +#: ../../library/unittest.mock.rst:1041 msgid "" "See :func:`Mock.reset_mock`. Also sets :attr:`await_count` to 0, :attr:" "`await_args` to None, and clears the :attr:`await_args_list`." msgstr "" -#: ../../library/unittest.mock.rst:1049 +#: ../../library/unittest.mock.rst:1046 msgid "" "An integer keeping track of how many times the mock object has been awaited." msgstr "" -#: ../../library/unittest.mock.rst:1064 +#: ../../library/unittest.mock.rst:1061 msgid "" "This is either ``None`` (if the mock hasn’t been awaited), or the arguments " "that the mock was last awaited with. Functions the same as :attr:`Mock." "call_args`." msgstr "" -#: ../../library/unittest.mock.rst:1082 +#: ../../library/unittest.mock.rst:1079 msgid "" "This is a list of all the awaits made to the mock object in sequence (so the " "length of the list is the number of times it has been awaited). Before any " "awaits have been made it is an empty list." msgstr "" -#: ../../library/unittest.mock.rst:1101 +#: ../../library/unittest.mock.rst:1098 msgid "Calling" msgstr "" -#: ../../library/unittest.mock.rst:1103 +#: ../../library/unittest.mock.rst:1100 msgid "" "Mock objects are callable. The call will return the value set as the :attr:" "`~Mock.return_value` attribute. The default return value is a new Mock " @@ -803,26 +799,26 @@ msgid "" "returned each time." msgstr "" -#: ../../library/unittest.mock.rst:1109 +#: ../../library/unittest.mock.rst:1106 msgid "" "Calls made to the object will be recorded in the attributes like :attr:" "`~Mock.call_args` and :attr:`~Mock.call_args_list`." msgstr "" -#: ../../library/unittest.mock.rst:1112 +#: ../../library/unittest.mock.rst:1109 msgid "" "If :attr:`~Mock.side_effect` is set then it will be called after the call " "has been recorded, so if :attr:`side_effect` raises an exception the call is " "still recorded." msgstr "" -#: ../../library/unittest.mock.rst:1116 +#: ../../library/unittest.mock.rst:1113 msgid "" "The simplest way to make a mock raise an exception when called is to make :" "attr:`~Mock.side_effect` an exception class or instance:" msgstr "" -#: ../../library/unittest.mock.rst:1134 +#: ../../library/unittest.mock.rst:1131 msgid "" "If :attr:`side_effect` is a function then whatever that function returns is " "what calls to the mock return. The :attr:`side_effect` function is called " @@ -830,7 +826,7 @@ msgid "" "value of the call dynamically, based on the input:" msgstr "" -#: ../../library/unittest.mock.rst:1150 +#: ../../library/unittest.mock.rst:1147 msgid "" "If you want the mock to still return the default return value (a new mock), " "or any set return value, then there are two ways of doing this. Either " @@ -838,36 +834,36 @@ msgid "" "data:`DEFAULT`:" msgstr "" -#: ../../library/unittest.mock.rst:1169 +#: ../../library/unittest.mock.rst:1166 msgid "" "To remove a :attr:`side_effect`, and return to the default behaviour, set " "the :attr:`side_effect` to ``None``:" msgstr "" -#: ../../library/unittest.mock.rst:1183 +#: ../../library/unittest.mock.rst:1180 msgid "" "The :attr:`side_effect` can also be any iterable object. Repeated calls to " "the mock will return values from the iterable (until the iterable is " "exhausted and a :exc:`StopIteration` is raised):" msgstr "" -#: ../../library/unittest.mock.rst:1199 +#: ../../library/unittest.mock.rst:1196 msgid "" "If any members of the iterable are exceptions they will be raised instead of " "returned::" msgstr "" -#: ../../library/unittest.mock.rst:1217 +#: ../../library/unittest.mock.rst:1214 msgid "Deleting Attributes" msgstr "" -#: ../../library/unittest.mock.rst:1219 +#: ../../library/unittest.mock.rst:1216 msgid "" "Mock objects create attributes on demand. This allows them to pretend to be " "objects of any type." msgstr "" -#: ../../library/unittest.mock.rst:1222 +#: ../../library/unittest.mock.rst:1219 msgid "" "You may want a mock object to return ``False`` to a :func:`hasattr` call, or " "raise an :exc:`AttributeError` when an attribute is fetched. You can do this " @@ -875,17 +871,17 @@ msgid "" "convenient." msgstr "" -#: ../../library/unittest.mock.rst:1226 +#: ../../library/unittest.mock.rst:1223 msgid "" "You \"block\" attributes by deleting them. Once deleted, accessing an " "attribute will raise an :exc:`AttributeError`." msgstr "" -#: ../../library/unittest.mock.rst:1243 +#: ../../library/unittest.mock.rst:1240 msgid "Mock names and the name attribute" msgstr "" -#: ../../library/unittest.mock.rst:1245 +#: ../../library/unittest.mock.rst:1242 msgid "" "Since \"name\" is an argument to the :class:`Mock` constructor, if you want " "your mock object to have a \"name\" attribute you can't just pass it in at " @@ -893,17 +889,17 @@ msgid "" "configure_mock`::" msgstr "" -#: ../../library/unittest.mock.rst:1255 +#: ../../library/unittest.mock.rst:1252 msgid "" "A simpler option is to simply set the \"name\" attribute after mock " "creation::" msgstr "" -#: ../../library/unittest.mock.rst:1262 +#: ../../library/unittest.mock.rst:1259 msgid "Attaching Mocks as Attributes" msgstr "" -#: ../../library/unittest.mock.rst:1264 +#: ../../library/unittest.mock.rst:1261 msgid "" "When you attach a mock as an attribute of another mock (or as the return " "value) it becomes a \"child\" of that mock. Calls to the child are recorded " @@ -914,20 +910,20 @@ msgid "" "calls between mocks:" msgstr "" -#: ../../library/unittest.mock.rst:1282 +#: ../../library/unittest.mock.rst:1279 msgid "" "The exception to this is if the mock has a name. This allows you to prevent " "the \"parenting\" if for some reason you don't want it to happen." msgstr "" -#: ../../library/unittest.mock.rst:1293 +#: ../../library/unittest.mock.rst:1290 msgid "" "Mocks created for you by :func:`patch` are automatically given names. To " "attach mocks that have names to a parent you use the :meth:`~Mock." "attach_mock` method::" msgstr "" -#: ../../library/unittest.mock.rst:1311 +#: ../../library/unittest.mock.rst:1308 msgid "" "The only exceptions are magic methods and attributes (those that have " "leading and trailing double underscores). Mock doesn't create these but " @@ -937,11 +933,11 @@ msgid "" "support see :ref:`magic methods `." msgstr "" -#: ../../library/unittest.mock.rst:1320 +#: ../../library/unittest.mock.rst:1317 msgid "The patchers" msgstr "" -#: ../../library/unittest.mock.rst:1322 +#: ../../library/unittest.mock.rst:1319 msgid "" "The patch decorators are used for patching objects only within the scope of " "the function they decorate. They automatically handle the unpatching for " @@ -949,17 +945,17 @@ msgid "" "in with statements or as class decorators." msgstr "" -#: ../../library/unittest.mock.rst:1329 +#: ../../library/unittest.mock.rst:1326 msgid "patch" msgstr "" -#: ../../library/unittest.mock.rst:1333 +#: ../../library/unittest.mock.rst:1330 msgid "" "The key is to do the patching in the right namespace. See the section `where " "to patch`_." msgstr "" -#: ../../library/unittest.mock.rst:1337 +#: ../../library/unittest.mock.rst:1334 msgid "" ":func:`patch` acts as a function decorator, class decorator or a context " "manager. Inside the body of the function or with statement, the *target* is " @@ -967,7 +963,7 @@ msgid "" "patch is undone." msgstr "" -#: ../../library/unittest.mock.rst:1342 +#: ../../library/unittest.mock.rst:1339 msgid "" "If *new* is omitted, then the target is replaced with an :class:`AsyncMock` " "if the patched object is an async function or a :class:`MagicMock` " @@ -977,7 +973,7 @@ msgid "" "by the context manager." msgstr "" -#: ../../library/unittest.mock.rst:1350 +#: ../../library/unittest.mock.rst:1347 msgid "" "*target* should be a string in the form ``'package.module.ClassName'``. The " "*target* is imported and the specified object replaced with the *new* " @@ -986,26 +982,26 @@ msgid "" "function is executed, not at decoration time." msgstr "" -#: ../../library/unittest.mock.rst:1356 +#: ../../library/unittest.mock.rst:1353 msgid "" "The *spec* and *spec_set* keyword arguments are passed to the :class:" "`MagicMock` if patch is creating one for you." msgstr "" -#: ../../library/unittest.mock.rst:1359 +#: ../../library/unittest.mock.rst:1356 msgid "" "In addition you can pass ``spec=True`` or ``spec_set=True``, which causes " "patch to pass in the object being mocked as the spec/spec_set object." msgstr "" -#: ../../library/unittest.mock.rst:1362 +#: ../../library/unittest.mock.rst:1359 msgid "" "*new_callable* allows you to specify a different class, or callable object, " "that will be called to create the *new* object. By default :class:" "`AsyncMock` is used for async functions and :class:`MagicMock` for the rest." msgstr "" -#: ../../library/unittest.mock.rst:1366 +#: ../../library/unittest.mock.rst:1363 msgid "" "A more powerful form of *spec* is *autospec*. If you set ``autospec=True`` " "then the mock will be created with a spec from the object being replaced. " @@ -1017,13 +1013,13 @@ msgid "" "func:`create_autospec` function and :ref:`auto-speccing`." msgstr "" -#: ../../library/unittest.mock.rst:1376 +#: ../../library/unittest.mock.rst:1373 msgid "" "Instead of ``autospec=True`` you can pass ``autospec=some_object`` to use an " "arbitrary object as the spec instead of the one being replaced." msgstr "" -#: ../../library/unittest.mock.rst:1379 +#: ../../library/unittest.mock.rst:1376 msgid "" "By default :func:`patch` will fail to replace attributes that don't exist. " "If you pass in ``create=True``, and the attribute doesn't exist, patch will " @@ -1034,13 +1030,13 @@ msgid "" "write passing tests against APIs that don't actually exist!" msgstr "" -#: ../../library/unittest.mock.rst:1389 +#: ../../library/unittest.mock.rst:1386 msgid "" "If you are patching builtins in a module then you don't need to pass " "``create=True``, it will be added by default." msgstr "" -#: ../../library/unittest.mock.rst:1393 +#: ../../library/unittest.mock.rst:1390 msgid "" "Patch can be used as a :class:`TestCase` class decorator. It works by " "decorating each test method in the class. This reduces the boilerplate code " @@ -1051,7 +1047,7 @@ msgid "" "TEST_PREFIX``." msgstr "" -#: ../../library/unittest.mock.rst:1400 +#: ../../library/unittest.mock.rst:1397 msgid "" "Patch can be used as a context manager, with the with statement. Here the " "patching applies to the indented block after the with statement. If you use " @@ -1059,65 +1055,65 @@ msgid "" "very useful if :func:`patch` is creating a mock object for you." msgstr "" -#: ../../library/unittest.mock.rst:1405 +#: ../../library/unittest.mock.rst:1402 msgid "" ":func:`patch` takes arbitrary keyword arguments. These will be passed to :" "class:`AsyncMock` if the patched object is asynchronous, to :class:" "`MagicMock` otherwise or to *new_callable* if specified." msgstr "" -#: ../../library/unittest.mock.rst:1409 +#: ../../library/unittest.mock.rst:1406 msgid "" "``patch.dict(...)``, ``patch.multiple(...)`` and ``patch.object(...)`` are " "available for alternate use-cases." msgstr "" -#: ../../library/unittest.mock.rst:1412 +#: ../../library/unittest.mock.rst:1409 msgid "" ":func:`patch` as function decorator, creating the mock for you and passing " "it into the decorated function::" msgstr "" -#: ../../library/unittest.mock.rst:1422 +#: ../../library/unittest.mock.rst:1419 msgid "" "Patching a class replaces the class with a :class:`MagicMock` *instance*. If " "the class is instantiated in the code under test then it will be the :attr:" "`~Mock.return_value` of the mock that will be used." msgstr "" -#: ../../library/unittest.mock.rst:1426 +#: ../../library/unittest.mock.rst:1423 msgid "" "If the class is instantiated multiple times you could use :attr:`~Mock." "side_effect` to return a new mock each time. Alternatively you can set the " "*return_value* to be anything you want." msgstr "" -#: ../../library/unittest.mock.rst:1430 +#: ../../library/unittest.mock.rst:1427 msgid "" "To configure return values on methods of *instances* on the patched class " "you must do this on the :attr:`return_value`. For example::" msgstr "" -#: ../../library/unittest.mock.rst:1444 +#: ../../library/unittest.mock.rst:1441 msgid "" "If you use *spec* or *spec_set* and :func:`patch` is replacing a *class*, " "then the return value of the created mock will have the same spec. ::" msgstr "" -#: ../../library/unittest.mock.rst:1454 +#: ../../library/unittest.mock.rst:1451 msgid "" "The *new_callable* argument is useful where you want to use an alternative " "class to the default :class:`MagicMock` for the created mock. For example, " "if you wanted a :class:`NonCallableMock` to be used::" msgstr "" -#: ../../library/unittest.mock.rst:1467 +#: ../../library/unittest.mock.rst:1464 msgid "" "Another use case might be to replace an object with an :class:`io.StringIO` " "instance::" msgstr "" -#: ../../library/unittest.mock.rst:1480 +#: ../../library/unittest.mock.rst:1477 msgid "" "When :func:`patch` is creating a mock for you, it is common that the first " "thing you need to do is to configure the mock. Some of that configuration " @@ -1125,7 +1121,7 @@ msgid "" "call will be used to set attributes on the created mock::" msgstr "" -#: ../../library/unittest.mock.rst:1492 +#: ../../library/unittest.mock.rst:1489 msgid "" "As well as attributes on the created mock attributes, like the :attr:`~Mock." "return_value` and :attr:`~Mock.side_effect`, of child mocks can also be " @@ -1134,36 +1130,36 @@ msgid "" "func:`patch` call using ``**``::" msgstr "" -#: ../../library/unittest.mock.rst:1508 +#: ../../library/unittest.mock.rst:1505 msgid "" "By default, attempting to patch a function in a module (or a method or an " "attribute in a class) that does not exist will fail with :exc:" "`AttributeError`::" msgstr "" -#: ../../library/unittest.mock.rst:1520 +#: ../../library/unittest.mock.rst:1517 msgid "" "but adding ``create=True`` in the call to :func:`patch` will make the " "previous example work as expected::" msgstr "" -#: ../../library/unittest.mock.rst:1531 +#: ../../library/unittest.mock.rst:1528 msgid "" ":func:`patch` now returns an :class:`AsyncMock` if the target is an async " "function." msgstr "" -#: ../../library/unittest.mock.rst:1535 +#: ../../library/unittest.mock.rst:1532 msgid "patch.object" msgstr "" -#: ../../library/unittest.mock.rst:1539 +#: ../../library/unittest.mock.rst:1536 msgid "" "patch the named member (*attribute*) on an object (*target*) with a mock " "object." msgstr "" -#: ../../library/unittest.mock.rst:1542 +#: ../../library/unittest.mock.rst:1539 msgid "" ":func:`patch.object` can be used as a decorator, class decorator or a " "context manager. Arguments *new*, *spec*, *create*, *spec_set*, *autospec* " @@ -1172,112 +1168,112 @@ msgid "" "configuring the mock object it creates." msgstr "" -#: ../../library/unittest.mock.rst:1548 +#: ../../library/unittest.mock.rst:1545 msgid "" "When used as a class decorator :func:`patch.object` honours ``patch." "TEST_PREFIX`` for choosing which methods to wrap." msgstr "" -#: ../../library/unittest.mock.rst:1551 +#: ../../library/unittest.mock.rst:1548 msgid "" "You can either call :func:`patch.object` with three arguments or two " "arguments. The three argument form takes the object to be patched, the " "attribute name and the object to replace the attribute with." msgstr "" -#: ../../library/unittest.mock.rst:1555 +#: ../../library/unittest.mock.rst:1552 msgid "" "When calling with the two argument form you omit the replacement object, and " "a mock is created for you and passed in as an extra argument to the " "decorated function:" msgstr "" -#: ../../library/unittest.mock.rst:1566 +#: ../../library/unittest.mock.rst:1563 msgid "" "*spec*, *create* and the other arguments to :func:`patch.object` have the " "same meaning as they do for :func:`patch`." msgstr "" -#: ../../library/unittest.mock.rst:1571 +#: ../../library/unittest.mock.rst:1568 msgid "patch.dict" msgstr "" -#: ../../library/unittest.mock.rst:1575 +#: ../../library/unittest.mock.rst:1572 msgid "" "Patch a dictionary, or dictionary like object, and restore the dictionary to " "its original state after the test." msgstr "" -#: ../../library/unittest.mock.rst:1578 +#: ../../library/unittest.mock.rst:1575 msgid "" "*in_dict* can be a dictionary or a mapping like container. If it is a " "mapping then it must at least support getting, setting and deleting items " "plus iterating over keys." msgstr "" -#: ../../library/unittest.mock.rst:1582 +#: ../../library/unittest.mock.rst:1579 msgid "" "*in_dict* can also be a string specifying the name of the dictionary, which " "will then be fetched by importing it." msgstr "" -#: ../../library/unittest.mock.rst:1585 +#: ../../library/unittest.mock.rst:1582 msgid "" "*values* can be a dictionary of values to set in the dictionary. *values* " "can also be an iterable of ``(key, value)`` pairs." msgstr "" -#: ../../library/unittest.mock.rst:1588 +#: ../../library/unittest.mock.rst:1585 msgid "" "If *clear* is true then the dictionary will be cleared before the new values " "are set." msgstr "" -#: ../../library/unittest.mock.rst:1591 +#: ../../library/unittest.mock.rst:1588 msgid "" ":func:`patch.dict` can also be called with arbitrary keyword arguments to " "set values in the dictionary." msgstr "" -#: ../../library/unittest.mock.rst:1596 +#: ../../library/unittest.mock.rst:1593 msgid "" ":func:`patch.dict` now returns the patched dictionary when used as a context " "manager." msgstr "" -#: ../../library/unittest.mock.rst:1599 +#: ../../library/unittest.mock.rst:1596 msgid "" ":func:`patch.dict` can be used as a context manager, decorator or class " "decorator:" msgstr "" -#: ../../library/unittest.mock.rst:1609 +#: ../../library/unittest.mock.rst:1606 msgid "" "When used as a class decorator :func:`patch.dict` honours ``patch." "TEST_PREFIX`` (default to ``'test'``) for choosing which methods to wrap:" msgstr "" -#: ../../library/unittest.mock.rst:1620 +#: ../../library/unittest.mock.rst:1617 msgid "" "If you want to use a different prefix for your test, you can inform the " "patchers of the different prefix by setting ``patch.TEST_PREFIX``. For more " "details about how to change the value of see :ref:`test-prefix`." msgstr "" -#: ../../library/unittest.mock.rst:1624 +#: ../../library/unittest.mock.rst:1621 msgid "" ":func:`patch.dict` can be used to add members to a dictionary, or simply let " "a test change a dictionary, and ensure the dictionary is restored when the " "test ends." msgstr "" -#: ../../library/unittest.mock.rst:1645 +#: ../../library/unittest.mock.rst:1642 msgid "" "Keywords can be used in the :func:`patch.dict` call to set values in the " "dictionary:" msgstr "" -#: ../../library/unittest.mock.rst:1655 +#: ../../library/unittest.mock.rst:1652 msgid "" ":func:`patch.dict` can be used with dictionary like objects that aren't " "actually dictionaries. At the very minimum they must support item getting, " @@ -1286,18 +1282,18 @@ msgid "" "`__delitem__` and either :meth:`__iter__` or :meth:`__contains__`." msgstr "" -#: ../../library/unittest.mock.rst:1684 +#: ../../library/unittest.mock.rst:1681 msgid "patch.multiple" msgstr "" -#: ../../library/unittest.mock.rst:1688 +#: ../../library/unittest.mock.rst:1685 msgid "" "Perform multiple patches in a single call. It takes the object to be patched " "(either as an object or a string to fetch the object by importing) and " "keyword arguments for the patches::" msgstr "" -#: ../../library/unittest.mock.rst:1695 +#: ../../library/unittest.mock.rst:1692 msgid "" "Use :data:`DEFAULT` as the value if you want :func:`patch.multiple` to " "create mocks for you. In this case the created mocks are passed into a " @@ -1305,7 +1301,7 @@ msgid "" "`patch.multiple` is used as a context manager." msgstr "" -#: ../../library/unittest.mock.rst:1700 +#: ../../library/unittest.mock.rst:1697 msgid "" ":func:`patch.multiple` can be used as a decorator, class decorator or a " "context manager. The arguments *spec*, *spec_set*, *create*, *autospec* and " @@ -1313,13 +1309,13 @@ msgid "" "will be applied to *all* patches done by :func:`patch.multiple`." msgstr "" -#: ../../library/unittest.mock.rst:1705 +#: ../../library/unittest.mock.rst:1702 msgid "" "When used as a class decorator :func:`patch.multiple` honours ``patch." "TEST_PREFIX`` for choosing which methods to wrap." msgstr "" -#: ../../library/unittest.mock.rst:1708 +#: ../../library/unittest.mock.rst:1705 msgid "" "If you want :func:`patch.multiple` to create mocks for you, then you can " "use :data:`DEFAULT` as the value. If you use :func:`patch.multiple` as a " @@ -1327,32 +1323,32 @@ msgid "" "keyword. ::" msgstr "" -#: ../../library/unittest.mock.rst:1722 +#: ../../library/unittest.mock.rst:1719 msgid "" ":func:`patch.multiple` can be nested with other ``patch`` decorators, but " "put arguments passed by keyword *after* any of the standard arguments " "created by :func:`patch`::" msgstr "" -#: ../../library/unittest.mock.rst:1734 +#: ../../library/unittest.mock.rst:1731 msgid "" "If :func:`patch.multiple` is used as a context manager, the value returned " "by the context manager is a dictionary where created mocks are keyed by " "name::" msgstr "" -#: ../../library/unittest.mock.rst:1748 +#: ../../library/unittest.mock.rst:1745 msgid "patch methods: start and stop" msgstr "" -#: ../../library/unittest.mock.rst:1750 +#: ../../library/unittest.mock.rst:1747 msgid "" "All the patchers have :meth:`start` and :meth:`stop` methods. These make it " "simpler to do patching in ``setUp`` methods or where you want to do multiple " "patches without nesting decorators or with statements." msgstr "" -#: ../../library/unittest.mock.rst:1754 +#: ../../library/unittest.mock.rst:1751 msgid "" "To use them call :func:`patch`, :func:`patch.object` or :func:`patch.dict` " "as normal and keep a reference to the returned ``patcher`` object. You can " @@ -1360,19 +1356,19 @@ msgid "" "it." msgstr "" -#: ../../library/unittest.mock.rst:1758 +#: ../../library/unittest.mock.rst:1755 msgid "" "If you are using :func:`patch` to create a mock for you then it will be " "returned by the call to ``patcher.start``. ::" msgstr "" -#: ../../library/unittest.mock.rst:1772 +#: ../../library/unittest.mock.rst:1769 msgid "" "A typical use case for this might be for doing multiple patches in the " "``setUp`` method of a :class:`TestCase`::" msgstr "" -#: ../../library/unittest.mock.rst:1794 +#: ../../library/unittest.mock.rst:1791 msgid "" "If you use this technique you must ensure that the patching is \"undone\" by " "calling ``stop``. This can be fiddlier than you might think, because if an " @@ -1380,37 +1376,37 @@ msgid "" "`unittest.TestCase.addCleanup` makes this easier::" msgstr "" -#: ../../library/unittest.mock.rst:1809 +#: ../../library/unittest.mock.rst:1806 msgid "" "As an added bonus you no longer need to keep a reference to the ``patcher`` " "object." msgstr "" -#: ../../library/unittest.mock.rst:1812 +#: ../../library/unittest.mock.rst:1809 msgid "" "It is also possible to stop all patches which have been started by using :" "func:`patch.stopall`." msgstr "" -#: ../../library/unittest.mock.rst:1817 +#: ../../library/unittest.mock.rst:1814 msgid "Stop all active patches. Only stops patches started with ``start``." msgstr "" -#: ../../library/unittest.mock.rst:1823 +#: ../../library/unittest.mock.rst:1820 msgid "patch builtins" msgstr "" -#: ../../library/unittest.mock.rst:1824 +#: ../../library/unittest.mock.rst:1821 msgid "" "You can patch any builtins within a module. The following example patches " "builtin :func:`ord`::" msgstr "" -#: ../../library/unittest.mock.rst:1839 +#: ../../library/unittest.mock.rst:1836 msgid "TEST_PREFIX" msgstr "" -#: ../../library/unittest.mock.rst:1841 +#: ../../library/unittest.mock.rst:1838 msgid "" "All of the patchers can be used as class decorators. When used in this way " "they wrap every test method on the class. The patchers recognise methods " @@ -1418,39 +1414,39 @@ msgid "" "the :class:`unittest.TestLoader` finds test methods by default." msgstr "" -#: ../../library/unittest.mock.rst:1846 +#: ../../library/unittest.mock.rst:1843 msgid "" "It is possible that you want to use a different prefix for your tests. You " "can inform the patchers of the different prefix by setting ``patch." "TEST_PREFIX``::" msgstr "" -#: ../../library/unittest.mock.rst:1869 +#: ../../library/unittest.mock.rst:1866 msgid "Nesting Patch Decorators" msgstr "" -#: ../../library/unittest.mock.rst:1871 +#: ../../library/unittest.mock.rst:1868 msgid "" "If you want to perform multiple patches then you can simply stack up the " "decorators." msgstr "" -#: ../../library/unittest.mock.rst:1874 +#: ../../library/unittest.mock.rst:1871 msgid "You can stack up multiple patch decorators using this pattern:" msgstr "" -#: ../../library/unittest.mock.rst:1890 +#: ../../library/unittest.mock.rst:1887 msgid "" "Note that the decorators are applied from the bottom upwards. This is the " "standard way that Python applies decorators. The order of the created mocks " "passed into your test function matches this order." msgstr "" -#: ../../library/unittest.mock.rst:1898 +#: ../../library/unittest.mock.rst:1895 msgid "Where to patch" msgstr "" -#: ../../library/unittest.mock.rst:1900 +#: ../../library/unittest.mock.rst:1897 msgid "" ":func:`patch` works by (temporarily) changing the object that a *name* " "points to with another one. There can be many names pointing to any " @@ -1458,19 +1454,19 @@ msgid "" "the name used by the system under test." msgstr "" -#: ../../library/unittest.mock.rst:1905 +#: ../../library/unittest.mock.rst:1902 msgid "" "The basic principle is that you patch where an object is *looked up*, which " "is not necessarily the same place as where it is defined. A couple of " "examples will help to clarify this." msgstr "" -#: ../../library/unittest.mock.rst:1909 +#: ../../library/unittest.mock.rst:1906 msgid "" "Imagine we have a project that we want to test with the following structure::" msgstr "" -#: ../../library/unittest.mock.rst:1918 +#: ../../library/unittest.mock.rst:1915 msgid "" "Now we want to test ``some_function`` but we want to mock out ``SomeClass`` " "using :func:`patch`. The problem is that when we import module b, which we " @@ -1480,7 +1476,7 @@ msgid "" "like our patching had no effect." msgstr "" -#: ../../library/unittest.mock.rst:1925 +#: ../../library/unittest.mock.rst:1922 msgid "" "The key is to patch out ``SomeClass`` where it is used (or where it is " "looked up). In this case ``some_function`` will actually look up " @@ -1488,7 +1484,7 @@ msgid "" "look like::" msgstr "" -#: ../../library/unittest.mock.rst:1931 +#: ../../library/unittest.mock.rst:1928 msgid "" "However, consider the alternative scenario where instead of ``from a import " "SomeClass`` module b does ``import a`` and ``some_function`` uses ``a." @@ -1497,11 +1493,11 @@ msgid "" "``a.SomeClass`` instead::" msgstr "" -#: ../../library/unittest.mock.rst:1940 +#: ../../library/unittest.mock.rst:1937 msgid "Patching Descriptors and Proxy Objects" msgstr "" -#: ../../library/unittest.mock.rst:1942 +#: ../../library/unittest.mock.rst:1939 msgid "" "Both patch_ and patch.object_ correctly patch and restore descriptors: class " "methods, static methods and properties. You should patch these on the " @@ -1510,22 +1506,22 @@ msgid "" "voidspace.org.uk/python/weblog/arch_d7_2010_12_04.shtml#e1198>`_." msgstr "" -#: ../../library/unittest.mock.rst:1950 +#: ../../library/unittest.mock.rst:1947 msgid "MagicMock and magic method support" msgstr "" -#: ../../library/unittest.mock.rst:1955 +#: ../../library/unittest.mock.rst:1952 msgid "Mocking Magic Methods" msgstr "" -#: ../../library/unittest.mock.rst:1957 +#: ../../library/unittest.mock.rst:1954 msgid "" ":class:`Mock` supports mocking the Python protocol methods, also known as " "\"magic methods\". This allows mock objects to replace containers or other " "objects that implement Python protocols." msgstr "" -#: ../../library/unittest.mock.rst:1961 +#: ../../library/unittest.mock.rst:1958 msgid "" "Because magic methods are looked up differently from normal methods [#]_, " "this support has been specially implemented. This means that only specific " @@ -1533,72 +1529,72 @@ msgid "" "them. If there are any missing that you need please let us know." msgstr "" -#: ../../library/unittest.mock.rst:1966 +#: ../../library/unittest.mock.rst:1963 msgid "" "You mock magic methods by setting the method you are interested in to a " "function or a mock instance. If you are using a function then it *must* take " "``self`` as the first argument [#]_." msgstr "" -#: ../../library/unittest.mock.rst:1989 +#: ../../library/unittest.mock.rst:1986 msgid "" "One use case for this is for mocking objects used as context managers in a :" "keyword:`with` statement:" msgstr "" -#: ../../library/unittest.mock.rst:2001 +#: ../../library/unittest.mock.rst:1998 msgid "" "Calls to magic methods do not appear in :attr:`~Mock.method_calls`, but they " "are recorded in :attr:`~Mock.mock_calls`." msgstr "" -#: ../../library/unittest.mock.rst:2006 +#: ../../library/unittest.mock.rst:2003 msgid "" "If you use the *spec* keyword argument to create a mock then attempting to " "set a magic method that isn't in the spec will raise an :exc:" "`AttributeError`." msgstr "" -#: ../../library/unittest.mock.rst:2009 +#: ../../library/unittest.mock.rst:2006 msgid "The full list of supported magic methods is:" msgstr "" -#: ../../library/unittest.mock.rst:2011 +#: ../../library/unittest.mock.rst:2008 msgid "``__hash__``, ``__sizeof__``, ``__repr__`` and ``__str__``" msgstr "" -#: ../../library/unittest.mock.rst:2012 +#: ../../library/unittest.mock.rst:2009 msgid "``__dir__``, ``__format__`` and ``__subclasses__``" msgstr "" -#: ../../library/unittest.mock.rst:2013 +#: ../../library/unittest.mock.rst:2010 msgid "``__round__``, ``__floor__``, ``__trunc__`` and ``__ceil__``" msgstr "" -#: ../../library/unittest.mock.rst:2014 +#: ../../library/unittest.mock.rst:2011 msgid "" "Comparisons: ``__lt__``, ``__gt__``, ``__le__``, ``__ge__``, ``__eq__`` and " "``__ne__``" msgstr "" -#: ../../library/unittest.mock.rst:2016 +#: ../../library/unittest.mock.rst:2013 msgid "" "Container methods: ``__getitem__``, ``__setitem__``, ``__delitem__``, " "``__contains__``, ``__len__``, ``__iter__``, ``__reversed__`` and " "``__missing__``" msgstr "" -#: ../../library/unittest.mock.rst:2019 +#: ../../library/unittest.mock.rst:2016 msgid "" "Context manager: ``__enter__``, ``__exit__``, ``__aenter__`` and " "``__aexit__``" msgstr "" -#: ../../library/unittest.mock.rst:2020 +#: ../../library/unittest.mock.rst:2017 msgid "Unary numeric methods: ``__neg__``, ``__pos__`` and ``__invert__``" msgstr "" -#: ../../library/unittest.mock.rst:2021 +#: ../../library/unittest.mock.rst:2018 msgid "" "The numeric methods (including right hand and in-place variants): " "``__add__``, ``__sub__``, ``__mul__``, ``__matmul__``, ``__div__``, " @@ -1607,100 +1603,100 @@ msgid "" "``__pow__``" msgstr "" -#: ../../library/unittest.mock.rst:2025 +#: ../../library/unittest.mock.rst:2022 msgid "" "Numeric conversion methods: ``__complex__``, ``__int__``, ``__float__`` and " "``__index__``" msgstr "" -#: ../../library/unittest.mock.rst:2027 +#: ../../library/unittest.mock.rst:2024 msgid "Descriptor methods: ``__get__``, ``__set__`` and ``__delete__``" msgstr "" -#: ../../library/unittest.mock.rst:2028 +#: ../../library/unittest.mock.rst:2025 msgid "" "Pickling: ``__reduce__``, ``__reduce_ex__``, ``__getinitargs__``, " "``__getnewargs__``, ``__getstate__`` and ``__setstate__``" msgstr "" -#: ../../library/unittest.mock.rst:2030 +#: ../../library/unittest.mock.rst:2027 msgid "File system path representation: ``__fspath__``" msgstr "" -#: ../../library/unittest.mock.rst:2031 +#: ../../library/unittest.mock.rst:2028 msgid "Asynchronous iteration methods: ``__aiter__`` and ``__anext__``" msgstr "" -#: ../../library/unittest.mock.rst:2033 +#: ../../library/unittest.mock.rst:2030 msgid "Added support for :func:`os.PathLike.__fspath__`." msgstr "" -#: ../../library/unittest.mock.rst:2036 +#: ../../library/unittest.mock.rst:2033 msgid "" "Added support for ``__aenter__``, ``__aexit__``, ``__aiter__`` and " "``__anext__``." msgstr "" -#: ../../library/unittest.mock.rst:2040 +#: ../../library/unittest.mock.rst:2037 msgid "" "The following methods exist but are *not* supported as they are either in " "use by mock, can't be set dynamically, or can cause problems:" msgstr "" -#: ../../library/unittest.mock.rst:2043 +#: ../../library/unittest.mock.rst:2040 msgid "``__getattr__``, ``__setattr__``, ``__init__`` and ``__new__``" msgstr "" -#: ../../library/unittest.mock.rst:2044 +#: ../../library/unittest.mock.rst:2041 msgid "" "``__prepare__``, ``__instancecheck__``, ``__subclasscheck__``, ``__del__``" msgstr "" -#: ../../library/unittest.mock.rst:2049 +#: ../../library/unittest.mock.rst:2046 msgid "Magic Mock" msgstr "" -#: ../../library/unittest.mock.rst:2051 +#: ../../library/unittest.mock.rst:2048 msgid "" "There are two ``MagicMock`` variants: :class:`MagicMock` and :class:" "`NonCallableMagicMock`." msgstr "" -#: ../../library/unittest.mock.rst:2056 +#: ../../library/unittest.mock.rst:2053 msgid "" "``MagicMock`` is a subclass of :class:`Mock` with default implementations of " "most of the magic methods. You can use ``MagicMock`` without having to " "configure the magic methods yourself." msgstr "" -#: ../../library/unittest.mock.rst:2060 +#: ../../library/unittest.mock.rst:2057 msgid "The constructor parameters have the same meaning as for :class:`Mock`." msgstr "" -#: ../../library/unittest.mock.rst:2062 +#: ../../library/unittest.mock.rst:2059 msgid "" "If you use the *spec* or *spec_set* arguments then *only* magic methods that " "exist in the spec will be created." msgstr "" -#: ../../library/unittest.mock.rst:2068 +#: ../../library/unittest.mock.rst:2065 msgid "A non-callable version of :class:`MagicMock`." msgstr "" -#: ../../library/unittest.mock.rst:2070 +#: ../../library/unittest.mock.rst:2067 msgid "" "The constructor parameters have the same meaning as for :class:`MagicMock`, " "with the exception of *return_value* and *side_effect* which have no meaning " "on a non-callable mock." msgstr "" -#: ../../library/unittest.mock.rst:2074 +#: ../../library/unittest.mock.rst:2071 msgid "" "The magic methods are setup with :class:`MagicMock` objects, so you can " "configure them and use them in the usual way:" msgstr "" -#: ../../library/unittest.mock.rst:2084 +#: ../../library/unittest.mock.rst:2081 msgid "" "By default many of the protocol methods are required to return objects of a " "specific type. These methods are preconfigured with a default return value, " @@ -1709,83 +1705,83 @@ msgid "" "manually if you want to change the default." msgstr "" -#: ../../library/unittest.mock.rst:2090 +#: ../../library/unittest.mock.rst:2087 msgid "Methods and their defaults:" msgstr "" -#: ../../library/unittest.mock.rst:2092 +#: ../../library/unittest.mock.rst:2089 msgid "``__lt__``: ``NotImplemented``" msgstr "" -#: ../../library/unittest.mock.rst:2093 +#: ../../library/unittest.mock.rst:2090 msgid "``__gt__``: ``NotImplemented``" msgstr "" -#: ../../library/unittest.mock.rst:2094 +#: ../../library/unittest.mock.rst:2091 msgid "``__le__``: ``NotImplemented``" msgstr "" -#: ../../library/unittest.mock.rst:2095 +#: ../../library/unittest.mock.rst:2092 msgid "``__ge__``: ``NotImplemented``" msgstr "" -#: ../../library/unittest.mock.rst:2096 +#: ../../library/unittest.mock.rst:2093 msgid "``__int__``: ``1``" msgstr "" -#: ../../library/unittest.mock.rst:2097 +#: ../../library/unittest.mock.rst:2094 msgid "``__contains__``: ``False``" msgstr "" -#: ../../library/unittest.mock.rst:2098 +#: ../../library/unittest.mock.rst:2095 msgid "``__len__``: ``0``" msgstr "" -#: ../../library/unittest.mock.rst:2099 +#: ../../library/unittest.mock.rst:2096 msgid "``__iter__``: ``iter([])``" msgstr "" -#: ../../library/unittest.mock.rst:2100 +#: ../../library/unittest.mock.rst:2097 msgid "``__exit__``: ``False``" msgstr "" -#: ../../library/unittest.mock.rst:2101 +#: ../../library/unittest.mock.rst:2098 msgid "``__aexit__``: ``False``" msgstr "" -#: ../../library/unittest.mock.rst:2102 +#: ../../library/unittest.mock.rst:2099 msgid "``__complex__``: ``1j``" msgstr "" -#: ../../library/unittest.mock.rst:2103 +#: ../../library/unittest.mock.rst:2100 msgid "``__float__``: ``1.0``" msgstr "" -#: ../../library/unittest.mock.rst:2104 +#: ../../library/unittest.mock.rst:2101 msgid "``__bool__``: ``True``" msgstr "" -#: ../../library/unittest.mock.rst:2105 +#: ../../library/unittest.mock.rst:2102 msgid "``__index__``: ``1``" msgstr "" -#: ../../library/unittest.mock.rst:2106 +#: ../../library/unittest.mock.rst:2103 msgid "``__hash__``: default hash for the mock" msgstr "" -#: ../../library/unittest.mock.rst:2107 +#: ../../library/unittest.mock.rst:2104 msgid "``__str__``: default str for the mock" msgstr "" -#: ../../library/unittest.mock.rst:2108 +#: ../../library/unittest.mock.rst:2105 msgid "``__sizeof__``: default sizeof for the mock" msgstr "" -#: ../../library/unittest.mock.rst:2110 +#: ../../library/unittest.mock.rst:2107 msgid "For example:" msgstr "" -#: ../../library/unittest.mock.rst:2122 +#: ../../library/unittest.mock.rst:2119 msgid "" "The two equality methods, :meth:`__eq__` and :meth:`__ne__`, are special. " "They do the default equality comparison on identity, using the :attr:`~Mock." @@ -1793,102 +1789,102 @@ msgid "" "something else::" msgstr "" -#: ../../library/unittest.mock.rst:2136 +#: ../../library/unittest.mock.rst:2133 msgid "" "The return value of :meth:`MagicMock.__iter__` can be any iterable object " "and isn't required to be an iterator:" msgstr "" -#: ../../library/unittest.mock.rst:2146 +#: ../../library/unittest.mock.rst:2143 msgid "" "If the return value *is* an iterator, then iterating over it once will " "consume it and subsequent iterations will result in an empty list:" msgstr "" -#: ../../library/unittest.mock.rst:2155 +#: ../../library/unittest.mock.rst:2152 msgid "" "``MagicMock`` has all of the supported magic methods configured except for " "some of the obscure and obsolete ones. You can still set these up if you " "want." msgstr "" -#: ../../library/unittest.mock.rst:2158 +#: ../../library/unittest.mock.rst:2155 msgid "" "Magic methods that are supported but not setup by default in ``MagicMock`` " "are:" msgstr "" -#: ../../library/unittest.mock.rst:2160 +#: ../../library/unittest.mock.rst:2157 msgid "``__subclasses__``" msgstr "" -#: ../../library/unittest.mock.rst:2161 +#: ../../library/unittest.mock.rst:2158 msgid "``__dir__``" msgstr "" -#: ../../library/unittest.mock.rst:2162 +#: ../../library/unittest.mock.rst:2159 msgid "``__format__``" msgstr "" -#: ../../library/unittest.mock.rst:2163 +#: ../../library/unittest.mock.rst:2160 msgid "``__get__``, ``__set__`` and ``__delete__``" msgstr "" -#: ../../library/unittest.mock.rst:2164 +#: ../../library/unittest.mock.rst:2161 msgid "``__reversed__`` and ``__missing__``" msgstr "" -#: ../../library/unittest.mock.rst:2165 +#: ../../library/unittest.mock.rst:2162 msgid "" "``__reduce__``, ``__reduce_ex__``, ``__getinitargs__``, ``__getnewargs__``, " "``__getstate__`` and ``__setstate__``" msgstr "" -#: ../../library/unittest.mock.rst:2167 +#: ../../library/unittest.mock.rst:2164 msgid "``__getformat__`` and ``__setformat__``" msgstr "" -#: ../../library/unittest.mock.rst:2171 +#: ../../library/unittest.mock.rst:2168 msgid "" "Magic methods *should* be looked up on the class rather than the instance. " "Different versions of Python are inconsistent about applying this rule. The " "supported protocol methods should work with all supported versions of Python." msgstr "" -#: ../../library/unittest.mock.rst:2175 +#: ../../library/unittest.mock.rst:2172 msgid "" "The function is basically hooked up to the class, but each ``Mock`` instance " "is kept isolated from the others." msgstr "" -#: ../../library/unittest.mock.rst:2180 +#: ../../library/unittest.mock.rst:2177 msgid "Helpers" msgstr "" -#: ../../library/unittest.mock.rst:2183 +#: ../../library/unittest.mock.rst:2180 msgid "sentinel" msgstr "" -#: ../../library/unittest.mock.rst:2187 +#: ../../library/unittest.mock.rst:2184 msgid "" "The ``sentinel`` object provides a convenient way of providing unique " "objects for your tests." msgstr "" -#: ../../library/unittest.mock.rst:2190 +#: ../../library/unittest.mock.rst:2187 msgid "" "Attributes are created on demand when you access them by name. Accessing the " "same attribute will always return the same object. The objects returned have " "a sensible repr so that test failure messages are readable." msgstr "" -#: ../../library/unittest.mock.rst:2194 +#: ../../library/unittest.mock.rst:2191 msgid "" "The ``sentinel`` attributes now preserve their identity when they are :mod:" "`copied ` or :mod:`pickled `." msgstr "" -#: ../../library/unittest.mock.rst:2198 +#: ../../library/unittest.mock.rst:2195 msgid "" "Sometimes when testing you need to test that a specific object is passed as " "an argument to another method, or returned. It can be common to create named " @@ -1896,28 +1892,28 @@ msgid "" "creating and testing the identity of objects like this." msgstr "" -#: ../../library/unittest.mock.rst:2203 +#: ../../library/unittest.mock.rst:2200 msgid "" "In this example we monkey patch ``method`` to return ``sentinel." "some_object``:" msgstr "" -#: ../../library/unittest.mock.rst:2215 +#: ../../library/unittest.mock.rst:2212 msgid "DEFAULT" msgstr "" -#: ../../library/unittest.mock.rst:2220 +#: ../../library/unittest.mock.rst:2217 msgid "" "The :data:`DEFAULT` object is a pre-created sentinel (actually ``sentinel." "DEFAULT``). It can be used by :attr:`~Mock.side_effect` functions to " "indicate that the normal return value should be used." msgstr "" -#: ../../library/unittest.mock.rst:2226 +#: ../../library/unittest.mock.rst:2223 msgid "call" msgstr "" -#: ../../library/unittest.mock.rst:2230 +#: ../../library/unittest.mock.rst:2227 msgid "" ":func:`call` is a helper object for making simpler assertions, for comparing " "with :attr:`~Mock.call_args`, :attr:`~Mock.call_args_list`, :attr:`~Mock." @@ -1925,13 +1921,13 @@ msgid "" "with :meth:`~Mock.assert_has_calls`." msgstr "" -#: ../../library/unittest.mock.rst:2243 +#: ../../library/unittest.mock.rst:2240 msgid "" "For a call object that represents multiple calls, :meth:`call_list` returns " "a list of all the intermediate calls as well as the final call." msgstr "" -#: ../../library/unittest.mock.rst:2247 +#: ../../library/unittest.mock.rst:2244 msgid "" "``call_list`` is particularly useful for making assertions on \"chained calls" "\". A chained call is multiple calls on a single line of code. This results " @@ -1939,13 +1935,13 @@ msgid "" "constructing the sequence of calls can be tedious." msgstr "" -#: ../../library/unittest.mock.rst:2252 +#: ../../library/unittest.mock.rst:2249 msgid "" ":meth:`~call.call_list` can construct the sequence of calls from the same " "chained call:" msgstr "" -#: ../../library/unittest.mock.rst:2269 +#: ../../library/unittest.mock.rst:2266 msgid "" "A ``call`` object is either a tuple of (positional args, keyword args) or " "(name, positional args, keyword args) depending on how it was constructed. " @@ -1955,7 +1951,7 @@ msgid "" "to get at the individual arguments they contain." msgstr "" -#: ../../library/unittest.mock.rst:2276 +#: ../../library/unittest.mock.rst:2273 msgid "" "The ``call`` objects in :attr:`Mock.call_args` and :attr:`Mock." "call_args_list` are two-tuples of (positional args, keyword args) whereas " @@ -1964,7 +1960,7 @@ msgid "" "args)." msgstr "" -#: ../../library/unittest.mock.rst:2281 +#: ../../library/unittest.mock.rst:2278 msgid "" "You can use their \"tupleness\" to pull out the individual arguments for " "more complex introspection and assertions. The positional arguments are a " @@ -1972,29 +1968,29 @@ msgid "" "arguments are a dictionary:" msgstr "" -#: ../../library/unittest.mock.rst:2314 +#: ../../library/unittest.mock.rst:2311 msgid "create_autospec" msgstr "" -#: ../../library/unittest.mock.rst:2318 +#: ../../library/unittest.mock.rst:2315 msgid "" "Create a mock object using another object as a spec. Attributes on the mock " "will use the corresponding attribute on the *spec* object as their spec." msgstr "" -#: ../../library/unittest.mock.rst:2322 +#: ../../library/unittest.mock.rst:2319 msgid "" "Functions or methods being mocked will have their arguments checked to " "ensure that they are called with the correct signature." msgstr "" -#: ../../library/unittest.mock.rst:2325 +#: ../../library/unittest.mock.rst:2322 msgid "" "If *spec_set* is ``True`` then attempting to set attributes that don't exist " "on the spec object will raise an :exc:`AttributeError`." msgstr "" -#: ../../library/unittest.mock.rst:2328 +#: ../../library/unittest.mock.rst:2325 msgid "" "If a class is used as a spec then the return value of the mock (the instance " "of the class) will have the same spec. You can use a class as the spec for " @@ -2002,29 +1998,29 @@ msgid "" "be callable if instances of the mock are callable." msgstr "" -#: ../../library/unittest.mock.rst:2333 +#: ../../library/unittest.mock.rst:2330 msgid "" ":func:`create_autospec` also takes arbitrary keyword arguments that are " "passed to the constructor of the created mock." msgstr "" -#: ../../library/unittest.mock.rst:2336 +#: ../../library/unittest.mock.rst:2333 msgid "" "See :ref:`auto-speccing` for examples of how to use auto-speccing with :func:" "`create_autospec` and the *autospec* argument to :func:`patch`." msgstr "" -#: ../../library/unittest.mock.rst:2342 +#: ../../library/unittest.mock.rst:2339 msgid "" ":func:`create_autospec` now returns an :class:`AsyncMock` if the target is " "an async function." msgstr "" -#: ../../library/unittest.mock.rst:2347 +#: ../../library/unittest.mock.rst:2344 msgid "ANY" msgstr "" -#: ../../library/unittest.mock.rst:2351 +#: ../../library/unittest.mock.rst:2348 msgid "" "Sometimes you may need to make assertions about *some* of the arguments in a " "call to mock, but either not care about some of the arguments or want to " @@ -2032,24 +2028,24 @@ msgid "" "assertions on them." msgstr "" -#: ../../library/unittest.mock.rst:2356 +#: ../../library/unittest.mock.rst:2353 msgid "" "To ignore certain arguments you can pass in objects that compare equal to " "*everything*. Calls to :meth:`~Mock.assert_called_with` and :meth:`~Mock." "assert_called_once_with` will then succeed no matter what was passed in." msgstr "" -#: ../../library/unittest.mock.rst:2365 +#: ../../library/unittest.mock.rst:2362 msgid "" ":data:`ANY` can also be used in comparisons with call lists like :attr:" "`~Mock.mock_calls`:" msgstr "" -#: ../../library/unittest.mock.rst:2378 +#: ../../library/unittest.mock.rst:2375 msgid "FILTER_DIR" msgstr "" -#: ../../library/unittest.mock.rst:2382 +#: ../../library/unittest.mock.rst:2379 msgid "" ":data:`FILTER_DIR` is a module level variable that controls the way mock " "objects respond to :func:`dir` (only for Python 2.6 or more recent). The " @@ -2058,7 +2054,7 @@ msgid "" "diagnostic purposes, then set ``mock.FILTER_DIR = False``." msgstr "" -#: ../../library/unittest.mock.rst:2388 +#: ../../library/unittest.mock.rst:2385 msgid "" "With filtering on, ``dir(some_mock)`` shows only useful attributes and will " "include any dynamically created attributes that wouldn't normally be shown. " @@ -2067,7 +2063,7 @@ msgid "" "yet:" msgstr "" -#: ../../library/unittest.mock.rst:2415 +#: ../../library/unittest.mock.rst:2412 msgid "" "Many of the not-very-useful (private to :class:`Mock` rather than the thing " "being mocked) underscore and double underscore prefixed attributes have been " @@ -2076,31 +2072,31 @@ msgid "" "switch :data:`FILTER_DIR`:" msgstr "" -#: ../../library/unittest.mock.rst:2436 +#: ../../library/unittest.mock.rst:2433 msgid "" "Alternatively you can just use ``vars(my_mock)`` (instance members) and " "``dir(type(my_mock))`` (type members) to bypass the filtering irrespective " "of :data:`mock.FILTER_DIR`." msgstr "" -#: ../../library/unittest.mock.rst:2442 +#: ../../library/unittest.mock.rst:2439 msgid "mock_open" msgstr "" -#: ../../library/unittest.mock.rst:2446 +#: ../../library/unittest.mock.rst:2443 msgid "" "A helper function to create a mock to replace the use of :func:`open`. It " "works for :func:`open` called directly or used as a context manager." msgstr "" -#: ../../library/unittest.mock.rst:2449 +#: ../../library/unittest.mock.rst:2446 msgid "" "The *mock* argument is the mock object to configure. If ``None`` (the " "default) then a :class:`MagicMock` will be created for you, with the API " "limited to methods or attributes available on standard file handles." msgstr "" -#: ../../library/unittest.mock.rst:2453 +#: ../../library/unittest.mock.rst:2450 msgid "" "*read_data* is a string for the :meth:`~io.IOBase.read`, :meth:`~io.IOBase." "readline`, and :meth:`~io.IOBase.readlines` methods of the file handle to " @@ -2113,51 +2109,51 @@ msgid "" "realistic filesystem for testing." msgstr "" -#: ../../library/unittest.mock.rst:2463 +#: ../../library/unittest.mock.rst:2460 msgid "" "Added :meth:`~io.IOBase.readline` and :meth:`~io.IOBase.readlines` support. " "The mock of :meth:`~io.IOBase.read` changed to consume *read_data* rather " "than returning it on each call." msgstr "" -#: ../../library/unittest.mock.rst:2468 +#: ../../library/unittest.mock.rst:2465 msgid "*read_data* is now reset on each call to the *mock*." msgstr "" -#: ../../library/unittest.mock.rst:2471 +#: ../../library/unittest.mock.rst:2468 msgid "" "Added :meth:`__iter__` to implementation so that iteration (such as in for " "loops) correctly consumes *read_data*." msgstr "" -#: ../../library/unittest.mock.rst:2475 +#: ../../library/unittest.mock.rst:2472 msgid "" "Using :func:`open` as a context manager is a great way to ensure your file " "handles are closed properly and is becoming common::" msgstr "" -#: ../../library/unittest.mock.rst:2481 +#: ../../library/unittest.mock.rst:2478 msgid "" "The issue is that even if you mock out the call to :func:`open` it is the " "*returned object* that is used as a context manager (and has :meth:" "`__enter__` and :meth:`__exit__` called)." msgstr "" -#: ../../library/unittest.mock.rst:2485 +#: ../../library/unittest.mock.rst:2482 msgid "" "Mocking context managers with a :class:`MagicMock` is common enough and " "fiddly enough that a helper function is useful. ::" msgstr "" -#: ../../library/unittest.mock.rst:2502 +#: ../../library/unittest.mock.rst:2499 msgid "And for reading files::" msgstr "" -#: ../../library/unittest.mock.rst:2515 +#: ../../library/unittest.mock.rst:2512 msgid "Autospeccing" msgstr "" -#: ../../library/unittest.mock.rst:2517 +#: ../../library/unittest.mock.rst:2514 msgid "" "Autospeccing is based on the existing :attr:`spec` feature of mock. It " "limits the api of mocks to the api of an original object (the spec), but it " @@ -2167,11 +2163,11 @@ msgid "" "`TypeError` if they are called incorrectly." msgstr "" -#: ../../library/unittest.mock.rst:2524 +#: ../../library/unittest.mock.rst:2521 msgid "Before I explain how auto-speccing works, here's why it is needed." msgstr "" -#: ../../library/unittest.mock.rst:2526 +#: ../../library/unittest.mock.rst:2523 msgid "" ":class:`Mock` is a very powerful and flexible object, but it suffers from " "two flaws when used to mock out objects from a system under test. One of " @@ -2179,25 +2175,25 @@ msgid "" "general problem with using mock objects." msgstr "" -#: ../../library/unittest.mock.rst:2531 +#: ../../library/unittest.mock.rst:2528 msgid "" "First the problem specific to :class:`Mock`. :class:`Mock` has two assert " "methods that are extremely handy: :meth:`~Mock.assert_called_with` and :meth:" "`~Mock.assert_called_once_with`." msgstr "" -#: ../../library/unittest.mock.rst:2544 +#: ../../library/unittest.mock.rst:2541 msgid "" "Because mocks auto-create attributes on demand, and allow you to call them " "with arbitrary arguments, if you misspell one of these assert methods then " "your assertion is gone:" msgstr "" -#: ../../library/unittest.mock.rst:2554 +#: ../../library/unittest.mock.rst:2551 msgid "Your tests can pass silently and incorrectly because of the typo." msgstr "" -#: ../../library/unittest.mock.rst:2556 +#: ../../library/unittest.mock.rst:2553 msgid "" "The second issue is more general to mocking. If you refactor some of your " "code, rename members and so on, any tests for code that is still using the " @@ -2205,7 +2201,7 @@ msgid "" "means your tests can all pass even though your code is broken." msgstr "" -#: ../../library/unittest.mock.rst:2561 +#: ../../library/unittest.mock.rst:2558 msgid "" "Note that this is another reason why you need integration tests as well as " "unit tests. Testing everything in isolation is all fine and dandy, but if " @@ -2213,20 +2209,20 @@ msgid "" "room for bugs that tests might have caught." msgstr "" -#: ../../library/unittest.mock.rst:2566 +#: ../../library/unittest.mock.rst:2563 msgid "" ":mod:`mock` already provides a feature to help with this, called speccing. " "If you use a class or instance as the :attr:`spec` for a mock then you can " "only access attributes on the mock that exist on the real class:" msgstr "" -#: ../../library/unittest.mock.rst:2577 +#: ../../library/unittest.mock.rst:2574 msgid "" "The spec only applies to the mock itself, so we still have the same issue " "with any methods on the mock:" msgstr "" -#: ../../library/unittest.mock.rst:2586 +#: ../../library/unittest.mock.rst:2583 msgid "" "Auto-speccing solves this problem. You can either pass ``autospec=True`` to :" "func:`patch` / :func:`patch.object` or use the :func:`create_autospec` " @@ -2238,24 +2234,24 @@ msgid "" "import modules) without a big performance hit." msgstr "" -#: ../../library/unittest.mock.rst:2595 +#: ../../library/unittest.mock.rst:2592 msgid "Here's an example of it in use::" msgstr "" -#: ../../library/unittest.mock.rst:2605 +#: ../../library/unittest.mock.rst:2602 msgid "" "You can see that :class:`request.Request` has a spec. :class:`request." "Request` takes two arguments in the constructor (one of which is *self*). " "Here's what happens if we try to call it incorrectly::" msgstr "" -#: ../../library/unittest.mock.rst:2614 +#: ../../library/unittest.mock.rst:2611 msgid "" "The spec also applies to instantiated classes (i.e. the return value of " "specced mocks)::" msgstr "" -#: ../../library/unittest.mock.rst:2621 +#: ../../library/unittest.mock.rst:2618 msgid "" ":class:`Request` objects are not callable, so the return value of " "instantiating our mocked out :class:`request.Request` is a non-callable " @@ -2263,20 +2259,20 @@ msgid "" "error::" msgstr "" -#: ../../library/unittest.mock.rst:2633 +#: ../../library/unittest.mock.rst:2630 msgid "" "In many cases you will just be able to add ``autospec=True`` to your " "existing :func:`patch` calls and then be protected against bugs due to typos " "and api changes." msgstr "" -#: ../../library/unittest.mock.rst:2637 +#: ../../library/unittest.mock.rst:2634 msgid "" "As well as using *autospec* through :func:`patch` there is a :func:" "`create_autospec` for creating autospecced mocks directly:" msgstr "" -#: ../../library/unittest.mock.rst:2645 +#: ../../library/unittest.mock.rst:2642 msgid "" "This isn't without caveats and limitations however, which is why it is not " "the default behaviour. In order to know what attributes are available on the " @@ -2288,7 +2284,7 @@ msgid "" "objects so that introspection is safe [#]_." msgstr "" -#: ../../library/unittest.mock.rst:2654 +#: ../../library/unittest.mock.rst:2651 msgid "" "A more serious problem is that it is common for instance attributes to be " "created in the :meth:`__init__` method and not to exist on the class at all. " @@ -2296,7 +2292,7 @@ msgid "" "the api to visible attributes. ::" msgstr "" -#: ../../library/unittest.mock.rst:2671 +#: ../../library/unittest.mock.rst:2668 msgid "" "There are a few different ways of resolving this problem. The easiest, but " "not necessarily the least annoying, way is to simply set the required " @@ -2305,7 +2301,7 @@ msgid "" "setting them::" msgstr "" -#: ../../library/unittest.mock.rst:2682 +#: ../../library/unittest.mock.rst:2679 msgid "" "There is a more aggressive version of both *spec* and *autospec* that *does* " "prevent you setting non-existent attributes. This is useful if you want to " @@ -2313,7 +2309,7 @@ msgid "" "this particular scenario:" msgstr "" -#: ../../library/unittest.mock.rst:2695 +#: ../../library/unittest.mock.rst:2692 msgid "" "Probably the best way of solving the problem is to add class attributes as " "default values for instance members initialised in :meth:`__init__`. Note " @@ -2322,7 +2318,7 @@ msgid "" "faster too. e.g." msgstr "" -#: ../../library/unittest.mock.rst:2705 +#: ../../library/unittest.mock.rst:2702 msgid "" "This brings up another issue. It is relatively common to provide a default " "value of ``None`` for members that will later be an object of a different " @@ -2333,7 +2329,7 @@ msgid "" "These will just be ordinary mocks (well - MagicMocks):" msgstr "" -#: ../../library/unittest.mock.rst:2720 +#: ../../library/unittest.mock.rst:2717 msgid "" "If modifying your production classes to add defaults isn't to your liking " "then there are more options. One of these is simply to use an instance as " @@ -2344,25 +2340,25 @@ msgid "" "alternative object as the *autospec* argument::" msgstr "" -#: ../../library/unittest.mock.rst:2741 +#: ../../library/unittest.mock.rst:2738 msgid "" "This only applies to classes or already instantiated objects. Calling a " "mocked class to create a mock instance *does not* create a real instance. It " "is only attribute lookups - along with calls to :func:`dir` - that are done." msgstr "" -#: ../../library/unittest.mock.rst:2746 +#: ../../library/unittest.mock.rst:2743 msgid "Sealing mocks" msgstr "" -#: ../../library/unittest.mock.rst:2755 +#: ../../library/unittest.mock.rst:2752 msgid "" "Seal will disable the automatic creation of mocks when accessing an " "attribute of the mock being sealed or any of its attributes that are already " "mocks recursively." msgstr "" -#: ../../library/unittest.mock.rst:2758 +#: ../../library/unittest.mock.rst:2755 msgid "" "If a mock instance with a name or a spec is assigned to an attribute it " "won't be considered in the sealing chain. This allows one to prevent seal " diff --git a/library/unittest.po b/library/unittest.po index c70923df5b..b777bf21ab 100644 --- a/library/unittest.po +++ b/library/unittest.po @@ -10,7 +10,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.7\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2021-09-07 06:52+0000\n" +"POT-Creation-Date: 2020-06-20 18:08+0800\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-" @@ -185,8 +185,7 @@ msgid "" "intended largely for ease of use for those new to unit testing. For " "production environments it is recommended that tests be driven by a " "continuous integration system such as `Buildbot `_, " -"`Jenkins `_ or `Travis-CI `_, or " -"`AppVeyor `_." +"`Jenkins `_ or `Hudson `_." msgstr "" #: ../../library/unittest.rst:82 @@ -536,17 +535,14 @@ msgid "" msgstr "" #: ../../library/unittest.rst:332 -msgid "" -"Test discovery supports :term:`namespace packages ` for " -"the start directory. Note that you need to specify the top level directory " -"too (e.g. ``python -m unittest discover -s root/namespace -t root``)." +msgid "Test discovery supports :term:`namespace packages `." msgstr "" -#: ../../library/unittest.rst:342 +#: ../../library/unittest.rst:339 msgid "Organizing test code" msgstr "" -#: ../../library/unittest.rst:344 +#: ../../library/unittest.rst:341 msgid "" "The basic building blocks of unit testing are :dfn:`test cases` --- single " "scenarios that must be set up and checked for correctness. In :mod:" @@ -555,21 +551,21 @@ msgid "" "`TestCase` or use :class:`FunctionTestCase`." msgstr "" -#: ../../library/unittest.rst:350 +#: ../../library/unittest.rst:347 msgid "" "The testing code of a :class:`TestCase` instance should be entirely self " "contained, such that it can be run either in isolation or in arbitrary " "combination with any number of other test cases." msgstr "" -#: ../../library/unittest.rst:354 +#: ../../library/unittest.rst:351 msgid "" "The simplest :class:`TestCase` subclass will simply implement a test method " "(i.e. a method whose name starts with ``test``) in order to perform specific " "testing code::" msgstr "" -#: ../../library/unittest.rst:365 +#: ../../library/unittest.rst:362 msgid "" "Note that in order to test something, we use one of the :meth:`assert\\*` " "methods provided by the :class:`TestCase` base class. If the test fails, an " @@ -578,7 +574,7 @@ msgid "" "be treated as :dfn:`errors`." msgstr "" -#: ../../library/unittest.rst:371 +#: ../../library/unittest.rst:368 msgid "" "Tests can be numerous, and their set-up can be repetitive. Luckily, we can " "factor out set-up code by implementing a method called :meth:`~TestCase." @@ -586,32 +582,32 @@ msgid "" "test we run::" msgstr "" -#: ../../library/unittest.rst:392 +#: ../../library/unittest.rst:389 msgid "" "The order in which the various tests will be run is determined by sorting " "the test method names with respect to the built-in ordering for strings." msgstr "" -#: ../../library/unittest.rst:396 +#: ../../library/unittest.rst:393 msgid "" "If the :meth:`~TestCase.setUp` method raises an exception while the test is " "running, the framework will consider the test to have suffered an error, and " "the test method will not be executed." msgstr "" -#: ../../library/unittest.rst:400 +#: ../../library/unittest.rst:397 msgid "" "Similarly, we can provide a :meth:`~TestCase.tearDown` method that tidies up " "after the test method has been run::" msgstr "" -#: ../../library/unittest.rst:412 +#: ../../library/unittest.rst:409 msgid "" "If :meth:`~TestCase.setUp` succeeded, :meth:`~TestCase.tearDown` will be run " "whether the test method succeeded or not." msgstr "" -#: ../../library/unittest.rst:415 +#: ../../library/unittest.rst:412 msgid "" "Such a working environment for the testing code is called a :dfn:`test " "fixture`. A new TestCase instance is created as a unique test fixture used " @@ -620,7 +616,7 @@ msgid "" "test." msgstr "" -#: ../../library/unittest.rst:421 +#: ../../library/unittest.rst:418 msgid "" "It is recommended that you use TestCase implementations to group tests " "together according to the features they test. :mod:`unittest` provides a " @@ -630,13 +626,13 @@ msgid "" "execute them." msgstr "" -#: ../../library/unittest.rst:428 +#: ../../library/unittest.rst:425 msgid "" "However, should you want to customize the building of your test suite, you " "can do it yourself::" msgstr "" -#: ../../library/unittest.rst:441 +#: ../../library/unittest.rst:438 msgid "" "You can place the definitions of test cases and test suites in the same " "modules as the code they are to test (such as :file:`widget.py`), but there " @@ -644,69 +640,69 @@ msgid "" "as :file:`test_widget.py`:" msgstr "" -#: ../../library/unittest.rst:446 +#: ../../library/unittest.rst:443 msgid "The test module can be run standalone from the command line." msgstr "" -#: ../../library/unittest.rst:448 +#: ../../library/unittest.rst:445 msgid "The test code can more easily be separated from shipped code." msgstr "" -#: ../../library/unittest.rst:450 +#: ../../library/unittest.rst:447 msgid "" "There is less temptation to change test code to fit the code it tests " "without a good reason." msgstr "" -#: ../../library/unittest.rst:453 +#: ../../library/unittest.rst:450 msgid "" "Test code should be modified much less frequently than the code it tests." msgstr "" -#: ../../library/unittest.rst:455 +#: ../../library/unittest.rst:452 msgid "Tested code can be refactored more easily." msgstr "" -#: ../../library/unittest.rst:457 +#: ../../library/unittest.rst:454 msgid "" "Tests for modules written in C must be in separate modules anyway, so why " "not be consistent?" msgstr "" -#: ../../library/unittest.rst:460 +#: ../../library/unittest.rst:457 msgid "" "If the testing strategy changes, there is no need to change the source code." msgstr "" -#: ../../library/unittest.rst:466 +#: ../../library/unittest.rst:463 msgid "Re-using old test code" msgstr "" -#: ../../library/unittest.rst:468 +#: ../../library/unittest.rst:465 msgid "" "Some users will find that they have existing test code that they would like " "to run from :mod:`unittest`, without converting every old test function to " "a :class:`TestCase` subclass." msgstr "" -#: ../../library/unittest.rst:472 +#: ../../library/unittest.rst:469 msgid "" "For this reason, :mod:`unittest` provides a :class:`FunctionTestCase` class. " "This subclass of :class:`TestCase` can be used to wrap an existing test " "function. Set-up and tear-down functions can also be provided." msgstr "" -#: ../../library/unittest.rst:476 +#: ../../library/unittest.rst:473 msgid "Given the following test function::" msgstr "" -#: ../../library/unittest.rst:483 +#: ../../library/unittest.rst:480 msgid "" "one can create an equivalent test case instance as follows, with optional " "set-up and tear-down methods::" msgstr "" -#: ../../library/unittest.rst:492 +#: ../../library/unittest.rst:489 msgid "" "Even though :class:`FunctionTestCase` can be used to quickly convert an " "existing test base over to a :mod:`unittest`\\ -based system, this approach " @@ -714,7 +710,7 @@ msgid "" "subclasses will make future test refactorings infinitely easier." msgstr "" -#: ../../library/unittest.rst:497 +#: ../../library/unittest.rst:494 msgid "" "In some cases, the existing tests may have been written using the :mod:" "`doctest` module. If so, :mod:`doctest` provides a :class:`DocTestSuite` " @@ -722,11 +718,11 @@ msgid "" "from the existing :mod:`doctest`\\ -based tests." msgstr "" -#: ../../library/unittest.rst:506 +#: ../../library/unittest.rst:503 msgid "Skipping tests and expected failures" msgstr "" -#: ../../library/unittest.rst:510 +#: ../../library/unittest.rst:507 msgid "" "Unittest supports skipping individual test methods and even whole classes of " "tests. In addition, it supports marking a test as an \"expected failure,\" " @@ -734,7 +730,7 @@ msgid "" "on a :class:`TestResult`." msgstr "" -#: ../../library/unittest.rst:515 +#: ../../library/unittest.rst:512 msgid "" "Skipping a test is simply a matter of using the :func:`skip` :term:" "`decorator` or one of its conditional variants, calling :meth:`TestCase." @@ -742,74 +738,72 @@ msgid "" "`SkipTest` directly." msgstr "" -#: ../../library/unittest.rst:519 +#: ../../library/unittest.rst:516 msgid "Basic skipping looks like this::" msgstr "" -#: ../../library/unittest.rst:544 +#: ../../library/unittest.rst:541 msgid "This is the output of running the example above in verbose mode::" msgstr "" -#: ../../library/unittest.rst:556 +#: ../../library/unittest.rst:553 msgid "Classes can be skipped just like methods::" msgstr "" -#: ../../library/unittest.rst:563 +#: ../../library/unittest.rst:560 msgid "" ":meth:`TestCase.setUp` can also skip the test. This is useful when a " "resource that needs to be set up is not available." msgstr "" -#: ../../library/unittest.rst:566 +#: ../../library/unittest.rst:563 msgid "Expected failures use the :func:`expectedFailure` decorator. ::" msgstr "" -#: ../../library/unittest.rst:573 +#: ../../library/unittest.rst:570 msgid "" "It's easy to roll your own skipping decorators by making a decorator that " "calls :func:`skip` on the test when it wants it to be skipped. This " "decorator skips the test unless the passed object has a certain attribute::" msgstr "" -#: ../../library/unittest.rst:582 +#: ../../library/unittest.rst:579 msgid "" "The following decorators and exception implement test skipping and expected " "failures:" msgstr "" -#: ../../library/unittest.rst:586 +#: ../../library/unittest.rst:583 msgid "" "Unconditionally skip the decorated test. *reason* should describe why the " "test is being skipped." msgstr "" -#: ../../library/unittest.rst:591 +#: ../../library/unittest.rst:588 msgid "Skip the decorated test if *condition* is true." msgstr "" -#: ../../library/unittest.rst:595 +#: ../../library/unittest.rst:592 msgid "Skip the decorated test unless *condition* is true." msgstr "" -#: ../../library/unittest.rst:599 +#: ../../library/unittest.rst:596 msgid "" -"Mark the test as an expected failure or error. If the test fails or errors " -"in the test function itself (rather than in one of the :dfn:`test fixture` " -"methods) then it will be considered a success. If the test passes, it will " -"be considered a failure." +"Mark the test as an expected failure. If the test fails it will be " +"considered a success. If the test passes, it will be considered a failure." msgstr "" -#: ../../library/unittest.rst:606 +#: ../../library/unittest.rst:601 msgid "This exception is raised to skip a test." msgstr "" -#: ../../library/unittest.rst:608 +#: ../../library/unittest.rst:603 msgid "" "Usually you can use :meth:`TestCase.skipTest` or one of the skipping " "decorators instead of raising this directly." msgstr "" -#: ../../library/unittest.rst:611 +#: ../../library/unittest.rst:606 msgid "" "Skipped tests will not have :meth:`~TestCase.setUp` or :meth:`~TestCase." "tearDown` run around them. Skipped classes will not have :meth:`~TestCase." @@ -817,45 +811,45 @@ msgid "" "have :func:`setUpModule` or :func:`tearDownModule` run." msgstr "" -#: ../../library/unittest.rst:619 +#: ../../library/unittest.rst:614 msgid "Distinguishing test iterations using subtests" msgstr "" -#: ../../library/unittest.rst:623 +#: ../../library/unittest.rst:618 msgid "" "When there are very small differences among your tests, for instance some " "parameters, unittest allows you to distinguish them inside the body of a " "test method using the :meth:`~TestCase.subTest` context manager." msgstr "" -#: ../../library/unittest.rst:627 +#: ../../library/unittest.rst:622 msgid "For example, the following test::" msgstr "" -#: ../../library/unittest.rst:639 +#: ../../library/unittest.rst:634 msgid "will produce the following output::" msgstr "" -#: ../../library/unittest.rst:665 +#: ../../library/unittest.rst:660 msgid "" "Without using a subtest, execution would stop after the first failure, and " "the error would be less easy to diagnose because the value of ``i`` wouldn't " "be displayed::" msgstr "" -#: ../../library/unittest.rst:681 +#: ../../library/unittest.rst:676 msgid "Classes and functions" msgstr "" -#: ../../library/unittest.rst:683 +#: ../../library/unittest.rst:678 msgid "This section describes in depth the API of :mod:`unittest`." msgstr "" -#: ../../library/unittest.rst:689 +#: ../../library/unittest.rst:684 msgid "Test cases" msgstr "" -#: ../../library/unittest.rst:693 +#: ../../library/unittest.rst:688 msgid "" "Instances of the :class:`TestCase` class represent the logical test units in " "the :mod:`unittest` universe. This class is intended to be used as a base " @@ -865,21 +859,21 @@ msgid "" "report various kinds of failure." msgstr "" -#: ../../library/unittest.rst:700 +#: ../../library/unittest.rst:695 msgid "" "Each instance of :class:`TestCase` will run a single base method: the method " "named *methodName*. In most uses of :class:`TestCase`, you will neither " "change the *methodName* nor reimplement the default ``runTest()`` method." msgstr "" -#: ../../library/unittest.rst:705 +#: ../../library/unittest.rst:700 msgid "" ":class:`TestCase` can be instantiated successfully without providing a " "*methodName*. This makes it easier to experiment with :class:`TestCase` from " "the interactive interpreter." msgstr "" -#: ../../library/unittest.rst:710 +#: ../../library/unittest.rst:705 msgid "" ":class:`TestCase` instances provide three groups of methods: one group used " "to run the test, another used by the test implementation to check conditions " @@ -887,11 +881,11 @@ msgid "" "test itself to be gathered." msgstr "" -#: ../../library/unittest.rst:715 +#: ../../library/unittest.rst:710 msgid "Methods in the first group (running the test) are:" msgstr "" -#: ../../library/unittest.rst:719 +#: ../../library/unittest.rst:714 msgid "" "Method called to prepare the test fixture. This is called immediately " "before calling the test method; other than :exc:`AssertionError` or :exc:" @@ -899,7 +893,7 @@ msgid "" "rather than a test failure. The default implementation does nothing." msgstr "" -#: ../../library/unittest.rst:727 +#: ../../library/unittest.rst:722 msgid "" "Method called immediately after the test method has been called and the " "result recorded. This is called even if the test method raised an " @@ -912,25 +906,25 @@ msgid "" "The default implementation does nothing." msgstr "" -#: ../../library/unittest.rst:740 +#: ../../library/unittest.rst:735 msgid "" "A class method called before tests in an individual class are run. " "``setUpClass`` is called with the class as the only argument and must be " "decorated as a :func:`classmethod`::" msgstr "" -#: ../../library/unittest.rst:748 ../../library/unittest.rst:763 +#: ../../library/unittest.rst:743 ../../library/unittest.rst:758 msgid "See `Class and Module Fixtures`_ for more details." msgstr "" -#: ../../library/unittest.rst:755 +#: ../../library/unittest.rst:750 msgid "" "A class method called after tests in an individual class have run. " "``tearDownClass`` is called with the class as the only argument and must be " "decorated as a :meth:`classmethod`::" msgstr "" -#: ../../library/unittest.rst:770 +#: ../../library/unittest.rst:765 msgid "" "Run the test, collecting the result into the :class:`TestResult` object " "passed as *result*. If *result* is omitted or ``None``, a temporary result " @@ -938,184 +932,184 @@ msgid "" "used. The result object is returned to :meth:`run`'s caller." msgstr "" -#: ../../library/unittest.rst:776 +#: ../../library/unittest.rst:771 msgid "" "The same effect may be had by simply calling the :class:`TestCase` instance." msgstr "" -#: ../../library/unittest.rst:779 +#: ../../library/unittest.rst:774 msgid "" "Previous versions of ``run`` did not return the result. Neither did calling " "an instance." msgstr "" -#: ../../library/unittest.rst:785 +#: ../../library/unittest.rst:780 msgid "" "Calling this during a test method or :meth:`setUp` skips the current test. " "See :ref:`unittest-skipping` for more information." msgstr "" -#: ../../library/unittest.rst:793 +#: ../../library/unittest.rst:788 msgid "" "Return a context manager which executes the enclosed code block as a " "subtest. *msg* and *params* are optional, arbitrary values which are " "displayed whenever a subtest fails, allowing you to identify them clearly." msgstr "" -#: ../../library/unittest.rst:798 +#: ../../library/unittest.rst:793 msgid "" "A test case can contain any number of subtest declarations, and they can be " "arbitrarily nested." msgstr "" -#: ../../library/unittest.rst:801 +#: ../../library/unittest.rst:796 msgid "See :ref:`subtests` for more information." msgstr "" -#: ../../library/unittest.rst:808 +#: ../../library/unittest.rst:803 msgid "" "Run the test without collecting the result. This allows exceptions raised " "by the test to be propagated to the caller, and can be used to support " "running tests under a debugger." msgstr "" -#: ../../library/unittest.rst:814 +#: ../../library/unittest.rst:809 msgid "" "The :class:`TestCase` class provides several assert methods to check for and " "report failures. The following table lists the most commonly used methods " "(see the tables below for more assert methods):" msgstr "" -#: ../../library/unittest.rst:819 ../../library/unittest.rst:940 -#: ../../library/unittest.rst:1133 ../../library/unittest.rst:1260 +#: ../../library/unittest.rst:814 ../../library/unittest.rst:936 +#: ../../library/unittest.rst:1128 ../../library/unittest.rst:1255 msgid "Method" msgstr "" -#: ../../library/unittest.rst:819 ../../library/unittest.rst:940 -#: ../../library/unittest.rst:1133 +#: ../../library/unittest.rst:814 ../../library/unittest.rst:936 +#: ../../library/unittest.rst:1128 msgid "Checks that" msgstr "" -#: ../../library/unittest.rst:819 ../../library/unittest.rst:940 -#: ../../library/unittest.rst:1133 ../../library/unittest.rst:1260 +#: ../../library/unittest.rst:814 ../../library/unittest.rst:936 +#: ../../library/unittest.rst:1128 ../../library/unittest.rst:1255 msgid "New in" msgstr "" -#: ../../library/unittest.rst:821 +#: ../../library/unittest.rst:816 msgid ":meth:`assertEqual(a, b) `" msgstr "" -#: ../../library/unittest.rst:821 +#: ../../library/unittest.rst:816 msgid "``a == b``" msgstr "" -#: ../../library/unittest.rst:824 +#: ../../library/unittest.rst:819 msgid ":meth:`assertNotEqual(a, b) `" msgstr "" -#: ../../library/unittest.rst:824 +#: ../../library/unittest.rst:819 msgid "``a != b``" msgstr "" -#: ../../library/unittest.rst:827 +#: ../../library/unittest.rst:822 msgid ":meth:`assertTrue(x) `" msgstr "" -#: ../../library/unittest.rst:827 +#: ../../library/unittest.rst:822 msgid "``bool(x) is True``" msgstr "" -#: ../../library/unittest.rst:830 +#: ../../library/unittest.rst:825 msgid ":meth:`assertFalse(x) `" msgstr "" -#: ../../library/unittest.rst:830 +#: ../../library/unittest.rst:825 msgid "``bool(x) is False``" msgstr "" -#: ../../library/unittest.rst:833 +#: ../../library/unittest.rst:828 msgid ":meth:`assertIs(a, b) `" msgstr "" -#: ../../library/unittest.rst:833 +#: ../../library/unittest.rst:828 msgid "``a is b``" msgstr "" -#: ../../library/unittest.rst:833 ../../library/unittest.rst:836 -#: ../../library/unittest.rst:839 ../../library/unittest.rst:842 -#: ../../library/unittest.rst:845 ../../library/unittest.rst:848 -#: ../../library/unittest.rst:945 ../../library/unittest.rst:1141 -#: ../../library/unittest.rst:1144 ../../library/unittest.rst:1147 -#: ../../library/unittest.rst:1150 ../../library/unittest.rst:1153 -#: ../../library/unittest.rst:1262 ../../library/unittest.rst:1265 -#: ../../library/unittest.rst:1268 ../../library/unittest.rst:1271 -#: ../../library/unittest.rst:1274 ../../library/unittest.rst:1277 +#: ../../library/unittest.rst:828 ../../library/unittest.rst:831 +#: ../../library/unittest.rst:834 ../../library/unittest.rst:837 +#: ../../library/unittest.rst:840 ../../library/unittest.rst:843 +#: ../../library/unittest.rst:941 ../../library/unittest.rst:1136 +#: ../../library/unittest.rst:1139 ../../library/unittest.rst:1142 +#: ../../library/unittest.rst:1145 ../../library/unittest.rst:1148 +#: ../../library/unittest.rst:1257 ../../library/unittest.rst:1260 +#: ../../library/unittest.rst:1263 ../../library/unittest.rst:1266 +#: ../../library/unittest.rst:1269 ../../library/unittest.rst:1272 msgid "3.1" msgstr "" -#: ../../library/unittest.rst:836 +#: ../../library/unittest.rst:831 msgid ":meth:`assertIsNot(a, b) `" msgstr "" -#: ../../library/unittest.rst:836 +#: ../../library/unittest.rst:831 msgid "``a is not b``" msgstr "" -#: ../../library/unittest.rst:839 +#: ../../library/unittest.rst:834 msgid ":meth:`assertIsNone(x) `" msgstr "" -#: ../../library/unittest.rst:839 +#: ../../library/unittest.rst:834 msgid "``x is None``" msgstr "" -#: ../../library/unittest.rst:842 +#: ../../library/unittest.rst:837 msgid ":meth:`assertIsNotNone(x) `" msgstr "" -#: ../../library/unittest.rst:842 +#: ../../library/unittest.rst:837 msgid "``x is not None``" msgstr "" -#: ../../library/unittest.rst:845 +#: ../../library/unittest.rst:840 msgid ":meth:`assertIn(a, b) `" msgstr "" -#: ../../library/unittest.rst:845 +#: ../../library/unittest.rst:840 msgid "``a in b``" msgstr "" -#: ../../library/unittest.rst:848 +#: ../../library/unittest.rst:843 msgid ":meth:`assertNotIn(a, b) `" msgstr "" -#: ../../library/unittest.rst:848 +#: ../../library/unittest.rst:843 msgid "``a not in b``" msgstr "" -#: ../../library/unittest.rst:851 +#: ../../library/unittest.rst:846 msgid ":meth:`assertIsInstance(a, b) `" msgstr "" -#: ../../library/unittest.rst:851 +#: ../../library/unittest.rst:846 msgid "``isinstance(a, b)``" msgstr "" -#: ../../library/unittest.rst:851 ../../library/unittest.rst:854 -#: ../../library/unittest.rst:948 ../../library/unittest.rst:951 -#: ../../library/unittest.rst:1156 ../../library/unittest.rst:1159 +#: ../../library/unittest.rst:846 ../../library/unittest.rst:849 +#: ../../library/unittest.rst:944 ../../library/unittest.rst:947 +#: ../../library/unittest.rst:1151 ../../library/unittest.rst:1154 msgid "3.2" msgstr "" -#: ../../library/unittest.rst:854 +#: ../../library/unittest.rst:849 msgid ":meth:`assertNotIsInstance(a, b) `" msgstr "" -#: ../../library/unittest.rst:854 +#: ../../library/unittest.rst:849 msgid "``not isinstance(a, b)``" msgstr "" -#: ../../library/unittest.rst:858 +#: ../../library/unittest.rst:853 msgid "" "All the assert methods accept a *msg* argument that, if specified, is used " "as the error message on failure (see also :data:`longMessage`). Note that " @@ -1124,13 +1118,13 @@ msgid "" "they are used as a context manager." msgstr "" -#: ../../library/unittest.rst:866 +#: ../../library/unittest.rst:861 msgid "" "Test that *first* and *second* are equal. If the values do not compare " "equal, the test will fail." msgstr "" -#: ../../library/unittest.rst:869 +#: ../../library/unittest.rst:864 msgid "" "In addition, if *first* and *second* are the exact same type and one of " "list, tuple, dict, set, frozenset or str or any type that a subclass " @@ -1140,27 +1134,27 @@ msgid "" "methods>`)." msgstr "" -#: ../../library/unittest.rst:876 +#: ../../library/unittest.rst:871 msgid "Added the automatic calling of type-specific equality function." msgstr "" -#: ../../library/unittest.rst:879 +#: ../../library/unittest.rst:874 msgid "" ":meth:`assertMultiLineEqual` added as the default type equality function for " "comparing strings." msgstr "" -#: ../../library/unittest.rst:886 +#: ../../library/unittest.rst:881 msgid "" "Test that *first* and *second* are not equal. If the values do compare " "equal, the test will fail." msgstr "" -#: ../../library/unittest.rst:892 +#: ../../library/unittest.rst:887 msgid "Test that *expr* is true (or false)." msgstr "" -#: ../../library/unittest.rst:894 +#: ../../library/unittest.rst:889 msgid "" "Note that this is equivalent to ``bool(expr) is True`` and not to ``expr is " "True`` (use ``assertIs(expr, True)`` for the latter). This method should " @@ -1169,80 +1163,82 @@ msgid "" "provide a better error message in case of failure." msgstr "" -#: ../../library/unittest.rst:904 -msgid "Test that *first* and *second* are (or are not) the same object." +#: ../../library/unittest.rst:899 +msgid "" +"Test that *first* and *second* evaluate (or don't evaluate) to the same " +"object." msgstr "" -#: ../../library/unittest.rst:912 +#: ../../library/unittest.rst:908 msgid "Test that *expr* is (or is not) ``None``." msgstr "" -#: ../../library/unittest.rst:920 +#: ../../library/unittest.rst:916 msgid "Test that *member* is (or is not) in *container*." msgstr "" -#: ../../library/unittest.rst:928 +#: ../../library/unittest.rst:924 msgid "" "Test that *obj* is (or is not) an instance of *cls* (which can be a class or " "a tuple of classes, as supported by :func:`isinstance`). To check for the " "exact type, use :func:`assertIs(type(obj), cls) `." msgstr "" -#: ../../library/unittest.rst:936 +#: ../../library/unittest.rst:932 msgid "" "It is also possible to check the production of exceptions, warnings, and log " "messages using the following methods:" msgstr "" -#: ../../library/unittest.rst:942 +#: ../../library/unittest.rst:938 msgid ":meth:`assertRaises(exc, fun, *args, **kwds) `" msgstr "" -#: ../../library/unittest.rst:942 +#: ../../library/unittest.rst:938 msgid "``fun(*args, **kwds)`` raises *exc*" msgstr "" -#: ../../library/unittest.rst:945 +#: ../../library/unittest.rst:941 msgid "" ":meth:`assertRaisesRegex(exc, r, fun, *args, **kwds) `" msgstr "" -#: ../../library/unittest.rst:945 +#: ../../library/unittest.rst:941 msgid "``fun(*args, **kwds)`` raises *exc* and the message matches regex *r*" msgstr "" -#: ../../library/unittest.rst:948 +#: ../../library/unittest.rst:944 msgid ":meth:`assertWarns(warn, fun, *args, **kwds) `" msgstr "" -#: ../../library/unittest.rst:948 +#: ../../library/unittest.rst:944 msgid "``fun(*args, **kwds)`` raises *warn*" msgstr "" -#: ../../library/unittest.rst:951 +#: ../../library/unittest.rst:947 msgid "" ":meth:`assertWarnsRegex(warn, r, fun, *args, **kwds) `" msgstr "" -#: ../../library/unittest.rst:951 +#: ../../library/unittest.rst:947 msgid "``fun(*args, **kwds)`` raises *warn* and the message matches regex *r*" msgstr "" -#: ../../library/unittest.rst:954 +#: ../../library/unittest.rst:950 msgid ":meth:`assertLogs(logger, level) `" msgstr "" -#: ../../library/unittest.rst:954 +#: ../../library/unittest.rst:950 msgid "The ``with`` block logs on *logger* with minimum *level*" msgstr "" -#: ../../library/unittest.rst:954 +#: ../../library/unittest.rst:950 msgid "3.4" msgstr "" -#: ../../library/unittest.rst:961 +#: ../../library/unittest.rst:957 msgid "" "Test that an exception is raised when *callable* is called with any " "positional or keyword arguments that are also passed to :meth:" @@ -1252,40 +1248,40 @@ msgid "" "be passed as *exception*." msgstr "" -#: ../../library/unittest.rst:968 +#: ../../library/unittest.rst:964 msgid "" "If only the *exception* and possibly the *msg* arguments are given, return a " "context manager so that the code under test can be written inline rather " "than as a function::" msgstr "" -#: ../../library/unittest.rst:975 +#: ../../library/unittest.rst:971 msgid "" "When used as a context manager, :meth:`assertRaises` accepts the additional " "keyword argument *msg*." msgstr "" -#: ../../library/unittest.rst:978 +#: ../../library/unittest.rst:974 msgid "" "The context manager will store the caught exception object in its :attr:" "`exception` attribute. This can be useful if the intention is to perform " "additional checks on the exception raised::" msgstr "" -#: ../../library/unittest.rst:988 +#: ../../library/unittest.rst:984 msgid "Added the ability to use :meth:`assertRaises` as a context manager." msgstr "" -#: ../../library/unittest.rst:991 +#: ../../library/unittest.rst:987 msgid "Added the :attr:`exception` attribute." msgstr "" -#: ../../library/unittest.rst:994 ../../library/unittest.rst:1020 -#: ../../library/unittest.rst:1061 ../../library/unittest.rst:1084 +#: ../../library/unittest.rst:990 ../../library/unittest.rst:1016 +#: ../../library/unittest.rst:1057 ../../library/unittest.rst:1080 msgid "Added the *msg* keyword argument when used as a context manager." msgstr "" -#: ../../library/unittest.rst:1001 +#: ../../library/unittest.rst:997 msgid "" "Like :meth:`assertRaises` but also tests that *regex* matches on the string " "representation of the raised exception. *regex* may be a regular expression " @@ -1293,22 +1289,22 @@ msgid "" "`re.search`. Examples::" msgstr "" -#: ../../library/unittest.rst:1009 ../../library/unittest.rst:1077 +#: ../../library/unittest.rst:1005 ../../library/unittest.rst:1073 msgid "or::" msgstr "" "或是:\n" "\n" "::" -#: ../../library/unittest.rst:1014 +#: ../../library/unittest.rst:1010 msgid "Added under the name ``assertRaisesRegexp``." msgstr "" -#: ../../library/unittest.rst:1017 +#: ../../library/unittest.rst:1013 msgid "Renamed to :meth:`assertRaisesRegex`." msgstr "" -#: ../../library/unittest.rst:1027 +#: ../../library/unittest.rst:1023 msgid "" "Test that a warning is triggered when *callable* is called with any " "positional or keyword arguments that are also passed to :meth:" @@ -1317,20 +1313,20 @@ msgid "" "tuple containing the warning classes may be passed as *warnings*." msgstr "" -#: ../../library/unittest.rst:1034 +#: ../../library/unittest.rst:1030 msgid "" "If only the *warning* and possibly the *msg* arguments are given, return a " "context manager so that the code under test can be written inline rather " "than as a function::" msgstr "" -#: ../../library/unittest.rst:1041 +#: ../../library/unittest.rst:1037 msgid "" "When used as a context manager, :meth:`assertWarns` accepts the additional " "keyword argument *msg*." msgstr "" -#: ../../library/unittest.rst:1044 +#: ../../library/unittest.rst:1040 msgid "" "The context manager will store the caught warning object in its :attr:" "`warning` attribute, and the source line which triggered the warnings in " @@ -1338,13 +1334,13 @@ msgid "" "the intention is to perform additional checks on the warning caught::" msgstr "" -#: ../../library/unittest.rst:1056 +#: ../../library/unittest.rst:1052 msgid "" "This method works regardless of the warning filters in place when it is " "called." msgstr "" -#: ../../library/unittest.rst:1068 +#: ../../library/unittest.rst:1064 msgid "" "Like :meth:`assertWarns` but also tests that *regex* matches on the message " "of the triggered warning. *regex* may be a regular expression object or a " @@ -1352,134 +1348,133 @@ msgid "" "search`. Example::" msgstr "" -#: ../../library/unittest.rst:1089 +#: ../../library/unittest.rst:1085 msgid "" "A context manager to test that at least one message is logged on the " "*logger* or one of its children, with at least the given *level*." msgstr "" -#: ../../library/unittest.rst:1093 +#: ../../library/unittest.rst:1089 msgid "" "If given, *logger* should be a :class:`logging.Logger` object or a :class:" "`str` giving the name of a logger. The default is the root logger, which " -"will catch all messages that were not blocked by a non-propagating " -"descendent logger." +"will catch all messages." msgstr "" -#: ../../library/unittest.rst:1098 +#: ../../library/unittest.rst:1093 msgid "" "If given, *level* should be either a numeric logging level or its string " "equivalent (for example either ``\"ERROR\"`` or :attr:`logging.ERROR`). The " "default is :attr:`logging.INFO`." msgstr "" -#: ../../library/unittest.rst:1102 +#: ../../library/unittest.rst:1097 msgid "" "The test passes if at least one message emitted inside the ``with`` block " "matches the *logger* and *level* conditions, otherwise it fails." msgstr "" -#: ../../library/unittest.rst:1105 +#: ../../library/unittest.rst:1100 msgid "" "The object returned by the context manager is a recording helper which keeps " "tracks of the matching log messages. It has two attributes:" msgstr "" -#: ../../library/unittest.rst:1111 +#: ../../library/unittest.rst:1106 msgid "" "A list of :class:`logging.LogRecord` objects of the matching log messages." msgstr "" -#: ../../library/unittest.rst:1116 +#: ../../library/unittest.rst:1111 msgid "" "A list of :class:`str` objects with the formatted output of matching " "messages." msgstr "" -#: ../../library/unittest.rst:1119 +#: ../../library/unittest.rst:1114 msgid "Example::" msgstr "" -#: ../../library/unittest.rst:1130 +#: ../../library/unittest.rst:1125 msgid "" "There are also other methods used to perform more specific checks, such as:" msgstr "" -#: ../../library/unittest.rst:1135 +#: ../../library/unittest.rst:1130 msgid ":meth:`assertAlmostEqual(a, b) `" msgstr "" -#: ../../library/unittest.rst:1135 +#: ../../library/unittest.rst:1130 msgid "``round(a-b, 7) == 0``" msgstr "" -#: ../../library/unittest.rst:1138 +#: ../../library/unittest.rst:1133 msgid ":meth:`assertNotAlmostEqual(a, b) `" msgstr "" -#: ../../library/unittest.rst:1138 +#: ../../library/unittest.rst:1133 msgid "``round(a-b, 7) != 0``" msgstr "" -#: ../../library/unittest.rst:1141 +#: ../../library/unittest.rst:1136 msgid ":meth:`assertGreater(a, b) `" msgstr "" -#: ../../library/unittest.rst:1141 +#: ../../library/unittest.rst:1136 msgid "``a > b``" msgstr "" -#: ../../library/unittest.rst:1144 +#: ../../library/unittest.rst:1139 msgid ":meth:`assertGreaterEqual(a, b) `" msgstr "" -#: ../../library/unittest.rst:1144 +#: ../../library/unittest.rst:1139 msgid "``a >= b``" msgstr "" -#: ../../library/unittest.rst:1147 +#: ../../library/unittest.rst:1142 msgid ":meth:`assertLess(a, b) `" msgstr "" -#: ../../library/unittest.rst:1147 +#: ../../library/unittest.rst:1142 msgid "``a < b``" msgstr "" -#: ../../library/unittest.rst:1150 +#: ../../library/unittest.rst:1145 msgid ":meth:`assertLessEqual(a, b) `" msgstr "" -#: ../../library/unittest.rst:1150 +#: ../../library/unittest.rst:1145 msgid "``a <= b``" msgstr "" -#: ../../library/unittest.rst:1153 +#: ../../library/unittest.rst:1148 msgid ":meth:`assertRegex(s, r) `" msgstr "" -#: ../../library/unittest.rst:1153 +#: ../../library/unittest.rst:1148 msgid "``r.search(s)``" msgstr "" -#: ../../library/unittest.rst:1156 +#: ../../library/unittest.rst:1151 msgid ":meth:`assertNotRegex(s, r) `" msgstr "" -#: ../../library/unittest.rst:1156 +#: ../../library/unittest.rst:1151 msgid "``not r.search(s)``" msgstr "" -#: ../../library/unittest.rst:1159 +#: ../../library/unittest.rst:1154 msgid ":meth:`assertCountEqual(a, b) `" msgstr "" -#: ../../library/unittest.rst:1159 +#: ../../library/unittest.rst:1154 msgid "" "*a* and *b* have the same elements in the same number, regardless of their " "order." msgstr "" -#: ../../library/unittest.rst:1168 +#: ../../library/unittest.rst:1163 msgid "" "Test that *first* and *second* are approximately (or not approximately) " "equal by computing the difference, rounding to the given number of decimal " @@ -1488,30 +1483,30 @@ msgid "" "`round` function) and not *significant digits*." msgstr "" -#: ../../library/unittest.rst:1174 +#: ../../library/unittest.rst:1169 msgid "" "If *delta* is supplied instead of *places* then the difference between " "*first* and *second* must be less or equal to (or greater than) *delta*." msgstr "" -#: ../../library/unittest.rst:1177 +#: ../../library/unittest.rst:1172 msgid "Supplying both *delta* and *places* raises a :exc:`TypeError`." msgstr "" -#: ../../library/unittest.rst:1179 +#: ../../library/unittest.rst:1174 msgid "" ":meth:`assertAlmostEqual` automatically considers almost equal objects that " "compare equal. :meth:`assertNotAlmostEqual` automatically fails if the " "objects compare equal. Added the *delta* keyword argument." msgstr "" -#: ../../library/unittest.rst:1190 +#: ../../library/unittest.rst:1185 msgid "" "Test that *first* is respectively >, >=, < or <= than *second* depending on " "the method name. If not, the test will fail::" msgstr "" -#: ../../library/unittest.rst:1202 +#: ../../library/unittest.rst:1197 msgid "" "Test that a *regex* search matches (or does not match) *text*. In case of " "failure, the error message will include the pattern and the *text* (or the " @@ -1520,34 +1515,34 @@ msgid "" "suitable for use by :func:`re.search`." msgstr "" -#: ../../library/unittest.rst:1208 +#: ../../library/unittest.rst:1203 msgid "Added under the name ``assertRegexpMatches``." msgstr "" -#: ../../library/unittest.rst:1210 +#: ../../library/unittest.rst:1205 msgid "" "The method ``assertRegexpMatches()`` has been renamed to :meth:`." "assertRegex`." msgstr "" -#: ../../library/unittest.rst:1213 +#: ../../library/unittest.rst:1208 msgid ":meth:`.assertNotRegex`." msgstr "" -#: ../../library/unittest.rst:1215 +#: ../../library/unittest.rst:1210 msgid "" "The name ``assertNotRegexpMatches`` is a deprecated alias for :meth:`." "assertNotRegex`." msgstr "" -#: ../../library/unittest.rst:1222 +#: ../../library/unittest.rst:1217 msgid "" "Test that sequence *first* contains the same elements as *second*, " "regardless of their order. When they don't, an error message listing the " "differences between the sequences will be generated." msgstr "" -#: ../../library/unittest.rst:1226 +#: ../../library/unittest.rst:1221 msgid "" "Duplicate elements are *not* ignored when comparing *first* and *second*. It " "verifies whether each element has the same count in both sequences. " @@ -1555,7 +1550,7 @@ msgid "" "but works with sequences of unhashable objects as well." msgstr "" -#: ../../library/unittest.rst:1237 +#: ../../library/unittest.rst:1232 msgid "" "The :meth:`assertEqual` method dispatches the equality check for objects of " "the same type to different type-specific methods. These methods are already " @@ -1563,7 +1558,7 @@ msgid "" "register new methods using :meth:`addTypeEqualityFunc`:" msgstr "" -#: ../../library/unittest.rst:1244 +#: ../../library/unittest.rst:1239 msgid "" "Registers a type-specific method called by :meth:`assertEqual` to check if " "two objects of exactly the same *typeobj* (not subclasses) compare equal. " @@ -1574,66 +1569,66 @@ msgid "" "explaining the inequalities in details in the error message." msgstr "" -#: ../../library/unittest.rst:1255 +#: ../../library/unittest.rst:1250 msgid "" "The list of type-specific methods automatically used by :meth:`~TestCase." "assertEqual` are summarized in the following table. Note that it's usually " "not necessary to invoke these methods directly." msgstr "" -#: ../../library/unittest.rst:1260 +#: ../../library/unittest.rst:1255 msgid "Used to compare" msgstr "" -#: ../../library/unittest.rst:1262 +#: ../../library/unittest.rst:1257 msgid ":meth:`assertMultiLineEqual(a, b) `" msgstr "" -#: ../../library/unittest.rst:1262 +#: ../../library/unittest.rst:1257 msgid "strings" msgstr "" -#: ../../library/unittest.rst:1265 +#: ../../library/unittest.rst:1260 msgid ":meth:`assertSequenceEqual(a, b) `" msgstr "" -#: ../../library/unittest.rst:1265 +#: ../../library/unittest.rst:1260 msgid "sequences" msgstr "" -#: ../../library/unittest.rst:1268 +#: ../../library/unittest.rst:1263 msgid ":meth:`assertListEqual(a, b) `" msgstr "" -#: ../../library/unittest.rst:1268 +#: ../../library/unittest.rst:1263 msgid "lists" msgstr "" -#: ../../library/unittest.rst:1271 +#: ../../library/unittest.rst:1266 msgid ":meth:`assertTupleEqual(a, b) `" msgstr "" -#: ../../library/unittest.rst:1271 +#: ../../library/unittest.rst:1266 msgid "tuples" msgstr "" -#: ../../library/unittest.rst:1274 +#: ../../library/unittest.rst:1269 msgid ":meth:`assertSetEqual(a, b) `" msgstr "" -#: ../../library/unittest.rst:1274 +#: ../../library/unittest.rst:1269 msgid "sets or frozensets" msgstr "" -#: ../../library/unittest.rst:1277 +#: ../../library/unittest.rst:1272 msgid ":meth:`assertDictEqual(a, b) `" msgstr "" -#: ../../library/unittest.rst:1277 +#: ../../library/unittest.rst:1272 msgid "dicts" msgstr "" -#: ../../library/unittest.rst:1285 +#: ../../library/unittest.rst:1280 msgid "" "Test that the multiline string *first* is equal to the string *second*. When " "not equal a diff of the two strings highlighting the differences will be " @@ -1641,7 +1636,7 @@ msgid "" "strings with :meth:`assertEqual`." msgstr "" -#: ../../library/unittest.rst:1295 +#: ../../library/unittest.rst:1290 msgid "" "Tests that two sequences are equal. If a *seq_type* is supplied, both " "*first* and *second* must be instances of *seq_type* or a failure will be " @@ -1649,13 +1644,13 @@ msgid "" "shows the difference between the two." msgstr "" -#: ../../library/unittest.rst:1300 +#: ../../library/unittest.rst:1295 msgid "" "This method is not called directly by :meth:`assertEqual`, but it's used to " "implement :meth:`assertListEqual` and :meth:`assertTupleEqual`." msgstr "" -#: ../../library/unittest.rst:1310 +#: ../../library/unittest.rst:1305 msgid "" "Tests that two lists or tuples are equal. If not, an error message is " "constructed that shows only the differences between the two. An error is " @@ -1663,38 +1658,38 @@ msgid "" "are used by default when comparing lists or tuples with :meth:`assertEqual`." msgstr "" -#: ../../library/unittest.rst:1321 +#: ../../library/unittest.rst:1316 msgid "" "Tests that two sets are equal. If not, an error message is constructed that " "lists the differences between the sets. This method is used by default when " "comparing sets or frozensets with :meth:`assertEqual`." msgstr "" -#: ../../library/unittest.rst:1325 +#: ../../library/unittest.rst:1320 msgid "" "Fails if either of *first* or *second* does not have a :meth:`set." "difference` method." msgstr "" -#: ../../library/unittest.rst:1333 +#: ../../library/unittest.rst:1328 msgid "" "Test that two dictionaries are equal. If not, an error message is " "constructed that shows the differences in the dictionaries. This method will " "be used by default to compare dictionaries in calls to :meth:`assertEqual`." msgstr "" -#: ../../library/unittest.rst:1344 +#: ../../library/unittest.rst:1339 msgid "" "Finally the :class:`TestCase` provides the following methods and attributes:" msgstr "" -#: ../../library/unittest.rst:1349 +#: ../../library/unittest.rst:1344 msgid "" "Signals a test failure unconditionally, with *msg* or ``None`` for the error " "message." msgstr "" -#: ../../library/unittest.rst:1355 +#: ../../library/unittest.rst:1350 msgid "" "This class attribute gives the exception raised by the test method. If a " "test framework needs to use a specialized exception, possibly to carry " @@ -1703,7 +1698,7 @@ msgid "" "`AssertionError`." msgstr "" -#: ../../library/unittest.rst:1364 +#: ../../library/unittest.rst:1359 msgid "" "This class attribute determines what happens when a custom failure message " "is passed as the msg argument to an assertXYY call that fails. ``True`` is " @@ -1712,18 +1707,18 @@ msgid "" "replaces the standard message." msgstr "" -#: ../../library/unittest.rst:1370 +#: ../../library/unittest.rst:1365 msgid "" "The class setting can be overridden in individual test methods by assigning " "an instance attribute, self.longMessage, to ``True`` or ``False`` before " "calling the assert methods." msgstr "" -#: ../../library/unittest.rst:1374 +#: ../../library/unittest.rst:1369 msgid "The class setting gets reset before each test call." msgstr "" -#: ../../library/unittest.rst:1381 +#: ../../library/unittest.rst:1376 msgid "" "This attribute controls the maximum length of diffs output by assert methods " "that report diffs on failure. It defaults to 80*8 characters. Assert methods " @@ -1732,52 +1727,52 @@ msgid "" "`assertDictEqual` and :meth:`assertMultiLineEqual`." msgstr "" -#: ../../library/unittest.rst:1388 +#: ../../library/unittest.rst:1383 msgid "" "Setting ``maxDiff`` to ``None`` means that there is no maximum length of " "diffs." msgstr "" -#: ../../library/unittest.rst:1394 +#: ../../library/unittest.rst:1389 msgid "" "Testing frameworks can use the following methods to collect information on " "the test:" msgstr "" -#: ../../library/unittest.rst:1400 +#: ../../library/unittest.rst:1395 msgid "" "Return the number of tests represented by this test object. For :class:" "`TestCase` instances, this will always be ``1``." msgstr "" -#: ../../library/unittest.rst:1406 +#: ../../library/unittest.rst:1401 msgid "" "Return an instance of the test result class that should be used for this " "test case class (if no other result instance is provided to the :meth:`run` " "method)." msgstr "" -#: ../../library/unittest.rst:1410 +#: ../../library/unittest.rst:1405 msgid "" "For :class:`TestCase` instances, this will always be an instance of :class:" "`TestResult`; subclasses of :class:`TestCase` should override this as " "necessary." msgstr "" -#: ../../library/unittest.rst:1417 +#: ../../library/unittest.rst:1412 msgid "" "Return a string identifying the specific test case. This is usually the " "full name of the test method, including the module and class name." msgstr "" -#: ../../library/unittest.rst:1423 +#: ../../library/unittest.rst:1418 msgid "" "Returns a description of the test, or ``None`` if no description has been " "provided. The default implementation of this method returns the first line " "of the test method's docstring, if available, or ``None``." msgstr "" -#: ../../library/unittest.rst:1428 +#: ../../library/unittest.rst:1423 msgid "" "In 3.1 this was changed to add the test name to the short description even " "in the presence of a docstring. This caused compatibility issues with " @@ -1785,7 +1780,7 @@ msgid "" "`TextTestResult` in Python 3.2." msgstr "" -#: ../../library/unittest.rst:1437 +#: ../../library/unittest.rst:1432 msgid "" "Add a function to be called after :meth:`tearDown` to cleanup resources used " "during the test. Functions will be called in reverse order to the order they " @@ -1794,32 +1789,32 @@ msgid "" "added." msgstr "" -#: ../../library/unittest.rst:1443 +#: ../../library/unittest.rst:1438 msgid "" "If :meth:`setUp` fails, meaning that :meth:`tearDown` is not called, then " "any cleanup functions added will still be called." msgstr "" -#: ../../library/unittest.rst:1451 +#: ../../library/unittest.rst:1446 msgid "" "This method is called unconditionally after :meth:`tearDown`, or after :meth:" "`setUp` if :meth:`setUp` raises an exception." msgstr "" -#: ../../library/unittest.rst:1454 +#: ../../library/unittest.rst:1449 msgid "" "It is responsible for calling all the cleanup functions added by :meth:" "`addCleanup`. If you need cleanup functions to be called *prior* to :meth:" "`tearDown` then you can call :meth:`doCleanups` yourself." msgstr "" -#: ../../library/unittest.rst:1459 +#: ../../library/unittest.rst:1454 msgid "" ":meth:`doCleanups` pops methods off the stack of cleanup functions one at a " "time, so it can be called at any time." msgstr "" -#: ../../library/unittest.rst:1466 +#: ../../library/unittest.rst:1461 msgid "" "Add a function to be called after :meth:`tearDownClass` to cleanup resources " "used during the test class. Functions will be called in reverse order to the " @@ -1828,38 +1823,38 @@ msgid "" "when they are added." msgstr "" -#: ../../library/unittest.rst:1472 +#: ../../library/unittest.rst:1467 msgid "" "If :meth:`setUpClass` fails, meaning that :meth:`tearDownClass` is not " "called, then any cleanup functions added will still be called." msgstr "" -#: ../../library/unittest.rst:1480 +#: ../../library/unittest.rst:1475 msgid "" "This method is called unconditionally after :meth:`tearDownClass`, or after :" "meth:`setUpClass` if :meth:`setUpClass` raises an exception." msgstr "" -#: ../../library/unittest.rst:1483 +#: ../../library/unittest.rst:1478 msgid "" "It is responsible for calling all the cleanup functions added by :meth:" -"`addClassCleanup`. If you need cleanup functions to be called *prior* to :" -"meth:`tearDownClass` then you can call :meth:`doClassCleanups` yourself." +"`addCleanupClass`. If you need cleanup functions to be called *prior* to :" +"meth:`tearDownClass` then you can call :meth:`doCleanupsClass` yourself." msgstr "" -#: ../../library/unittest.rst:1488 +#: ../../library/unittest.rst:1483 msgid "" -":meth:`doClassCleanups` pops methods off the stack of cleanup functions one " +":meth:`doCleanupsClass` pops methods off the stack of cleanup functions one " "at a time, so it can be called at any time." msgstr "" -#: ../../library/unittest.rst:1496 +#: ../../library/unittest.rst:1491 msgid "" "This class provides an API similar to :class:`TestCase` and also accepts " "coroutines as test functions." msgstr "" -#: ../../library/unittest.rst:1503 +#: ../../library/unittest.rst:1498 msgid "" "Method called to prepare the test fixture. This is called after :meth:" "`setUp`. This is called immediately before calling the test method; other " @@ -1868,7 +1863,7 @@ msgid "" "implementation does nothing." msgstr "" -#: ../../library/unittest.rst:1511 +#: ../../library/unittest.rst:1506 msgid "" "Method called immediately after the test method has been called and the " "result recorded. This is called before :meth:`tearDown`. This is called " @@ -1881,11 +1876,11 @@ msgid "" "the outcome of the test method. The default implementation does nothing." msgstr "" -#: ../../library/unittest.rst:1523 +#: ../../library/unittest.rst:1518 msgid "This method accepts a coroutine that can be used as a cleanup function." msgstr "" -#: ../../library/unittest.rst:1527 +#: ../../library/unittest.rst:1522 msgid "" "Sets up a new event loop to run the test, collecting the result into the :" "class:`TestResult` object passed as *result*. If *result* is omitted or " @@ -1895,17 +1890,17 @@ msgid "" "cancelled." msgstr "" -#: ../../library/unittest.rst:1535 +#: ../../library/unittest.rst:1530 msgid "An example illustrating the order::" msgstr "" -#: ../../library/unittest.rst:1571 +#: ../../library/unittest.rst:1566 msgid "" "After running the test, ``events`` would contain ``[\"setUp\", \"asyncSetUp" "\", \"test_response\", \"asyncTearDown\", \"tearDown\", \"cleanup\"]``." msgstr "" -#: ../../library/unittest.rst:1576 +#: ../../library/unittest.rst:1571 msgid "" "This class implements the portion of the :class:`TestCase` interface which " "allows the test runner to drive the test, but does not provide the methods " @@ -1914,150 +1909,150 @@ msgid "" "`unittest`-based test framework." msgstr "" -#: ../../library/unittest.rst:1586 +#: ../../library/unittest.rst:1581 msgid "Deprecated aliases" msgstr "" -#: ../../library/unittest.rst:1588 +#: ../../library/unittest.rst:1583 msgid "" "For historical reasons, some of the :class:`TestCase` methods had one or " "more aliases that are now deprecated. The following table lists the correct " "names along with their deprecated aliases:" msgstr "" -#: ../../library/unittest.rst:1593 +#: ../../library/unittest.rst:1588 msgid "Method Name" msgstr "" -#: ../../library/unittest.rst:1593 +#: ../../library/unittest.rst:1588 msgid "Deprecated alias" msgstr "" -#: ../../library/unittest.rst:1595 +#: ../../library/unittest.rst:1590 msgid ":meth:`.assertEqual`" msgstr "" -#: ../../library/unittest.rst:1595 +#: ../../library/unittest.rst:1590 msgid "failUnlessEqual" msgstr "" -#: ../../library/unittest.rst:1595 +#: ../../library/unittest.rst:1590 msgid "assertEquals" msgstr "" -#: ../../library/unittest.rst:1596 +#: ../../library/unittest.rst:1591 msgid ":meth:`.assertNotEqual`" msgstr "" -#: ../../library/unittest.rst:1596 +#: ../../library/unittest.rst:1591 msgid "failIfEqual" msgstr "" -#: ../../library/unittest.rst:1596 +#: ../../library/unittest.rst:1591 msgid "assertNotEquals" msgstr "" -#: ../../library/unittest.rst:1597 +#: ../../library/unittest.rst:1592 msgid ":meth:`.assertTrue`" msgstr "" -#: ../../library/unittest.rst:1597 +#: ../../library/unittest.rst:1592 msgid "failUnless" msgstr "" -#: ../../library/unittest.rst:1597 +#: ../../library/unittest.rst:1592 msgid "assert\\_" msgstr "" -#: ../../library/unittest.rst:1598 +#: ../../library/unittest.rst:1593 msgid ":meth:`.assertFalse`" msgstr "" -#: ../../library/unittest.rst:1598 +#: ../../library/unittest.rst:1593 msgid "failIf" msgstr "" -#: ../../library/unittest.rst:1599 +#: ../../library/unittest.rst:1594 msgid ":meth:`.assertRaises`" msgstr "" -#: ../../library/unittest.rst:1599 +#: ../../library/unittest.rst:1594 msgid "failUnlessRaises" msgstr "" -#: ../../library/unittest.rst:1600 +#: ../../library/unittest.rst:1595 msgid ":meth:`.assertAlmostEqual`" msgstr "" -#: ../../library/unittest.rst:1600 +#: ../../library/unittest.rst:1595 msgid "failUnlessAlmostEqual" msgstr "" -#: ../../library/unittest.rst:1600 +#: ../../library/unittest.rst:1595 msgid "assertAlmostEquals" msgstr "" -#: ../../library/unittest.rst:1601 +#: ../../library/unittest.rst:1596 msgid ":meth:`.assertNotAlmostEqual`" msgstr "" -#: ../../library/unittest.rst:1601 +#: ../../library/unittest.rst:1596 msgid "failIfAlmostEqual" msgstr "" -#: ../../library/unittest.rst:1601 +#: ../../library/unittest.rst:1596 msgid "assertNotAlmostEquals" msgstr "" -#: ../../library/unittest.rst:1602 +#: ../../library/unittest.rst:1597 msgid ":meth:`.assertRegex`" msgstr "" -#: ../../library/unittest.rst:1602 +#: ../../library/unittest.rst:1597 msgid "assertRegexpMatches" msgstr "" -#: ../../library/unittest.rst:1603 +#: ../../library/unittest.rst:1598 msgid ":meth:`.assertNotRegex`" msgstr "" -#: ../../library/unittest.rst:1603 +#: ../../library/unittest.rst:1598 msgid "assertNotRegexpMatches" msgstr "" -#: ../../library/unittest.rst:1604 +#: ../../library/unittest.rst:1599 msgid ":meth:`.assertRaisesRegex`" msgstr "" -#: ../../library/unittest.rst:1604 +#: ../../library/unittest.rst:1599 msgid "assertRaisesRegexp" msgstr "" -#: ../../library/unittest.rst:1607 +#: ../../library/unittest.rst:1602 msgid "The fail* aliases listed in the second column have been deprecated." msgstr "" -#: ../../library/unittest.rst:1609 +#: ../../library/unittest.rst:1604 msgid "The assert* aliases listed in the third column have been deprecated." msgstr "" -#: ../../library/unittest.rst:1611 +#: ../../library/unittest.rst:1606 msgid "" "``assertRegexpMatches`` and ``assertRaisesRegexp`` have been renamed to :" "meth:`.assertRegex` and :meth:`.assertRaisesRegex`." msgstr "" -#: ../../library/unittest.rst:1614 +#: ../../library/unittest.rst:1609 msgid "" "The ``assertNotRegexpMatches`` name is deprecated in favor of :meth:`." "assertNotRegex`." msgstr "" -#: ../../library/unittest.rst:1620 +#: ../../library/unittest.rst:1615 msgid "Grouping tests" msgstr "" -#: ../../library/unittest.rst:1624 +#: ../../library/unittest.rst:1619 msgid "" "This class represents an aggregation of individual test cases and test " "suites. The class presents the interface needed by the test runner to allow " @@ -2065,14 +2060,14 @@ msgid "" "is the same as iterating over the suite, running each test individually." msgstr "" -#: ../../library/unittest.rst:1629 +#: ../../library/unittest.rst:1624 msgid "" "If *tests* is given, it must be an iterable of individual test cases or " "other test suites that will be used to build the suite initially. Additional " "methods are provided to add test cases and suites to the collection later on." msgstr "" -#: ../../library/unittest.rst:1633 +#: ../../library/unittest.rst:1628 msgid "" ":class:`TestSuite` objects behave much like :class:`TestCase` objects, " "except they do not actually implement a test. Instead, they are used to " @@ -2081,47 +2076,47 @@ msgid "" "instances:" msgstr "" -#: ../../library/unittest.rst:1641 +#: ../../library/unittest.rst:1636 msgid "Add a :class:`TestCase` or :class:`TestSuite` to the suite." msgstr "" -#: ../../library/unittest.rst:1646 +#: ../../library/unittest.rst:1641 msgid "" "Add all the tests from an iterable of :class:`TestCase` and :class:" "`TestSuite` instances to this test suite." msgstr "" -#: ../../library/unittest.rst:1649 +#: ../../library/unittest.rst:1644 msgid "" "This is equivalent to iterating over *tests*, calling :meth:`addTest` for " "each element." msgstr "" -#: ../../library/unittest.rst:1652 +#: ../../library/unittest.rst:1647 msgid ":class:`TestSuite` shares the following methods with :class:`TestCase`:" msgstr "" -#: ../../library/unittest.rst:1657 +#: ../../library/unittest.rst:1652 msgid "" "Run the tests associated with this suite, collecting the result into the " "test result object passed as *result*. Note that unlike :meth:`TestCase." "run`, :meth:`TestSuite.run` requires the result object to be passed in." msgstr "" -#: ../../library/unittest.rst:1665 +#: ../../library/unittest.rst:1660 msgid "" "Run the tests associated with this suite without collecting the result. This " "allows exceptions raised by the test to be propagated to the caller and can " "be used to support running tests under a debugger." msgstr "" -#: ../../library/unittest.rst:1672 +#: ../../library/unittest.rst:1667 msgid "" "Return the number of tests represented by this test object, including all " "individual tests and sub-suites." msgstr "" -#: ../../library/unittest.rst:1678 +#: ../../library/unittest.rst:1673 msgid "" "Tests grouped by a :class:`TestSuite` are always accessed by iteration. " "Subclasses can lazily provide tests by overriding :meth:`__iter__`. Note " @@ -2133,31 +2128,31 @@ msgid "" "overrides :meth:`TestSuite._removeTestAtIndex` to preserve test references." msgstr "" -#: ../../library/unittest.rst:1688 +#: ../../library/unittest.rst:1683 msgid "" "In earlier versions the :class:`TestSuite` accessed tests directly rather " "than through iteration, so overriding :meth:`__iter__` wasn't sufficient for " "providing tests." msgstr "" -#: ../../library/unittest.rst:1693 +#: ../../library/unittest.rst:1688 msgid "" "In earlier versions the :class:`TestSuite` held references to each :class:" "`TestCase` after :meth:`TestSuite.run`. Subclasses can restore that behavior " "by overriding :meth:`TestSuite._removeTestAtIndex`." msgstr "" -#: ../../library/unittest.rst:1698 +#: ../../library/unittest.rst:1693 msgid "" "In the typical usage of a :class:`TestSuite` object, the :meth:`run` method " "is invoked by a :class:`TestRunner` rather than by the end-user test harness." msgstr "" -#: ../../library/unittest.rst:1703 +#: ../../library/unittest.rst:1698 msgid "Loading and running tests" msgstr "" -#: ../../library/unittest.rst:1707 +#: ../../library/unittest.rst:1702 msgid "" "The :class:`TestLoader` class is used to create test suites from classes and " "modules. Normally, there is no need to create an instance of this class; " @@ -2166,11 +2161,11 @@ msgid "" "customization of some configurable properties." msgstr "" -#: ../../library/unittest.rst:1713 +#: ../../library/unittest.rst:1708 msgid ":class:`TestLoader` objects have the following attributes:" msgstr "" -#: ../../library/unittest.rst:1718 +#: ../../library/unittest.rst:1713 msgid "" "A list of the non-fatal errors encountered while loading tests. Not reset by " "the loader at any point. Fatal errors are signalled by the relevant a method " @@ -2178,17 +2173,17 @@ msgid "" "synthetic test that will raise the original error when run." msgstr "" -#: ../../library/unittest.rst:1727 +#: ../../library/unittest.rst:1722 msgid ":class:`TestLoader` objects have the following methods:" msgstr "" -#: ../../library/unittest.rst:1732 +#: ../../library/unittest.rst:1727 msgid "" "Return a suite of all test cases contained in the :class:`TestCase`\\ -" "derived :class:`testCaseClass`." msgstr "" -#: ../../library/unittest.rst:1735 +#: ../../library/unittest.rst:1730 msgid "" "A test case instance is created for each method named by :meth:" "`getTestCaseNames`. By default these are the method names beginning with " @@ -2197,14 +2192,14 @@ msgid "" "method instead." msgstr "" -#: ../../library/unittest.rst:1744 +#: ../../library/unittest.rst:1739 msgid "" "Return a suite of all test cases contained in the given module. This method " "searches *module* for classes derived from :class:`TestCase` and creates an " "instance of the class for each test method defined for the class." msgstr "" -#: ../../library/unittest.rst:1751 +#: ../../library/unittest.rst:1746 msgid "" "While using a hierarchy of :class:`TestCase`\\ -derived classes can be " "convenient in sharing fixtures and helper functions, defining test methods " @@ -2213,7 +2208,7 @@ msgid "" "fixtures are different and defined in subclasses." msgstr "" -#: ../../library/unittest.rst:1757 +#: ../../library/unittest.rst:1752 msgid "" "If a module provides a ``load_tests`` function it will be called to load the " "tests. This allows modules to customize test loading. This is the " @@ -2221,11 +2216,11 @@ msgid "" "argument to ``load_tests``." msgstr "" -#: ../../library/unittest.rst:1762 +#: ../../library/unittest.rst:1757 msgid "Support for ``load_tests`` added." msgstr "" -#: ../../library/unittest.rst:1765 +#: ../../library/unittest.rst:1760 msgid "" "The undocumented and unofficial *use_load_tests* default argument is " "deprecated and ignored, although it is still accepted for backward " @@ -2233,11 +2228,11 @@ msgid "" "*pattern* which is passed to ``load_tests`` as the third argument." msgstr "" -#: ../../library/unittest.rst:1774 +#: ../../library/unittest.rst:1769 msgid "Return a suite of all test cases given a string specifier." msgstr "" -#: ../../library/unittest.rst:1776 +#: ../../library/unittest.rst:1771 msgid "" "The specifier *name* is a \"dotted name\" that may resolve either to a " "module, a test case class, a test method within a test case class, a :class:" @@ -2248,7 +2243,7 @@ msgid "" "object\"." msgstr "" -#: ../../library/unittest.rst:1784 +#: ../../library/unittest.rst:1779 msgid "" "For example, if you have a module :mod:`SampleTests` containing a :class:" "`TestCase`\\ -derived class :class:`SampleTestCase` with three test methods " @@ -2261,31 +2256,31 @@ msgid "" "a side-effect." msgstr "" -#: ../../library/unittest.rst:1794 +#: ../../library/unittest.rst:1789 msgid "The method optionally resolves *name* relative to the given *module*." msgstr "" -#: ../../library/unittest.rst:1796 +#: ../../library/unittest.rst:1791 msgid "" "If an :exc:`ImportError` or :exc:`AttributeError` occurs while traversing " "*name* then a synthetic test that raises that error when run will be " "returned. These errors are included in the errors accumulated by self.errors." msgstr "" -#: ../../library/unittest.rst:1805 +#: ../../library/unittest.rst:1800 msgid "" "Similar to :meth:`loadTestsFromName`, but takes a sequence of names rather " "than a single name. The return value is a test suite which supports all the " "tests defined for each name." msgstr "" -#: ../../library/unittest.rst:1812 +#: ../../library/unittest.rst:1807 msgid "" "Return a sorted sequence of method names found within *testCaseClass*; this " "should be a subclass of :class:`TestCase`." msgstr "" -#: ../../library/unittest.rst:1818 +#: ../../library/unittest.rst:1813 msgid "" "Find all the test modules by recursing into subdirectories from the " "specified start directory, and return a TestSuite object containing them. " @@ -2294,14 +2289,14 @@ msgid "" "Python identifiers) will be loaded." msgstr "" -#: ../../library/unittest.rst:1824 +#: ../../library/unittest.rst:1819 msgid "" "All test modules must be importable from the top level of the project. If " "the start directory is not the top level directory then the top level " "directory must be specified separately." msgstr "" -#: ../../library/unittest.rst:1828 +#: ../../library/unittest.rst:1823 msgid "" "If importing a module fails, for example due to a syntax error, then this " "will be recorded as a single error and discovery will continue. If the " @@ -2309,7 +2304,7 @@ msgid "" "as a skip instead of an error." msgstr "" -#: ../../library/unittest.rst:1833 +#: ../../library/unittest.rst:1828 msgid "" "If a package (a directory containing a file named :file:`__init__.py`) is " "found, the package will be checked for a ``load_tests`` function. If this " @@ -2319,13 +2314,13 @@ msgid "" "itself calls ``loader.discover``." msgstr "" -#: ../../library/unittest.rst:1841 +#: ../../library/unittest.rst:1836 msgid "" "If ``load_tests`` exists then discovery does *not* recurse into the package, " "``load_tests`` is responsible for loading all tests in the package." msgstr "" -#: ../../library/unittest.rst:1845 +#: ../../library/unittest.rst:1840 msgid "" "The pattern is deliberately not stored as a loader attribute so that " "packages can continue discovery themselves. *top_level_dir* is stored so " @@ -2333,75 +2328,68 @@ msgid "" "discover()``." msgstr "" -#: ../../library/unittest.rst:1850 +#: ../../library/unittest.rst:1845 msgid "*start_dir* can be a dotted module name as well as a directory." msgstr "" -#: ../../library/unittest.rst:1854 -msgid "" -"Modules that raise :exc:`SkipTest` on import are recorded as skips, not " -"errors." -msgstr "" - -#: ../../library/unittest.rst:1858 -msgid "*start_dir* can be a :term:`namespace packages `." -msgstr "" - -#: ../../library/unittest.rst:1861 +#: ../../library/unittest.rst:1849 msgid "" -"Paths are sorted before being imported so that execution order is the same " -"even if the underlying file system's ordering is not dependent on file name." +"Modules that raise :exc:`SkipTest` on import are recorded as skips, not " +"errors. Discovery works for :term:`namespace packages `. " +"Paths are sorted before being imported so that execution order is the same " +"even if the underlying file system's ordering is not dependent on file " +"name." msgstr "" -#: ../../library/unittest.rst:1866 +#: ../../library/unittest.rst:1857 msgid "" "Found packages are now checked for ``load_tests`` regardless of whether " "their path matches *pattern*, because it is impossible for a package name to " "match the default pattern." msgstr "" -#: ../../library/unittest.rst:1872 +#: ../../library/unittest.rst:1863 msgid "" "The following attributes of a :class:`TestLoader` can be configured either " "by subclassing or assignment on an instance:" msgstr "" -#: ../../library/unittest.rst:1878 +#: ../../library/unittest.rst:1869 msgid "" "String giving the prefix of method names which will be interpreted as test " "methods. The default value is ``'test'``." msgstr "" -#: ../../library/unittest.rst:1881 +#: ../../library/unittest.rst:1872 msgid "" "This affects :meth:`getTestCaseNames` and all the :meth:`loadTestsFrom\\*` " "methods." msgstr "" -#: ../../library/unittest.rst:1887 +#: ../../library/unittest.rst:1878 msgid "" "Function to be used to compare method names when sorting them in :meth:" "`getTestCaseNames` and all the :meth:`loadTestsFrom\\*` methods." msgstr "" -#: ../../library/unittest.rst:1893 +#: ../../library/unittest.rst:1884 msgid "" "Callable object that constructs a test suite from a list of tests. No " "methods on the resulting object are needed. The default value is the :class:" "`TestSuite` class." msgstr "" -#: ../../library/unittest.rst:1897 ../../library/unittest.rst:1910 +#: ../../library/unittest.rst:1888 ../../library/unittest.rst:1901 msgid "This affects all the :meth:`loadTestsFrom\\*` methods." msgstr "" -#: ../../library/unittest.rst:1901 +#: ../../library/unittest.rst:1892 msgid "" "List of Unix shell-style wildcard test name patterns that test methods have " "to match to be included in test suites (see ``-v`` option)." msgstr "" -#: ../../library/unittest.rst:1904 +#: ../../library/unittest.rst:1895 msgid "" "If this attribute is not ``None`` (the default), all test methods to be " "included in test suites must match one of the patterns in this list. Note " @@ -2410,13 +2398,13 @@ msgid "" "have to be converted using ``*`` wildcards." msgstr "" -#: ../../library/unittest.rst:1917 +#: ../../library/unittest.rst:1908 msgid "" "This class is used to compile information about which tests have succeeded " "and which have failed." msgstr "" -#: ../../library/unittest.rst:1920 +#: ../../library/unittest.rst:1911 msgid "" "A :class:`TestResult` object stores the results of a set of tests. The :" "class:`TestCase` and :class:`TestSuite` classes ensure that results are " @@ -2424,7 +2412,7 @@ msgid "" "outcome of tests." msgstr "" -#: ../../library/unittest.rst:1925 +#: ../../library/unittest.rst:1916 msgid "" "Testing frameworks built on top of :mod:`unittest` may want access to the :" "class:`TestResult` object generated by running a set of tests for reporting " @@ -2432,55 +2420,55 @@ msgid "" "`TestRunner.run` method for this purpose." msgstr "" -#: ../../library/unittest.rst:1930 +#: ../../library/unittest.rst:1921 msgid "" ":class:`TestResult` instances have the following attributes that will be of " "interest when inspecting the results of running a set of tests:" msgstr "" -#: ../../library/unittest.rst:1936 +#: ../../library/unittest.rst:1927 msgid "" "A list containing 2-tuples of :class:`TestCase` instances and strings " "holding formatted tracebacks. Each tuple represents a test which raised an " "unexpected exception." msgstr "" -#: ../../library/unittest.rst:1942 +#: ../../library/unittest.rst:1933 msgid "" "A list containing 2-tuples of :class:`TestCase` instances and strings " "holding formatted tracebacks. Each tuple represents a test where a failure " "was explicitly signalled using the :meth:`TestCase.assert\\*` methods." msgstr "" -#: ../../library/unittest.rst:1948 +#: ../../library/unittest.rst:1939 msgid "" "A list containing 2-tuples of :class:`TestCase` instances and strings " "holding the reason for skipping the test." msgstr "" -#: ../../library/unittest.rst:1955 +#: ../../library/unittest.rst:1946 msgid "" "A list containing 2-tuples of :class:`TestCase` instances and strings " -"holding formatted tracebacks. Each tuple represents an expected failure or " -"error of the test case." +"holding formatted tracebacks. Each tuple represents an expected failure of " +"the test case." msgstr "" -#: ../../library/unittest.rst:1961 +#: ../../library/unittest.rst:1952 msgid "" "A list containing :class:`TestCase` instances that were marked as expected " "failures, but succeeded." msgstr "" -#: ../../library/unittest.rst:1966 +#: ../../library/unittest.rst:1957 msgid "" "Set to ``True`` when the execution of tests should stop by :meth:`stop`." msgstr "" -#: ../../library/unittest.rst:1970 +#: ../../library/unittest.rst:1961 msgid "The total number of tests run so far." msgstr "" -#: ../../library/unittest.rst:1974 +#: ../../library/unittest.rst:1965 msgid "" "If set to true, ``sys.stdout`` and ``sys.stderr`` will be buffered in " "between :meth:`startTest` and :meth:`stopTest` being called. Collected " @@ -2489,29 +2477,29 @@ msgid "" "error message." msgstr "" -#: ../../library/unittest.rst:1983 +#: ../../library/unittest.rst:1974 msgid "" "If set to true :meth:`stop` will be called on the first failure or error, " "halting the test run." msgstr "" -#: ../../library/unittest.rst:1990 +#: ../../library/unittest.rst:1981 msgid "If set to true then local variables will be shown in tracebacks." msgstr "" -#: ../../library/unittest.rst:1996 +#: ../../library/unittest.rst:1987 msgid "" "Return ``True`` if all tests run so far have passed, otherwise returns " "``False``." msgstr "" -#: ../../library/unittest.rst:1999 +#: ../../library/unittest.rst:1990 msgid "" "Returns ``False`` if there were any :attr:`unexpectedSuccesses` from tests " "marked with the :func:`expectedFailure` decorator." msgstr "" -#: ../../library/unittest.rst:2005 +#: ../../library/unittest.rst:1996 msgid "" "This method can be called to signal that the set of tests being run should " "be aborted by setting the :attr:`shouldStop` attribute to ``True``. :class:" @@ -2519,7 +2507,7 @@ msgid "" "additional tests." msgstr "" -#: ../../library/unittest.rst:2010 +#: ../../library/unittest.rst:2001 msgid "" "For example, this feature is used by the :class:`TextTestRunner` class to " "stop the test framework when the user signals an interrupt from the " @@ -2527,7 +2515,7 @@ msgid "" "implementations can use this in a similar manner." msgstr "" -#: ../../library/unittest.rst:2015 +#: ../../library/unittest.rst:2006 msgid "" "The following methods of the :class:`TestResult` class are used to maintain " "the internal data structures, and may be extended in subclasses to support " @@ -2535,136 +2523,136 @@ msgid "" "tools which support interactive reporting while tests are being run." msgstr "" -#: ../../library/unittest.rst:2023 +#: ../../library/unittest.rst:2014 msgid "Called when the test case *test* is about to be run." msgstr "" -#: ../../library/unittest.rst:2027 +#: ../../library/unittest.rst:2018 msgid "" "Called after the test case *test* has been executed, regardless of the " "outcome." msgstr "" -#: ../../library/unittest.rst:2032 +#: ../../library/unittest.rst:2023 msgid "Called once before any tests are executed." msgstr "" -#: ../../library/unittest.rst:2039 +#: ../../library/unittest.rst:2030 msgid "Called once after all tests are executed." msgstr "" -#: ../../library/unittest.rst:2046 +#: ../../library/unittest.rst:2037 msgid "" "Called when the test case *test* raises an unexpected exception. *err* is a " "tuple of the form returned by :func:`sys.exc_info`: ``(type, value, " "traceback)``." msgstr "" -#: ../../library/unittest.rst:2050 +#: ../../library/unittest.rst:2041 msgid "" "The default implementation appends a tuple ``(test, formatted_err)`` to the " "instance's :attr:`errors` attribute, where *formatted_err* is a formatted " "traceback derived from *err*." msgstr "" -#: ../../library/unittest.rst:2057 +#: ../../library/unittest.rst:2048 msgid "" "Called when the test case *test* signals a failure. *err* is a tuple of the " "form returned by :func:`sys.exc_info`: ``(type, value, traceback)``." msgstr "" -#: ../../library/unittest.rst:2060 +#: ../../library/unittest.rst:2051 msgid "" "The default implementation appends a tuple ``(test, formatted_err)`` to the " "instance's :attr:`failures` attribute, where *formatted_err* is a formatted " "traceback derived from *err*." msgstr "" -#: ../../library/unittest.rst:2067 +#: ../../library/unittest.rst:2058 msgid "Called when the test case *test* succeeds." msgstr "" -#: ../../library/unittest.rst:2069 +#: ../../library/unittest.rst:2060 msgid "The default implementation does nothing." msgstr "" -#: ../../library/unittest.rst:2074 +#: ../../library/unittest.rst:2065 msgid "" "Called when the test case *test* is skipped. *reason* is the reason the " "test gave for skipping." msgstr "" -#: ../../library/unittest.rst:2077 +#: ../../library/unittest.rst:2068 msgid "" "The default implementation appends a tuple ``(test, reason)`` to the " "instance's :attr:`skipped` attribute." msgstr "" -#: ../../library/unittest.rst:2083 +#: ../../library/unittest.rst:2074 msgid "" -"Called when the test case *test* fails or errors, but was marked with the :" -"func:`expectedFailure` decorator." +"Called when the test case *test* fails, but was marked with the :func:" +"`expectedFailure` decorator." msgstr "" -#: ../../library/unittest.rst:2086 +#: ../../library/unittest.rst:2077 msgid "" "The default implementation appends a tuple ``(test, formatted_err)`` to the " "instance's :attr:`expectedFailures` attribute, where *formatted_err* is a " "formatted traceback derived from *err*." msgstr "" -#: ../../library/unittest.rst:2093 +#: ../../library/unittest.rst:2084 msgid "" "Called when the test case *test* was marked with the :func:`expectedFailure` " "decorator, but succeeded." msgstr "" -#: ../../library/unittest.rst:2096 +#: ../../library/unittest.rst:2087 msgid "" "The default implementation appends the test to the instance's :attr:" "`unexpectedSuccesses` attribute." msgstr "" -#: ../../library/unittest.rst:2102 +#: ../../library/unittest.rst:2093 msgid "" "Called when a subtest finishes. *test* is the test case corresponding to " "the test method. *subtest* is a custom :class:`TestCase` instance " "describing the subtest." msgstr "" -#: ../../library/unittest.rst:2106 +#: ../../library/unittest.rst:2097 msgid "" "If *outcome* is :const:`None`, the subtest succeeded. Otherwise, it failed " "with an exception where *outcome* is a tuple of the form returned by :func:" "`sys.exc_info`: ``(type, value, traceback)``." msgstr "" -#: ../../library/unittest.rst:2110 +#: ../../library/unittest.rst:2101 msgid "" "The default implementation does nothing when the outcome is a success, and " "records subtest failures as normal failures." msgstr "" -#: ../../library/unittest.rst:2118 +#: ../../library/unittest.rst:2109 msgid "" "A concrete implementation of :class:`TestResult` used by the :class:" "`TextTestRunner`." msgstr "" -#: ../../library/unittest.rst:2121 +#: ../../library/unittest.rst:2112 msgid "" "This class was previously named ``_TextTestResult``. The old name still " "exists as an alias but is deprecated." msgstr "" -#: ../../library/unittest.rst:2128 +#: ../../library/unittest.rst:2119 msgid "" "Instance of the :class:`TestLoader` class intended to be shared. If no " "customization of the :class:`TestLoader` is needed, this instance can be " "used instead of repeatedly creating new instances." msgstr "" -#: ../../library/unittest.rst:2136 +#: ../../library/unittest.rst:2127 msgid "" "A basic test runner implementation that outputs results to a stream. If " "*stream* is ``None``, the default, :data:`sys.stderr` is used as the output " @@ -2675,7 +2663,7 @@ msgid "" "unittest." msgstr "" -#: ../../library/unittest.rst:2143 +#: ../../library/unittest.rst:2134 msgid "" "By default this runner shows :exc:`DeprecationWarning`, :exc:" "`PendingDeprecationWarning`, :exc:`ResourceWarning` and :exc:`ImportWarning` " @@ -2688,28 +2676,28 @@ msgid "" "warnings>`) and leaving *warnings* to ``None``." msgstr "" -#: ../../library/unittest.rst:2154 +#: ../../library/unittest.rst:2145 msgid "Added the ``warnings`` argument." msgstr "" -#: ../../library/unittest.rst:2157 +#: ../../library/unittest.rst:2148 msgid "" "The default stream is set to :data:`sys.stderr` at instantiation time rather " "than import time." msgstr "" -#: ../../library/unittest.rst:2161 +#: ../../library/unittest.rst:2152 msgid "Added the tb_locals parameter." msgstr "" -#: ../../library/unittest.rst:2166 +#: ../../library/unittest.rst:2157 msgid "" "This method returns the instance of ``TestResult`` used by :meth:`run`. It " "is not intended to be called directly, but can be overridden in subclasses " "to provide a custom ``TestResult``." msgstr "" -#: ../../library/unittest.rst:2170 +#: ../../library/unittest.rst:2161 msgid "" "``_makeResult()`` instantiates the class or callable passed in the " "``TextTestRunner`` constructor as the ``resultclass`` argument. It defaults " @@ -2717,7 +2705,7 @@ msgid "" "class is instantiated with the following arguments::" msgstr "" -#: ../../library/unittest.rst:2179 +#: ../../library/unittest.rst:2170 msgid "" "This method is the main public interface to the ``TextTestRunner``. This " "method takes a :class:`TestSuite` or :class:`TestCase` instance. A :class:" @@ -2725,7 +2713,7 @@ msgid "" "run and the results printed to stdout." msgstr "" -#: ../../library/unittest.rst:2190 +#: ../../library/unittest.rst:2181 msgid "" "A command-line program that loads a set of tests from *module* and runs " "them; this is primarily for making test modules conveniently executable. The " @@ -2733,13 +2721,13 @@ msgid "" "of a test script::" msgstr "" -#: ../../library/unittest.rst:2198 +#: ../../library/unittest.rst:2189 msgid "" "You can run tests with more detailed information by passing in the verbosity " "argument::" msgstr "" -#: ../../library/unittest.rst:2204 +#: ../../library/unittest.rst:2195 msgid "" "The *defaultTest* argument is either the name of a single test or an " "iterable of test names to run if no test names are specified via *argv*. If " @@ -2747,40 +2735,40 @@ msgid "" "tests found in *module* are run." msgstr "" -#: ../../library/unittest.rst:2209 +#: ../../library/unittest.rst:2200 msgid "" "The *argv* argument can be a list of options passed to the program, with the " "first element being the program name. If not specified or ``None``, the " "values of :data:`sys.argv` are used." msgstr "" -#: ../../library/unittest.rst:2213 +#: ../../library/unittest.rst:2204 msgid "" "The *testRunner* argument can either be a test runner class or an already " "created instance of it. By default ``main`` calls :func:`sys.exit` with an " "exit code indicating success or failure of the tests run." msgstr "" -#: ../../library/unittest.rst:2217 +#: ../../library/unittest.rst:2208 msgid "" "The *testLoader* argument has to be a :class:`TestLoader` instance, and " "defaults to :data:`defaultTestLoader`." msgstr "" -#: ../../library/unittest.rst:2220 +#: ../../library/unittest.rst:2211 msgid "" "``main`` supports being used from the interactive interpreter by passing in " "the argument ``exit=False``. This displays the result on standard output " "without calling :func:`sys.exit`::" msgstr "" -#: ../../library/unittest.rst:2227 +#: ../../library/unittest.rst:2218 msgid "" "The *failfast*, *catchbreak* and *buffer* parameters have the same effect as " "the same-name `command-line options`_." msgstr "" -#: ../../library/unittest.rst:2230 +#: ../../library/unittest.rst:2221 msgid "" "The *warnings* argument specifies the :ref:`warning filter ` " "that should be used while running the tests. If it's not specified, it will " @@ -2789,56 +2777,56 @@ msgid "" "to ``'default'``." msgstr "" -#: ../../library/unittest.rst:2236 +#: ../../library/unittest.rst:2227 msgid "" "Calling ``main`` actually returns an instance of the ``TestProgram`` class. " "This stores the result of the tests run as the ``result`` attribute." msgstr "" -#: ../../library/unittest.rst:2239 +#: ../../library/unittest.rst:2230 msgid "The *exit* parameter was added." msgstr "" -#: ../../library/unittest.rst:2242 +#: ../../library/unittest.rst:2233 msgid "" "The *verbosity*, *failfast*, *catchbreak*, *buffer* and *warnings* " "parameters were added." msgstr "" -#: ../../library/unittest.rst:2246 +#: ../../library/unittest.rst:2237 msgid "" "The *defaultTest* parameter was changed to also accept an iterable of test " "names." msgstr "" -#: ../../library/unittest.rst:2252 +#: ../../library/unittest.rst:2243 msgid "load_tests Protocol" msgstr "" -#: ../../library/unittest.rst:2256 +#: ../../library/unittest.rst:2247 msgid "" "Modules or packages can customize how tests are loaded from them during " "normal test runs or test discovery by implementing a function called " "``load_tests``." msgstr "" -#: ../../library/unittest.rst:2259 +#: ../../library/unittest.rst:2250 msgid "" "If a test module defines ``load_tests`` it will be called by :meth:" "`TestLoader.loadTestsFromModule` with the following arguments::" msgstr "" -#: ../../library/unittest.rst:2264 +#: ../../library/unittest.rst:2255 msgid "" "where *pattern* is passed straight through from ``loadTestsFromModule``. It " "defaults to ``None``." msgstr "" -#: ../../library/unittest.rst:2267 +#: ../../library/unittest.rst:2258 msgid "It should return a :class:`TestSuite`." msgstr "" -#: ../../library/unittest.rst:2269 +#: ../../library/unittest.rst:2260 msgid "" "*loader* is the instance of :class:`TestLoader` doing the loading. " "*standard_tests* are the tests that would be loaded by default from the " @@ -2847,13 +2835,13 @@ msgid "" "packages as part of test discovery." msgstr "" -#: ../../library/unittest.rst:2275 +#: ../../library/unittest.rst:2266 msgid "" "A typical ``load_tests`` function that loads tests from a specific set of :" "class:`TestCase` classes may look like::" msgstr "" -#: ../../library/unittest.rst:2287 +#: ../../library/unittest.rst:2278 msgid "" "If discovery is started in a directory containing a package, either from the " "command line or by calling :meth:`TestLoader.discover`, then the package :" @@ -2863,31 +2851,31 @@ msgid "" "left up to ``load_tests`` which is called with the following arguments::" msgstr "" -#: ../../library/unittest.rst:2296 +#: ../../library/unittest.rst:2287 msgid "" "This should return a :class:`TestSuite` representing all the tests from the " "package. (``standard_tests`` will only contain tests collected from :file:" "`__init__.py`.)" msgstr "" -#: ../../library/unittest.rst:2300 +#: ../../library/unittest.rst:2291 msgid "" "Because the pattern is passed into ``load_tests`` the package is free to " "continue (and potentially modify) test discovery. A 'do nothing' " "``load_tests`` function for a test package would look like::" msgstr "" -#: ../../library/unittest.rst:2311 +#: ../../library/unittest.rst:2302 msgid "" "Discovery no longer checks package names for matching *pattern* due to the " "impossibility of package names matching the default pattern." msgstr "" -#: ../../library/unittest.rst:2318 +#: ../../library/unittest.rst:2309 msgid "Class and Module Fixtures" msgstr "" -#: ../../library/unittest.rst:2320 +#: ../../library/unittest.rst:2311 msgid "" "Class and module level fixtures are implemented in :class:`TestSuite`. When " "the test suite encounters a test from a new class then :meth:`tearDownClass` " @@ -2895,27 +2883,27 @@ msgid "" "`setUpClass` from the new class." msgstr "" -#: ../../library/unittest.rst:2325 +#: ../../library/unittest.rst:2316 msgid "" "Similarly if a test is from a different module from the previous test then " "``tearDownModule`` from the previous module is run, followed by " "``setUpModule`` from the new module." msgstr "" -#: ../../library/unittest.rst:2329 +#: ../../library/unittest.rst:2320 msgid "" "After all the tests have run the final ``tearDownClass`` and " "``tearDownModule`` are run." msgstr "" -#: ../../library/unittest.rst:2332 +#: ../../library/unittest.rst:2323 msgid "" "Note that shared fixtures do not play well with [potential] features like " "test parallelization and they break test isolation. They should be used with " "care." msgstr "" -#: ../../library/unittest.rst:2335 +#: ../../library/unittest.rst:2326 msgid "" "The default ordering of tests created by the unittest test loaders is to " "group all tests from the same modules and classes together. This will lead " @@ -2925,14 +2913,14 @@ msgid "" "functions may be called multiple times in a single test run." msgstr "" -#: ../../library/unittest.rst:2342 +#: ../../library/unittest.rst:2333 msgid "" "Shared fixtures are not intended to work with suites with non-standard " "ordering. A ``BaseTestSuite`` still exists for frameworks that don't want to " "support shared fixtures." msgstr "" -#: ../../library/unittest.rst:2346 +#: ../../library/unittest.rst:2337 msgid "" "If there are any exceptions raised during one of the shared fixture " "functions the test is reported as an error. Because there is no " @@ -2942,22 +2930,22 @@ msgid "" "matter, but if you are a framework author it may be relevant." msgstr "" -#: ../../library/unittest.rst:2355 +#: ../../library/unittest.rst:2346 msgid "setUpClass and tearDownClass" msgstr "" -#: ../../library/unittest.rst:2357 +#: ../../library/unittest.rst:2348 msgid "These must be implemented as class methods::" msgstr "" -#: ../../library/unittest.rst:2370 +#: ../../library/unittest.rst:2361 msgid "" "If you want the ``setUpClass`` and ``tearDownClass`` on base classes called " "then you must call up to them yourself. The implementations in :class:" "`TestCase` are empty." msgstr "" -#: ../../library/unittest.rst:2374 +#: ../../library/unittest.rst:2365 msgid "" "If an exception is raised during a ``setUpClass`` then the tests in the " "class are not run and the ``tearDownClass`` is not run. Skipped classes will " @@ -2966,15 +2954,15 @@ msgid "" "instead of as an error." msgstr "" -#: ../../library/unittest.rst:2382 +#: ../../library/unittest.rst:2373 msgid "setUpModule and tearDownModule" msgstr "" -#: ../../library/unittest.rst:2384 +#: ../../library/unittest.rst:2375 msgid "These should be implemented as functions::" msgstr "" -#: ../../library/unittest.rst:2392 +#: ../../library/unittest.rst:2383 msgid "" "If an exception is raised in a ``setUpModule`` then none of the tests in the " "module will be run and the ``tearDownModule`` will not be run. If the " @@ -2982,13 +2970,13 @@ msgid "" "having been skipped instead of as an error." msgstr "" -#: ../../library/unittest.rst:2397 +#: ../../library/unittest.rst:2388 msgid "" "To add cleanup code that must be run even in the case of an exception, use " "``addModuleCleanup``:" msgstr "" -#: ../../library/unittest.rst:2403 +#: ../../library/unittest.rst:2394 msgid "" "Add a function to be called after :func:`tearDownModule` to cleanup " "resources used during the test class. Functions will be called in reverse " @@ -2997,36 +2985,36 @@ msgid "" "`addModuleCleanup` when they are added." msgstr "" -#: ../../library/unittest.rst:2409 +#: ../../library/unittest.rst:2400 msgid "" "If :meth:`setUpModule` fails, meaning that :func:`tearDownModule` is not " "called, then any cleanup functions added will still be called." msgstr "" -#: ../../library/unittest.rst:2417 +#: ../../library/unittest.rst:2408 msgid "" "This function is called unconditionally after :func:`tearDownModule`, or " "after :func:`setUpModule` if :func:`setUpModule` raises an exception." msgstr "" -#: ../../library/unittest.rst:2420 +#: ../../library/unittest.rst:2411 msgid "" "It is responsible for calling all the cleanup functions added by :func:" "`addCleanupModule`. If you need cleanup functions to be called *prior* to :" "func:`tearDownModule` then you can call :func:`doModuleCleanups` yourself." msgstr "" -#: ../../library/unittest.rst:2425 +#: ../../library/unittest.rst:2416 msgid "" ":func:`doModuleCleanups` pops methods off the stack of cleanup functions one " "at a time, so it can be called at any time." msgstr "" -#: ../../library/unittest.rst:2431 +#: ../../library/unittest.rst:2422 msgid "Signal Handling" msgstr "" -#: ../../library/unittest.rst:2435 +#: ../../library/unittest.rst:2426 msgid "" "The :option:`-c/--catch ` command-line option to unittest, " "along with the ``catchbreak`` parameter to :func:`unittest.main()`, provide " @@ -3036,7 +3024,7 @@ msgid "" "A second control-c will raise a :exc:`KeyboardInterrupt` in the usual way." msgstr "" -#: ../../library/unittest.rst:2442 +#: ../../library/unittest.rst:2433 msgid "" "The control-c handling signal handler attempts to remain compatible with " "code or tests that install their own :const:`signal.SIGINT` handler. If the " @@ -3048,41 +3036,41 @@ msgid "" "disabled the :func:`removeHandler` decorator can be used." msgstr "" -#: ../../library/unittest.rst:2451 +#: ../../library/unittest.rst:2442 msgid "" "There are a few utility functions for framework authors to enable control-c " "handling functionality within test frameworks." msgstr "" -#: ../../library/unittest.rst:2456 +#: ../../library/unittest.rst:2447 msgid "" "Install the control-c handler. When a :const:`signal.SIGINT` is received " "(usually in response to the user pressing control-c) all registered results " "have :meth:`~TestResult.stop` called." msgstr "" -#: ../../library/unittest.rst:2463 +#: ../../library/unittest.rst:2454 msgid "" "Register a :class:`TestResult` object for control-c handling. Registering a " "result stores a weak reference to it, so it doesn't prevent the result from " "being garbage collected." msgstr "" -#: ../../library/unittest.rst:2467 +#: ../../library/unittest.rst:2458 msgid "" "Registering a :class:`TestResult` object has no side-effects if control-c " "handling is not enabled, so test frameworks can unconditionally register all " "results they create independently of whether or not handling is enabled." msgstr "" -#: ../../library/unittest.rst:2474 +#: ../../library/unittest.rst:2465 msgid "" "Remove a registered result. Once a result has been removed then :meth:" "`~TestResult.stop` will no longer be called on that result object in " "response to a control-c." msgstr "" -#: ../../library/unittest.rst:2481 +#: ../../library/unittest.rst:2472 msgid "" "When called without arguments this function removes the control-c handler if " "it has been installed. This function can also be used as a test decorator to " diff --git a/library/urllib.parse.po b/library/urllib.parse.po index 0450d87bf4..4859143cf1 100644 --- a/library/urllib.parse.po +++ b/library/urllib.parse.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.7\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2021-09-07 06:52+0000\n" +"POT-Creation-Date: 2020-06-20 18:08+0800\n" "PO-Revision-Date: 2018-05-23 16:14+0000\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -101,74 +101,74 @@ msgid "" "accessed by index or as named attributes, which are:" msgstr "" -#: ../../library/urllib.parse.rst:96 ../../library/urllib.parse.rst:280 -#: ../../library/urllib.parse.rst:384 +#: ../../library/urllib.parse.rst:96 ../../library/urllib.parse.rst:263 +#: ../../library/urllib.parse.rst:360 msgid "Attribute" msgstr "" -#: ../../library/urllib.parse.rst:96 ../../library/urllib.parse.rst:280 -#: ../../library/urllib.parse.rst:384 +#: ../../library/urllib.parse.rst:96 ../../library/urllib.parse.rst:263 +#: ../../library/urllib.parse.rst:360 msgid "Index" msgstr "" -#: ../../library/urllib.parse.rst:96 ../../library/urllib.parse.rst:280 -#: ../../library/urllib.parse.rst:384 +#: ../../library/urllib.parse.rst:96 ../../library/urllib.parse.rst:263 +#: ../../library/urllib.parse.rst:360 msgid "Value" msgstr "" -#: ../../library/urllib.parse.rst:96 ../../library/urllib.parse.rst:280 -#: ../../library/urllib.parse.rst:384 +#: ../../library/urllib.parse.rst:96 ../../library/urllib.parse.rst:263 +#: ../../library/urllib.parse.rst:360 msgid "Value if not present" msgstr "" -#: ../../library/urllib.parse.rst:98 ../../library/urllib.parse.rst:282 +#: ../../library/urllib.parse.rst:98 ../../library/urllib.parse.rst:265 msgid ":attr:`scheme`" msgstr "" -#: ../../library/urllib.parse.rst:98 ../../library/urllib.parse.rst:282 -#: ../../library/urllib.parse.rst:386 +#: ../../library/urllib.parse.rst:98 ../../library/urllib.parse.rst:265 +#: ../../library/urllib.parse.rst:362 msgid "0" msgstr "0" -#: ../../library/urllib.parse.rst:98 ../../library/urllib.parse.rst:282 +#: ../../library/urllib.parse.rst:98 ../../library/urllib.parse.rst:265 msgid "URL scheme specifier" msgstr "" -#: ../../library/urllib.parse.rst:98 ../../library/urllib.parse.rst:282 +#: ../../library/urllib.parse.rst:98 ../../library/urllib.parse.rst:265 msgid "*scheme* parameter" msgstr "" -#: ../../library/urllib.parse.rst:100 ../../library/urllib.parse.rst:284 +#: ../../library/urllib.parse.rst:100 ../../library/urllib.parse.rst:267 msgid ":attr:`netloc`" msgstr "" -#: ../../library/urllib.parse.rst:100 ../../library/urllib.parse.rst:284 -#: ../../library/urllib.parse.rst:388 +#: ../../library/urllib.parse.rst:100 ../../library/urllib.parse.rst:267 +#: ../../library/urllib.parse.rst:364 msgid "1" msgstr "1" -#: ../../library/urllib.parse.rst:100 ../../library/urllib.parse.rst:284 +#: ../../library/urllib.parse.rst:100 ../../library/urllib.parse.rst:267 msgid "Network location part" msgstr "" #: ../../library/urllib.parse.rst:100 ../../library/urllib.parse.rst:102 #: ../../library/urllib.parse.rst:104 ../../library/urllib.parse.rst:107 -#: ../../library/urllib.parse.rst:109 ../../library/urllib.parse.rst:284 -#: ../../library/urllib.parse.rst:286 ../../library/urllib.parse.rst:288 -#: ../../library/urllib.parse.rst:290 ../../library/urllib.parse.rst:386 -#: ../../library/urllib.parse.rst:388 +#: ../../library/urllib.parse.rst:109 ../../library/urllib.parse.rst:267 +#: ../../library/urllib.parse.rst:269 ../../library/urllib.parse.rst:271 +#: ../../library/urllib.parse.rst:273 ../../library/urllib.parse.rst:362 +#: ../../library/urllib.parse.rst:364 msgid "empty string" msgstr "" -#: ../../library/urllib.parse.rst:102 ../../library/urllib.parse.rst:286 +#: ../../library/urllib.parse.rst:102 ../../library/urllib.parse.rst:269 msgid ":attr:`path`" msgstr "" -#: ../../library/urllib.parse.rst:102 ../../library/urllib.parse.rst:286 +#: ../../library/urllib.parse.rst:102 ../../library/urllib.parse.rst:269 msgid "2" msgstr "2" -#: ../../library/urllib.parse.rst:102 ../../library/urllib.parse.rst:286 +#: ../../library/urllib.parse.rst:102 ../../library/urllib.parse.rst:269 msgid "Hierarchical path" msgstr "" @@ -176,7 +176,7 @@ msgstr "" msgid ":attr:`params`" msgstr "" -#: ../../library/urllib.parse.rst:104 ../../library/urllib.parse.rst:288 +#: ../../library/urllib.parse.rst:104 ../../library/urllib.parse.rst:271 msgid "3" msgstr "" @@ -184,20 +184,20 @@ msgstr "" msgid "Parameters for last path element" msgstr "" -#: ../../library/urllib.parse.rst:107 ../../library/urllib.parse.rst:288 +#: ../../library/urllib.parse.rst:107 ../../library/urllib.parse.rst:271 msgid ":attr:`query`" msgstr "" -#: ../../library/urllib.parse.rst:107 ../../library/urllib.parse.rst:290 +#: ../../library/urllib.parse.rst:107 ../../library/urllib.parse.rst:273 msgid "4" msgstr "4" -#: ../../library/urllib.parse.rst:107 ../../library/urllib.parse.rst:288 +#: ../../library/urllib.parse.rst:107 ../../library/urllib.parse.rst:271 msgid "Query component" msgstr "" -#: ../../library/urllib.parse.rst:109 ../../library/urllib.parse.rst:290 -#: ../../library/urllib.parse.rst:388 +#: ../../library/urllib.parse.rst:109 ../../library/urllib.parse.rst:273 +#: ../../library/urllib.parse.rst:364 msgid ":attr:`fragment`" msgstr "" @@ -205,64 +205,64 @@ msgstr "" msgid "5" msgstr "" -#: ../../library/urllib.parse.rst:109 ../../library/urllib.parse.rst:290 -#: ../../library/urllib.parse.rst:388 +#: ../../library/urllib.parse.rst:109 ../../library/urllib.parse.rst:273 +#: ../../library/urllib.parse.rst:364 msgid "Fragment identifier" msgstr "" -#: ../../library/urllib.parse.rst:111 ../../library/urllib.parse.rst:292 +#: ../../library/urllib.parse.rst:111 ../../library/urllib.parse.rst:275 msgid ":attr:`username`" msgstr "" -#: ../../library/urllib.parse.rst:111 ../../library/urllib.parse.rst:292 +#: ../../library/urllib.parse.rst:111 ../../library/urllib.parse.rst:275 msgid "User name" msgstr "" #: ../../library/urllib.parse.rst:111 ../../library/urllib.parse.rst:113 #: ../../library/urllib.parse.rst:115 ../../library/urllib.parse.rst:117 -#: ../../library/urllib.parse.rst:292 ../../library/urllib.parse.rst:294 -#: ../../library/urllib.parse.rst:296 ../../library/urllib.parse.rst:298 +#: ../../library/urllib.parse.rst:275 ../../library/urllib.parse.rst:277 +#: ../../library/urllib.parse.rst:279 ../../library/urllib.parse.rst:281 msgid ":const:`None`" msgstr "" -#: ../../library/urllib.parse.rst:113 ../../library/urllib.parse.rst:294 +#: ../../library/urllib.parse.rst:113 ../../library/urllib.parse.rst:277 msgid ":attr:`password`" msgstr "" -#: ../../library/urllib.parse.rst:113 ../../library/urllib.parse.rst:294 +#: ../../library/urllib.parse.rst:113 ../../library/urllib.parse.rst:277 msgid "Password" msgstr "" -#: ../../library/urllib.parse.rst:115 ../../library/urllib.parse.rst:296 +#: ../../library/urllib.parse.rst:115 ../../library/urllib.parse.rst:279 msgid ":attr:`hostname`" msgstr "" -#: ../../library/urllib.parse.rst:115 ../../library/urllib.parse.rst:296 +#: ../../library/urllib.parse.rst:115 ../../library/urllib.parse.rst:279 msgid "Host name (lower case)" msgstr "" -#: ../../library/urllib.parse.rst:117 ../../library/urllib.parse.rst:298 +#: ../../library/urllib.parse.rst:117 ../../library/urllib.parse.rst:281 msgid ":attr:`port`" msgstr "" -#: ../../library/urllib.parse.rst:117 ../../library/urllib.parse.rst:298 +#: ../../library/urllib.parse.rst:117 ../../library/urllib.parse.rst:281 msgid "Port number as integer, if present" msgstr "" -#: ../../library/urllib.parse.rst:121 ../../library/urllib.parse.rst:302 +#: ../../library/urllib.parse.rst:121 ../../library/urllib.parse.rst:285 msgid "" "Reading the :attr:`port` attribute will raise a :exc:`ValueError` if an " "invalid port is specified in the URL. See section :ref:`urlparse-result-" "object` for more information on the result object." msgstr "" -#: ../../library/urllib.parse.rst:125 ../../library/urllib.parse.rst:306 +#: ../../library/urllib.parse.rst:125 ../../library/urllib.parse.rst:289 msgid "" "Unmatched square brackets in the :attr:`netloc` attribute will raise a :exc:" "`ValueError`." msgstr "" -#: ../../library/urllib.parse.rst:128 ../../library/urllib.parse.rst:309 +#: ../../library/urllib.parse.rst:128 ../../library/urllib.parse.rst:292 msgid "" "Characters in the :attr:`netloc` attribute that decompose under NFKC " "normalization (as used by the IDNA encoding) into any of ``/``, ``?``, " @@ -289,13 +289,13 @@ msgid "" "that support fragments existed." msgstr "" -#: ../../library/urllib.parse.rst:159 ../../library/urllib.parse.rst:317 +#: ../../library/urllib.parse.rst:159 ../../library/urllib.parse.rst:297 msgid "" "Out-of-range port numbers now raise :exc:`ValueError`, instead of returning :" "const:`None`." msgstr "" -#: ../../library/urllib.parse.rst:163 ../../library/urllib.parse.rst:321 +#: ../../library/urllib.parse.rst:163 ../../library/urllib.parse.rst:301 msgid "" "Characters that affect netloc parsing under NFKC normalization will now " "raise :exc:`ValueError`." @@ -309,7 +309,7 @@ msgid "" "lists of values for each name." msgstr "" -#: ../../library/urllib.parse.rst:175 ../../library/urllib.parse.rst:220 +#: ../../library/urllib.parse.rst:175 ../../library/urllib.parse.rst:211 msgid "" "The optional argument *keep_blank_values* is a flag indicating whether blank " "values in percent-encoded queries should be treated as blank strings. A true " @@ -318,69 +318,55 @@ msgid "" "treated as if they were not included." msgstr "" -#: ../../library/urllib.parse.rst:181 ../../library/urllib.parse.rst:226 +#: ../../library/urllib.parse.rst:181 ../../library/urllib.parse.rst:217 msgid "" "The optional argument *strict_parsing* is a flag indicating what to do with " "parsing errors. If false (the default), errors are silently ignored. If " "true, errors raise a :exc:`ValueError` exception." msgstr "" -#: ../../library/urllib.parse.rst:185 ../../library/urllib.parse.rst:230 +#: ../../library/urllib.parse.rst:185 ../../library/urllib.parse.rst:221 msgid "" "The optional *encoding* and *errors* parameters specify how to decode " "percent-encoded sequences into Unicode characters, as accepted by the :meth:" "`bytes.decode` method." msgstr "" -#: ../../library/urllib.parse.rst:189 ../../library/urllib.parse.rst:234 +#: ../../library/urllib.parse.rst:189 ../../library/urllib.parse.rst:225 msgid "" "The optional argument *max_num_fields* is the maximum number of fields to " "read. If set, then throws a :exc:`ValueError` if there are more than " "*max_num_fields* fields read." msgstr "" -#: ../../library/urllib.parse.rst:193 ../../library/urllib.parse.rst:238 -msgid "" -"The optional argument *separator* is the symbol to use for separating the " -"query arguments. It defaults to ``&``." -msgstr "" - -#: ../../library/urllib.parse.rst:196 +#: ../../library/urllib.parse.rst:193 msgid "" "Use the :func:`urllib.parse.urlencode` function (with the ``doseq`` " "parameter set to ``True``) to convert such dictionaries into query strings." msgstr "" -#: ../../library/urllib.parse.rst:201 ../../library/urllib.parse.rst:243 +#: ../../library/urllib.parse.rst:198 ../../library/urllib.parse.rst:232 msgid "Add *encoding* and *errors* parameters." msgstr "" -#: ../../library/urllib.parse.rst:204 ../../library/urllib.parse.rst:246 +#: ../../library/urllib.parse.rst:201 ../../library/urllib.parse.rst:235 msgid "Added *max_num_fields* parameter." msgstr "" -#: ../../library/urllib.parse.rst:207 ../../library/urllib.parse.rst:249 -msgid "" -"Added *separator* parameter with the default value of ``&``. Python versions " -"earlier than Python 3.9.2 allowed using both ``;`` and ``&`` as query " -"parameter separator. This has been changed to allow only a single separator " -"key, with ``&`` as the default separator." -msgstr "" - -#: ../../library/urllib.parse.rst:216 +#: ../../library/urllib.parse.rst:207 msgid "" "Parse a query string given as a string argument (data of type :mimetype:" "`application/x-www-form-urlencoded`). Data are returned as a list of name, " "value pairs." msgstr "" -#: ../../library/urllib.parse.rst:240 +#: ../../library/urllib.parse.rst:229 msgid "" "Use the :func:`urllib.parse.urlencode` function to convert such lists of " "pairs into query strings." msgstr "" -#: ../../library/urllib.parse.rst:258 +#: ../../library/urllib.parse.rst:241 msgid "" "Construct a URL from a tuple as returned by ``urlparse()``. The *parts* " "argument can be any six-item iterable. This may result in a slightly " @@ -389,7 +375,7 @@ msgid "" "states that these are equivalent)." msgstr "" -#: ../../library/urllib.parse.rst:267 +#: ../../library/urllib.parse.rst:250 msgid "" "This is similar to :func:`urlparse`, but does not split the params from the " "URL. This should generally be used instead of :func:`urlparse` if the more " @@ -399,23 +385,13 @@ msgid "" "returns a 5-item :term:`named tuple`::" msgstr "" -#: ../../library/urllib.parse.rst:276 ../../library/urllib.parse.rst:380 +#: ../../library/urllib.parse.rst:259 ../../library/urllib.parse.rst:356 msgid "" "The return value is a :term:`named tuple`, its items can be accessed by " "index or as named attributes:" msgstr "" -#: ../../library/urllib.parse.rst:314 -msgid "" -"Following the `WHATWG spec`_ that updates RFC 3986, ASCII newline ``\\n``, ``" -"\\r`` and tab ``\\t`` characters are stripped from the URL." -msgstr "" - -#: ../../library/urllib.parse.rst:325 -msgid "ASCII newline and tab characters are stripped from the URL." -msgstr "" - -#: ../../library/urllib.parse.rst:332 +#: ../../library/urllib.parse.rst:308 msgid "" "Combine the elements of a tuple as returned by :func:`urlsplit` into a " "complete URL as a string. The *parts* argument can be any five-item " @@ -424,7 +400,7 @@ msgid "" "a ? with an empty query; the RFC states that these are equivalent)." msgstr "" -#: ../../library/urllib.parse.rst:341 +#: ../../library/urllib.parse.rst:317 msgid "" "Construct a full (\"absolute\") URL by combining a \"base URL\" (*base*) " "with another URL (*url*). Informally, this uses components of the base URL, " @@ -432,30 +408,30 @@ msgid "" "path, to provide missing components in the relative URL. For example:" msgstr "" -#: ../../library/urllib.parse.rst:350 +#: ../../library/urllib.parse.rst:326 msgid "" "The *allow_fragments* argument has the same meaning and default as for :func:" "`urlparse`." msgstr "" -#: ../../library/urllib.parse.rst:355 +#: ../../library/urllib.parse.rst:331 msgid "" "If *url* is an absolute URL (that is, it starts with ``//`` or ``scheme://" "``), the *url*'s hostname and/or scheme will be present in the result. For " "example:" msgstr "" -#: ../../library/urllib.parse.rst:364 +#: ../../library/urllib.parse.rst:340 msgid "" "If you do not want that behavior, preprocess the *url* with :func:`urlsplit` " "and :func:`urlunsplit`, removing possible *scheme* and *netloc* parts." msgstr "" -#: ../../library/urllib.parse.rst:370 +#: ../../library/urllib.parse.rst:346 msgid "Behavior updated to match the semantics defined in :rfc:`3986`." msgstr "" -#: ../../library/urllib.parse.rst:375 +#: ../../library/urllib.parse.rst:351 msgid "" "If *url* contains a fragment identifier, return a modified version of *url* " "with no fragment identifier, and the fragment identifier as a separate " @@ -463,25 +439,25 @@ msgid "" "unmodified and an empty string." msgstr "" -#: ../../library/urllib.parse.rst:386 +#: ../../library/urllib.parse.rst:362 msgid ":attr:`url`" msgstr "" -#: ../../library/urllib.parse.rst:386 +#: ../../library/urllib.parse.rst:362 msgid "URL with no fragment" msgstr "" -#: ../../library/urllib.parse.rst:391 +#: ../../library/urllib.parse.rst:367 msgid "" "See section :ref:`urlparse-result-object` for more information on the result " "object." msgstr "" -#: ../../library/urllib.parse.rst:394 +#: ../../library/urllib.parse.rst:370 msgid "Result is a structured object rather than a simple 2-tuple." msgstr "" -#: ../../library/urllib.parse.rst:399 +#: ../../library/urllib.parse.rst:375 msgid "" "Extract the url from a wrapped URL (that is, a string formatted as ````, ````, ``URL:scheme://host/path`` " @@ -489,11 +465,11 @@ msgid "" "without changes." msgstr "" -#: ../../library/urllib.parse.rst:407 +#: ../../library/urllib.parse.rst:383 msgid "Parsing ASCII Encoded Bytes" msgstr "" -#: ../../library/urllib.parse.rst:409 +#: ../../library/urllib.parse.rst:385 msgid "" "The URL parsing functions were originally designed to operate on character " "strings only. In practice, it is useful to be able to manipulate properly " @@ -502,14 +478,14 @@ msgid "" "`bytearray` objects in addition to :class:`str` objects." msgstr "" -#: ../../library/urllib.parse.rst:415 +#: ../../library/urllib.parse.rst:391 msgid "" "If :class:`str` data is passed in, the result will also contain only :class:" "`str` data. If :class:`bytes` or :class:`bytearray` data is passed in, the " "result will contain only :class:`bytes` data." msgstr "" -#: ../../library/urllib.parse.rst:419 +#: ../../library/urllib.parse.rst:395 msgid "" "Attempting to mix :class:`str` data with :class:`bytes` or :class:" "`bytearray` in a single function call will result in a :exc:`TypeError` " @@ -517,7 +493,7 @@ msgid "" "trigger :exc:`UnicodeDecodeError`." msgstr "" -#: ../../library/urllib.parse.rst:424 +#: ../../library/urllib.parse.rst:400 msgid "" "To support easier conversion of result objects between :class:`str` and :" "class:`bytes`, all return values from URL parsing functions provide either " @@ -530,14 +506,14 @@ msgid "" "`str` data (for :meth:`decode` methods)." msgstr "" -#: ../../library/urllib.parse.rst:435 +#: ../../library/urllib.parse.rst:411 msgid "" "Applications that need to operate on potentially improperly quoted URLs that " "may contain non-ASCII data will need to do their own decoding from bytes to " "characters before invoking the URL parsing methods." msgstr "" -#: ../../library/urllib.parse.rst:439 +#: ../../library/urllib.parse.rst:415 msgid "" "The behaviour described in this section applies only to the URL parsing " "functions. The URL quoting functions use their own rules when producing or " @@ -545,15 +521,15 @@ msgid "" "URL quoting functions." msgstr "" -#: ../../library/urllib.parse.rst:444 +#: ../../library/urllib.parse.rst:420 msgid "URL parsing functions now accept ASCII encoded byte sequences" msgstr "" -#: ../../library/urllib.parse.rst:451 +#: ../../library/urllib.parse.rst:427 msgid "Structured Parse Results" msgstr "" -#: ../../library/urllib.parse.rst:453 +#: ../../library/urllib.parse.rst:429 msgid "" "The result objects from the :func:`urlparse`, :func:`urlsplit` and :func:" "`urldefrag` functions are subclasses of the :class:`tuple` type. These " @@ -562,7 +538,7 @@ msgid "" "section, as well as an additional method:" msgstr "" -#: ../../library/urllib.parse.rst:461 +#: ../../library/urllib.parse.rst:437 msgid "" "Return the re-combined version of the original URL as a string. This may " "differ from the original URL in that the scheme may be normalized to lower " @@ -570,72 +546,72 @@ msgid "" "queries, and fragment identifiers will be removed." msgstr "" -#: ../../library/urllib.parse.rst:466 +#: ../../library/urllib.parse.rst:442 msgid "" "For :func:`urldefrag` results, only empty fragment identifiers will be " "removed. For :func:`urlsplit` and :func:`urlparse` results, all noted " "changes will be made to the URL returned by this method." msgstr "" -#: ../../library/urllib.parse.rst:470 +#: ../../library/urllib.parse.rst:446 msgid "" "The result of this method remains unchanged if passed back through the " "original parsing function:" msgstr "" -#: ../../library/urllib.parse.rst:483 +#: ../../library/urllib.parse.rst:459 msgid "" "The following classes provide the implementations of the structured parse " "results when operating on :class:`str` objects:" msgstr "" -#: ../../library/urllib.parse.rst:488 +#: ../../library/urllib.parse.rst:464 msgid "" "Concrete class for :func:`urldefrag` results containing :class:`str` data. " "The :meth:`encode` method returns a :class:`DefragResultBytes` instance." msgstr "" -#: ../../library/urllib.parse.rst:496 +#: ../../library/urllib.parse.rst:472 msgid "" "Concrete class for :func:`urlparse` results containing :class:`str` data. " "The :meth:`encode` method returns a :class:`ParseResultBytes` instance." msgstr "" -#: ../../library/urllib.parse.rst:502 +#: ../../library/urllib.parse.rst:478 msgid "" "Concrete class for :func:`urlsplit` results containing :class:`str` data. " "The :meth:`encode` method returns a :class:`SplitResultBytes` instance." msgstr "" -#: ../../library/urllib.parse.rst:507 +#: ../../library/urllib.parse.rst:483 msgid "" "The following classes provide the implementations of the parse results when " "operating on :class:`bytes` or :class:`bytearray` objects:" msgstr "" -#: ../../library/urllib.parse.rst:512 +#: ../../library/urllib.parse.rst:488 msgid "" "Concrete class for :func:`urldefrag` results containing :class:`bytes` data. " "The :meth:`decode` method returns a :class:`DefragResult` instance." msgstr "" -#: ../../library/urllib.parse.rst:520 +#: ../../library/urllib.parse.rst:496 msgid "" "Concrete class for :func:`urlparse` results containing :class:`bytes` data. " "The :meth:`decode` method returns a :class:`ParseResult` instance." msgstr "" -#: ../../library/urllib.parse.rst:528 +#: ../../library/urllib.parse.rst:504 msgid "" "Concrete class for :func:`urlsplit` results containing :class:`bytes` data. " "The :meth:`decode` method returns a :class:`SplitResult` instance." msgstr "" -#: ../../library/urllib.parse.rst:536 +#: ../../library/urllib.parse.rst:512 msgid "URL Quoting" msgstr "" -#: ../../library/urllib.parse.rst:538 +#: ../../library/urllib.parse.rst:514 msgid "" "The URL quoting functions focus on taking program data and making it safe " "for use as URL components by quoting special characters and appropriately " @@ -644,7 +620,7 @@ msgid "" "isn't already covered by the URL parsing functions above." msgstr "" -#: ../../library/urllib.parse.rst:546 +#: ../../library/urllib.parse.rst:522 msgid "" "Replace special characters in *string* using the ``%xx`` escape. Letters, " "digits, and the characters ``'_.-~'`` are never quoted. By default, this " @@ -653,18 +629,18 @@ msgid "" "quoted --- its default value is ``'/'``." msgstr "" -#: ../../library/urllib.parse.rst:552 ../../library/urllib.parse.rst:598 -#: ../../library/urllib.parse.rst:627 +#: ../../library/urllib.parse.rst:528 ../../library/urllib.parse.rst:574 +#: ../../library/urllib.parse.rst:603 msgid "*string* may be either a :class:`str` or a :class:`bytes` object." msgstr "" -#: ../../library/urllib.parse.rst:554 +#: ../../library/urllib.parse.rst:530 msgid "" "Moved from :rfc:`2396` to :rfc:`3986` for quoting URL strings. \"~\" is now " "included in the set of unreserved characters." msgstr "" -#: ../../library/urllib.parse.rst:558 +#: ../../library/urllib.parse.rst:534 msgid "" "The optional *encoding* and *errors* parameters specify how to deal with non-" "ASCII characters, as accepted by the :meth:`str.encode` method. *encoding* " @@ -674,17 +650,17 @@ msgid "" "`TypeError` is raised." msgstr "" -#: ../../library/urllib.parse.rst:566 +#: ../../library/urllib.parse.rst:542 msgid "" "Note that ``quote(string, safe, encoding, errors)`` is equivalent to " "``quote_from_bytes(string.encode(encoding, errors), safe)``." msgstr "" -#: ../../library/urllib.parse.rst:569 +#: ../../library/urllib.parse.rst:545 msgid "Example: ``quote('/El Niño/')`` yields ``'/El%20Ni%C3%B1o/'``." msgstr "" -#: ../../library/urllib.parse.rst:574 +#: ../../library/urllib.parse.rst:550 msgid "" "Like :func:`quote`, but also replace spaces with plus signs, as required for " "quoting HTML form values when building up a query string to go into a URL. " @@ -692,21 +668,21 @@ msgid "" "*safe*. It also does not have *safe* default to ``'/'``." msgstr "" -#: ../../library/urllib.parse.rst:579 +#: ../../library/urllib.parse.rst:555 msgid "Example: ``quote_plus('/El Niño/')`` yields ``'%2FEl+Ni%C3%B1o%2F'``." msgstr "" -#: ../../library/urllib.parse.rst:584 +#: ../../library/urllib.parse.rst:560 msgid "" "Like :func:`quote`, but accepts a :class:`bytes` object rather than a :class:" "`str`, and does not perform string-to-bytes encoding." msgstr "" -#: ../../library/urllib.parse.rst:587 +#: ../../library/urllib.parse.rst:563 msgid "Example: ``quote_from_bytes(b'a&\\xef')`` yields ``'a%26%EF'``." msgstr "" -#: ../../library/urllib.parse.rst:593 +#: ../../library/urllib.parse.rst:569 msgid "" "Replace ``%xx`` escapes with their single-character equivalent. The optional " "*encoding* and *errors* parameters specify how to decode percent-encoded " @@ -714,52 +690,52 @@ msgid "" "method." msgstr "" -#: ../../library/urllib.parse.rst:600 +#: ../../library/urllib.parse.rst:576 msgid "" "*encoding* defaults to ``'utf-8'``. *errors* defaults to ``'replace'``, " "meaning invalid sequences are replaced by a placeholder character." msgstr "" -#: ../../library/urllib.parse.rst:604 +#: ../../library/urllib.parse.rst:580 msgid "Example: ``unquote('/El%20Ni%C3%B1o/')`` yields ``'/El Niño/'``." msgstr "" -#: ../../library/urllib.parse.rst:606 +#: ../../library/urllib.parse.rst:582 msgid "" "*string* parameter supports bytes and str objects (previously only str)." msgstr "" -#: ../../library/urllib.parse.rst:614 +#: ../../library/urllib.parse.rst:590 msgid "" "Like :func:`unquote`, but also replace plus signs with spaces, as required " "for unquoting HTML form values." msgstr "" -#: ../../library/urllib.parse.rst:617 +#: ../../library/urllib.parse.rst:593 msgid "*string* must be a :class:`str`." msgstr "" -#: ../../library/urllib.parse.rst:619 +#: ../../library/urllib.parse.rst:595 msgid "Example: ``unquote_plus('/El+Ni%C3%B1o/')`` yields ``'/El Niño/'``." msgstr "" -#: ../../library/urllib.parse.rst:624 +#: ../../library/urllib.parse.rst:600 msgid "" "Replace ``%xx`` escapes with their single-octet equivalent, and return a :" "class:`bytes` object." msgstr "" -#: ../../library/urllib.parse.rst:629 +#: ../../library/urllib.parse.rst:605 msgid "" "If it is a :class:`str`, unescaped non-ASCII characters in *string* are " "encoded into UTF-8 bytes." msgstr "" -#: ../../library/urllib.parse.rst:632 +#: ../../library/urllib.parse.rst:608 msgid "Example: ``unquote_to_bytes('a%26%EF')`` yields ``b'a&\\xef'``." msgstr "" -#: ../../library/urllib.parse.rst:638 +#: ../../library/urllib.parse.rst:614 msgid "" "Convert a mapping object or a sequence of two-element tuples, which may " "contain :class:`str` or :class:`bytes` objects, to a percent-encoded ASCII " @@ -768,7 +744,7 @@ msgid "" "be encoded to bytes, otherwise it would result in a :exc:`TypeError`." msgstr "" -#: ../../library/urllib.parse.rst:645 +#: ../../library/urllib.parse.rst:621 msgid "" "The resulting string is a series of ``key=value`` pairs separated by ``'&'`` " "characters, where both *key* and *value* are quoted using the *quote_via* " @@ -781,7 +757,7 @@ msgid "" "``quote`` and specify a value for *safe*." msgstr "" -#: ../../library/urllib.parse.rst:655 +#: ../../library/urllib.parse.rst:631 msgid "" "When a sequence of two-element tuples is used as the *query* argument, the " "first element of each tuple is a key and the second is a value. The value " @@ -792,49 +768,39 @@ msgid "" "order of parameter tuples in the sequence." msgstr "" -#: ../../library/urllib.parse.rst:663 +#: ../../library/urllib.parse.rst:639 msgid "" "The *safe*, *encoding*, and *errors* parameters are passed down to " "*quote_via* (the *encoding* and *errors* parameters are only passed when a " "query element is a :class:`str`)." msgstr "" -#: ../../library/urllib.parse.rst:667 +#: ../../library/urllib.parse.rst:643 msgid "" "To reverse this encoding process, :func:`parse_qs` and :func:`parse_qsl` are " "provided in this module to parse query strings into Python data structures." msgstr "" -#: ../../library/urllib.parse.rst:670 +#: ../../library/urllib.parse.rst:646 msgid "" "Refer to :ref:`urllib examples ` to find out how the :func:" "`urllib.parse.urlencode` method can be used for generating the query string " "of a URL or data for a POST request." msgstr "" -#: ../../library/urllib.parse.rst:674 +#: ../../library/urllib.parse.rst:650 msgid "*query* supports bytes and string objects." msgstr "" -#: ../../library/urllib.parse.rst:677 +#: ../../library/urllib.parse.rst:653 msgid "*quote_via* parameter." msgstr "" -#: ../../library/urllib.parse.rst:685 -msgid "`WHATWG`_ - URL Living standard" -msgstr "" - -#: ../../library/urllib.parse.rst:684 -msgid "" -"Working Group for the URL Standard that defines URLs, domains, IP addresses, " -"the application/x-www-form-urlencoded format, and their API." -msgstr "" - -#: ../../library/urllib.parse.rst:691 +#: ../../library/urllib.parse.rst:663 msgid ":rfc:`3986` - Uniform Resource Identifiers" msgstr "" -#: ../../library/urllib.parse.rst:688 +#: ../../library/urllib.parse.rst:660 msgid "" "This is the current standard (STD66). Any changes to urllib.parse module " "should conform to this. Certain deviations could be observed, which are " @@ -842,47 +808,47 @@ msgid "" "requirements as commonly observed in major browsers." msgstr "" -#: ../../library/urllib.parse.rst:694 +#: ../../library/urllib.parse.rst:666 msgid ":rfc:`2732` - Format for Literal IPv6 Addresses in URL's." msgstr "" -#: ../../library/urllib.parse.rst:694 +#: ../../library/urllib.parse.rst:666 msgid "This specifies the parsing requirements of IPv6 URLs." msgstr "" -#: ../../library/urllib.parse.rst:698 +#: ../../library/urllib.parse.rst:670 msgid ":rfc:`2396` - Uniform Resource Identifiers (URI): Generic Syntax" msgstr "" -#: ../../library/urllib.parse.rst:697 +#: ../../library/urllib.parse.rst:669 msgid "" "Document describing the generic syntactic requirements for both Uniform " "Resource Names (URNs) and Uniform Resource Locators (URLs)." msgstr "" -#: ../../library/urllib.parse.rst:701 +#: ../../library/urllib.parse.rst:673 msgid ":rfc:`2368` - The mailto URL scheme." msgstr "" -#: ../../library/urllib.parse.rst:701 +#: ../../library/urllib.parse.rst:673 msgid "Parsing requirements for mailto URL schemes." msgstr "" -#: ../../library/urllib.parse.rst:706 +#: ../../library/urllib.parse.rst:678 msgid ":rfc:`1808` - Relative Uniform Resource Locators" msgstr "" -#: ../../library/urllib.parse.rst:704 +#: ../../library/urllib.parse.rst:676 msgid "" "This Request For Comments includes the rules for joining an absolute and a " "relative URL, including a fair number of \"Abnormal Examples\" which govern " "the treatment of border cases." msgstr "" -#: ../../library/urllib.parse.rst:708 +#: ../../library/urllib.parse.rst:680 msgid ":rfc:`1738` - Uniform Resource Locators (URL)" msgstr "" -#: ../../library/urllib.parse.rst:709 +#: ../../library/urllib.parse.rst:681 msgid "This specifies the formal syntax and semantics of absolute URLs." msgstr "" diff --git a/library/urllib.request.po b/library/urllib.request.po index 7f355169b4..945c037b01 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-07 06:52+0000\n" +"POT-Creation-Date: 2020-06-20 18:08+0800\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-" @@ -142,7 +142,7 @@ msgid "" "`ProxyHandler` objects." msgstr "" -#: ../../library/urllib.request.rst:90 +#: ../../library/urllib.request.rst:None msgid "" "Raises an :ref:`auditing event ` ``urllib.Request`` with arguments " "``fullurl``, ``data``, ``headers``, ``method``." diff --git a/library/venv.po b/library/venv.po index c5b5defcb9..3623c64f85 100644 --- a/library/venv.po +++ b/library/venv.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.7\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2021-09-07 06:52+0000\n" +"POT-Creation-Date: 2020-06-20 18:08+0800\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-" @@ -238,13 +238,6 @@ msgstr "" #: ../../using/venv-create.inc:129 msgid "" -"When a virtual environment is active, the :envvar:`VIRTUAL_ENV` environment " -"variable is set to the path of the virtual environment. This can be used to " -"check if one is running inside a virtual environment." -msgstr "" - -#: ../../using/venv-create.inc:133 -msgid "" "You don't specifically *need* to activate an environment; activation just " "prepends the virtual environment's binary directory to your path, so that " "\"python\" invokes the virtual environment's Python interpreter and you can " @@ -253,18 +246,18 @@ msgid "" "activating it, and run with the virtual environment's Python automatically." msgstr "" -#: ../../using/venv-create.inc:140 +#: ../../using/venv-create.inc:136 msgid "" "You can deactivate a virtual environment by typing \"deactivate\" in your " "shell. The exact mechanism is platform-specific and is an internal " "implementation detail (typically a script or shell function will be used)." msgstr "" -#: ../../using/venv-create.inc:144 +#: ../../using/venv-create.inc:140 msgid "``fish`` and ``csh`` activation scripts." msgstr "" -#: ../../using/venv-create.inc:147 +#: ../../using/venv-create.inc:143 msgid "" "PowerShell activation scripts installed under POSIX for PowerShell Core " "support." diff --git a/library/webbrowser.po b/library/webbrowser.po index f6e22efa65..b2b6d1a7c0 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-07 06:52+0000\n" +"POT-Creation-Date: 2020-06-20 18:08+0800\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-" @@ -303,7 +303,7 @@ msgid "``'macosx'``" msgstr "" #: ../../library/webbrowser.rst:146 -msgid ":class:`MacOSXOSAScript('default')`" +msgid ":class:`MacOSX('default')`" msgstr "" #: ../../library/webbrowser.rst:146 ../../library/webbrowser.rst:148 @@ -315,7 +315,7 @@ msgid "``'safari'``" msgstr "" #: ../../library/webbrowser.rst:148 -msgid ":class:`MacOSXOSAScript('safari')`" +msgid ":class:`MacOSX('safari')`" msgstr "" #: ../../library/webbrowser.rst:150 diff --git a/library/winreg.po b/library/winreg.po index 227b782e84..bccff7ef5d 100644 --- a/library/winreg.po +++ b/library/winreg.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.7\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2021-09-07 06:52+0000\n" +"POT-Creation-Date: 2020-06-20 18:08+0800\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-" @@ -79,7 +79,7 @@ msgid "" "exc:`OSError` exception is raised." msgstr "" -#: ../../library/winreg.rst:56 +#: ../../library/winreg.rst:57 msgid "" "Raises an :ref:`auditing event ` ``winreg.ConnectRegistry`` with " "arguments ``computer_name``, ``key``." @@ -126,14 +126,14 @@ msgstr "" msgid "If the key already exists, this function opens the existing key." msgstr "" -#: ../../library/winreg.rst:80 ../../library/winreg.rst:112 +#: ../../library/winreg.rst:81 ../../library/winreg.rst:113 msgid "" "Raises an :ref:`auditing event ` ``winreg.CreateKey`` with " "arguments ``key``, ``sub_key``, ``access``." msgstr "" -#: ../../library/winreg.rst:82 ../../library/winreg.rst:114 -#: ../../library/winreg.rst:329 +#: ../../library/winreg.rst:83 ../../library/winreg.rst:115 +#: ../../library/winreg.rst:330 msgid "" "Raises an :ref:`auditing event ` ``winreg.OpenKey/result`` with " "argument ``key``." @@ -172,7 +172,7 @@ msgid "" "removed. If the method fails, an :exc:`OSError` exception is raised." msgstr "" -#: ../../library/winreg.rst:137 ../../library/winreg.rst:173 +#: ../../library/winreg.rst:138 ../../library/winreg.rst:174 msgid "" "Raises an :ref:`auditing event ` ``winreg.DeleteKey`` with " "arguments ``key``, ``sub_key``, ``access``." @@ -233,7 +233,7 @@ msgid "" "indicating, no more values are available." msgstr "" -#: ../../library/winreg.rst:206 +#: ../../library/winreg.rst:207 msgid "" "Raises an :ref:`auditing event ` ``winreg.EnumKey`` with arguments " "``key``, ``index``." @@ -299,7 +299,7 @@ msgid "" "for :meth:`SetValueEx`)" msgstr "" -#: ../../library/winreg.rst:241 +#: ../../library/winreg.rst:242 msgid "" "Raises an :ref:`auditing event ` ``winreg.EnumValue`` with " "arguments ``key``, ``index``." @@ -410,7 +410,7 @@ msgstr "" msgid "If the function fails, :exc:`OSError` is raised." msgstr "" -#: ../../library/winreg.rst:327 +#: ../../library/winreg.rst:328 msgid "" "Raises an :ref:`auditing event ` ``winreg.OpenKey`` with arguments " "``key``, ``sub_key``, ``access``." diff --git a/library/wsgiref.po b/library/wsgiref.po index 1c9da6008f..126116bd4c 100644 --- a/library/wsgiref.po +++ b/library/wsgiref.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.7\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2021-09-07 06:52+0000\n" +"POT-Creation-Date: 2020-06-20 18:08+0800\n" "PO-Revision-Date: 2016-11-19 00:36+0000\n" "Last-Translator: Liang-Bo Wang \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -512,8 +512,8 @@ msgid "" "rarely used and is not guaranteed by WSGI. On IIS<7, though, the setting can " "only be made on a vhost level, affecting all other script mappings, many of " "which break when exposed to the ``PATH_TRANSLATED`` bug. For this reason " -"IIS<7 is almost never deployed with the fix (Even IIS7 rarely uses it " -"because there is still no UI for it.)." +"IIS<7 is almost never deployed with the fix. (Even IIS7 rarely uses it " +"because there is still no UI for it.)" msgstr "" #: ../../library/wsgiref.rst:486 diff --git a/library/xml.dom.minidom.po b/library/xml.dom.minidom.po index 7bd38c42b2..63835e502f 100644 --- a/library/xml.dom.minidom.po +++ b/library/xml.dom.minidom.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.7\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2021-09-07 06:52+0000\n" +"POT-Creation-Date: 2020-06-20 18:08+0800\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-" @@ -176,7 +176,7 @@ msgstr "" #: ../../library/xml.dom.minidom.rst:148 msgid "" -"Similarly, explicitly stating the *standalone* argument causes the " +"Silimarly, explicitly stating the *standalone* argument causes the " "standalone document declarations to be added to the prologue of the XML " "document. If the value is set to `True`, `standalone=\"yes\"` is added, " "otherwise it is set to `\"no\"`. Not stating the argument will omit the " diff --git a/library/xml.etree.elementtree.po b/library/xml.etree.elementtree.po index 51ba6b7e6a..7ea1ecbb8c 100644 --- a/library/xml.etree.elementtree.po +++ b/library/xml.etree.elementtree.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.7\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2021-09-07 06:52+0000\n" +"POT-Creation-Date: 2020-06-20 18:08+0800\n" "PO-Revision-Date: 2018-05-23 16:16+0000\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -214,7 +214,7 @@ msgid "" msgstr "" #: ../../library/xml.etree.elementtree.rst:222 -#: ../../library/xml.etree.elementtree.rst:266 +#: ../../library/xml.etree.elementtree.rst:260 msgid "Our XML now looks like this:" msgstr "" @@ -224,29 +224,21 @@ msgid "" "remove all countries with a rank higher than 50::" msgstr "" -#: ../../library/xml.etree.elementtree.rst:261 -msgid "" -"Note that concurrent modification while iterating can lead to problems, just " -"like when iterating and modifying Python lists or dicts. Therefore, the " -"example first collects all matching elements with ``root.findall()``, and " -"only then iterates over the list of matches." -msgstr "" - -#: ../../library/xml.etree.elementtree.rst:288 +#: ../../library/xml.etree.elementtree.rst:282 msgid "Building XML documents" msgstr "" -#: ../../library/xml.etree.elementtree.rst:290 +#: ../../library/xml.etree.elementtree.rst:284 msgid "" "The :func:`SubElement` function also provides a convenient way to create new " "sub-elements for a given element::" msgstr "" -#: ../../library/xml.etree.elementtree.rst:301 +#: ../../library/xml.etree.elementtree.rst:295 msgid "Parsing XML with Namespaces" msgstr "" -#: ../../library/xml.etree.elementtree.rst:303 +#: ../../library/xml.etree.elementtree.rst:297 msgid "" "If the XML input has `namespaces `__, tags and attributes with prefixes in the form ``prefix:" @@ -256,44 +248,44 @@ msgid "" "prefixed tags." msgstr "" -#: ../../library/xml.etree.elementtree.rst:311 +#: ../../library/xml.etree.elementtree.rst:305 msgid "" "Here is an XML example that incorporates two namespaces, one with the prefix " "\"fictional\" and the other serving as the default namespace:" msgstr "" -#: ../../library/xml.etree.elementtree.rst:332 +#: ../../library/xml.etree.elementtree.rst:326 msgid "" "One way to search and explore this XML example is to manually add the URI to " "every tag or attribute in the xpath of a :meth:`~Element.find` or :meth:" "`~Element.findall`::" msgstr "" -#: ../../library/xml.etree.elementtree.rst:343 +#: ../../library/xml.etree.elementtree.rst:337 msgid "" "A better way to search the namespaced XML example is to create a dictionary " "with your own prefixes and use those in the search functions::" msgstr "" -#: ../../library/xml.etree.elementtree.rst:355 +#: ../../library/xml.etree.elementtree.rst:349 msgid "These two approaches both output::" msgstr "" -#: ../../library/xml.etree.elementtree.rst:367 +#: ../../library/xml.etree.elementtree.rst:361 msgid "Additional resources" msgstr "" -#: ../../library/xml.etree.elementtree.rst:369 +#: ../../library/xml.etree.elementtree.rst:363 msgid "" "See http://effbot.org/zone/element-index.htm for tutorials and links to " "other docs." msgstr "" -#: ../../library/xml.etree.elementtree.rst:376 +#: ../../library/xml.etree.elementtree.rst:370 msgid "XPath support" msgstr "" -#: ../../library/xml.etree.elementtree.rst:378 +#: ../../library/xml.etree.elementtree.rst:372 msgid "" "This module provides limited support for `XPath expressions `_ for locating elements in a tree. The goal is to support a " @@ -301,41 +293,41 @@ msgid "" "scope of the module." msgstr "" -#: ../../library/xml.etree.elementtree.rst:384 -#: ../../library/xml.etree.elementtree.rst:758 +#: ../../library/xml.etree.elementtree.rst:378 +#: ../../library/xml.etree.elementtree.rst:752 msgid "Example" msgstr "" -#: ../../library/xml.etree.elementtree.rst:386 +#: ../../library/xml.etree.elementtree.rst:380 msgid "" "Here's an example that demonstrates some of the XPath capabilities of the " "module. We'll be using the ``countrydata`` XML document from the :ref:" "`Parsing XML ` section::" msgstr "" -#: ../../library/xml.etree.elementtree.rst:410 +#: ../../library/xml.etree.elementtree.rst:404 msgid "" "For XML with namespaces, use the usual qualified ``{namespace}tag`` " "notation::" msgstr "" -#: ../../library/xml.etree.elementtree.rst:417 +#: ../../library/xml.etree.elementtree.rst:411 msgid "Supported XPath syntax" msgstr "" -#: ../../library/xml.etree.elementtree.rst:422 +#: ../../library/xml.etree.elementtree.rst:416 msgid "Syntax" msgstr "" -#: ../../library/xml.etree.elementtree.rst:422 +#: ../../library/xml.etree.elementtree.rst:416 msgid "Meaning" msgstr "" -#: ../../library/xml.etree.elementtree.rst:424 +#: ../../library/xml.etree.elementtree.rst:418 msgid "``tag``" msgstr "" -#: ../../library/xml.etree.elementtree.rst:424 +#: ../../library/xml.etree.elementtree.rst:418 msgid "" "Selects all child elements with the given tag. For example, ``spam`` selects " "all child elements named ``spam``, and ``spam/egg`` selects all " @@ -345,103 +337,103 @@ msgid "" "not in a namespace." msgstr "" -#: ../../library/xml.etree.elementtree.rst:433 +#: ../../library/xml.etree.elementtree.rst:427 msgid "Support for star-wildcards was added." msgstr "" -#: ../../library/xml.etree.elementtree.rst:436 +#: ../../library/xml.etree.elementtree.rst:430 msgid "``*``" msgstr "" -#: ../../library/xml.etree.elementtree.rst:436 +#: ../../library/xml.etree.elementtree.rst:430 msgid "" "Selects all child elements, including comments and processing instructions. " "For example, ``*/egg`` selects all grandchildren named ``egg``." msgstr "" -#: ../../library/xml.etree.elementtree.rst:440 +#: ../../library/xml.etree.elementtree.rst:434 msgid "``.``" msgstr "" -#: ../../library/xml.etree.elementtree.rst:440 +#: ../../library/xml.etree.elementtree.rst:434 msgid "" "Selects the current node. This is mostly useful at the beginning of the " "path, to indicate that it's a relative path." msgstr "" -#: ../../library/xml.etree.elementtree.rst:444 +#: ../../library/xml.etree.elementtree.rst:438 msgid "``//``" msgstr "" -#: ../../library/xml.etree.elementtree.rst:444 +#: ../../library/xml.etree.elementtree.rst:438 msgid "" "Selects all subelements, on all levels beneath the current element. For " "example, ``.//egg`` selects all ``egg`` elements in the entire tree." msgstr "" -#: ../../library/xml.etree.elementtree.rst:448 +#: ../../library/xml.etree.elementtree.rst:442 msgid "``..``" msgstr "" -#: ../../library/xml.etree.elementtree.rst:448 +#: ../../library/xml.etree.elementtree.rst:442 msgid "" "Selects the parent element. Returns ``None`` if the path attempts to reach " "the ancestors of the start element (the element ``find`` was called on)." msgstr "" -#: ../../library/xml.etree.elementtree.rst:452 +#: ../../library/xml.etree.elementtree.rst:446 msgid "``[@attrib]``" msgstr "" -#: ../../library/xml.etree.elementtree.rst:452 +#: ../../library/xml.etree.elementtree.rst:446 msgid "Selects all elements that have the given attribute." msgstr "" -#: ../../library/xml.etree.elementtree.rst:454 +#: ../../library/xml.etree.elementtree.rst:448 msgid "``[@attrib='value']``" msgstr "" -#: ../../library/xml.etree.elementtree.rst:454 +#: ../../library/xml.etree.elementtree.rst:448 msgid "" "Selects all elements for which the given attribute has the given value. The " "value cannot contain quotes." msgstr "" -#: ../../library/xml.etree.elementtree.rst:458 +#: ../../library/xml.etree.elementtree.rst:452 msgid "``[tag]``" msgstr "" -#: ../../library/xml.etree.elementtree.rst:458 +#: ../../library/xml.etree.elementtree.rst:452 msgid "" "Selects all elements that have a child named ``tag``. Only immediate " "children are supported." msgstr "" -#: ../../library/xml.etree.elementtree.rst:461 +#: ../../library/xml.etree.elementtree.rst:455 msgid "``[.='text']``" msgstr "" -#: ../../library/xml.etree.elementtree.rst:461 +#: ../../library/xml.etree.elementtree.rst:455 msgid "" "Selects all elements whose complete text content, including descendants, " "equals the given ``text``." msgstr "" -#: ../../library/xml.etree.elementtree.rst:466 +#: ../../library/xml.etree.elementtree.rst:460 msgid "``[tag='text']``" msgstr "" -#: ../../library/xml.etree.elementtree.rst:466 +#: ../../library/xml.etree.elementtree.rst:460 msgid "" "Selects all elements that have a child named ``tag`` whose complete text " "content, including descendants, equals the given ``text``." msgstr "" -#: ../../library/xml.etree.elementtree.rst:470 +#: ../../library/xml.etree.elementtree.rst:464 msgid "``[position]``" msgstr "" -#: ../../library/xml.etree.elementtree.rst:470 +#: ../../library/xml.etree.elementtree.rst:464 msgid "" "Selects all elements that are located at the given position. The position " "can be either an integer (1 is the first position), the expression " @@ -449,28 +441,28 @@ msgid "" "position (e.g. ``last()-1``)." msgstr "" -#: ../../library/xml.etree.elementtree.rst:477 +#: ../../library/xml.etree.elementtree.rst:471 msgid "" "Predicates (expressions within square brackets) must be preceded by a tag " "name, an asterisk, or another predicate. ``position`` predicates must be " "preceded by a tag name." msgstr "" -#: ../../library/xml.etree.elementtree.rst:482 -#: ../../library/xml.etree.elementtree.rst:810 +#: ../../library/xml.etree.elementtree.rst:476 +#: ../../library/xml.etree.elementtree.rst:804 msgid "Reference" msgstr "" -#: ../../library/xml.etree.elementtree.rst:487 -#: ../../library/xml.etree.elementtree.rst:815 +#: ../../library/xml.etree.elementtree.rst:481 +#: ../../library/xml.etree.elementtree.rst:809 msgid "Functions" msgstr "" -#: ../../library/xml.etree.elementtree.rst:491 +#: ../../library/xml.etree.elementtree.rst:485 msgid "`C14N 2.0 `_ transformation function." msgstr "" -#: ../../library/xml.etree.elementtree.rst:493 +#: ../../library/xml.etree.elementtree.rst:487 msgid "" "Canonicalization is a way to normalise XML output in a way that allows byte-" "by-byte comparisons and digital signatures. It reduced the freedom that XML " @@ -479,7 +471,7 @@ msgid "" "declarations, the ordering of attributes, and ignorable whitespace." msgstr "" -#: ../../library/xml.etree.elementtree.rst:499 +#: ../../library/xml.etree.elementtree.rst:493 msgid "" "This function takes an XML data string (*xml_data*) or a file path or file-" "like object (*from_file*) as input, converts it to the canonical form, and " @@ -488,63 +480,63 @@ msgid "" "should therefore be opened in text mode with ``utf-8`` encoding." msgstr "" -#: ../../library/xml.etree.elementtree.rst:506 +#: ../../library/xml.etree.elementtree.rst:500 msgid "Typical uses::" msgstr "" -#: ../../library/xml.etree.elementtree.rst:517 +#: ../../library/xml.etree.elementtree.rst:511 msgid "The configuration *options* are as follows:" msgstr "" -#: ../../library/xml.etree.elementtree.rst:519 +#: ../../library/xml.etree.elementtree.rst:513 msgid "*with_comments*: set to true to include comments (default: false)" msgstr "" -#: ../../library/xml.etree.elementtree.rst:520 +#: ../../library/xml.etree.elementtree.rst:514 msgid "" "*strip_text*: set to true to strip whitespace before and after text content" msgstr "" -#: ../../library/xml.etree.elementtree.rst:521 -#: ../../library/xml.etree.elementtree.rst:523 +#: ../../library/xml.etree.elementtree.rst:515 +#: ../../library/xml.etree.elementtree.rst:517 msgid "(default: false)" msgstr "" -#: ../../library/xml.etree.elementtree.rst:522 +#: ../../library/xml.etree.elementtree.rst:516 msgid "" "*rewrite_prefixes*: set to true to replace namespace prefixes by " "\"n{number}\"" msgstr "" -#: ../../library/xml.etree.elementtree.rst:524 +#: ../../library/xml.etree.elementtree.rst:518 msgid "*qname_aware_tags*: a set of qname aware tag names in which prefixes" msgstr "" -#: ../../library/xml.etree.elementtree.rst:525 -#: ../../library/xml.etree.elementtree.rst:527 +#: ../../library/xml.etree.elementtree.rst:519 +#: ../../library/xml.etree.elementtree.rst:521 msgid "should be replaced in text content (default: empty)" msgstr "" -#: ../../library/xml.etree.elementtree.rst:526 +#: ../../library/xml.etree.elementtree.rst:520 msgid "" "*qname_aware_attrs*: a set of qname aware attribute names in which prefixes" msgstr "" -#: ../../library/xml.etree.elementtree.rst:528 +#: ../../library/xml.etree.elementtree.rst:522 msgid "*exclude_attrs*: a set of attribute names that should not be serialised" msgstr "" -#: ../../library/xml.etree.elementtree.rst:529 +#: ../../library/xml.etree.elementtree.rst:523 msgid "*exclude_tags*: a set of tag names that should not be serialised" msgstr "" -#: ../../library/xml.etree.elementtree.rst:531 +#: ../../library/xml.etree.elementtree.rst:525 msgid "" "In the option list above, \"a set\" refers to any collection or iterable of " "strings, no ordering is expected." msgstr "" -#: ../../library/xml.etree.elementtree.rst:539 +#: ../../library/xml.etree.elementtree.rst:533 msgid "" "Comment element factory. This factory function creates a special element " "that will be serialized as an XML comment by the standard serializer. The " @@ -553,7 +545,7 @@ msgid "" "representing a comment." msgstr "" -#: ../../library/xml.etree.elementtree.rst:545 +#: ../../library/xml.etree.elementtree.rst:539 msgid "" "Note that :class:`XMLParser` skips over comments in the input instead of " "creating comment objects for them. An :class:`ElementTree` will only contain " @@ -561,29 +553,29 @@ msgid "" "class:`Element` methods." msgstr "" -#: ../../library/xml.etree.elementtree.rst:552 +#: ../../library/xml.etree.elementtree.rst:546 msgid "" "Writes an element tree or element structure to sys.stdout. This function " "should be used for debugging only." msgstr "" -#: ../../library/xml.etree.elementtree.rst:555 +#: ../../library/xml.etree.elementtree.rst:549 msgid "" "The exact output format is implementation dependent. In this version, it's " "written as an ordinary XML file." msgstr "" -#: ../../library/xml.etree.elementtree.rst:558 +#: ../../library/xml.etree.elementtree.rst:552 msgid "*elem* is an element tree or an individual element." msgstr "" -#: ../../library/xml.etree.elementtree.rst:560 +#: ../../library/xml.etree.elementtree.rst:554 msgid "" "The :func:`dump` function now preserves the attribute order specified by the " "user." msgstr "" -#: ../../library/xml.etree.elementtree.rst:567 +#: ../../library/xml.etree.elementtree.rst:561 msgid "" "Parses an XML section from a string constant. Same as :func:`XML`. *text* " "is a string containing XML data. *parser* is an optional parser instance. " @@ -591,7 +583,7 @@ msgid "" "class:`Element` instance." msgstr "" -#: ../../library/xml.etree.elementtree.rst:575 +#: ../../library/xml.etree.elementtree.rst:569 msgid "" "Parses an XML document from a sequence of string fragments. *sequence* is a " "list or other sequence containing XML data fragments. *parser* is an " @@ -599,7 +591,7 @@ msgid "" "parser is used. Returns an :class:`Element` instance." msgstr "" -#: ../../library/xml.etree.elementtree.rst:585 +#: ../../library/xml.etree.elementtree.rst:579 msgid "" "Appends whitespace to the subtree to indent the tree visually. This can be " "used to generate pretty-printed XML output. *tree* can be an Element or " @@ -609,13 +601,13 @@ msgid "" "indentation level as *level*." msgstr "" -#: ../../library/xml.etree.elementtree.rst:597 +#: ../../library/xml.etree.elementtree.rst:591 msgid "" "Check if an object appears to be a valid element object. *element* is an " "element instance. Return ``True`` if this is an element object." msgstr "" -#: ../../library/xml.etree.elementtree.rst:603 +#: ../../library/xml.etree.elementtree.rst:597 msgid "" "Parses an XML section into an element tree incrementally, and reports what's " "going on to the user. *source* is a filename or :term:`file object` " @@ -630,7 +622,7 @@ msgid "" "elem)`` pairs." msgstr "" -#: ../../library/xml.etree.elementtree.rst:615 +#: ../../library/xml.etree.elementtree.rst:609 msgid "" "Note that while :func:`iterparse` builds the tree incrementally, it issues " "blocking reads on *source* (or the file it names). As such, it's unsuitable " @@ -638,7 +630,7 @@ msgid "" "parsing, see :class:`XMLPullParser`." msgstr "" -#: ../../library/xml.etree.elementtree.rst:622 +#: ../../library/xml.etree.elementtree.rst:616 msgid "" ":func:`iterparse` only guarantees that it has seen the \">\" character of a " "starting tag when it emits a \"start\" event, so the attributes are defined, " @@ -647,21 +639,21 @@ msgid "" "present." msgstr "" -#: ../../library/xml.etree.elementtree.rst:628 -#: ../../library/xml.etree.elementtree.rst:1456 +#: ../../library/xml.etree.elementtree.rst:622 +#: ../../library/xml.etree.elementtree.rst:1450 msgid "If you need a fully populated element, look for \"end\" events instead." msgstr "" -#: ../../library/xml.etree.elementtree.rst:630 +#: ../../library/xml.etree.elementtree.rst:624 msgid "The *parser* argument." msgstr "" -#: ../../library/xml.etree.elementtree.rst:633 -#: ../../library/xml.etree.elementtree.rst:1460 +#: ../../library/xml.etree.elementtree.rst:627 +#: ../../library/xml.etree.elementtree.rst:1454 msgid "The ``comment`` and ``pi`` events were added." msgstr "" -#: ../../library/xml.etree.elementtree.rst:639 +#: ../../library/xml.etree.elementtree.rst:633 msgid "" "Parses an XML section into an element tree. *source* is a filename or file " "object containing XML data. *parser* is an optional parser instance. If " @@ -669,7 +661,7 @@ msgid "" "class:`ElementTree` instance." msgstr "" -#: ../../library/xml.etree.elementtree.rst:647 +#: ../../library/xml.etree.elementtree.rst:641 msgid "" "PI element factory. This factory function creates a special element that " "will be serialized as an XML processing instruction. *target* is a string " @@ -677,7 +669,7 @@ msgid "" "given. Returns an element instance, representing a processing instruction." msgstr "" -#: ../../library/xml.etree.elementtree.rst:652 +#: ../../library/xml.etree.elementtree.rst:646 msgid "" "Note that :class:`XMLParser` skips over processing instructions in the input " "instead of creating comment objects for them. An :class:`ElementTree` will " @@ -685,7 +677,7 @@ msgid "" "the tree using one of the :class:`Element` methods." msgstr "" -#: ../../library/xml.etree.elementtree.rst:660 +#: ../../library/xml.etree.elementtree.rst:654 msgid "" "Registers a namespace prefix. The registry is global, and any existing " "mapping for either the given prefix or the namespace URI will be removed. " @@ -694,13 +686,13 @@ msgid "" "all possible." msgstr "" -#: ../../library/xml.etree.elementtree.rst:671 +#: ../../library/xml.etree.elementtree.rst:665 msgid "" "Subelement factory. This function creates an element instance, and appends " "it to an existing element." msgstr "" -#: ../../library/xml.etree.elementtree.rst:674 +#: ../../library/xml.etree.elementtree.rst:668 msgid "" "The element name, attribute names, and attribute values can be either " "bytestrings or Unicode strings. *parent* is the parent element. *tag* is " @@ -709,7 +701,7 @@ msgid "" "arguments. Returns an element instance." msgstr "" -#: ../../library/xml.etree.elementtree.rst:685 +#: ../../library/xml.etree.elementtree.rst:679 msgid "" "Generates a string representation of an XML element, including all " "subelements. *element* is an :class:`Element` instance. *encoding* [1]_ is " @@ -721,24 +713,24 @@ msgid "" "encoded string containing the XML data." msgstr "" -#: ../../library/xml.etree.elementtree.rst:694 -#: ../../library/xml.etree.elementtree.rst:721 -#: ../../library/xml.etree.elementtree.rst:1168 +#: ../../library/xml.etree.elementtree.rst:688 +#: ../../library/xml.etree.elementtree.rst:715 +#: ../../library/xml.etree.elementtree.rst:1162 msgid "The *short_empty_elements* parameter." msgstr "" -#: ../../library/xml.etree.elementtree.rst:697 -#: ../../library/xml.etree.elementtree.rst:724 +#: ../../library/xml.etree.elementtree.rst:691 +#: ../../library/xml.etree.elementtree.rst:718 msgid "The *xml_declaration* and *default_namespace* parameters." msgstr "" -#: ../../library/xml.etree.elementtree.rst:700 +#: ../../library/xml.etree.elementtree.rst:694 msgid "" "The :func:`tostring` function now preserves the attribute order specified by " "the user." msgstr "" -#: ../../library/xml.etree.elementtree.rst:709 +#: ../../library/xml.etree.elementtree.rst:703 msgid "" "Generates a string representation of an XML element, including all " "subelements. *element* is an :class:`Element` instance. *encoding* [1]_ is " @@ -752,13 +744,13 @@ msgid "" "tostring(element)``." msgstr "" -#: ../../library/xml.etree.elementtree.rst:727 +#: ../../library/xml.etree.elementtree.rst:721 msgid "" "The :func:`tostringlist` function now preserves the attribute order " "specified by the user." msgstr "" -#: ../../library/xml.etree.elementtree.rst:734 +#: ../../library/xml.etree.elementtree.rst:728 msgid "" "Parses an XML section from a string constant. This function can be used to " "embed \"XML literals\" in Python code. *text* is a string containing XML " @@ -766,7 +758,7 @@ msgid "" "class:`XMLParser` parser is used. Returns an :class:`Element` instance." msgstr "" -#: ../../library/xml.etree.elementtree.rst:742 +#: ../../library/xml.etree.elementtree.rst:736 msgid "" "Parses an XML section from a string constant, and also returns a dictionary " "which maps from element id:s to elements. *text* is a string containing XML " @@ -775,11 +767,11 @@ msgid "" "`Element` instance and a dictionary." msgstr "" -#: ../../library/xml.etree.elementtree.rst:752 +#: ../../library/xml.etree.elementtree.rst:746 msgid "XInclude support" msgstr "" -#: ../../library/xml.etree.elementtree.rst:754 +#: ../../library/xml.etree.elementtree.rst:748 msgid "" "This module provides limited support for `XInclude directives `_, via the :mod:`xml.etree.ElementInclude` helper " @@ -787,7 +779,7 @@ msgid "" "element trees, based on information in the tree." msgstr "" -#: ../../library/xml.etree.elementtree.rst:760 +#: ../../library/xml.etree.elementtree.rst:754 msgid "" "Here's an example that demonstrates use of the XInclude module. To include " "an XML document in the current document, use the ``{http://www.w3.org/2001/" @@ -795,43 +787,43 @@ msgid "" "and use the **href** attribute to specify the document to include." msgstr "" -#: ../../library/xml.etree.elementtree.rst:769 +#: ../../library/xml.etree.elementtree.rst:763 msgid "" "By default, the **href** attribute is treated as a file name. You can use " "custom loaders to override this behaviour. Also note that the standard " "helper does not support XPointer syntax." msgstr "" -#: ../../library/xml.etree.elementtree.rst:771 +#: ../../library/xml.etree.elementtree.rst:765 msgid "" "To process this file, load it as usual, and pass the root element to the :" "mod:`xml.etree.ElementTree` module:" msgstr "" -#: ../../library/xml.etree.elementtree.rst:782 +#: ../../library/xml.etree.elementtree.rst:776 msgid "" "The ElementInclude module replaces the ``{http://www.w3.org/2001/XInclude}" "include`` element with the root element from the **source.xml** document. " "The result might look something like this:" msgstr "" -#: ../../library/xml.etree.elementtree.rst:790 +#: ../../library/xml.etree.elementtree.rst:784 msgid "" "If the **parse** attribute is omitted, it defaults to \"xml\". The href " "attribute is required." msgstr "" -#: ../../library/xml.etree.elementtree.rst:792 +#: ../../library/xml.etree.elementtree.rst:786 msgid "" "To include a text document, use the ``{http://www.w3.org/2001/XInclude}" "include`` element, and set the **parse** attribute to \"text\":" msgstr "" -#: ../../library/xml.etree.elementtree.rst:801 +#: ../../library/xml.etree.elementtree.rst:795 msgid "The result might look something like:" msgstr "" -#: ../../library/xml.etree.elementtree.rst:819 +#: ../../library/xml.etree.elementtree.rst:813 msgid "" "Default loader. This default loader reads an included resource from disk. " "*href* is a URL. *parse* is for parse mode either \"xml\" or \"text\". " @@ -842,7 +834,7 @@ msgid "" "exception." msgstr "" -#: ../../library/xml.etree.elementtree.rst:830 +#: ../../library/xml.etree.elementtree.rst:824 msgid "" "This function expands XInclude directives. *elem* is the root element. " "*loader* is an optional resource loader. If omitted, it defaults to :func:" @@ -853,28 +845,28 @@ msgid "" "malicious content explosion. Pass a negative value to disable the limitation." msgstr "" -#: ../../library/xml.etree.elementtree.rst:838 +#: ../../library/xml.etree.elementtree.rst:832 msgid "" "Returns the expanded resource. If the parse mode is ``\"xml\"``, this is an " "ElementTree instance. If the parse mode is \"text\", this is a Unicode " "string. If the loader fails, it can return None or raise an exception." msgstr "" -#: ../../library/xml.etree.elementtree.rst:843 +#: ../../library/xml.etree.elementtree.rst:837 msgid "The *base_url* and *max_depth* parameters." msgstr "" -#: ../../library/xml.etree.elementtree.rst:850 +#: ../../library/xml.etree.elementtree.rst:844 msgid "Element Objects" msgstr "" -#: ../../library/xml.etree.elementtree.rst:854 +#: ../../library/xml.etree.elementtree.rst:848 msgid "" "Element class. This class defines the Element interface, and provides a " "reference implementation of this interface." msgstr "" -#: ../../library/xml.etree.elementtree.rst:857 +#: ../../library/xml.etree.elementtree.rst:851 msgid "" "The element name, attribute names, and attribute values can be either " "bytestrings or Unicode strings. *tag* is the element name. *attrib* is an " @@ -882,13 +874,13 @@ msgid "" "additional attributes, given as keyword arguments." msgstr "" -#: ../../library/xml.etree.elementtree.rst:865 +#: ../../library/xml.etree.elementtree.rst:859 msgid "" "A string identifying what kind of data this element represents (the element " "type, in other words)." msgstr "" -#: ../../library/xml.etree.elementtree.rst:872 +#: ../../library/xml.etree.elementtree.rst:866 msgid "" "These attributes can be used to hold additional data associated with the " "element. Their values are usually strings but may be any application-" @@ -899,7 +891,7 @@ msgid "" "the XML data" msgstr "" -#: ../../library/xml.etree.elementtree.rst:884 +#: ../../library/xml.etree.elementtree.rst:878 msgid "" "the *a* element has ``None`` for both *text* and *tail* attributes, the *b* " "element has *text* ``\"1\"`` and *tail* ``\"4\"``, the *c* element has " @@ -907,17 +899,17 @@ msgid "" "``None`` and *tail* ``\"3\"``." msgstr "" -#: ../../library/xml.etree.elementtree.rst:889 +#: ../../library/xml.etree.elementtree.rst:883 msgid "" "To collect the inner text of an element, see :meth:`itertext`, for example ``" "\"\".join(element.itertext())``." msgstr "" -#: ../../library/xml.etree.elementtree.rst:892 +#: ../../library/xml.etree.elementtree.rst:886 msgid "Applications may store arbitrary objects in these attributes." msgstr "" -#: ../../library/xml.etree.elementtree.rst:897 +#: ../../library/xml.etree.elementtree.rst:891 msgid "" "A dictionary containing the element's attributes. Note that while the " "*attrib* value is always a real mutable Python dictionary, an ElementTree " @@ -926,59 +918,59 @@ msgid "" "implementations, use the dictionary methods below whenever possible." msgstr "" -#: ../../library/xml.etree.elementtree.rst:903 +#: ../../library/xml.etree.elementtree.rst:897 msgid "The following dictionary-like methods work on the element attributes." msgstr "" -#: ../../library/xml.etree.elementtree.rst:908 +#: ../../library/xml.etree.elementtree.rst:902 msgid "" "Resets an element. This function removes all subelements, clears all " "attributes, and sets the text and tail attributes to ``None``." msgstr "" -#: ../../library/xml.etree.elementtree.rst:914 +#: ../../library/xml.etree.elementtree.rst:908 msgid "Gets the element attribute named *key*." msgstr "" -#: ../../library/xml.etree.elementtree.rst:916 +#: ../../library/xml.etree.elementtree.rst:910 msgid "" "Returns the attribute value, or *default* if the attribute was not found." msgstr "" -#: ../../library/xml.etree.elementtree.rst:921 +#: ../../library/xml.etree.elementtree.rst:915 msgid "" "Returns the element attributes as a sequence of (name, value) pairs. The " "attributes are returned in an arbitrary order." msgstr "" -#: ../../library/xml.etree.elementtree.rst:927 +#: ../../library/xml.etree.elementtree.rst:921 msgid "" "Returns the elements attribute names as a list. The names are returned in " "an arbitrary order." msgstr "" -#: ../../library/xml.etree.elementtree.rst:933 +#: ../../library/xml.etree.elementtree.rst:927 msgid "Set the attribute *key* on the element to *value*." msgstr "" -#: ../../library/xml.etree.elementtree.rst:935 +#: ../../library/xml.etree.elementtree.rst:929 msgid "The following methods work on the element's children (subelements)." msgstr "" -#: ../../library/xml.etree.elementtree.rst:940 +#: ../../library/xml.etree.elementtree.rst:934 msgid "" "Adds the element *subelement* to the end of this element's internal list of " "subelements. Raises :exc:`TypeError` if *subelement* is not an :class:" "`Element`." msgstr "" -#: ../../library/xml.etree.elementtree.rst:947 +#: ../../library/xml.etree.elementtree.rst:941 msgid "" "Appends *subelements* from a sequence object with zero or more elements. " "Raises :exc:`TypeError` if a subelement is not an :class:`Element`." msgstr "" -#: ../../library/xml.etree.elementtree.rst:955 +#: ../../library/xml.etree.elementtree.rst:949 msgid "" "Finds the first subelement matching *match*. *match* may be a tag name or " "a :ref:`path `. Returns an element instance or " @@ -987,7 +979,7 @@ msgid "" "expression into the given namespace." msgstr "" -#: ../../library/xml.etree.elementtree.rst:964 +#: ../../library/xml.etree.elementtree.rst:958 msgid "" "Finds all matching subelements, by tag name or :ref:`path `. Returns a list containing all matching elements in document " @@ -996,7 +988,7 @@ msgid "" "expression into the given namespace." msgstr "" -#: ../../library/xml.etree.elementtree.rst:973 +#: ../../library/xml.etree.elementtree.rst:967 msgid "" "Finds text for the first subelement matching *match*. *match* may be a tag " "name or a :ref:`path `. Returns the text content of the " @@ -1007,13 +999,13 @@ msgid "" "into the given namespace." msgstr "" -#: ../../library/xml.etree.elementtree.rst:984 +#: ../../library/xml.etree.elementtree.rst:978 msgid "" "Inserts *subelement* at the given position in this element. Raises :exc:" "`TypeError` if *subelement* is not an :class:`Element`." msgstr "" -#: ../../library/xml.etree.elementtree.rst:990 +#: ../../library/xml.etree.elementtree.rst:984 msgid "" "Creates a tree :term:`iterator` with the current element as the root. The " "iterator iterates over this element and all elements below it, in document " @@ -1022,7 +1014,7 @@ msgid "" "structure is modified during iteration, the result is undefined." msgstr "" -#: ../../library/xml.etree.elementtree.rst:1001 +#: ../../library/xml.etree.elementtree.rst:995 msgid "" "Finds all matching subelements, by tag name or :ref:`path `. Returns an iterable yielding all matching elements in document " @@ -1030,40 +1022,40 @@ msgid "" "name." msgstr "" -#: ../../library/xml.etree.elementtree.rst:1012 +#: ../../library/xml.etree.elementtree.rst:1006 msgid "" "Creates a text iterator. The iterator loops over this element and all " "subelements, in document order, and returns all inner text." msgstr "" -#: ../../library/xml.etree.elementtree.rst:1020 +#: ../../library/xml.etree.elementtree.rst:1014 msgid "" "Creates a new element object of the same type as this element. Do not call " "this method, use the :func:`SubElement` factory function instead." msgstr "" -#: ../../library/xml.etree.elementtree.rst:1026 +#: ../../library/xml.etree.elementtree.rst:1020 msgid "" "Removes *subelement* from the element. Unlike the find\\* methods this " "method compares elements based on the instance identity, not on tag value or " "contents." msgstr "" -#: ../../library/xml.etree.elementtree.rst:1030 +#: ../../library/xml.etree.elementtree.rst:1024 msgid "" ":class:`Element` objects also support the following sequence type methods " "for working with subelements: :meth:`~object.__delitem__`, :meth:`~object." "__getitem__`, :meth:`~object.__setitem__`, :meth:`~object.__len__`." msgstr "" -#: ../../library/xml.etree.elementtree.rst:1035 +#: ../../library/xml.etree.elementtree.rst:1029 msgid "" "Caution: Elements with no subelements will test as ``False``. This behavior " "will change in future versions. Use specific ``len(elem)`` or ``elem is " "None`` test instead. ::" msgstr "" -#: ../../library/xml.etree.elementtree.rst:1047 +#: ../../library/xml.etree.elementtree.rst:1041 msgid "" "Prior to Python 3.8, the serialisation order of the XML attributes of " "elements was artificially made predictable by sorting the attributes by " @@ -1072,7 +1064,7 @@ msgid "" "attributes were originally parsed or created by user code." msgstr "" -#: ../../library/xml.etree.elementtree.rst:1053 +#: ../../library/xml.etree.elementtree.rst:1047 msgid "" "In general, user code should try not to depend on a specific ordering of " "attributes, given that the `XML Information Set `_ writer. Arguments are the " "same as for the :func:`canonicalize` function. This class does not build a " @@ -1307,11 +1299,11 @@ msgid "" "using the *write* function." msgstr "" -#: ../../library/xml.etree.elementtree.rst:1331 +#: ../../library/xml.etree.elementtree.rst:1325 msgid "XMLParser Objects" msgstr "" -#: ../../library/xml.etree.elementtree.rst:1336 +#: ../../library/xml.etree.elementtree.rst:1330 msgid "" "This class is the low-level building block of the module. It uses :mod:`xml." "parsers.expat` for efficient, event-based parsing of XML. It can be fed XML " @@ -1322,24 +1314,24 @@ msgid "" "XML file." msgstr "" -#: ../../library/xml.etree.elementtree.rst:1344 +#: ../../library/xml.etree.elementtree.rst:1338 msgid "" "Parameters are now :ref:`keyword-only `. The *html* " "argument no longer supported." msgstr "" -#: ../../library/xml.etree.elementtree.rst:1351 +#: ../../library/xml.etree.elementtree.rst:1345 msgid "" "Finishes feeding data to the parser. Returns the result of calling the " "``close()`` method of the *target* passed during construction; by default, " "this is the toplevel document element." msgstr "" -#: ../../library/xml.etree.elementtree.rst:1358 +#: ../../library/xml.etree.elementtree.rst:1352 msgid "Feeds data to the parser. *data* is encoded data." msgstr "" -#: ../../library/xml.etree.elementtree.rst:1360 +#: ../../library/xml.etree.elementtree.rst:1354 msgid "" ":meth:`XMLParser.feed` calls *target*\\'s ``start(tag, attrs_dict)`` method " "for each opening tag, its ``end(tag)`` method for each closing tag, and data " @@ -1350,11 +1342,11 @@ msgid "" "of an XML file::" msgstr "" -#: ../../library/xml.etree.elementtree.rst:1404 +#: ../../library/xml.etree.elementtree.rst:1398 msgid "XMLPullParser Objects" msgstr "" -#: ../../library/xml.etree.elementtree.rst:1408 +#: ../../library/xml.etree.elementtree.rst:1402 msgid "" "A pull parser suitable for non-blocking applications. Its input-side API is " "similar to that of :class:`XMLParser`, but instead of pushing calls to a " @@ -1366,11 +1358,11 @@ msgid "" "is omitted, only ``\"end\"`` events are reported." msgstr "" -#: ../../library/xml.etree.elementtree.rst:1419 +#: ../../library/xml.etree.elementtree.rst:1413 msgid "Feed the given bytes data to the parser." msgstr "" -#: ../../library/xml.etree.elementtree.rst:1423 +#: ../../library/xml.etree.elementtree.rst:1417 msgid "" "Signal the parser that the data stream is terminated. Unlike :meth:" "`XMLParser.close`, this method always returns :const:`None`. Any events not " @@ -1378,7 +1370,7 @@ msgid "" "`read_events`." msgstr "" -#: ../../library/xml.etree.elementtree.rst:1430 +#: ../../library/xml.etree.elementtree.rst:1424 msgid "" "Return an iterator over the events which have been encountered in the data " "fed to the parser. The iterator yields ``(event, elem)`` pairs, where " @@ -1387,25 +1379,25 @@ msgid "" "follows." msgstr "" -#: ../../library/xml.etree.elementtree.rst:1436 +#: ../../library/xml.etree.elementtree.rst:1430 msgid "``start``, ``end``: the current Element." msgstr "" -#: ../../library/xml.etree.elementtree.rst:1437 +#: ../../library/xml.etree.elementtree.rst:1431 msgid "``comment``, ``pi``: the current comment / processing instruction" msgstr "" -#: ../../library/xml.etree.elementtree.rst:1438 +#: ../../library/xml.etree.elementtree.rst:1432 msgid "" "``start-ns``: a tuple ``(prefix, uri)`` naming the declared namespace " "mapping." msgstr "" -#: ../../library/xml.etree.elementtree.rst:1440 +#: ../../library/xml.etree.elementtree.rst:1434 msgid "``end-ns``: :const:`None` (this may change in a future version)" msgstr "" -#: ../../library/xml.etree.elementtree.rst:1442 +#: ../../library/xml.etree.elementtree.rst:1436 msgid "" "Events provided in a previous call to :meth:`read_events` will not be " "yielded again. Events are consumed from the internal queue only when they " @@ -1414,7 +1406,7 @@ msgid "" "results." msgstr "" -#: ../../library/xml.etree.elementtree.rst:1450 +#: ../../library/xml.etree.elementtree.rst:1444 msgid "" ":class:`XMLPullParser` only guarantees that it has seen the \">\" character " "of a starting tag when it emits a \"start\" event, so the attributes are " @@ -1423,11 +1415,11 @@ msgid "" "be present." msgstr "" -#: ../../library/xml.etree.elementtree.rst:1465 +#: ../../library/xml.etree.elementtree.rst:1459 msgid "Exceptions" msgstr "" -#: ../../library/xml.etree.elementtree.rst:1469 +#: ../../library/xml.etree.elementtree.rst:1463 msgid "" "XML parse error, raised by the various parsing methods in this module when " "parsing fails. The string representation of an instance of this exception " @@ -1435,22 +1427,22 @@ msgid "" "following attributes available:" msgstr "" -#: ../../library/xml.etree.elementtree.rst:1476 +#: ../../library/xml.etree.elementtree.rst:1470 msgid "" "A numeric error code from the expat parser. See the documentation of :mod:" "`xml.parsers.expat` for the list of error codes and their meanings." msgstr "" -#: ../../library/xml.etree.elementtree.rst:1481 +#: ../../library/xml.etree.elementtree.rst:1475 msgid "" "A tuple of *line*, *column* numbers, specifying where the error occurred." msgstr "" -#: ../../library/xml.etree.elementtree.rst:1484 +#: ../../library/xml.etree.elementtree.rst:1478 msgid "Footnotes" msgstr "註解" -#: ../../library/xml.etree.elementtree.rst:1485 +#: ../../library/xml.etree.elementtree.rst:1479 msgid "" "The encoding string included in XML output should conform to the appropriate " "standards. For example, \"UTF-8\" is valid, but \"UTF8\" is not. See " diff --git a/library/xml.po b/library/xml.po index 96fa7aadc2..e85cf64941 100644 --- a/library/xml.po +++ b/library/xml.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.7\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2021-09-07 06:52+0000\n" +"POT-Creation-Date: 2020-06-20 18:08+0800\n" "PO-Revision-Date: 2018-05-23 16:16+0000\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -36,7 +36,7 @@ msgstr "" msgid "" "The XML modules are not secure against erroneous or maliciously constructed " "data. If you need to parse untrusted or unauthenticated data see the :ref:" -"`xml-vulnerabilities` and :ref:`defusedxml-package` sections." +"`xml-vulnerabilities` and :ref:`defused-packages` sections." msgstr "" #: ../../library/xml.rst:25 @@ -129,35 +129,35 @@ msgstr "" msgid "billion laughs" msgstr "" -#: ../../library/xml.rst:66 ../../library/xml.rst:67 -msgid "**Vulnerable** (1)" +#: ../../library/xml.rst:66 ../../library/xml.rst:67 ../../library/xml.rst:70 +msgid "**Vulnerable**" msgstr "" #: ../../library/xml.rst:67 msgid "quadratic blowup" msgstr "" -#: ../../library/xml.rst:68 ../../library/xml.rst:103 +#: ../../library/xml.rst:68 ../../library/xml.rst:99 msgid "external entity expansion" msgstr "" #: ../../library/xml.rst:68 ../../library/xml.rst:69 -msgid "Safe (5)" +msgid "Safe (4)" msgstr "" #: ../../library/xml.rst:68 -msgid "Safe (2)" +msgid "Safe (1)" msgstr "" #: ../../library/xml.rst:68 -msgid "Safe (3)" +msgid "Safe (2)" msgstr "" #: ../../library/xml.rst:68 -msgid "Safe (4)" +msgid "Safe (3)" msgstr "" -#: ../../library/xml.rst:69 ../../library/xml.rst:108 +#: ../../library/xml.rst:69 ../../library/xml.rst:104 msgid "`DTD`_ retrieval" msgstr "" @@ -165,49 +165,37 @@ msgstr "" msgid "Safe" msgstr "" -#: ../../library/xml.rst:70 ../../library/xml.rst:115 +#: ../../library/xml.rst:70 ../../library/xml.rst:111 msgid "decompression bomb" msgstr "" -#: ../../library/xml.rst:70 -msgid "**Vulnerable**" -msgstr "" - #: ../../library/xml.rst:73 msgid "" -"Expat 2.4.1 and newer is not vulnerable to the \"billion laughs\" and " -"\"quadratic blowup\" vulnerabilities. Items still listed as vulnerable due " -"to potential reliance on system-provided libraries. Check :data:`pyexpat." -"EXPAT_VERSION`." -msgstr "" - -#: ../../library/xml.rst:77 -msgid "" ":mod:`xml.etree.ElementTree` doesn't expand external entities and raises a :" "exc:`ParserError` when an entity occurs." msgstr "" -#: ../../library/xml.rst:79 +#: ../../library/xml.rst:75 msgid "" ":mod:`xml.dom.minidom` doesn't expand external entities and simply returns " "the unexpanded entity verbatim." msgstr "" -#: ../../library/xml.rst:81 +#: ../../library/xml.rst:77 msgid ":mod:`xmlrpclib` doesn't expand external entities and omits them." msgstr "" -#: ../../library/xml.rst:82 +#: ../../library/xml.rst:78 msgid "" "Since Python 3.7.1, external general entities are no longer processed by " "default." msgstr "" -#: ../../library/xml.rst:91 +#: ../../library/xml.rst:87 msgid "billion laughs / exponential entity expansion" msgstr "" -#: ../../library/xml.rst:87 +#: ../../library/xml.rst:83 msgid "" "The `Billion Laughs`_ attack -- also known as exponential entity expansion " "-- uses multiple levels of nested entities. Each entity refers to another " @@ -216,11 +204,11 @@ msgid "" "consumes lots of memory and CPU time." msgstr "" -#: ../../library/xml.rst:98 +#: ../../library/xml.rst:94 msgid "quadratic blowup entity expansion" msgstr "" -#: ../../library/xml.rst:94 +#: ../../library/xml.rst:90 msgid "" "A quadratic blowup attack is similar to a `Billion Laughs`_ attack; it " "abuses entity expansion, too. Instead of nested entities it repeats one " @@ -229,21 +217,21 @@ msgid "" "countermeasures that forbid deeply-nested entities." msgstr "" -#: ../../library/xml.rst:101 +#: ../../library/xml.rst:97 msgid "" "Entity declarations can contain more than just text for replacement. They " "can also point to external resources or local files. The XML parser accesses " "the resource and embeds the content into the XML document." msgstr "" -#: ../../library/xml.rst:106 +#: ../../library/xml.rst:102 msgid "" "Some XML libraries like Python's :mod:`xml.dom.pulldom` retrieve document " "type definitions from remote or local locations. The feature has similar " "implications as the external entity expansion issue." msgstr "" -#: ../../library/xml.rst:111 +#: ../../library/xml.rst:107 msgid "" "Decompression bombs (aka `ZIP bomb`_) apply to all XML libraries that can " "parse compressed XML streams such as gzipped HTTP streams or LZMA-compressed " @@ -251,17 +239,17 @@ msgid "" "magnitudes or more." msgstr "" -#: ../../library/xml.rst:117 +#: ../../library/xml.rst:113 msgid "" "The documentation for `defusedxml`_ on PyPI has further information about " "all known attack vectors with examples and references." msgstr "" -#: ../../library/xml.rst:123 -msgid "The :mod:`defusedxml` Package" +#: ../../library/xml.rst:119 +msgid "The :mod:`defusedxml` and :mod:`defusedexpat` Packages" msgstr "" -#: ../../library/xml.rst:125 +#: ../../library/xml.rst:121 msgid "" "`defusedxml`_ is a pure Python package with modified subclasses of all " "stdlib XML parsers that prevent any potentially malicious operation. Use of " @@ -269,3 +257,13 @@ msgid "" "data. The package also ships with example exploits and extended " "documentation on more XML exploits such as XPath injection." msgstr "" + +#: ../../library/xml.rst:127 +msgid "" +"`defusedexpat`_ provides a modified libexpat and a patched :mod:`pyexpat` " +"module that have countermeasures against entity expansion DoS attacks. The :" +"mod:`defusedexpat` module still allows a sane and configurable amount of " +"entity expansions. The modifications may be included in some future release " +"of Python, but will not be included in any bugfix releases of Python because " +"they break backward compatibility." +msgstr "" diff --git a/library/zipfile.po b/library/zipfile.po index 0d14e640ab..3b9b3e7330 100644 --- a/library/zipfile.po +++ b/library/zipfile.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.7\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2021-09-07 06:52+0000\n" +"POT-Creation-Date: 2020-06-20 18:08+0800\n" "PO-Revision-Date: 2018-05-23 16:16+0000\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -90,40 +90,40 @@ msgid "" "ref:`zipinfo-objects`." msgstr "" -#: ../../library/zipfile.rst:83 +#: ../../library/zipfile.rst:84 msgid "" "Returns ``True`` if *filename* is a valid ZIP file based on its magic " "number, otherwise returns ``False``. *filename* may be a file or file-like " "object too." msgstr "" -#: ../../library/zipfile.rst:86 +#: ../../library/zipfile.rst:87 msgid "Support for file and file-like objects." msgstr "" -#: ../../library/zipfile.rst:92 +#: ../../library/zipfile.rst:93 msgid "The numeric constant for an uncompressed archive member." msgstr "" -#: ../../library/zipfile.rst:97 +#: ../../library/zipfile.rst:98 msgid "" "The numeric constant for the usual ZIP compression method. This requires " "the :mod:`zlib` module." msgstr "" -#: ../../library/zipfile.rst:103 +#: ../../library/zipfile.rst:104 msgid "" "The numeric constant for the BZIP2 compression method. This requires the :" "mod:`bz2` module." msgstr "" -#: ../../library/zipfile.rst:110 +#: ../../library/zipfile.rst:111 msgid "" "The numeric constant for the LZMA compression method. This requires the :" "mod:`lzma` module." msgstr "" -#: ../../library/zipfile.rst:117 +#: ../../library/zipfile.rst:118 msgid "" "The ZIP file format specification has included support for bzip2 compression " "since 2001, and for LZMA compression since 2006. However, some tools " @@ -132,37 +132,37 @@ msgid "" "individual files." msgstr "" -#: ../../library/zipfile.rst:128 +#: ../../library/zipfile.rst:129 msgid "`PKZIP Application Note`_" msgstr "" -#: ../../library/zipfile.rst:127 +#: ../../library/zipfile.rst:128 msgid "" "Documentation on the ZIP file format by Phil Katz, the creator of the format " "and algorithms used." msgstr "" -#: ../../library/zipfile.rst:131 +#: ../../library/zipfile.rst:132 msgid "`Info-ZIP Home Page `_" msgstr "" -#: ../../library/zipfile.rst:131 +#: ../../library/zipfile.rst:132 msgid "" "Information about the Info-ZIP project's ZIP archive programs and " "development libraries." msgstr "" -#: ../../library/zipfile.rst:138 +#: ../../library/zipfile.rst:139 msgid "ZipFile Objects" msgstr "" -#: ../../library/zipfile.rst:144 +#: ../../library/zipfile.rst:145 msgid "" "Open a ZIP file, where *file* can be a path to a file (a string), a file-" "like object or a :term:`path-like object`." msgstr "" -#: ../../library/zipfile.rst:147 +#: ../../library/zipfile.rst:148 msgid "" "The *mode* parameter should be ``'r'`` to read an existing file, ``'w'`` to " "truncate and write a new file, ``'a'`` to append to an existing file, or " @@ -176,7 +176,7 @@ msgid "" "``'r'`` or ``'a'``, the file should be seekable." msgstr "" -#: ../../library/zipfile.rst:159 +#: ../../library/zipfile.rst:160 msgid "" "*compression* is the ZIP compression method to use when writing the archive, " "and should be :const:`ZIP_STORED`, :const:`ZIP_DEFLATED`, :const:`ZIP_BZIP2` " @@ -187,7 +187,7 @@ msgid "" "is raised. The default is :const:`ZIP_STORED`." msgstr "" -#: ../../library/zipfile.rst:167 +#: ../../library/zipfile.rst:168 msgid "" "If *allowZip64* is ``True`` (the default) zipfile will create ZIP files that " "use the ZIP64 extensions when the zipfile is larger than 4 GiB. If it is " @@ -195,7 +195,7 @@ msgid "" "require ZIP64 extensions." msgstr "" -#: ../../library/zipfile.rst:172 +#: ../../library/zipfile.rst:173 msgid "" "The *compresslevel* parameter controls the compression level to use when " "writing files to the archive. When using :const:`ZIP_STORED` or :const:" @@ -205,7 +205,7 @@ msgid "" "accepted (see :class:`bz2 ` for more information)." msgstr "" -#: ../../library/zipfile.rst:180 ../../library/zipfile.rst:640 +#: ../../library/zipfile.rst:181 ../../library/zipfile.rst:636 msgid "" "The *strict_timestamps* argument, when set to ``False``, allows to zip files " "older than 1980-01-01 at the cost of setting the timestamp to 1980-01-01. " @@ -213,81 +213,81 @@ msgid "" "also set to the limit." msgstr "" -#: ../../library/zipfile.rst:186 +#: ../../library/zipfile.rst:187 msgid "" "If the file is created with mode ``'w'``, ``'x'`` or ``'a'`` and then :meth:" "`closed ` without adding any files to the archive, the appropriate " "ZIP structures for an empty archive will be written to the file." msgstr "" -#: ../../library/zipfile.rst:190 +#: ../../library/zipfile.rst:191 msgid "" "ZipFile is also a context manager and therefore supports the :keyword:`with` " "statement. In the example, *myzip* is closed after the :keyword:`!with` " "statement's suite is finished---even if an exception occurs::" msgstr "" -#: ../../library/zipfile.rst:197 +#: ../../library/zipfile.rst:198 msgid "Added the ability to use :class:`ZipFile` as a context manager." msgstr "" -#: ../../library/zipfile.rst:200 +#: ../../library/zipfile.rst:201 msgid "Added support for :mod:`bzip2 ` and :mod:`lzma` compression." msgstr "" -#: ../../library/zipfile.rst:203 ../../library/zipfile.rst:554 +#: ../../library/zipfile.rst:204 ../../library/zipfile.rst:550 msgid "ZIP64 extensions are enabled by default." msgstr "" -#: ../../library/zipfile.rst:206 +#: ../../library/zipfile.rst:207 msgid "" "Added support for writing to unseekable streams. Added support for the " "``'x'`` mode." msgstr "" -#: ../../library/zipfile.rst:210 +#: ../../library/zipfile.rst:211 msgid "" "Previously, a plain :exc:`RuntimeError` was raised for unrecognized " "compression values." msgstr "" -#: ../../library/zipfile.rst:214 +#: ../../library/zipfile.rst:215 msgid "The *file* parameter accepts a :term:`path-like object`." msgstr "" -#: ../../library/zipfile.rst:217 +#: ../../library/zipfile.rst:218 msgid "Add the *compresslevel* parameter." msgstr "" -#: ../../library/zipfile.rst:220 ../../library/zipfile.rst:651 +#: ../../library/zipfile.rst:221 ../../library/zipfile.rst:647 msgid "The *strict_timestamps* keyword-only argument" msgstr "" -#: ../../library/zipfile.rst:226 +#: ../../library/zipfile.rst:227 msgid "" "Close the archive file. You must call :meth:`close` before exiting your " "program or essential records will not be written." msgstr "" -#: ../../library/zipfile.rst:232 +#: ../../library/zipfile.rst:233 msgid "" "Return a :class:`ZipInfo` object with information about the archive member " "*name*. Calling :meth:`getinfo` for a name not currently contained in the " "archive will raise a :exc:`KeyError`." msgstr "" -#: ../../library/zipfile.rst:239 +#: ../../library/zipfile.rst:240 msgid "" "Return a list containing a :class:`ZipInfo` object for each member of the " "archive. The objects are in the same order as their entries in the actual " "ZIP file on disk if an existing archive was opened." msgstr "" -#: ../../library/zipfile.rst:246 +#: ../../library/zipfile.rst:247 msgid "Return a list of archive members by name." msgstr "" -#: ../../library/zipfile.rst:251 +#: ../../library/zipfile.rst:252 msgid "" "Access a member of the archive as a binary file-like object. *name* can be " "either the name of a file within the archive or a :class:`ZipInfo` object. " @@ -295,13 +295,13 @@ msgid "" "``'w'``. *pwd* is the password used to decrypt encrypted ZIP files." msgstr "" -#: ../../library/zipfile.rst:256 +#: ../../library/zipfile.rst:257 msgid "" ":meth:`~ZipFile.open` is also a context manager and therefore supports the :" "keyword:`with` statement::" msgstr "" -#: ../../library/zipfile.rst:263 +#: ../../library/zipfile.rst:264 msgid "" "With *mode* ``'r'`` the file-like object (``ZipExtFile``) is read-only and " "provides the following methods: :meth:`~io.BufferedIOBase.read`, :meth:`~io." @@ -310,7 +310,7 @@ msgid "" "objects can operate independently of the ZipFile." msgstr "" -#: ../../library/zipfile.rst:270 +#: ../../library/zipfile.rst:271 msgid "" "With ``mode='w'``, a writable file handle is returned, which supports the :" "meth:`~io.BufferedIOBase.write` method. While a writable file handle is " @@ -318,7 +318,7 @@ msgid "" "exc:`ValueError`." msgstr "" -#: ../../library/zipfile.rst:275 +#: ../../library/zipfile.rst:276 msgid "" "When writing a file, if the file size is not known in advance but may exceed " "2 GiB, pass ``force_zip64=True`` to ensure that the header format is capable " @@ -327,32 +327,32 @@ msgid "" "as the *name* parameter." msgstr "" -#: ../../library/zipfile.rst:283 +#: ../../library/zipfile.rst:284 msgid "" "The :meth:`.open`, :meth:`read` and :meth:`extract` methods can take a " "filename or a :class:`ZipInfo` object. You will appreciate this when trying " "to read a ZIP file that contains members with duplicate names." msgstr "" -#: ../../library/zipfile.rst:287 +#: ../../library/zipfile.rst:288 msgid "" "Removed support of ``mode='U'``. Use :class:`io.TextIOWrapper` for reading " "compressed text files in :term:`universal newlines` mode." msgstr "" -#: ../../library/zipfile.rst:291 +#: ../../library/zipfile.rst:292 msgid "" ":meth:`open` can now be used to write files into the archive with the " "``mode='w'`` option." msgstr "" -#: ../../library/zipfile.rst:295 +#: ../../library/zipfile.rst:296 msgid "" "Calling :meth:`.open` on a closed ZipFile will raise a :exc:`ValueError`. " "Previously, a :exc:`RuntimeError` was raised." msgstr "" -#: ../../library/zipfile.rst:302 +#: ../../library/zipfile.rst:303 msgid "" "Extract a member from the archive to the current working directory; *member* " "must be its full name or a :class:`ZipInfo` object. Its file information is " @@ -361,11 +361,11 @@ msgid "" "*pwd* is the password used for encrypted files." msgstr "" -#: ../../library/zipfile.rst:308 +#: ../../library/zipfile.rst:309 msgid "Returns the normalized path created (a directory or new file)." msgstr "" -#: ../../library/zipfile.rst:312 +#: ../../library/zipfile.rst:313 msgid "" "If a member filename is an absolute path, a drive/UNC sharepoint and leading " "(back)slashes will be stripped, e.g.: ``///foo/bar`` becomes ``foo/bar`` on " @@ -376,17 +376,17 @@ msgid "" "(``_``)." msgstr "" -#: ../../library/zipfile.rst:320 +#: ../../library/zipfile.rst:321 msgid "" "Calling :meth:`extract` on a closed ZipFile will raise a :exc:`ValueError`. " "Previously, a :exc:`RuntimeError` was raised." msgstr "" -#: ../../library/zipfile.rst:324 ../../library/zipfile.rst:347 +#: ../../library/zipfile.rst:325 ../../library/zipfile.rst:348 msgid "The *path* parameter accepts a :term:`path-like object`." msgstr "" -#: ../../library/zipfile.rst:330 +#: ../../library/zipfile.rst:331 msgid "" "Extract all members from the archive to the current working directory. " "*path* specifies a different directory to extract to. *members* is optional " @@ -394,7 +394,7 @@ msgid "" "password used for encrypted files." msgstr "" -#: ../../library/zipfile.rst:337 +#: ../../library/zipfile.rst:338 msgid "" "Never extract archives from untrusted sources without prior inspection. It " "is possible that files are created outside of *path*, e.g. members that have " @@ -402,21 +402,21 @@ msgid "" "\"``. This module attempts to prevent that. See :meth:`extract` note." msgstr "" -#: ../../library/zipfile.rst:343 +#: ../../library/zipfile.rst:344 msgid "" "Calling :meth:`extractall` on a closed ZipFile will raise a :exc:" "`ValueError`. Previously, a :exc:`RuntimeError` was raised." msgstr "" -#: ../../library/zipfile.rst:353 +#: ../../library/zipfile.rst:354 msgid "Print a table of contents for the archive to ``sys.stdout``." msgstr "" -#: ../../library/zipfile.rst:358 +#: ../../library/zipfile.rst:359 msgid "Set *pwd* as default password to extract encrypted files." msgstr "" -#: ../../library/zipfile.rst:363 +#: ../../library/zipfile.rst:364 msgid "" "Return the bytes of the file *name* in the archive. *name* is the name of " "the file in the archive, or a :class:`ZipInfo` object. The archive must be " @@ -429,25 +429,25 @@ msgid "" "available." msgstr "" -#: ../../library/zipfile.rst:372 +#: ../../library/zipfile.rst:373 msgid "" "Calling :meth:`read` on a closed ZipFile will raise a :exc:`ValueError`. " "Previously, a :exc:`RuntimeError` was raised." msgstr "" -#: ../../library/zipfile.rst:379 +#: ../../library/zipfile.rst:380 msgid "" "Read all the files in the archive and check their CRC's and file headers. " "Return the name of the first bad file, or else return ``None``." msgstr "" -#: ../../library/zipfile.rst:382 +#: ../../library/zipfile.rst:383 msgid "" "Calling :meth:`testzip` on a closed ZipFile will raise a :exc:`ValueError`. " "Previously, a :exc:`RuntimeError` was raised." msgstr "" -#: ../../library/zipfile.rst:390 +#: ../../library/zipfile.rst:391 msgid "" "Write the file named *filename* to the archive, giving it the archive name " "*arcname* (by default, this will be the same as *filename*, but without a " @@ -458,33 +458,27 @@ msgid "" "``'x'`` or ``'a'``." msgstr "" -#: ../../library/zipfile.rst:400 +#: ../../library/zipfile.rst:401 msgid "" "Archive names should be relative to the archive root, that is, they should " "not start with a path separator." msgstr "" -#: ../../library/zipfile.rst:405 +#: ../../library/zipfile.rst:406 msgid "" "If ``arcname`` (or ``filename``, if ``arcname`` is not given) contains a " "null byte, the name of the file in the archive will be truncated at the null " "byte." msgstr "" -#: ../../library/zipfile.rst:410 -msgid "" -"A leading slash in the filename may lead to the archive being impossible to " -"open in some zip programs on Windows systems." -msgstr "" - -#: ../../library/zipfile.rst:413 +#: ../../library/zipfile.rst:409 msgid "" "Calling :meth:`write` on a ZipFile created with mode ``'r'`` or a closed " "ZipFile will raise a :exc:`ValueError`. Previously, a :exc:`RuntimeError` " "was raised." msgstr "" -#: ../../library/zipfile.rst:422 +#: ../../library/zipfile.rst:418 msgid "" "Write a file into the archive. The contents is *data*, which may be either " "a :class:`str` or a :class:`bytes` instance; if it is a :class:`str`, it is " @@ -495,7 +489,7 @@ msgid "" "must be opened with mode ``'w'``, ``'x'`` or ``'a'``." msgstr "" -#: ../../library/zipfile.rst:430 +#: ../../library/zipfile.rst:426 msgid "" "If given, *compress_type* overrides the value given for the *compression* " "parameter to the constructor for the new entry, or in the *zinfo_or_arcname* " @@ -503,7 +497,7 @@ msgid "" "override the constructor if given." msgstr "" -#: ../../library/zipfile.rst:437 +#: ../../library/zipfile.rst:433 msgid "" "When passing a :class:`ZipInfo` instance as the *zinfo_or_arcname* " "parameter, the compression method used will be that specified in the " @@ -511,33 +505,33 @@ msgid "" "the :class:`ZipInfo` constructor sets this member to :const:`ZIP_STORED`." msgstr "" -#: ../../library/zipfile.rst:442 +#: ../../library/zipfile.rst:438 msgid "The *compress_type* argument." msgstr "" -#: ../../library/zipfile.rst:445 +#: ../../library/zipfile.rst:441 msgid "" "Calling :meth:`writestr` on a ZipFile created with mode ``'r'`` or a closed " "ZipFile will raise a :exc:`ValueError`. Previously, a :exc:`RuntimeError` " "was raised." msgstr "" -#: ../../library/zipfile.rst:451 +#: ../../library/zipfile.rst:447 msgid "The following data attributes are also available:" msgstr "" -#: ../../library/zipfile.rst:455 +#: ../../library/zipfile.rst:451 msgid "Name of the ZIP file." msgstr "" -#: ../../library/zipfile.rst:459 +#: ../../library/zipfile.rst:455 msgid "" "The level of debug output to use. This may be set from ``0`` (the default, " "no output) to ``3`` (the most output). Debugging information is written to " "``sys.stdout``." msgstr "" -#: ../../library/zipfile.rst:465 +#: ../../library/zipfile.rst:461 msgid "" "The comment associated with the ZIP file as a :class:`bytes` object. If " "assigning a comment to a :class:`ZipFile` instance created with mode " @@ -545,37 +539,37 @@ msgid "" "Comments longer than this will be truncated." msgstr "" -#: ../../library/zipfile.rst:475 +#: ../../library/zipfile.rst:471 msgid "Path Objects" msgstr "" -#: ../../library/zipfile.rst:479 +#: ../../library/zipfile.rst:475 msgid "" "Construct a Path object from a ``root`` zipfile (which may be a :class:" "`ZipFile` instance or ``file`` suitable for passing to the :class:`ZipFile` " "constructor)." msgstr "" -#: ../../library/zipfile.rst:483 +#: ../../library/zipfile.rst:479 msgid "" "``at`` specifies the location of this Path within the zipfile, e.g. 'dir/" "file.txt', 'dir/', or ''. Defaults to the empty string, indicating the root." msgstr "" -#: ../../library/zipfile.rst:487 +#: ../../library/zipfile.rst:483 msgid "" "Path objects expose the following features of :mod:`pathlib.Path` objects:" msgstr "" -#: ../../library/zipfile.rst:490 +#: ../../library/zipfile.rst:486 msgid "Path objects are traversable using the ``/`` operator." msgstr "" -#: ../../library/zipfile.rst:494 +#: ../../library/zipfile.rst:490 msgid "The final path component." msgstr "" -#: ../../library/zipfile.rst:498 +#: ../../library/zipfile.rst:494 msgid "" "Invoke :meth:`ZipFile.open` on the current path. Allows opening for read or " "write, text or binary through supported modes: 'r', 'w', 'rb', 'wb'. " @@ -584,79 +578,79 @@ msgid "" "``pwd`` parameter to :meth:`ZipFile.open`." msgstr "" -#: ../../library/zipfile.rst:507 +#: ../../library/zipfile.rst:503 msgid "" "Added support for text and binary modes for open. Default mode is now text." msgstr "" -#: ../../library/zipfile.rst:513 +#: ../../library/zipfile.rst:509 msgid "Enumerate the children of the current directory." msgstr "" -#: ../../library/zipfile.rst:517 +#: ../../library/zipfile.rst:513 msgid "Return ``True`` if the current context references a directory." msgstr "" -#: ../../library/zipfile.rst:521 +#: ../../library/zipfile.rst:517 msgid "Return ``True`` if the current context references a file." msgstr "" -#: ../../library/zipfile.rst:525 +#: ../../library/zipfile.rst:521 msgid "" "Return ``True`` if the current context references a file or directory in the " "zip file." msgstr "" -#: ../../library/zipfile.rst:530 +#: ../../library/zipfile.rst:526 msgid "" "Read the current file as unicode text. Positional and keyword arguments are " "passed through to :class:`io.TextIOWrapper` (except ``buffer``, which is " "implied by the context)." msgstr "" -#: ../../library/zipfile.rst:537 +#: ../../library/zipfile.rst:533 msgid "Read the current file as bytes." msgstr "" -#: ../../library/zipfile.rst:543 +#: ../../library/zipfile.rst:539 msgid "PyZipFile Objects" msgstr "" -#: ../../library/zipfile.rst:545 +#: ../../library/zipfile.rst:541 msgid "" "The :class:`PyZipFile` constructor takes the same parameters as the :class:" "`ZipFile` constructor, and one additional parameter, *optimize*." msgstr "" -#: ../../library/zipfile.rst:551 +#: ../../library/zipfile.rst:547 msgid "The *optimize* parameter." msgstr "" -#: ../../library/zipfile.rst:557 +#: ../../library/zipfile.rst:553 msgid "" "Instances have one method in addition to those of :class:`ZipFile` objects:" msgstr "" -#: ../../library/zipfile.rst:561 +#: ../../library/zipfile.rst:557 msgid "" "Search for files :file:`\\*.py` and add the corresponding file to the " "archive." msgstr "" -#: ../../library/zipfile.rst:564 +#: ../../library/zipfile.rst:560 msgid "" "If the *optimize* parameter to :class:`PyZipFile` was not given or ``-1``, " "the corresponding file is a :file:`\\*.pyc` file, compiling if necessary." msgstr "" -#: ../../library/zipfile.rst:567 +#: ../../library/zipfile.rst:563 msgid "" "If the *optimize* parameter to :class:`PyZipFile` was ``0``, ``1`` or ``2``, " "only files with that optimization level (see :func:`compile`) are added to " "the archive, compiling if necessary." msgstr "" -#: ../../library/zipfile.rst:571 +#: ../../library/zipfile.rst:567 msgid "" "If *pathname* is a file, the filename must end with :file:`.py`, and just " "the (corresponding :file:`\\*.pyc`) file is added at the top level (no path " @@ -669,11 +663,11 @@ msgid "" "in sorted order." msgstr "" -#: ../../library/zipfile.rst:581 +#: ../../library/zipfile.rst:577 msgid "*basename* is intended for internal use only." msgstr "" -#: ../../library/zipfile.rst:583 +#: ../../library/zipfile.rst:579 msgid "" "*filterfunc*, if given, must be a function taking a single string argument. " "It will be passed each path (including each individual full file path) " @@ -684,280 +678,280 @@ msgid "" "exclude them::" msgstr "" -#: ../../library/zipfile.rst:597 +#: ../../library/zipfile.rst:593 msgid "The :meth:`writepy` method makes archives with file names like this::" msgstr "" -#: ../../library/zipfile.rst:606 +#: ../../library/zipfile.rst:602 msgid "The *filterfunc* parameter." msgstr "" -#: ../../library/zipfile.rst:609 +#: ../../library/zipfile.rst:605 msgid "The *pathname* parameter accepts a :term:`path-like object`." msgstr "" -#: ../../library/zipfile.rst:612 +#: ../../library/zipfile.rst:608 msgid "Recursion sorts directory entries." msgstr "" -#: ../../library/zipfile.rst:619 +#: ../../library/zipfile.rst:615 msgid "ZipInfo Objects" msgstr "" -#: ../../library/zipfile.rst:621 +#: ../../library/zipfile.rst:617 msgid "" "Instances of the :class:`ZipInfo` class are returned by the :meth:`.getinfo` " "and :meth:`.infolist` methods of :class:`ZipFile` objects. Each object " "stores information about a single member of the ZIP archive." msgstr "" -#: ../../library/zipfile.rst:625 +#: ../../library/zipfile.rst:621 msgid "" "There is one classmethod to make a :class:`ZipInfo` instance for a " "filesystem file:" msgstr "" -#: ../../library/zipfile.rst:631 +#: ../../library/zipfile.rst:627 msgid "" "Construct a :class:`ZipInfo` instance for a file on the filesystem, in " "preparation for adding it to a zip file." msgstr "" -#: ../../library/zipfile.rst:634 +#: ../../library/zipfile.rst:630 msgid "*filename* should be the path to a file or directory on the filesystem." msgstr "" -#: ../../library/zipfile.rst:636 +#: ../../library/zipfile.rst:632 msgid "" "If *arcname* is specified, it is used as the name within the archive. If " "*arcname* is not specified, the name will be the same as *filename*, but " "with any drive letter and leading path separators removed." msgstr "" -#: ../../library/zipfile.rst:648 +#: ../../library/zipfile.rst:644 msgid "The *filename* parameter accepts a :term:`path-like object`." msgstr "" -#: ../../library/zipfile.rst:655 +#: ../../library/zipfile.rst:651 msgid "Instances have the following methods and attributes:" msgstr "" -#: ../../library/zipfile.rst:659 +#: ../../library/zipfile.rst:655 msgid "Return ``True`` if this archive member is a directory." msgstr "" -#: ../../library/zipfile.rst:661 +#: ../../library/zipfile.rst:657 msgid "This uses the entry's name: directories should always end with ``/``." msgstr "" -#: ../../library/zipfile.rst:668 +#: ../../library/zipfile.rst:664 msgid "Name of the file in the archive." msgstr "" -#: ../../library/zipfile.rst:673 +#: ../../library/zipfile.rst:669 msgid "" "The time and date of the last modification to the archive member. This is a " "tuple of six values:" msgstr "" -#: ../../library/zipfile.rst:677 +#: ../../library/zipfile.rst:673 msgid "Index" msgstr "" -#: ../../library/zipfile.rst:677 +#: ../../library/zipfile.rst:673 msgid "Value" msgstr "" -#: ../../library/zipfile.rst:679 +#: ../../library/zipfile.rst:675 msgid "``0``" msgstr "" -#: ../../library/zipfile.rst:679 +#: ../../library/zipfile.rst:675 msgid "Year (>= 1980)" msgstr "" -#: ../../library/zipfile.rst:681 +#: ../../library/zipfile.rst:677 msgid "``1``" msgstr "" -#: ../../library/zipfile.rst:681 +#: ../../library/zipfile.rst:677 msgid "Month (one-based)" msgstr "" -#: ../../library/zipfile.rst:683 +#: ../../library/zipfile.rst:679 msgid "``2``" msgstr "" -#: ../../library/zipfile.rst:683 +#: ../../library/zipfile.rst:679 msgid "Day of month (one-based)" msgstr "" -#: ../../library/zipfile.rst:685 +#: ../../library/zipfile.rst:681 msgid "``3``" msgstr "" -#: ../../library/zipfile.rst:685 +#: ../../library/zipfile.rst:681 msgid "Hours (zero-based)" msgstr "" -#: ../../library/zipfile.rst:687 +#: ../../library/zipfile.rst:683 msgid "``4``" msgstr "" -#: ../../library/zipfile.rst:687 +#: ../../library/zipfile.rst:683 msgid "Minutes (zero-based)" msgstr "" -#: ../../library/zipfile.rst:689 +#: ../../library/zipfile.rst:685 msgid "``5``" msgstr "" -#: ../../library/zipfile.rst:689 +#: ../../library/zipfile.rst:685 msgid "Seconds (zero-based)" msgstr "" -#: ../../library/zipfile.rst:694 +#: ../../library/zipfile.rst:690 msgid "The ZIP file format does not support timestamps before 1980." msgstr "" -#: ../../library/zipfile.rst:699 +#: ../../library/zipfile.rst:695 msgid "Type of compression for the archive member." msgstr "" -#: ../../library/zipfile.rst:704 +#: ../../library/zipfile.rst:700 msgid "Comment for the individual archive member as a :class:`bytes` object." msgstr "" -#: ../../library/zipfile.rst:709 +#: ../../library/zipfile.rst:705 msgid "" "Expansion field data. The `PKZIP Application Note`_ contains some comments " "on the internal structure of the data contained in this :class:`bytes` " "object." msgstr "" -#: ../../library/zipfile.rst:716 +#: ../../library/zipfile.rst:712 msgid "System which created ZIP archive." msgstr "" -#: ../../library/zipfile.rst:721 +#: ../../library/zipfile.rst:717 msgid "PKZIP version which created ZIP archive." msgstr "" -#: ../../library/zipfile.rst:726 +#: ../../library/zipfile.rst:722 msgid "PKZIP version needed to extract archive." msgstr "" -#: ../../library/zipfile.rst:731 +#: ../../library/zipfile.rst:727 msgid "Must be zero." msgstr "" -#: ../../library/zipfile.rst:736 +#: ../../library/zipfile.rst:732 msgid "ZIP flag bits." msgstr "" -#: ../../library/zipfile.rst:741 +#: ../../library/zipfile.rst:737 msgid "Volume number of file header." msgstr "" -#: ../../library/zipfile.rst:746 +#: ../../library/zipfile.rst:742 msgid "Internal attributes." msgstr "" -#: ../../library/zipfile.rst:751 +#: ../../library/zipfile.rst:747 msgid "External file attributes." msgstr "" -#: ../../library/zipfile.rst:756 +#: ../../library/zipfile.rst:752 msgid "Byte offset to the file header." msgstr "" -#: ../../library/zipfile.rst:761 +#: ../../library/zipfile.rst:757 msgid "CRC-32 of the uncompressed file." msgstr "" -#: ../../library/zipfile.rst:766 +#: ../../library/zipfile.rst:762 msgid "Size of the compressed data." msgstr "" -#: ../../library/zipfile.rst:771 +#: ../../library/zipfile.rst:767 msgid "Size of the uncompressed file." msgstr "" -#: ../../library/zipfile.rst:778 +#: ../../library/zipfile.rst:774 msgid "Command-Line Interface" msgstr "" -#: ../../library/zipfile.rst:780 +#: ../../library/zipfile.rst:776 msgid "" "The :mod:`zipfile` module provides a simple command-line interface to " "interact with ZIP archives." msgstr "" -#: ../../library/zipfile.rst:783 +#: ../../library/zipfile.rst:779 msgid "" "If you want to create a new ZIP archive, specify its name after the :option:" "`-c` option and then list the filename(s) that should be included:" msgstr "" -#: ../../library/zipfile.rst:790 +#: ../../library/zipfile.rst:786 msgid "Passing a directory is also acceptable:" msgstr "" -#: ../../library/zipfile.rst:796 +#: ../../library/zipfile.rst:792 msgid "" "If you want to extract a ZIP archive into the specified directory, use the :" "option:`-e` option:" msgstr "" -#: ../../library/zipfile.rst:803 +#: ../../library/zipfile.rst:799 msgid "For a list of the files in a ZIP archive, use the :option:`-l` option:" msgstr "" -#: ../../library/zipfile.rst:811 +#: ../../library/zipfile.rst:807 msgid "Command-line options" msgstr "" -#: ../../library/zipfile.rst:816 +#: ../../library/zipfile.rst:812 msgid "List files in a zipfile." msgstr "" -#: ../../library/zipfile.rst:821 +#: ../../library/zipfile.rst:817 msgid "Create zipfile from source files." msgstr "" -#: ../../library/zipfile.rst:826 +#: ../../library/zipfile.rst:822 msgid "Extract zipfile into target directory." msgstr "" -#: ../../library/zipfile.rst:831 +#: ../../library/zipfile.rst:827 msgid "Test whether the zipfile is valid or not." msgstr "" -#: ../../library/zipfile.rst:834 +#: ../../library/zipfile.rst:830 msgid "Decompression pitfalls" msgstr "" -#: ../../library/zipfile.rst:836 +#: ../../library/zipfile.rst:832 msgid "" "The extraction in zipfile module might fail due to some pitfalls listed " "below." msgstr "" -#: ../../library/zipfile.rst:839 +#: ../../library/zipfile.rst:835 msgid "From file itself" msgstr "" -#: ../../library/zipfile.rst:841 +#: ../../library/zipfile.rst:837 msgid "" "Decompression may fail due to incorrect password / CRC checksum / ZIP format " "or unsupported compression method / decryption." msgstr "" -#: ../../library/zipfile.rst:845 +#: ../../library/zipfile.rst:841 msgid "File System limitations" msgstr "" -#: ../../library/zipfile.rst:847 +#: ../../library/zipfile.rst:843 msgid "" "Exceeding limitations on different file systems can cause decompression " "failed. Such as allowable characters in the directory entries, length of the " @@ -965,33 +959,33 @@ msgid "" "files, etc." msgstr "" -#: ../../library/zipfile.rst:854 +#: ../../library/zipfile.rst:848 msgid "Resources limitations" msgstr "" -#: ../../library/zipfile.rst:856 +#: ../../library/zipfile.rst:850 msgid "" "The lack of memory or disk volume would lead to decompression failed. For " "example, decompression bombs (aka `ZIP bomb`_) apply to zipfile library that " "can cause disk volume exhaustion." msgstr "" -#: ../../library/zipfile.rst:861 +#: ../../library/zipfile.rst:855 msgid "Interruption" msgstr "" -#: ../../library/zipfile.rst:863 +#: ../../library/zipfile.rst:857 msgid "" "Interruption during the decompression, such as pressing control-C or killing " "the decompression process may result in incomplete decompression of the " "archive." msgstr "" -#: ../../library/zipfile.rst:867 +#: ../../library/zipfile.rst:861 msgid "Default behaviors of extraction" msgstr "" -#: ../../library/zipfile.rst:869 +#: ../../library/zipfile.rst:863 msgid "" "Not knowing the default extraction behaviors can cause unexpected " "decompression results. For example, when extracting the same archive twice, " diff --git a/library/zoneinfo.po b/library/zoneinfo.po index 27f829c40a..564ae55e0a 100644 --- a/library/zoneinfo.po +++ b/library/zoneinfo.po @@ -8,11 +8,10 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.9\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2021-09-07 06:52+0000\n" +"POT-Creation-Date: 2020-06-20 18:08+0800\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" -"Language: \n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" diff --git a/license.po b/license.po index 52305d80f5..3be32ffa45 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-07 06:52+0000\n" +"POT-Creation-Date: 2020-06-20 18:08+0800\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-" @@ -217,158 +217,134 @@ msgstr "" msgid "Terms and conditions for accessing or otherwise using Python" msgstr "" -#: ../../license.rst:75 -msgid "" -"Python software and documentation are licensed under the :ref:`PSF License " -"Agreement `." -msgstr "" - -#: ../../license.rst:78 -msgid "" -"Starting with Python 3.8.6, examples, recipes, and other code in the " -"documentation are dual licensed under the PSF License Agreement and the :ref:" -"`Zero-Clause BSD license `." -msgstr "" - -#: ../../license.rst:82 -msgid "" -"Some software incorporated into Python is under different licenses. The " -"licenses are listed with code falling under that license. See :ref:" -"`OtherLicenses` for an incomplete list of these licenses." -msgstr "" - -#: ../../license.rst:90 +#: ../../license.rst:77 msgid "PSF LICENSE AGREEMENT FOR PYTHON |release|" msgstr "" -#: ../../license.rst:138 +#: ../../license.rst:125 msgid "BEOPEN.COM LICENSE AGREEMENT FOR PYTHON 2.0" msgstr "" -#: ../../license.rst:140 +#: ../../license.rst:127 msgid "BEOPEN PYTHON OPEN SOURCE LICENSE AGREEMENT VERSION 1" msgstr "" -#: ../../license.rst:185 +#: ../../license.rst:172 msgid "CNRI LICENSE AGREEMENT FOR PYTHON 1.6.1" msgstr "" -#: ../../license.rst:250 +#: ../../license.rst:237 msgid "CWI LICENSE AGREEMENT FOR PYTHON 0.9.0 THROUGH 1.2" msgstr "" -#: ../../license.rst:277 -msgid "ZERO-CLAUSE BSD LICENSE FOR CODE IN THE PYTHON |release| DOCUMENTATION" -msgstr "" - -#: ../../license.rst:296 +#: ../../license.rst:262 msgid "Licenses and Acknowledgements for Incorporated Software" msgstr "" -#: ../../license.rst:298 +#: ../../license.rst:264 msgid "" "This section is an incomplete, but growing list of licenses and " "acknowledgements for third-party software incorporated in the Python " "distribution." msgstr "" -#: ../../license.rst:303 +#: ../../license.rst:269 msgid "Mersenne Twister" msgstr "" -#: ../../license.rst:305 +#: ../../license.rst:271 msgid "" "The :mod:`_random` module includes code based on a download from http://www." "math.sci.hiroshima-u.ac.jp/~m-mat/MT/MT2002/emt19937ar.html. The following " "are the verbatim comments from the original code::" msgstr "" -#: ../../license.rst:352 +#: ../../license.rst:318 msgid "Sockets" msgstr "" -#: ../../license.rst:354 +#: ../../license.rst:320 msgid "" "The :mod:`socket` module uses the functions, :func:`getaddrinfo`, and :func:" "`getnameinfo`, which are coded in separate source files from the WIDE " "Project, http://www.wide.ad.jp/. ::" msgstr "" -#: ../../license.rst:387 +#: ../../license.rst:353 msgid "Asynchronous socket services" msgstr "" -#: ../../license.rst:389 +#: ../../license.rst:355 msgid "" "The :mod:`asynchat` and :mod:`asyncore` modules contain the following " "notice::" msgstr "" -#: ../../license.rst:414 +#: ../../license.rst:380 msgid "Cookie management" msgstr "" -#: ../../license.rst:416 +#: ../../license.rst:382 msgid "The :mod:`http.cookies` module contains the following notice::" msgstr "" -#: ../../license.rst:442 +#: ../../license.rst:408 msgid "Execution tracing" msgstr "" -#: ../../license.rst:444 +#: ../../license.rst:410 msgid "The :mod:`trace` module contains the following notice::" msgstr "" -#: ../../license.rst:475 +#: ../../license.rst:441 msgid "UUencode and UUdecode functions" msgstr "" -#: ../../license.rst:477 +#: ../../license.rst:443 msgid "The :mod:`uu` module contains the following notice::" msgstr "" -#: ../../license.rst:505 +#: ../../license.rst:471 msgid "XML Remote Procedure Calls" msgstr "" -#: ../../license.rst:507 +#: ../../license.rst:473 msgid "The :mod:`xmlrpc.client` module contains the following notice::" msgstr "" -#: ../../license.rst:538 +#: ../../license.rst:504 msgid "test_epoll" msgstr "" -#: ../../license.rst:540 +#: ../../license.rst:506 msgid "The :mod:`test_epoll` module contains the following notice::" msgstr "" -#: ../../license.rst:564 +#: ../../license.rst:530 msgid "Select kqueue" msgstr "" -#: ../../license.rst:566 +#: ../../license.rst:532 msgid "" "The :mod:`select` module contains the following notice for the kqueue " "interface::" msgstr "" -#: ../../license.rst:595 +#: ../../license.rst:561 msgid "SipHash24" msgstr "" -#: ../../license.rst:597 +#: ../../license.rst:563 msgid "" "The file :file:`Python/pyhash.c` contains Marek Majkowski' implementation of " "Dan Bernstein's SipHash24 algorithm. It contains the following note::" msgstr "" -#: ../../license.rst:624 +#: ../../license.rst:590 msgid "strtod and dtoa" msgstr "" -#: ../../license.rst:626 +#: ../../license.rst:592 msgid "" "The file :file:`Python/dtoa.c`, which supplies C functions dtoa and strtod " "for conversion of C doubles to and from strings, is derived from the file of " @@ -377,11 +353,11 @@ msgid "" "following copyright and licensing notice::" msgstr "" -#: ../../license.rst:654 +#: ../../license.rst:620 msgid "OpenSSL" msgstr "" -#: ../../license.rst:656 +#: ../../license.rst:622 msgid "" "The modules :mod:`hashlib`, :mod:`posix`, :mod:`ssl`, :mod:`crypt` use the " "OpenSSL library for added performance if made available by the operating " @@ -390,64 +366,110 @@ msgid "" "license here::" msgstr "" -#: ../../license.rst:791 +#: ../../license.rst:757 msgid "expat" msgstr "" -#: ../../license.rst:793 +#: ../../license.rst:759 msgid "" "The :mod:`pyexpat` extension is built using an included copy of the expat " "sources unless the build is configured ``--with-system-expat``::" msgstr "" -#: ../../license.rst:820 +#: ../../license.rst:786 msgid "libffi" msgstr "" -#: ../../license.rst:822 +#: ../../license.rst:788 msgid "" "The :mod:`_ctypes` extension is built using an included copy of the libffi " "sources unless the build is configured ``--with-system-libffi``::" msgstr "" -#: ../../license.rst:849 +#: ../../license.rst:815 msgid "zlib" msgstr "" -#: ../../license.rst:851 +#: ../../license.rst:817 msgid "" "The :mod:`zlib` extension is built using an included copy of the zlib " "sources if the zlib version found on the system is too old to be used for " "the build::" msgstr "" -#: ../../license.rst:880 +#: ../../license.rst:846 msgid "cfuhash" msgstr "" -#: ../../license.rst:882 +#: ../../license.rst:848 msgid "" "The implementation of the hash table used by the :mod:`tracemalloc` is based " "on the cfuhash project::" msgstr "" -#: ../../license.rst:921 +#: ../../license.rst:887 msgid "libmpdec" msgstr "" -#: ../../license.rst:923 +#: ../../license.rst:889 msgid "" "The :mod:`_decimal` module is built using an included copy of the libmpdec " "library unless the build is configured ``--with-system-libmpdec``::" msgstr "" -#: ../../license.rst:953 +#: ../../license.rst:919 msgid "W3C C14N test suite" msgstr "" -#: ../../license.rst:955 +#: ../../license.rst:921 msgid "" "The C14N 2.0 test suite in the :mod:`test` package (``Lib/test/xmltestdata/" "c14n-20/``) was retrieved from the W3C website at https://www.w3.org/TR/xml-" -"c14n2-testcases/ and is distributed under the 3-clause BSD license::" +"c14n2-testcases/ and is distributed under the 3-clause BSD license:" +msgstr "" + +#: ../../license.rst:926 +msgid "" +"Copyright (c) 2013 W3C(R) (MIT, ERCIM, Keio, Beihang), All Rights Reserved." +msgstr "" + +#: ../../license.rst:929 +msgid "" +"Redistribution and use in source and binary forms, with or without " +"modification, are permitted provided that the following conditions are met:" +msgstr "" + +#: ../../license.rst:933 +msgid "" +"Redistributions of works must retain the original copyright notice, this " +"list of conditions and the following disclaimer." +msgstr "" + +#: ../../license.rst:935 +msgid "" +"Redistributions in binary form must reproduce the original copyright notice, " +"this list of conditions and the following disclaimer in the documentation " +"and/or other materials provided with the distribution." +msgstr "" + +#: ../../license.rst:938 +msgid "" +"Neither the name of the W3C nor the names of its contributors may be used to " +"endorse or promote products derived from this work without specific prior " +"written permission." +msgstr "" + +#: ../../license.rst:942 +msgid "" +"THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS" +"\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE " +"IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE " +"ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE " +"LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR " +"CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF " +"SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS " +"INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN " +"CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) " +"ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE " +"POSSIBILITY OF SUCH DAMAGE." msgstr "" diff --git a/reference/compound_stmts.po b/reference/compound_stmts.po index 47b2505dc7..295fe75447 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-07 06:52+0000\n" +"POT-Creation-Date: 2020-06-20 18:08+0800\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-" @@ -66,7 +66,7 @@ msgstr "" msgid "Summarizing:" msgstr "" -#: ../../reference/compound_stmts.rst:68 +#: ../../reference/compound_stmts.rst:67 msgid "" "Note that statements always end in a ``NEWLINE`` possibly followed by a " "``DEDENT``. Also note that optional continuation clauses always begin with " @@ -75,21 +75,21 @@ msgid "" "keyword:`if` statements to be indented)." msgstr "" -#: ../../reference/compound_stmts.rst:74 +#: ../../reference/compound_stmts.rst:73 msgid "" "The formatting of the grammar rules in the following sections places each " "clause on a separate line for clarity." msgstr "" -#: ../../reference/compound_stmts.rst:83 +#: ../../reference/compound_stmts.rst:82 msgid "The :keyword:`!if` statement" msgstr "" -#: ../../reference/compound_stmts.rst:91 +#: ../../reference/compound_stmts.rst:90 msgid "The :keyword:`if` statement is used for conditional execution:" msgstr "" -#: ../../reference/compound_stmts.rst:98 +#: ../../reference/compound_stmts.rst:97 msgid "" "It selects exactly one of the suites by evaluating the expressions one by " "one until one is found to be true (see section :ref:`booleans` for the " @@ -99,17 +99,17 @@ msgid "" "is executed." msgstr "" -#: ../../reference/compound_stmts.rst:108 +#: ../../reference/compound_stmts.rst:107 msgid "The :keyword:`!while` statement" msgstr "" -#: ../../reference/compound_stmts.rst:116 +#: ../../reference/compound_stmts.rst:115 msgid "" "The :keyword:`while` statement is used for repeated execution as long as an " "expression is true:" msgstr "" -#: ../../reference/compound_stmts.rst:123 +#: ../../reference/compound_stmts.rst:122 msgid "" "This repeatedly tests the expression and, if it is true, executes the first " "suite; if the expression is false (which may be the first time it is tested) " @@ -117,7 +117,7 @@ msgid "" "loop terminates." msgstr "" -#: ../../reference/compound_stmts.rst:132 +#: ../../reference/compound_stmts.rst:131 msgid "" "A :keyword:`break` statement executed in the first suite terminates the loop " "without executing the :keyword:`!else` clause's suite. A :keyword:" @@ -125,17 +125,17 @@ msgid "" "and goes back to testing the expression." msgstr "" -#: ../../reference/compound_stmts.rst:141 +#: ../../reference/compound_stmts.rst:140 msgid "The :keyword:`!for` statement" msgstr "" -#: ../../reference/compound_stmts.rst:152 +#: ../../reference/compound_stmts.rst:151 msgid "" "The :keyword:`for` statement is used to iterate over the elements of a " "sequence (such as a string, tuple or list) or other iterable object:" msgstr "" -#: ../../reference/compound_stmts.rst:159 +#: ../../reference/compound_stmts.rst:158 msgid "" "The expression list is evaluated once; it should yield an iterable object. " "An iterator is created for the result of the ``expression_list``. The suite " @@ -148,7 +148,7 @@ msgid "" "executed, and the loop terminates." msgstr "" -#: ../../reference/compound_stmts.rst:172 +#: ../../reference/compound_stmts.rst:171 msgid "" "A :keyword:`break` statement executed in the first suite terminates the loop " "without executing the :keyword:`!else` clause's suite. A :keyword:" @@ -157,14 +157,14 @@ msgid "" "there is no next item." msgstr "" -#: ../../reference/compound_stmts.rst:178 +#: ../../reference/compound_stmts.rst:177 msgid "" "The for-loop makes assignments to the variables in the target list. This " "overwrites all previous assignments to those variables including those made " "in the suite of the for-loop::" msgstr "" -#: ../../reference/compound_stmts.rst:192 +#: ../../reference/compound_stmts.rst:191 msgid "" "Names in the target list are not deleted when the loop is finished, but if " "the sequence is empty, they will not have been assigned to at all by the " @@ -173,7 +173,7 @@ msgid "" "e.g., ``list(range(3))`` returns the list ``[0, 1, 2]``." msgstr "" -#: ../../reference/compound_stmts.rst:204 +#: ../../reference/compound_stmts.rst:203 msgid "" "There is a subtlety when the sequence is being modified by the loop (this " "can only occur for mutable sequences, e.g. lists). An internal counter is " @@ -188,17 +188,17 @@ msgid "" "using a slice of the whole sequence, e.g., ::" msgstr "" -#: ../../reference/compound_stmts.rst:225 +#: ../../reference/compound_stmts.rst:224 msgid "The :keyword:`!try` statement" msgstr "" -#: ../../reference/compound_stmts.rst:235 +#: ../../reference/compound_stmts.rst:234 msgid "" "The :keyword:`try` statement specifies exception handlers and/or cleanup " "code for a group of statements:" msgstr "" -#: ../../reference/compound_stmts.rst:248 +#: ../../reference/compound_stmts.rst:247 msgid "" "The :keyword:`except` clause(s) specify one or more exception handlers. When " "no exception occurs in the :keyword:`try` clause, no exception handler is " @@ -209,18 +209,17 @@ msgid "" "exception. For an except clause with an expression, that expression is " "evaluated, and the clause matches the exception if the resulting object is " "\"compatible\" with the exception. An object is compatible with an " -"exception if it is the class or a base class of the exception object, or a " -"tuple containing an item that is the class or a base class of the exception " -"object." +"exception if it is the class or a base class of the exception object or a " +"tuple containing an item compatible with the exception." msgstr "" -#: ../../reference/compound_stmts.rst:260 +#: ../../reference/compound_stmts.rst:258 msgid "" "If no except clause matches the exception, the search for an exception " "handler continues in the surrounding code and on the invocation stack. [#]_" msgstr "" -#: ../../reference/compound_stmts.rst:263 +#: ../../reference/compound_stmts.rst:261 msgid "" "If the evaluation of an expression in the header of an except clause raises " "an exception, the original search for a handler is canceled and a search " @@ -229,7 +228,7 @@ msgid "" "exception)." msgstr "" -#: ../../reference/compound_stmts.rst:270 +#: ../../reference/compound_stmts.rst:268 msgid "" "When a matching except clause is found, the exception is assigned to the " "target specified after the :keyword:`!as` keyword in that except clause, if " @@ -241,17 +240,17 @@ msgid "" "exception.)" msgstr "" -#: ../../reference/compound_stmts.rst:278 +#: ../../reference/compound_stmts.rst:276 msgid "" "When an exception has been assigned using ``as target``, it is cleared at " "the end of the except clause. This is as if ::" msgstr "" -#: ../../reference/compound_stmts.rst:284 +#: ../../reference/compound_stmts.rst:282 msgid "was translated to ::" msgstr "" -#: ../../reference/compound_stmts.rst:292 +#: ../../reference/compound_stmts.rst:290 msgid "" "This means the exception must be assigned to a different name to be able to " "refer to it after the except clause. Exceptions are cleared because with " @@ -260,7 +259,7 @@ msgid "" "collection occurs." msgstr "" -#: ../../reference/compound_stmts.rst:301 +#: ../../reference/compound_stmts.rst:299 msgid "" "Before an except clause's suite is executed, details about the exception are " "stored in the :mod:`sys` module and can be accessed via :func:`sys." @@ -271,7 +270,7 @@ msgid "" "(before the call) when returning from a function that handled an exception." msgstr "" -#: ../../reference/compound_stmts.rst:315 +#: ../../reference/compound_stmts.rst:313 msgid "" "The optional :keyword:`!else` clause is executed if the control flow leaves " "the :keyword:`try` suite, no exception was raised, and no :keyword:" @@ -280,7 +279,7 @@ msgid "" "keyword:`except` clauses." msgstr "" -#: ../../reference/compound_stmts.rst:323 +#: ../../reference/compound_stmts.rst:321 msgid "" "If :keyword:`finally` is present, it specifies a 'cleanup' handler. The :" "keyword:`try` clause is executed, including any :keyword:`except` and :" @@ -294,13 +293,13 @@ msgid "" "exception is discarded::" msgstr "" -#: ../../reference/compound_stmts.rst:342 +#: ../../reference/compound_stmts.rst:340 msgid "" "The exception information is not available to the program during execution " "of the :keyword:`finally` clause." msgstr "" -#: ../../reference/compound_stmts.rst:350 +#: ../../reference/compound_stmts.rst:348 msgid "" "When a :keyword:`return`, :keyword:`break` or :keyword:`continue` statement " "is executed in the :keyword:`try` suite of a :keyword:`!try`...\\ :keyword:`!" @@ -308,7 +307,7 @@ msgid "" "way out.'" msgstr "" -#: ../../reference/compound_stmts.rst:354 +#: ../../reference/compound_stmts.rst:352 msgid "" "The return value of a function is determined by the last :keyword:`return` " "statement executed. Since the :keyword:`finally` clause always executes, a :" @@ -316,24 +315,24 @@ msgid "" "always be the last one executed::" msgstr "" -#: ../../reference/compound_stmts.rst:368 +#: ../../reference/compound_stmts.rst:366 msgid "" "Additional information on exceptions can be found in section :ref:" "`exceptions`, and information on using the :keyword:`raise` statement to " "generate exceptions may be found in section :ref:`raise`." msgstr "" -#: ../../reference/compound_stmts.rst:372 +#: ../../reference/compound_stmts.rst:370 msgid "" "Prior to Python 3.8, a :keyword:`continue` statement was illegal in the :" "keyword:`finally` clause due to a problem with the implementation." msgstr "" -#: ../../reference/compound_stmts.rst:381 +#: ../../reference/compound_stmts.rst:379 msgid "The :keyword:`!with` statement" msgstr "" -#: ../../reference/compound_stmts.rst:390 +#: ../../reference/compound_stmts.rst:388 msgid "" "The :keyword:`with` statement is used to wrap the execution of a block with " "methods defined by a context manager (see section :ref:`context-managers`). " @@ -341,37 +340,37 @@ msgid "" "`finally` usage patterns to be encapsulated for convenient reuse." msgstr "" -#: ../../reference/compound_stmts.rst:399 +#: ../../reference/compound_stmts.rst:397 msgid "" "The execution of the :keyword:`with` statement with one \"item\" proceeds as " "follows:" msgstr "" -#: ../../reference/compound_stmts.rst:401 +#: ../../reference/compound_stmts.rst:399 msgid "" "The context expression (the expression given in the :token:`with_item`) is " "evaluated to obtain a context manager." msgstr "" -#: ../../reference/compound_stmts.rst:404 +#: ../../reference/compound_stmts.rst:402 msgid "The context manager's :meth:`__enter__` is loaded for later use." msgstr "" -#: ../../reference/compound_stmts.rst:406 +#: ../../reference/compound_stmts.rst:404 msgid "The context manager's :meth:`__exit__` is loaded for later use." msgstr "" -#: ../../reference/compound_stmts.rst:408 +#: ../../reference/compound_stmts.rst:406 msgid "The context manager's :meth:`__enter__` method is invoked." msgstr "" -#: ../../reference/compound_stmts.rst:410 +#: ../../reference/compound_stmts.rst:408 msgid "" "If a target was included in the :keyword:`with` statement, the return value " "from :meth:`__enter__` is assigned to it." msgstr "" -#: ../../reference/compound_stmts.rst:415 +#: ../../reference/compound_stmts.rst:413 msgid "" "The :keyword:`with` statement guarantees that if the :meth:`__enter__` " "method returns without an error, then :meth:`__exit__` will always be " @@ -380,11 +379,11 @@ msgid "" "See step 6 below." msgstr "" -#: ../../reference/compound_stmts.rst:421 +#: ../../reference/compound_stmts.rst:419 msgid "The suite is executed." msgstr "" -#: ../../reference/compound_stmts.rst:423 +#: ../../reference/compound_stmts.rst:421 msgid "" "The context manager's :meth:`__exit__` method is invoked. If an exception " "caused the suite to be exited, its type, value, and traceback are passed as " @@ -392,7 +391,7 @@ msgid "" "supplied." msgstr "" -#: ../../reference/compound_stmts.rst:428 +#: ../../reference/compound_stmts.rst:426 msgid "" "If the suite was exited due to an exception, and the return value from the :" "meth:`__exit__` method was false, the exception is reraised. If the return " @@ -400,56 +399,56 @@ msgid "" "the statement following the :keyword:`with` statement." msgstr "" -#: ../../reference/compound_stmts.rst:433 +#: ../../reference/compound_stmts.rst:431 msgid "" "If the suite was exited for any reason other than an exception, the return " "value from :meth:`__exit__` is ignored, and execution proceeds at the normal " "location for the kind of exit that was taken." msgstr "" -#: ../../reference/compound_stmts.rst:437 -#: ../../reference/compound_stmts.rst:815 -#: ../../reference/compound_stmts.rst:856 +#: ../../reference/compound_stmts.rst:435 +#: ../../reference/compound_stmts.rst:808 +#: ../../reference/compound_stmts.rst:849 msgid "The following code::" msgstr "" -#: ../../reference/compound_stmts.rst:442 -#: ../../reference/compound_stmts.rst:467 -#: ../../reference/compound_stmts.rst:861 +#: ../../reference/compound_stmts.rst:440 +#: ../../reference/compound_stmts.rst:465 +#: ../../reference/compound_stmts.rst:854 msgid "is semantically equivalent to::" msgstr "" -#: ../../reference/compound_stmts.rst:461 +#: ../../reference/compound_stmts.rst:459 msgid "" "With more than one item, the context managers are processed as if multiple :" "keyword:`with` statements were nested::" msgstr "" -#: ../../reference/compound_stmts.rst:473 +#: ../../reference/compound_stmts.rst:471 msgid "Support for multiple context expressions." msgstr "" -#: ../../reference/compound_stmts.rst:479 +#: ../../reference/compound_stmts.rst:477 msgid ":pep:`343` - The \"with\" statement" msgstr "" -#: ../../reference/compound_stmts.rst:479 +#: ../../reference/compound_stmts.rst:477 msgid "" "The specification, background, and examples for the Python :keyword:`with` " "statement." msgstr "" -#: ../../reference/compound_stmts.rst:490 +#: ../../reference/compound_stmts.rst:488 msgid "Function definitions" msgstr "" -#: ../../reference/compound_stmts.rst:505 +#: ../../reference/compound_stmts.rst:503 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 +457,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 +474,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:717 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 +503,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,29 +516,21 @@ msgid "" "explicitly test for it in the body of the function, e.g.::" msgstr "" -#: ../../reference/compound_stmts.rst:593 +#: ../../reference/compound_stmts.rst:591 msgid "" "Function call semantics are described in more detail in section :ref:" "`calls`. A function call always assigns values to all parameters mentioned " -"in the parameter list, either from positional arguments, from keyword " +"in the parameter list, either from position arguments, from keyword " "arguments, or from default values. If the form \"``*identifier``\" is " "present, it is initialized to a tuple receiving any excess positional " "parameters, defaulting to the empty tuple. If the form \"``**identifier``\" " "is present, it is initialized to a new ordered mapping receiving any excess " "keyword arguments, defaulting to a new empty mapping of the same type. " "Parameters after \"``*``\" or \"``*identifier``\" are keyword-only " -"parameters and may only be passed by keyword arguments. Parameters before " -"\"``/``\" are positional-only parameters and may only be passed by " -"positional arguments." +"parameters and may only be passed used keyword arguments." msgstr "" -#: ../../reference/compound_stmts.rst:605 -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:607 msgid "" "Parameters may have an :term:`annotation ` of the form " "\"``: expression``\" following the parameter name. Any parameter may have " @@ -556,7 +547,7 @@ msgid "" "different order than they appear in the source code." msgstr "" -#: ../../reference/compound_stmts.rst:629 +#: ../../reference/compound_stmts.rst:622 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 +559,7 @@ msgid "" "execution of multiple statements and annotations." msgstr "" -#: ../../reference/compound_stmts.rst:637 +#: ../../reference/compound_stmts.rst:630 msgid "" "**Programmer's note:** Functions are first-class objects. A \"``def``\" " "statement executed inside a function definition defines a local function " @@ -577,51 +568,51 @@ msgid "" "See section :ref:`naming` for details." msgstr "" -#: ../../reference/compound_stmts.rst:646 +#: ../../reference/compound_stmts.rst:639 msgid ":pep:`3107` - Function Annotations" msgstr "" -#: ../../reference/compound_stmts.rst:646 +#: ../../reference/compound_stmts.rst:639 msgid "The original specification for function annotations." msgstr "" -#: ../../reference/compound_stmts.rst:649 +#: ../../reference/compound_stmts.rst:642 msgid ":pep:`484` - Type Hints" msgstr "" -#: ../../reference/compound_stmts.rst:649 +#: ../../reference/compound_stmts.rst:642 msgid "Definition of a standard meaning for annotations: type hints." msgstr "" -#: ../../reference/compound_stmts.rst:653 +#: ../../reference/compound_stmts.rst:646 msgid ":pep:`526` - Syntax for Variable Annotations" msgstr "" -#: ../../reference/compound_stmts.rst:652 +#: ../../reference/compound_stmts.rst:645 msgid "" "Ability to type hint variable declarations, including class variables and " "instance variables" msgstr "" -#: ../../reference/compound_stmts.rst:656 +#: ../../reference/compound_stmts.rst:649 msgid ":pep:`563` - Postponed Evaluation of Annotations" msgstr "" -#: ../../reference/compound_stmts.rst:656 +#: ../../reference/compound_stmts.rst:649 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:656 msgid "Class definitions" msgstr "" -#: ../../reference/compound_stmts.rst:678 +#: ../../reference/compound_stmts.rst:671 msgid "A class definition defines a class object (see section :ref:`types`):" msgstr "" -#: ../../reference/compound_stmts.rst:685 +#: ../../reference/compound_stmts.rst:678 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 +621,11 @@ msgid "" "default, from the base class :class:`object`; hence, ::" msgstr "" -#: ../../reference/compound_stmts.rst:694 +#: ../../reference/compound_stmts.rst:687 msgid "is equivalent to ::" msgstr "" -#: ../../reference/compound_stmts.rst:699 +#: ../../reference/compound_stmts.rst:692 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 +637,7 @@ msgid "" "original local namespace." msgstr "" -#: ../../reference/compound_stmts.rst:708 +#: ../../reference/compound_stmts.rst:701 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 +645,30 @@ msgid "" "definition syntax." msgstr "" -#: ../../reference/compound_stmts.rst:713 +#: ../../reference/compound_stmts.rst:706 msgid "" "Class creation can be customized heavily using :ref:`metaclasses " "`." msgstr "" -#: ../../reference/compound_stmts.rst:718 +#: ../../reference/compound_stmts.rst:711 msgid "Classes can also be decorated: just like when decorating functions, ::" msgstr "" -#: ../../reference/compound_stmts.rst:729 +#: ../../reference/compound_stmts.rst:722 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:725 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:730 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 +681,35 @@ msgid "" "implementation details." msgstr "" -#: ../../reference/compound_stmts.rst:752 +#: ../../reference/compound_stmts.rst:745 msgid ":pep:`3115` - Metaclasses in Python 3000" msgstr "" -#: ../../reference/compound_stmts.rst:750 +#: ../../reference/compound_stmts.rst:743 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:748 msgid ":pep:`3129` - Class Decorators" msgstr "" -#: ../../reference/compound_stmts.rst:755 +#: ../../reference/compound_stmts.rst:748 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:755 msgid "Coroutines" msgstr "" -#: ../../reference/compound_stmts.rst:770 +#: ../../reference/compound_stmts.rst:763 msgid "Coroutine function definition" msgstr "" -#: ../../reference/compound_stmts.rst:780 +#: ../../reference/compound_stmts.rst:773 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 +718,102 @@ msgid "" "in coroutine function bodies." msgstr "" -#: ../../reference/compound_stmts.rst:786 +#: ../../reference/compound_stmts.rst:779 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:782 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:785 msgid "An example of a coroutine function::" msgstr "" -#: ../../reference/compound_stmts.rst:803 +#: ../../reference/compound_stmts.rst:796 msgid "The :keyword:`!async for` statement" msgstr "" -#: ../../reference/compound_stmts.rst:808 +#: ../../reference/compound_stmts.rst:801 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." +"An :term:`asynchronous iterable` is able to call asynchronous code in its " +"*iter* implementation, and :term:`asynchronous iterator` can call " +"asynchronous code in its *next* method." msgstr "" -#: ../../reference/compound_stmts.rst:812 +#: ../../reference/compound_stmts.rst:805 msgid "" "The ``async for`` statement allows convenient iteration over asynchronous " -"iterables." +"iterators." msgstr "" -#: ../../reference/compound_stmts.rst:822 +#: ../../reference/compound_stmts.rst:815 msgid "Is semantically equivalent to::" msgstr "" -#: ../../reference/compound_stmts.rst:838 +#: ../../reference/compound_stmts.rst:831 msgid "See also :meth:`__aiter__` and :meth:`__anext__` for details." msgstr "" -#: ../../reference/compound_stmts.rst:840 +#: ../../reference/compound_stmts.rst:833 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:841 msgid "The :keyword:`!async with` statement" msgstr "" -#: ../../reference/compound_stmts.rst:853 +#: ../../reference/compound_stmts.rst:846 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:873 msgid "See also :meth:`__aenter__` and :meth:`__aexit__` for details." msgstr "" -#: ../../reference/compound_stmts.rst:882 +#: ../../reference/compound_stmts.rst:875 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:881 msgid ":pep:`492` - Coroutines with async and await syntax" msgstr "" -#: ../../reference/compound_stmts.rst:888 +#: ../../reference/compound_stmts.rst:881 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:886 msgid "Footnotes" msgstr "註解" -#: ../../reference/compound_stmts.rst:894 +#: ../../reference/compound_stmts.rst:887 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:891 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:895 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 843aae20b1..79cb95daa3 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-07 06:52+0000\n" +"POT-Creation-Date: 2020-06-20 18:08+0800\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-" @@ -206,7 +206,7 @@ msgid "" "``Ellipsis``. Its truth value is true." msgstr "" -#: ../../reference/datamodel.rst:266 +#: ../../reference/datamodel.rst:249 msgid ":class:`numbers.Number`" msgstr "" @@ -221,61 +221,29 @@ msgstr "" #: ../../reference/datamodel.rst:190 msgid "" -"The string representations of the numeric classes, computed by :meth:" -"`__repr__` and :meth:`__str__`, have the following properties:" -msgstr "" - -#: ../../reference/datamodel.rst:194 -msgid "" -"They are valid numeric literals which, when passed to their class " -"constructor, produce an object having the value of the original numeric." -msgstr "" - -#: ../../reference/datamodel.rst:198 -msgid "The representation is in base 10, when possible." -msgstr "" - -#: ../../reference/datamodel.rst:200 -msgid "" -"Leading zeros, possibly excepting a single zero before a decimal point, are " -"not shown." -msgstr "" - -#: ../../reference/datamodel.rst:203 -msgid "" -"Trailing zeros, possibly excepting a single zero after a decimal point, are " -"not shown." -msgstr "" - -#: ../../reference/datamodel.rst:206 -msgid "A sign is shown only when the number is negative." -msgstr "" - -#: ../../reference/datamodel.rst:208 -msgid "" "Python distinguishes between integers, floating point numbers, and complex " "numbers:" msgstr "" -#: ../../reference/datamodel.rst:241 +#: ../../reference/datamodel.rst:224 msgid ":class:`numbers.Integral`" msgstr "" -#: ../../reference/datamodel.rst:214 +#: ../../reference/datamodel.rst:196 msgid "" "These represent elements from the mathematical set of integers (positive and " "negative)." msgstr "" -#: ../../reference/datamodel.rst:217 +#: ../../reference/datamodel.rst:199 msgid "There are two types of integers:" msgstr "" -#: ../../reference/datamodel.rst:224 +#: ../../reference/datamodel.rst:201 msgid "Integers (:class:`int`)" msgstr "" -#: ../../reference/datamodel.rst:220 +#: ../../reference/datamodel.rst:203 msgid "" "These represent numbers in an unlimited range, subject to available " "(virtual) memory only. For the purpose of shift and mask operations, a " @@ -284,11 +252,11 @@ msgid "" "sign bits extending to the left." msgstr "" -#: ../../reference/datamodel.rst:236 +#: ../../reference/datamodel.rst:219 msgid "Booleans (:class:`bool`)" msgstr "" -#: ../../reference/datamodel.rst:232 +#: ../../reference/datamodel.rst:215 msgid "" "These represent the truth values False and True. The two objects " "representing the values ``False`` and ``True`` are the only Boolean objects. " @@ -298,18 +266,18 @@ msgid "" "\"`` are returned, respectively." msgstr "" -#: ../../reference/datamodel.rst:240 +#: ../../reference/datamodel.rst:223 msgid "" "The rules for integer representation are intended to give the most " "meaningful interpretation of shift and mask operations involving negative " "integers." msgstr "" -#: ../../reference/datamodel.rst:256 +#: ../../reference/datamodel.rst:239 msgid ":class:`numbers.Real` (:class:`float`)" msgstr "" -#: ../../reference/datamodel.rst:250 +#: ../../reference/datamodel.rst:233 msgid "" "These represent machine-level double precision floating point numbers. You " "are at the mercy of the underlying machine architecture (and C or Java " @@ -320,11 +288,11 @@ msgid "" "complicate the language with two kinds of floating point numbers." msgstr "" -#: ../../reference/datamodel.rst:266 +#: ../../reference/datamodel.rst:249 msgid ":class:`numbers.Complex` (:class:`complex`)" msgstr "" -#: ../../reference/datamodel.rst:263 +#: ../../reference/datamodel.rst:246 msgid "" "These represent complex numbers as a pair of machine-level double precision " "floating point numbers. The same caveats apply as for floating point " @@ -332,11 +300,11 @@ msgid "" "retrieved through the read-only attributes ``z.real`` and ``z.imag``." msgstr "" -#: ../../reference/datamodel.rst:383 +#: ../../reference/datamodel.rst:366 msgid "Sequences" msgstr "" -#: ../../reference/datamodel.rst:276 +#: ../../reference/datamodel.rst:259 msgid "" "These represent finite ordered sets indexed by non-negative numbers. The " "built-in function :func:`len` returns the number of items of a sequence. " @@ -344,7 +312,7 @@ msgid "" "1, ..., *n*-1. Item *i* of sequence *a* is selected by ``a[i]``." msgstr "" -#: ../../reference/datamodel.rst:283 +#: ../../reference/datamodel.rst:266 msgid "" "Sequences also support slicing: ``a[i:j]`` selects all items with index *k* " "such that *i* ``<=`` *k* ``<`` *j*. When used as an expression, a slice is " @@ -352,22 +320,22 @@ msgid "" "so that it starts at 0." msgstr "" -#: ../../reference/datamodel.rst:288 +#: ../../reference/datamodel.rst:271 msgid "" "Some sequences also support \"extended slicing\" with a third \"step\" " "parameter: ``a[i:j:k]`` selects all items of *a* with index *x* where ``x = " "i + n*k``, *n* ``>=`` ``0`` and *i* ``<=`` *x* ``<`` *j*." msgstr "" -#: ../../reference/datamodel.rst:292 +#: ../../reference/datamodel.rst:275 msgid "Sequences are distinguished according to their mutability:" msgstr "" -#: ../../reference/datamodel.rst:349 +#: ../../reference/datamodel.rst:332 msgid "Immutable sequences" msgstr "" -#: ../../reference/datamodel.rst:299 +#: ../../reference/datamodel.rst:282 msgid "" "An object of an immutable sequence type cannot change once it is created. " "(If the object contains references to other objects, these other objects may " @@ -375,15 +343,15 @@ msgid "" "referenced by an immutable object cannot change.)" msgstr "" -#: ../../reference/datamodel.rst:304 +#: ../../reference/datamodel.rst:287 msgid "The following types are immutable sequences:" msgstr "" -#: ../../reference/datamodel.rst:327 +#: ../../reference/datamodel.rst:310 msgid "Strings" msgstr "字串 (String)" -#: ../../reference/datamodel.rst:317 +#: ../../reference/datamodel.rst:300 msgid "" "A string is a sequence of values that represent Unicode code points. All the " "code points in the range ``U+0000 - U+10FFFF`` can be represented in a " @@ -397,11 +365,11 @@ msgid "" "to achieve the opposite." msgstr "" -#: ../../reference/datamodel.rst:340 +#: ../../reference/datamodel.rst:323 msgid "Tuples" msgstr "" -#: ../../reference/datamodel.rst:335 +#: ../../reference/datamodel.rst:318 msgid "" "The items of a tuple are arbitrary Python objects. Tuples of two or more " "items are formed by comma-separated lists of expressions. A tuple of one " @@ -411,11 +379,11 @@ msgid "" "empty pair of parentheses." msgstr "" -#: ../../reference/datamodel.rst:349 +#: ../../reference/datamodel.rst:332 msgid "Bytes" msgstr "" -#: ../../reference/datamodel.rst:345 +#: ../../reference/datamodel.rst:328 msgid "" "A bytes object is an immutable array. The items are 8-bit bytes, " "represented by integers in the range 0 <= x < 256. Bytes literals (like " @@ -424,37 +392,37 @@ msgid "" "the :meth:`~bytes.decode` method." msgstr "" -#: ../../reference/datamodel.rst:383 +#: ../../reference/datamodel.rst:366 msgid "Mutable sequences" msgstr "" -#: ../../reference/datamodel.rst:359 +#: ../../reference/datamodel.rst:342 msgid "" "Mutable sequences can be changed after they are created. The subscription " "and slicing notations can be used as the target of assignment and :keyword:" "`del` (delete) statements." msgstr "" -#: ../../reference/datamodel.rst:363 +#: ../../reference/datamodel.rst:346 msgid "There are currently two intrinsic mutable sequence types:" msgstr "" -#: ../../reference/datamodel.rst:370 +#: ../../reference/datamodel.rst:353 msgid "Lists" msgstr "List(串列)" -#: ../../reference/datamodel.rst:368 +#: ../../reference/datamodel.rst:351 msgid "" "The items of a list are arbitrary Python objects. Lists are formed by " "placing a comma-separated list of expressions in square brackets. (Note that " "there are no special cases needed to form lists of length 0 or 1.)" msgstr "" -#: ../../reference/datamodel.rst:378 +#: ../../reference/datamodel.rst:361 msgid "Byte Arrays" msgstr "" -#: ../../reference/datamodel.rst:375 +#: ../../reference/datamodel.rst:358 msgid "" "A bytearray object is a mutable array. They are created by the built-in :" "func:`bytearray` constructor. Aside from being mutable (and hence " @@ -462,17 +430,17 @@ msgid "" "functionality as immutable :class:`bytes` objects." msgstr "" -#: ../../reference/datamodel.rst:382 +#: ../../reference/datamodel.rst:365 msgid "" "The extension module :mod:`array` provides an additional example of a " "mutable sequence type, as does the :mod:`collections` module." msgstr "" -#: ../../reference/datamodel.rst:417 +#: ../../reference/datamodel.rst:400 msgid "Set types" msgstr "" -#: ../../reference/datamodel.rst:390 +#: ../../reference/datamodel.rst:373 msgid "" "These represent unordered, finite sets of unique, immutable objects. As " "such, they cannot be indexed by any subscript. However, they can be iterated " @@ -482,7 +450,7 @@ msgid "" "union, difference, and symmetric difference." msgstr "" -#: ../../reference/datamodel.rst:397 +#: ../../reference/datamodel.rst:380 msgid "" "For set elements, the same immutability rules apply as for dictionary keys. " "Note that numeric types obey the normal rules for numeric comparison: if two " @@ -490,37 +458,37 @@ msgid "" "contained in a set." msgstr "" -#: ../../reference/datamodel.rst:402 +#: ../../reference/datamodel.rst:385 msgid "There are currently two intrinsic set types:" msgstr "" -#: ../../reference/datamodel.rst:409 +#: ../../reference/datamodel.rst:392 msgid "Sets" msgstr "" -#: ../../reference/datamodel.rst:407 +#: ../../reference/datamodel.rst:390 msgid "" "These represent a mutable set. They are created by the built-in :func:`set` " "constructor and can be modified afterwards by several methods, such as :meth:" "`~set.add`." msgstr "" -#: ../../reference/datamodel.rst:417 +#: ../../reference/datamodel.rst:400 msgid "Frozen sets" msgstr "" -#: ../../reference/datamodel.rst:414 +#: ../../reference/datamodel.rst:397 msgid "" "These represent an immutable set. They are created by the built-in :func:" "`frozenset` constructor. As a frozenset is immutable and :term:`hashable`, " "it can be used again as an element of another set, or as a dictionary key." msgstr "" -#: ../../reference/datamodel.rst:464 +#: ../../reference/datamodel.rst:447 msgid "Mappings" msgstr "" -#: ../../reference/datamodel.rst:425 +#: ../../reference/datamodel.rst:408 msgid "" "These represent finite sets of objects indexed by arbitrary index sets. The " "subscript notation ``a[k]`` selects the item indexed by ``k`` from the " @@ -529,15 +497,15 @@ msgid "" "returns the number of items in a mapping." msgstr "" -#: ../../reference/datamodel.rst:431 +#: ../../reference/datamodel.rst:414 msgid "There is currently a single intrinsic mapping type:" msgstr "" -#: ../../reference/datamodel.rst:464 +#: ../../reference/datamodel.rst:447 msgid "Dictionaries" msgstr "字典" -#: ../../reference/datamodel.rst:436 +#: ../../reference/datamodel.rst:419 msgid "" "These represent finite sets of objects indexed by nearly arbitrary values. " "The only types of values not acceptable as keys are values containing lists " @@ -549,7 +517,7 @@ msgid "" "interchangeably to index the same dictionary entry." msgstr "" -#: ../../reference/datamodel.rst:445 +#: ../../reference/datamodel.rst:428 msgid "" "Dictionaries preserve insertion order, meaning that keys will be produced in " "the same order they were added sequentially over the dictionary. Replacing " @@ -557,177 +525,177 @@ msgid "" "inserting it will add it to the end instead of keeping its old place." msgstr "" -#: ../../reference/datamodel.rst:450 +#: ../../reference/datamodel.rst:433 msgid "" "Dictionaries are mutable; they can be created by the ``{...}`` notation (see " "section :ref:`dict`)." msgstr "" -#: ../../reference/datamodel.rst:457 +#: ../../reference/datamodel.rst:440 msgid "" "The extension modules :mod:`dbm.ndbm` and :mod:`dbm.gnu` provide additional " "examples of mapping types, as does the :mod:`collections` module." msgstr "" -#: ../../reference/datamodel.rst:461 +#: ../../reference/datamodel.rst:444 msgid "" "Dictionaries did not preserve insertion order in versions of Python before " "3.6. In CPython 3.6, insertion order was preserved, but it was considered an " "implementation detail at that time rather than a language guarantee." msgstr "" -#: ../../reference/datamodel.rst:722 +#: ../../reference/datamodel.rst:705 msgid "Callable types" msgstr "" -#: ../../reference/datamodel.rst:473 +#: ../../reference/datamodel.rst:456 msgid "" "These are the types to which the function call operation (see section :ref:" "`calls`) can be applied:" msgstr "" -#: ../../reference/datamodel.rst:576 +#: ../../reference/datamodel.rst:559 msgid "User-defined functions" msgstr "" -#: ../../reference/datamodel.rst:482 +#: ../../reference/datamodel.rst:465 msgid "" "A user-defined function object is created by a function definition (see " "section :ref:`function`). It should be called with an argument list " "containing the same number of items as the function's formal parameter list." msgstr "" -#: ../../reference/datamodel.rst:487 +#: ../../reference/datamodel.rst:470 msgid "Special attributes:" msgstr "" -#: ../../reference/datamodel.rst:505 +#: ../../reference/datamodel.rst:488 msgid "Attribute" msgstr "" -#: ../../reference/datamodel.rst:505 +#: ../../reference/datamodel.rst:488 msgid "Meaning" msgstr "" -#: ../../reference/datamodel.rst:507 +#: ../../reference/datamodel.rst:490 msgid ":attr:`__doc__`" msgstr "" -#: ../../reference/datamodel.rst:507 +#: ../../reference/datamodel.rst:490 msgid "" "The function's documentation string, or ``None`` if unavailable; not " "inherited by subclasses." msgstr "" -#: ../../reference/datamodel.rst:507 ../../reference/datamodel.rst:512 -#: ../../reference/datamodel.rst:515 ../../reference/datamodel.rst:520 -#: ../../reference/datamodel.rst:524 ../../reference/datamodel.rst:530 -#: ../../reference/datamodel.rst:540 ../../reference/datamodel.rst:551 -#: ../../reference/datamodel.rst:558 +#: ../../reference/datamodel.rst:490 ../../reference/datamodel.rst:495 +#: ../../reference/datamodel.rst:498 ../../reference/datamodel.rst:503 +#: ../../reference/datamodel.rst:507 ../../reference/datamodel.rst:513 +#: ../../reference/datamodel.rst:523 ../../reference/datamodel.rst:534 +#: ../../reference/datamodel.rst:541 msgid "Writable" msgstr "" -#: ../../reference/datamodel.rst:512 +#: ../../reference/datamodel.rst:495 msgid ":attr:`~definition.\\ __name__`" msgstr "" -#: ../../reference/datamodel.rst:512 +#: ../../reference/datamodel.rst:495 msgid "The function's name." msgstr "" -#: ../../reference/datamodel.rst:515 +#: ../../reference/datamodel.rst:498 msgid ":attr:`~definition.\\ __qualname__`" msgstr "" -#: ../../reference/datamodel.rst:515 +#: ../../reference/datamodel.rst:498 msgid "The function's :term:`qualified name`." msgstr "" -#: ../../reference/datamodel.rst:520 +#: ../../reference/datamodel.rst:503 msgid ":attr:`__module__`" msgstr "" -#: ../../reference/datamodel.rst:520 +#: ../../reference/datamodel.rst:503 msgid "" "The name of the module the function was defined in, or ``None`` if " "unavailable." msgstr "" -#: ../../reference/datamodel.rst:524 +#: ../../reference/datamodel.rst:507 msgid ":attr:`__defaults__`" msgstr "" -#: ../../reference/datamodel.rst:524 +#: ../../reference/datamodel.rst:507 msgid "" "A tuple containing default argument values for those arguments that have " "defaults, or ``None`` if no arguments have a default value." msgstr "" -#: ../../reference/datamodel.rst:530 +#: ../../reference/datamodel.rst:513 msgid ":attr:`__code__`" msgstr "" -#: ../../reference/datamodel.rst:530 +#: ../../reference/datamodel.rst:513 msgid "The code object representing the compiled function body." msgstr "" -#: ../../reference/datamodel.rst:533 +#: ../../reference/datamodel.rst:516 msgid ":attr:`__globals__`" msgstr "" -#: ../../reference/datamodel.rst:533 +#: ../../reference/datamodel.rst:516 msgid "" "A reference to the dictionary that holds the function's global variables --- " "the global namespace of the module in which the function was defined." msgstr "" -#: ../../reference/datamodel.rst:533 ../../reference/datamodel.rst:544 +#: ../../reference/datamodel.rst:516 ../../reference/datamodel.rst:527 msgid "Read-only" msgstr "" -#: ../../reference/datamodel.rst:540 +#: ../../reference/datamodel.rst:523 msgid ":attr:`~object.__dict__`" msgstr "" -#: ../../reference/datamodel.rst:540 +#: ../../reference/datamodel.rst:523 msgid "The namespace supporting arbitrary function attributes." msgstr "" -#: ../../reference/datamodel.rst:544 +#: ../../reference/datamodel.rst:527 msgid ":attr:`__closure__`" msgstr "" -#: ../../reference/datamodel.rst:544 +#: ../../reference/datamodel.rst:527 msgid "" "``None`` or a tuple of cells that contain bindings for the function's free " "variables. See below for information on the ``cell_contents`` attribute." msgstr "" -#: ../../reference/datamodel.rst:551 +#: ../../reference/datamodel.rst:534 msgid ":attr:`__annotations__`" msgstr "" -#: ../../reference/datamodel.rst:551 +#: ../../reference/datamodel.rst:534 msgid "" "A dict containing annotations of parameters. The keys of the dict are the " "parameter names, and ``'return'`` for the return annotation, if provided." msgstr "" -#: ../../reference/datamodel.rst:558 +#: ../../reference/datamodel.rst:541 msgid ":attr:`__kwdefaults__`" msgstr "" -#: ../../reference/datamodel.rst:558 +#: ../../reference/datamodel.rst:541 msgid "A dict containing defaults for keyword-only parameters." msgstr "" -#: ../../reference/datamodel.rst:562 +#: ../../reference/datamodel.rst:545 msgid "" "Most of the attributes labelled \"Writable\" check the type of the assigned " "value." msgstr "" -#: ../../reference/datamodel.rst:564 +#: ../../reference/datamodel.rst:547 msgid "" "Function objects also support getting and setting arbitrary attributes, " "which can be used, for example, to attach metadata to functions. Regular " @@ -737,30 +705,30 @@ msgid "" "future.*" msgstr "" -#: ../../reference/datamodel.rst:570 +#: ../../reference/datamodel.rst:553 msgid "" "A cell object has the attribute ``cell_contents``. This can be used to get " "the value of the cell, as well as set the value." msgstr "" -#: ../../reference/datamodel.rst:573 +#: ../../reference/datamodel.rst:556 msgid "" "Additional information about a function's definition can be retrieved from " "its code object; see the description of internal types below. The :data:" "`cell ` type can be accessed in the :mod:`types` module." msgstr "" -#: ../../reference/datamodel.rst:639 +#: ../../reference/datamodel.rst:622 msgid "Instance methods" msgstr "" -#: ../../reference/datamodel.rst:584 +#: ../../reference/datamodel.rst:567 msgid "" "An instance method object combines a class, a class instance and any " "callable object (normally a user-defined function)." msgstr "" -#: ../../reference/datamodel.rst:594 +#: ../../reference/datamodel.rst:577 msgid "" "Special read-only attributes: :attr:`__self__` is the class instance " "object, :attr:`__func__` is the function object; :attr:`__doc__` is the " @@ -770,20 +738,20 @@ msgid "" "``None`` if unavailable." msgstr "" -#: ../../reference/datamodel.rst:600 +#: ../../reference/datamodel.rst:583 msgid "" "Methods also support accessing (but not setting) the arbitrary function " "attributes on the underlying function object." msgstr "" -#: ../../reference/datamodel.rst:603 +#: ../../reference/datamodel.rst:586 msgid "" "User-defined method objects may be created when getting an attribute of a " "class (perhaps via an instance of that class), if that attribute is a user-" "defined function object or a class method object." msgstr "" -#: ../../reference/datamodel.rst:607 +#: ../../reference/datamodel.rst:590 msgid "" "When an instance method object is created by retrieving a user-defined " "function object from a class via one of its instances, its :attr:`__self__` " @@ -791,7 +759,7 @@ msgid "" "new method's :attr:`__func__` attribute is the original function object." msgstr "" -#: ../../reference/datamodel.rst:613 +#: ../../reference/datamodel.rst:596 msgid "" "When an instance method object is created by retrieving a class method " "object from a class or instance, its :attr:`__self__` attribute is the class " @@ -799,7 +767,7 @@ msgid "" "the class method." msgstr "" -#: ../../reference/datamodel.rst:618 +#: ../../reference/datamodel.rst:601 msgid "" "When an instance method object is called, the underlying function (:attr:" "`__func__`) is called, inserting the class instance (:attr:`__self__`) in " @@ -808,7 +776,7 @@ msgid "" "class:`C`, calling ``x.f(1)`` is equivalent to calling ``C.f(x, 1)``." msgstr "" -#: ../../reference/datamodel.rst:625 +#: ../../reference/datamodel.rst:608 msgid "" "When an instance method object is derived from a class method object, the " "\"class instance\" stored in :attr:`__self__` will actually be the class " @@ -816,7 +784,7 @@ msgid "" "calling ``f(C,1)`` where ``f`` is the underlying function." msgstr "" -#: ../../reference/datamodel.rst:630 +#: ../../reference/datamodel.rst:613 msgid "" "Note that the transformation from function object to instance method object " "happens each time the attribute is retrieved from the instance. In some " @@ -829,11 +797,11 @@ msgid "" "the function is an attribute of the class." msgstr "" -#: ../../reference/datamodel.rst:654 +#: ../../reference/datamodel.rst:637 msgid "Generator functions" msgstr "" -#: ../../reference/datamodel.rst:646 +#: ../../reference/datamodel.rst:629 msgid "" "A function or method which uses the :keyword:`yield` statement (see section :" "ref:`yield`) is called a :dfn:`generator function`. Such a function, when " @@ -846,11 +814,11 @@ msgid "" "returned." msgstr "" -#: ../../reference/datamodel.rst:664 +#: ../../reference/datamodel.rst:647 msgid "Coroutine functions" msgstr "" -#: ../../reference/datamodel.rst:660 +#: ../../reference/datamodel.rst:643 msgid "" "A function or method which is defined using :keyword:`async def` is called " "a :dfn:`coroutine function`. Such a function, when called, returns a :term:" @@ -859,11 +827,11 @@ msgid "" "ref:`coroutine-objects` section." msgstr "" -#: ../../reference/datamodel.rst:683 +#: ../../reference/datamodel.rst:666 msgid "Asynchronous generator functions" msgstr "" -#: ../../reference/datamodel.rst:671 +#: ../../reference/datamodel.rst:654 msgid "" "A function or method which is defined using :keyword:`async def` and which " "uses the :keyword:`yield` statement is called a :dfn:`asynchronous generator " @@ -872,7 +840,7 @@ msgid "" "body of the function." msgstr "" -#: ../../reference/datamodel.rst:677 +#: ../../reference/datamodel.rst:660 msgid "" "Calling the asynchronous iterator's :meth:`aiterator.__anext__` method will " "return an :term:`awaitable` which when awaited will execute until it " @@ -882,11 +850,11 @@ msgid "" "have reached the end of the set of values to be yielded." msgstr "" -#: ../../reference/datamodel.rst:698 +#: ../../reference/datamodel.rst:681 msgid "Built-in functions" msgstr "" -#: ../../reference/datamodel.rst:691 +#: ../../reference/datamodel.rst:674 msgid "" "A built-in function object is a wrapper around a C function. Examples of " "built-in functions are :func:`len` and :func:`math.sin` (:mod:`math` is a " @@ -898,11 +866,11 @@ msgid "" "module the function was defined in or ``None`` if unavailable." msgstr "" -#: ../../reference/datamodel.rst:710 +#: ../../reference/datamodel.rst:693 msgid "Built-in methods" msgstr "" -#: ../../reference/datamodel.rst:706 +#: ../../reference/datamodel.rst:689 msgid "" "This is really a different disguise of a built-in function, this time " "containing an object passed to the C function as an implicit extra " @@ -911,11 +879,11 @@ msgid "" "attr:`__self__` is set to the object denoted by *alist*." msgstr "" -#: ../../reference/datamodel.rst:717 +#: ../../reference/datamodel.rst:700 msgid "Classes" msgstr "" -#: ../../reference/datamodel.rst:713 +#: ../../reference/datamodel.rst:696 msgid "" "Classes are callable. These objects normally act as factories for new " "instances of themselves, but variations are possible for class types that " @@ -924,21 +892,21 @@ msgid "" "new instance." msgstr "" -#: ../../reference/datamodel.rst:722 +#: ../../reference/datamodel.rst:705 msgid "Class Instances" msgstr "" -#: ../../reference/datamodel.rst:720 +#: ../../reference/datamodel.rst:703 msgid "" "Instances of arbitrary classes can be made callable by defining a :meth:" "`__call__` method in their class." msgstr "" -#: ../../reference/datamodel.rst:772 +#: ../../reference/datamodel.rst:755 msgid "Modules" msgstr "" -#: ../../reference/datamodel.rst:729 +#: ../../reference/datamodel.rst:712 msgid "" "Modules are a basic organizational unit of Python code, and are created by " "the :ref:`import system ` as invoked either by the :keyword:" @@ -952,13 +920,13 @@ msgid "" "needed once the initialization is done)." msgstr "" -#: ../../reference/datamodel.rst:741 +#: ../../reference/datamodel.rst:724 msgid "" "Attribute assignment updates the module's namespace dictionary, e.g., ``m.x " "= 1`` is equivalent to ``m.__dict__[\"x\"] = 1``." msgstr "" -#: ../../reference/datamodel.rst:751 +#: ../../reference/datamodel.rst:734 msgid "" "Predefined (writable) attributes: :attr:`__name__` is the module's name; :" "attr:`__doc__` is the module's documentation string, or ``None`` if " @@ -972,13 +940,13 @@ msgid "" "library file." msgstr "" -#: ../../reference/datamodel.rst:764 +#: ../../reference/datamodel.rst:747 msgid "" "Special read-only attribute: :attr:`~object.__dict__` is the module's " "namespace as a dictionary object." msgstr "" -#: ../../reference/datamodel.rst:769 +#: ../../reference/datamodel.rst:752 msgid "" "Because of the way CPython clears module dictionaries, the module dictionary " "will be cleared when the module falls out of scope even if the dictionary " @@ -986,11 +954,11 @@ msgid "" "module around while using its dictionary directly." msgstr "" -#: ../../reference/datamodel.rst:831 +#: ../../reference/datamodel.rst:814 msgid "Custom classes" msgstr "" -#: ../../reference/datamodel.rst:775 +#: ../../reference/datamodel.rst:758 msgid "" "Custom class types are typically created by class definitions (see section :" "ref:`class`). A class has a namespace implemented by a dictionary object. " @@ -1006,7 +974,7 @@ msgid "" "python.org/download/releases/2.3/mro/." msgstr "" -#: ../../reference/datamodel.rst:799 +#: ../../reference/datamodel.rst:782 msgid "" "When a class attribute reference (for class :class:`C`, say) would yield a " "class method object, it is transformed into an instance method object whose :" @@ -1017,19 +985,19 @@ msgid "" "in its :attr:`~object.__dict__`." msgstr "" -#: ../../reference/datamodel.rst:809 +#: ../../reference/datamodel.rst:792 msgid "" "Class attribute assignments update the class's dictionary, never the " "dictionary of a base class." msgstr "" -#: ../../reference/datamodel.rst:814 +#: ../../reference/datamodel.rst:797 msgid "" "A class object can be called (see above) to yield a class instance (see " "below)." msgstr "" -#: ../../reference/datamodel.rst:824 +#: ../../reference/datamodel.rst:807 msgid "" "Special attributes: :attr:`~definition.__name__` is the class name; :attr:" "`__module__` is the module name in which the class was defined; :attr:" @@ -1041,11 +1009,11 @@ msgid "" "annotation>` collected during class body execution." msgstr "" -#: ../../reference/datamodel.rst:874 +#: ../../reference/datamodel.rst:857 msgid "Class instances" msgstr "" -#: ../../reference/datamodel.rst:840 +#: ../../reference/datamodel.rst:823 msgid "" "A class instance is created by calling a class object (see above). A class " "instance has a namespace implemented as a dictionary which is the first " @@ -1062,7 +1030,7 @@ msgid "" "method, that is called to satisfy the lookup." msgstr "" -#: ../../reference/datamodel.rst:856 +#: ../../reference/datamodel.rst:839 msgid "" "Attribute assignments and deletions update the instance's dictionary, never " "a class's dictionary. If the class has a :meth:`__setattr__` or :meth:" @@ -1070,23 +1038,23 @@ msgid "" "dictionary directly." msgstr "" -#: ../../reference/datamodel.rst:866 +#: ../../reference/datamodel.rst:849 msgid "" "Class instances can pretend to be numbers, sequences, or mappings if they " "have methods with certain special names. See section :ref:`specialnames`." msgstr "" -#: ../../reference/datamodel.rst:873 +#: ../../reference/datamodel.rst:856 msgid "" "Special attributes: :attr:`~object.__dict__` is the attribute dictionary; :" "attr:`~instance.__class__` is the instance's class." msgstr "" -#: ../../reference/datamodel.rst:900 +#: ../../reference/datamodel.rst:883 msgid "I/O objects (also known as file objects)" msgstr "" -#: ../../reference/datamodel.rst:890 +#: ../../reference/datamodel.rst:873 msgid "" "A :term:`file object` represents an open file. Various shortcuts are " "available to create file objects: the :func:`open` built-in function, and " @@ -1095,7 +1063,7 @@ msgid "" "methods provided by extension modules)." msgstr "" -#: ../../reference/datamodel.rst:896 +#: ../../reference/datamodel.rst:879 msgid "" "The objects ``sys.stdin``, ``sys.stdout`` and ``sys.stderr`` are initialized " "to file objects corresponding to the interpreter's standard input, output " @@ -1103,22 +1071,22 @@ msgid "" "interface defined by the :class:`io.TextIOBase` abstract class." msgstr "" -#: ../../reference/datamodel.rst:1151 +#: ../../reference/datamodel.rst:1128 msgid "Internal types" msgstr "" -#: ../../reference/datamodel.rst:907 +#: ../../reference/datamodel.rst:890 msgid "" "A few types used internally by the interpreter are exposed to the user. " "Their definitions may change with future versions of the interpreter, but " "they are mentioned here for completeness." msgstr "" -#: ../../reference/datamodel.rst:982 +#: ../../reference/datamodel.rst:965 msgid "Code objects" msgstr "" -#: ../../reference/datamodel.rst:914 +#: ../../reference/datamodel.rst:897 msgid "" "Code objects represent *byte-compiled* executable Python code, or :term:" "`bytecode`. The difference between a code object and a function object is " @@ -1130,7 +1098,7 @@ msgid "" "no references (directly or indirectly) to mutable objects." msgstr "" -#: ../../reference/datamodel.rst:941 +#: ../../reference/datamodel.rst:924 msgid "" "Special read-only attributes: :attr:`co_name` gives the function name; :attr:" "`co_argcount` is the total number of positional arguments (including " @@ -1154,7 +1122,7 @@ msgid "" "`co_flags` is an integer encoding a number of flags for the interpreter." msgstr "" -#: ../../reference/datamodel.rst:965 +#: ../../reference/datamodel.rst:948 msgid "" "The following flag bits are defined for :attr:`co_flags`: bit ``0x04`` is " "set if the function uses the ``*arguments`` syntax to accept an arbitrary " @@ -1163,7 +1131,7 @@ msgid "" "set if the function is a generator." msgstr "" -#: ../../reference/datamodel.rst:971 +#: ../../reference/datamodel.rst:954 msgid "" "Future feature declarations (``from __future__ import division``) also use " "bits in :attr:`co_flags` to indicate whether a code object was compiled with " @@ -1172,27 +1140,27 @@ msgid "" "used in earlier versions of Python." msgstr "" -#: ../../reference/datamodel.rst:977 +#: ../../reference/datamodel.rst:960 msgid "Other bits in :attr:`co_flags` are reserved for internal use." msgstr "" -#: ../../reference/datamodel.rst:981 +#: ../../reference/datamodel.rst:964 msgid "" "If a code object represents a function, the first item in :attr:`co_consts` " "is the documentation string of the function, or ``None`` if undefined." msgstr "" -#: ../../reference/datamodel.rst:1044 +#: ../../reference/datamodel.rst:1024 msgid "Frame objects" msgstr "" -#: ../../reference/datamodel.rst:989 +#: ../../reference/datamodel.rst:972 msgid "" "Frame objects represent execution frames. They may occur in traceback " "objects (see below), and are also passed to registered trace functions." msgstr "" -#: ../../reference/datamodel.rst:1000 +#: ../../reference/datamodel.rst:983 msgid "" "Special read-only attributes: :attr:`f_back` is to the previous stack frame " "(towards the caller), or ``None`` if this is the bottom stack frame; :attr:" @@ -1203,13 +1171,7 @@ msgid "" "the bytecode string of the code object)." msgstr "" -#: ../../reference/datamodel.rst:1008 -msgid "" -"Accessing ``f_code`` raises an :ref:`auditing event ` ``object." -"__getattr__`` with arguments ``obj`` and ``\"f_code\"``." -msgstr "" - -#: ../../reference/datamodel.rst:1017 +#: ../../reference/datamodel.rst:997 msgid "" "Special writable attributes: :attr:`f_trace`, if not ``None``, is a function " "called for various events during code execution (this is used by the " @@ -1217,7 +1179,7 @@ msgid "" "can be disabled by setting :attr:`f_trace_lines` to :const:`False`." msgstr "" -#: ../../reference/datamodel.rst:1022 +#: ../../reference/datamodel.rst:1002 msgid "" "Implementations *may* allow per-opcode events to be requested by setting :" "attr:`f_trace_opcodes` to :const:`True`. Note that this may lead to " @@ -1225,7 +1187,7 @@ msgid "" "escape to the function being traced." msgstr "" -#: ../../reference/datamodel.rst:1027 +#: ../../reference/datamodel.rst:1007 msgid "" ":attr:`f_lineno` is the current line number of the frame --- writing to this " "from within a trace function jumps to the given line (only for the bottom-" @@ -1233,11 +1195,11 @@ msgid "" "Statement) by writing to f_lineno." msgstr "" -#: ../../reference/datamodel.rst:1032 +#: ../../reference/datamodel.rst:1012 msgid "Frame objects support one method:" msgstr "" -#: ../../reference/datamodel.rst:1036 +#: ../../reference/datamodel.rst:1016 msgid "" "This method clears all references to local variables held by the frame. " "Also, if the frame belonged to a generator, the generator is finalized. " @@ -1245,22 +1207,22 @@ msgid "" "catching an exception and storing its traceback for later use)." msgstr "" -#: ../../reference/datamodel.rst:1042 +#: ../../reference/datamodel.rst:1022 msgid ":exc:`RuntimeError` is raised if the frame is currently executing." msgstr "" -#: ../../reference/datamodel.rst:1107 +#: ../../reference/datamodel.rst:1084 msgid "Traceback objects" msgstr "" -#: ../../reference/datamodel.rst:1059 +#: ../../reference/datamodel.rst:1039 msgid "" "Traceback objects represent a stack trace of an exception. A traceback " "object is implicitly created when an exception occurs, and may also be " "explicitly created by calling :class:`types.TracebackType`." msgstr "" -#: ../../reference/datamodel.rst:1063 +#: ../../reference/datamodel.rst:1043 msgid "" "For implicitly created tracebacks, when the search for an exception handler " "unwinds the execution stack, at each unwound level a traceback object is " @@ -1270,21 +1232,21 @@ msgid "" "exc_info()``, and as the ``__traceback__`` attribute of the caught exception." msgstr "" -#: ../../reference/datamodel.rst:1071 +#: ../../reference/datamodel.rst:1051 msgid "" "When the program contains no suitable handler, the stack trace is written " "(nicely formatted) to the standard error stream; if the interpreter is " "interactive, it is also made available to the user as ``sys.last_traceback``." msgstr "" -#: ../../reference/datamodel.rst:1076 +#: ../../reference/datamodel.rst:1056 msgid "" "For explicitly created tracebacks, it is up to the creator of the traceback " "to determine how the ``tb_next`` attributes should be linked to form a full " "stack trace." msgstr "" -#: ../../reference/datamodel.rst:1086 +#: ../../reference/datamodel.rst:1066 msgid "" "Special read-only attributes: :attr:`tb_frame` points to the execution frame " "of the current level; :attr:`tb_lineno` gives the line number where the " @@ -1294,47 +1256,41 @@ msgid "" "statement with no matching except clause or with a finally clause." msgstr "" -#: ../../reference/datamodel.rst:1095 -msgid "" -"Accessing ``tb_frame`` raises an :ref:`auditing event ` ``object." -"__getattr__`` with arguments ``obj`` and ``\"tb_frame\"``." -msgstr "" - -#: ../../reference/datamodel.rst:1101 +#: ../../reference/datamodel.rst:1078 msgid "" "Special writable attribute: :attr:`tb_next` is the next level in the stack " "trace (towards the frame where the exception occurred), or ``None`` if there " "is no next level." msgstr "" -#: ../../reference/datamodel.rst:1105 +#: ../../reference/datamodel.rst:1082 msgid "" "Traceback objects can now be explicitly instantiated from Python code, and " "the ``tb_next`` attribute of existing instances can be updated." msgstr "" -#: ../../reference/datamodel.rst:1133 +#: ../../reference/datamodel.rst:1110 msgid "Slice objects" msgstr "" -#: ../../reference/datamodel.rst:1112 +#: ../../reference/datamodel.rst:1089 msgid "" "Slice objects are used to represent slices for :meth:`__getitem__` methods. " "They are also created by the built-in :func:`slice` function." msgstr "" -#: ../../reference/datamodel.rst:1120 +#: ../../reference/datamodel.rst:1097 msgid "" "Special read-only attributes: :attr:`~slice.start` is the lower bound; :attr:" "`~slice.stop` is the upper bound; :attr:`~slice.step` is the step value; " "each is ``None`` if omitted. These attributes can have any type." msgstr "" -#: ../../reference/datamodel.rst:1124 +#: ../../reference/datamodel.rst:1101 msgid "Slice objects support one method:" msgstr "" -#: ../../reference/datamodel.rst:1128 +#: ../../reference/datamodel.rst:1105 msgid "" "This method takes a single integer argument *length* and computes " "information about the slice that the slice object would describe if applied " @@ -1344,11 +1300,11 @@ msgid "" "a manner consistent with regular slices." msgstr "" -#: ../../reference/datamodel.rst:1143 +#: ../../reference/datamodel.rst:1120 msgid "Static method objects" msgstr "" -#: ../../reference/datamodel.rst:1136 +#: ../../reference/datamodel.rst:1113 msgid "" "Static method objects provide a way of defeating the transformation of " "function objects to method objects described above. A static method object " @@ -1360,11 +1316,11 @@ msgid "" "are created by the built-in :func:`staticmethod` constructor." msgstr "" -#: ../../reference/datamodel.rst:1151 +#: ../../reference/datamodel.rst:1128 msgid "Class method objects" msgstr "" -#: ../../reference/datamodel.rst:1146 +#: ../../reference/datamodel.rst:1123 msgid "" "A class method object, like a static method object, is a wrapper around " "another object that alters the way in which that object is retrieved from " @@ -1373,11 +1329,11 @@ msgid "" "objects are created by the built-in :func:`classmethod` constructor." msgstr "" -#: ../../reference/datamodel.rst:1156 +#: ../../reference/datamodel.rst:1133 msgid "Special method names" msgstr "" -#: ../../reference/datamodel.rst:1162 +#: ../../reference/datamodel.rst:1139 msgid "" "A class can implement certain operations that are invoked by special syntax " "(such as arithmetic operations or subscripting and slicing) by defining " @@ -1391,7 +1347,7 @@ msgid "" "`TypeError`)." msgstr "" -#: ../../reference/datamodel.rst:1172 +#: ../../reference/datamodel.rst:1149 msgid "" "Setting a special method to ``None`` indicates that the corresponding " "operation is not available. For example, if a class sets :meth:`__iter__` " @@ -1400,7 +1356,7 @@ msgid "" "`__getitem__`). [#]_" msgstr "" -#: ../../reference/datamodel.rst:1178 +#: ../../reference/datamodel.rst:1155 msgid "" "When implementing a class that emulates any built-in type, it is important " "that the emulation only be implemented to the degree that it makes sense for " @@ -1410,11 +1366,11 @@ msgid "" "the W3C's Document Object Model.)" msgstr "" -#: ../../reference/datamodel.rst:1189 +#: ../../reference/datamodel.rst:1166 msgid "Basic customization" msgstr "" -#: ../../reference/datamodel.rst:1195 +#: ../../reference/datamodel.rst:1172 msgid "" "Called to create a new instance of class *cls*. :meth:`__new__` is a static " "method (special-cased so you need not declare it as such) that takes the " @@ -1424,7 +1380,7 @@ msgid "" "new object instance (usually an instance of *cls*)." msgstr "" -#: ../../reference/datamodel.rst:1202 +#: ../../reference/datamodel.rst:1179 msgid "" "Typical implementations create a new instance of the class by invoking the " "superclass's :meth:`__new__` method using ``super().__new__(cls[, ...])`` " @@ -1432,7 +1388,7 @@ msgid "" "necessary before returning it." msgstr "" -#: ../../reference/datamodel.rst:1207 +#: ../../reference/datamodel.rst:1184 msgid "" "If :meth:`__new__` is invoked during object construction and it returns an " "instance or subclass of *cls*, then the new instance’s :meth:`__init__` " @@ -1441,13 +1397,13 @@ msgid "" "object constructor." msgstr "" -#: ../../reference/datamodel.rst:1212 +#: ../../reference/datamodel.rst:1189 msgid "" "If :meth:`__new__` does not return an instance of *cls*, then the new " "instance's :meth:`__init__` method will not be invoked." msgstr "" -#: ../../reference/datamodel.rst:1215 +#: ../../reference/datamodel.rst:1192 msgid "" ":meth:`__new__` is intended mainly to allow subclasses of immutable types " "(like int, str, or tuple) to customize instance creation. It is also " @@ -1455,7 +1411,7 @@ msgid "" "creation." msgstr "" -#: ../../reference/datamodel.rst:1224 +#: ../../reference/datamodel.rst:1201 msgid "" "Called after the instance has been created (by :meth:`__new__`), but before " "it is returned to the caller. The arguments are those passed to the class " @@ -1465,7 +1421,7 @@ msgid "" "example: ``super().__init__([args...])``." msgstr "" -#: ../../reference/datamodel.rst:1231 +#: ../../reference/datamodel.rst:1208 msgid "" "Because :meth:`__new__` and :meth:`__init__` work together in constructing " "objects (:meth:`__new__` to create it, and :meth:`__init__` to customize " @@ -1473,7 +1429,7 @@ msgid "" "will cause a :exc:`TypeError` to be raised at runtime." msgstr "" -#: ../../reference/datamodel.rst:1244 +#: ../../reference/datamodel.rst:1221 msgid "" "Called when the instance is about to be destroyed. This is also called a " "finalizer or (improperly) a destructor. If a base class has a :meth:" @@ -1482,7 +1438,7 @@ msgid "" "instance." msgstr "" -#: ../../reference/datamodel.rst:1250 +#: ../../reference/datamodel.rst:1227 msgid "" "It is possible (though not recommended!) for the :meth:`__del__` method to " "postpone destruction of the instance by creating a new reference to it. " @@ -1492,31 +1448,31 @@ msgid "" "it once." msgstr "" -#: ../../reference/datamodel.rst:1257 +#: ../../reference/datamodel.rst:1234 msgid "" "It is not guaranteed that :meth:`__del__` methods are called for objects " "that still exist when the interpreter exits." msgstr "" -#: ../../reference/datamodel.rst:1262 +#: ../../reference/datamodel.rst:1239 msgid "" "``del x`` doesn't directly call ``x.__del__()`` --- the former decrements " "the reference count for ``x`` by one, and the latter is only called when " "``x``'s reference count reaches zero." msgstr "" -#: ../../reference/datamodel.rst:1277 +#: ../../reference/datamodel.rst:1254 msgid "Documentation for the :mod:`gc` module." msgstr "" -#: ../../reference/datamodel.rst:1281 +#: ../../reference/datamodel.rst:1258 msgid "" "Due to the precarious circumstances under which :meth:`__del__` methods are " "invoked, exceptions that occur during their execution are ignored, and a " "warning is printed to ``sys.stderr`` instead. In particular:" msgstr "" -#: ../../reference/datamodel.rst:1285 +#: ../../reference/datamodel.rst:1262 msgid "" ":meth:`__del__` can be invoked when arbitrary code is being executed, " "including from any arbitrary thread. If :meth:`__del__` needs to take a " @@ -1525,7 +1481,7 @@ msgid "" "`__del__`." msgstr "" -#: ../../reference/datamodel.rst:1291 +#: ../../reference/datamodel.rst:1268 msgid "" ":meth:`__del__` can be executed during interpreter shutdown. As a " "consequence, the global variables it needs to access (including other " @@ -1536,7 +1492,7 @@ msgid "" "still available at the time when the :meth:`__del__` method is called." msgstr "" -#: ../../reference/datamodel.rst:1306 +#: ../../reference/datamodel.rst:1283 msgid "" "Called by the :func:`repr` built-in function to compute the \"official\" " "string representation of an object. If at all possible, this should look " @@ -1548,13 +1504,13 @@ msgid "" "an \"informal\" string representation of instances of that class is required." msgstr "" -#: ../../reference/datamodel.rst:1315 +#: ../../reference/datamodel.rst:1292 msgid "" "This is typically used for debugging, so it is important that the " "representation is information-rich and unambiguous." msgstr "" -#: ../../reference/datamodel.rst:1326 +#: ../../reference/datamodel.rst:1303 msgid "" "Called by :func:`str(object) ` and the built-in functions :func:" "`format` and :func:`print` to compute the \"informal\" or nicely printable " @@ -1562,26 +1518,26 @@ msgid "" "` object." msgstr "" -#: ../../reference/datamodel.rst:1331 +#: ../../reference/datamodel.rst:1308 msgid "" "This method differs from :meth:`object.__repr__` in that there is no " "expectation that :meth:`__str__` return a valid Python expression: a more " "convenient or concise representation can be used." msgstr "" -#: ../../reference/datamodel.rst:1335 +#: ../../reference/datamodel.rst:1312 msgid "" "The default implementation defined by the built-in type :class:`object` " "calls :meth:`object.__repr__`." msgstr "" -#: ../../reference/datamodel.rst:1345 +#: ../../reference/datamodel.rst:1322 msgid "" "Called by :ref:`bytes ` to compute a byte-string representation " "of an object. This should return a :class:`bytes` object." msgstr "" -#: ../../reference/datamodel.rst:1356 +#: ../../reference/datamodel.rst:1333 msgid "" "Called by the :func:`format` built-in function, and by extension, evaluation " "of :ref:`formatted string literals ` and the :meth:`str.format` " @@ -1593,28 +1549,28 @@ msgid "" "formatting option syntax." msgstr "" -#: ../../reference/datamodel.rst:1366 +#: ../../reference/datamodel.rst:1343 msgid "" "See :ref:`formatspec` for a description of the standard formatting syntax." msgstr "" -#: ../../reference/datamodel.rst:1368 +#: ../../reference/datamodel.rst:1345 msgid "The return value must be a string object." msgstr "" -#: ../../reference/datamodel.rst:1370 +#: ../../reference/datamodel.rst:1347 msgid "" "The __format__ method of ``object`` itself raises a :exc:`TypeError` if " "passed any non-empty string." msgstr "" -#: ../../reference/datamodel.rst:1374 +#: ../../reference/datamodel.rst:1351 msgid "" "``object.__format__(x, '')`` is now equivalent to ``str(x)`` rather than " "``format(str(x), '')``." msgstr "" -#: ../../reference/datamodel.rst:1390 +#: ../../reference/datamodel.rst:1367 msgid "" "These are the so-called \"rich comparison\" methods. The correspondence " "between operator symbols and method names is as follows: ``x.__hash__``." msgstr "" -#: ../../reference/datamodel.rst:1479 +#: ../../reference/datamodel.rst:1454 msgid "" "If a class that does not override :meth:`__eq__` wishes to suppress hash " "support, it should include ``__hash__ = None`` in the class definition. A " @@ -1733,7 +1687,7 @@ msgid "" "``isinstance(obj, collections.abc.Hashable)`` call." msgstr "" -#: ../../reference/datamodel.rst:1488 +#: ../../reference/datamodel.rst:1463 msgid "" "By default, the :meth:`__hash__` values of str and bytes objects are \"salted" "\" with an unpredictable random value. Although they remain constant within " @@ -1741,7 +1695,7 @@ msgid "" "invocations of Python." msgstr "" -#: ../../reference/datamodel.rst:1493 +#: ../../reference/datamodel.rst:1468 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 " @@ -1749,22 +1703,22 @@ msgid "" "ocert-2011-003.html for details." msgstr "" -#: ../../reference/datamodel.rst:1498 +#: ../../reference/datamodel.rst:1473 msgid "" "Changing hash values affects the iteration order of sets. Python has never " "made guarantees about this ordering (and it typically varies between 32-bit " "and 64-bit builds)." msgstr "" -#: ../../reference/datamodel.rst:1502 +#: ../../reference/datamodel.rst:1477 msgid "See also :envvar:`PYTHONHASHSEED`." msgstr "" -#: ../../reference/datamodel.rst:1504 +#: ../../reference/datamodel.rst:1479 msgid "Hash randomization is enabled by default." msgstr "" -#: ../../reference/datamodel.rst:1512 +#: ../../reference/datamodel.rst:1487 msgid "" "Called to implement truth value testing and the built-in operation " "``bool()``; should return ``False`` or ``True``. When this method is not " @@ -1773,18 +1727,18 @@ msgid "" "`__len__` nor :meth:`__bool__`, all its instances are considered true." msgstr "" -#: ../../reference/datamodel.rst:1523 +#: ../../reference/datamodel.rst:1498 msgid "Customizing attribute access" msgstr "" -#: ../../reference/datamodel.rst:1525 +#: ../../reference/datamodel.rst:1500 msgid "" "The following methods can be defined to customize the meaning of attribute " "access (use of, assignment to, or deletion of ``x.name``) for class " "instances." msgstr "" -#: ../../reference/datamodel.rst:1533 +#: ../../reference/datamodel.rst:1508 msgid "" "Called when the default attribute access fails with an :exc:`AttributeError` " "(either :meth:`__getattribute__` raises an :exc:`AttributeError` because " @@ -1794,7 +1748,7 @@ msgid "" "attribute value or raise an :exc:`AttributeError` exception." msgstr "" -#: ../../reference/datamodel.rst:1540 +#: ../../reference/datamodel.rst:1515 msgid "" "Note that if the attribute is found through the normal mechanism, :meth:" "`__getattr__` is not called. (This is an intentional asymmetry between :" @@ -1807,7 +1761,7 @@ msgid "" "actually get total control over attribute access." msgstr "" -#: ../../reference/datamodel.rst:1553 +#: ../../reference/datamodel.rst:1528 msgid "" "Called unconditionally to implement attribute accesses for instances of the " "class. If the class also defines :meth:`__getattr__`, the latter will not be " @@ -1819,82 +1773,45 @@ msgid "" "example, ``object.__getattribute__(self, name)``." msgstr "" -#: ../../reference/datamodel.rst:1564 +#: ../../reference/datamodel.rst:1539 msgid "" "This method may still be bypassed when looking up special methods as the " "result of implicit invocation via language syntax or built-in functions. " "See :ref:`special-lookup`." msgstr "" -#: ../../reference/datamodel.rst:1568 -msgid "" -"Raises an :ref:`auditing event ` ``object.__getattr__`` with " -"arguments ``obj``, ``name``." -msgstr "" - -#: ../../reference/datamodel.rst:1570 -msgid "" -"For certain sensitive attribute accesses, raises an :ref:`auditing event " -"` ``object.__getattr__`` with arguments ``obj`` and ``name``." -msgstr "" - -#: ../../reference/datamodel.rst:1577 +#: ../../reference/datamodel.rst:1546 msgid "" "Called when an attribute assignment is attempted. This is called instead of " "the normal mechanism (i.e. store the value in the instance dictionary). " "*name* is the attribute name, *value* is the value to be assigned to it." msgstr "" -#: ../../reference/datamodel.rst:1581 +#: ../../reference/datamodel.rst:1550 msgid "" "If :meth:`__setattr__` wants to assign to an instance attribute, it should " "call the base class method with the same name, for example, ``object." "__setattr__(self, name, value)``." msgstr "" -#: ../../reference/datamodel.rst:1585 -msgid "" -"Raises an :ref:`auditing event ` ``object.__setattr__`` with " -"arguments ``obj``, ``name``, ``value``." -msgstr "" - -#: ../../reference/datamodel.rst:1587 -msgid "" -"For certain sensitive attribute assignments, raises an :ref:`auditing event " -"` ``object.__setattr__`` with arguments ``obj``, ``name``, " -"``value``." -msgstr "" - -#: ../../reference/datamodel.rst:1594 +#: ../../reference/datamodel.rst:1557 msgid "" "Like :meth:`__setattr__` but for attribute deletion instead of assignment. " "This should only be implemented if ``del obj.name`` is meaningful for the " "object." msgstr "" -#: ../../reference/datamodel.rst:1597 -msgid "" -"Raises an :ref:`auditing event ` ``object.__delattr__`` with " -"arguments ``obj``, ``name``." -msgstr "" - -#: ../../reference/datamodel.rst:1599 -msgid "" -"For certain sensitive attribute deletions, raises an :ref:`auditing event " -"` ``object.__delattr__`` with arguments ``obj`` and ``name``." -msgstr "" - -#: ../../reference/datamodel.rst:1606 +#: ../../reference/datamodel.rst:1563 msgid "" "Called when :func:`dir` is called on the object. A sequence must be " "returned. :func:`dir` converts the returned sequence to a list and sorts it." msgstr "" -#: ../../reference/datamodel.rst:1611 +#: ../../reference/datamodel.rst:1568 msgid "Customizing module attribute access" msgstr "" -#: ../../reference/datamodel.rst:1618 +#: ../../reference/datamodel.rst:1575 msgid "" "Special names ``__getattr__`` and ``__dir__`` can be also used to customize " "access to module attributes. The ``__getattr__`` function at the module " @@ -1906,21 +1823,21 @@ msgid "" "with the attribute name and the result is returned." msgstr "" -#: ../../reference/datamodel.rst:1627 +#: ../../reference/datamodel.rst:1584 msgid "" "The ``__dir__`` function should accept no arguments, and return a sequence " "of strings that represents the names accessible on module. If present, this " "function overrides the standard :func:`dir` search on a module." msgstr "" -#: ../../reference/datamodel.rst:1631 +#: ../../reference/datamodel.rst:1588 msgid "" "For a more fine grained customization of the module behavior (setting " "attributes, properties, etc.), one can set the ``__class__`` attribute of a " "module object to a subclass of :class:`types.ModuleType`. For example::" msgstr "" -#: ../../reference/datamodel.rst:1649 +#: ../../reference/datamodel.rst:1606 msgid "" "Defining module ``__getattr__`` and setting module ``__class__`` only affect " "lookups made using the attribute access syntax -- directly accessing the " @@ -1928,27 +1845,27 @@ msgid "" "module's globals dictionary) is unaffected." msgstr "" -#: ../../reference/datamodel.rst:1654 +#: ../../reference/datamodel.rst:1611 msgid "``__class__`` module attribute is now writable." msgstr "" -#: ../../reference/datamodel.rst:1657 +#: ../../reference/datamodel.rst:1614 msgid "``__getattr__`` and ``__dir__`` module attributes." msgstr "" -#: ../../reference/datamodel.rst:1662 +#: ../../reference/datamodel.rst:1619 msgid ":pep:`562` - Module __getattr__ and __dir__" msgstr "" -#: ../../reference/datamodel.rst:1663 +#: ../../reference/datamodel.rst:1620 msgid "Describes the ``__getattr__`` and ``__dir__`` functions on modules." msgstr "" -#: ../../reference/datamodel.rst:1669 +#: ../../reference/datamodel.rst:1626 msgid "Implementing Descriptors" msgstr "" -#: ../../reference/datamodel.rst:1671 +#: ../../reference/datamodel.rst:1628 msgid "" "The following methods only apply when an instance of the class containing " "the method (a so-called *descriptor* class) appears in an *owner* class (the " @@ -1958,7 +1875,7 @@ msgid "" "owner class' :attr:`~object.__dict__`." msgstr "" -#: ../../reference/datamodel.rst:1681 +#: ../../reference/datamodel.rst:1638 msgid "" "Called to get the attribute of the owner class (class attribute access) or " "of an instance of that class (instance attribute access). The optional " @@ -1967,13 +1884,13 @@ msgid "" "accessed through the *owner*." msgstr "" -#: ../../reference/datamodel.rst:1687 +#: ../../reference/datamodel.rst:1644 msgid "" "This method should return the computed attribute value or raise an :exc:" "`AttributeError` exception." msgstr "" -#: ../../reference/datamodel.rst:1690 +#: ../../reference/datamodel.rst:1647 msgid "" ":PEP:`252` specifies that :meth:`__get__` is callable with one or two " "arguments. Python's own built-in descriptors support this specification; " @@ -1983,42 +1900,42 @@ msgid "" "not." msgstr "" -#: ../../reference/datamodel.rst:1699 +#: ../../reference/datamodel.rst:1656 msgid "" "Called to set the attribute on an instance *instance* of the owner class to " "a new value, *value*." msgstr "" -#: ../../reference/datamodel.rst:1702 +#: ../../reference/datamodel.rst:1659 msgid "" "Note, adding :meth:`__set__` or :meth:`__delete__` changes the kind of " "descriptor to a \"data descriptor\". See :ref:`descriptor-invocation` for " "more details." msgstr "" -#: ../../reference/datamodel.rst:1708 +#: ../../reference/datamodel.rst:1665 msgid "" "Called to delete the attribute on an instance *instance* of the owner class." msgstr "" -#: ../../reference/datamodel.rst:1713 +#: ../../reference/datamodel.rst:1670 msgid "" "Called at the time the owning class *owner* is created. The descriptor has " "been assigned to *name*." msgstr "" -#: ../../reference/datamodel.rst:1718 +#: ../../reference/datamodel.rst:1675 msgid "" ":meth:`__set_name__` is only called implicitly as part of the :class:`type` " "constructor, so it will need to be called explicitly with the appropriate " "parameters when a descriptor is added to a class after initial creation::" msgstr "" -#: ../../reference/datamodel.rst:1729 +#: ../../reference/datamodel.rst:1686 msgid "See :ref:`class-object-creation` for more details." msgstr "" -#: ../../reference/datamodel.rst:1733 +#: ../../reference/datamodel.rst:1690 msgid "" "The attribute :attr:`__objclass__` is interpreted by the :mod:`inspect` " "module as specifying the class where this object was defined (setting this " @@ -2029,11 +1946,11 @@ msgid "" "are implemented in C)." msgstr "" -#: ../../reference/datamodel.rst:1744 +#: ../../reference/datamodel.rst:1701 msgid "Invoking Descriptors" msgstr "" -#: ../../reference/datamodel.rst:1746 +#: ../../reference/datamodel.rst:1703 msgid "" "In general, a descriptor is an object attribute with \"binding behavior\", " "one whose attribute access has been overridden by methods in the descriptor " @@ -2041,7 +1958,7 @@ msgid "" "of those methods are defined for an object, it is said to be a descriptor." msgstr "" -#: ../../reference/datamodel.rst:1751 +#: ../../reference/datamodel.rst:1708 msgid "" "The default behavior for attribute access is to get, set, or delete the " "attribute from an object's dictionary. For instance, ``a.x`` has a lookup " @@ -2049,7 +1966,7 @@ msgid "" "continuing through the base classes of ``type(a)`` excluding metaclasses." msgstr "" -#: ../../reference/datamodel.rst:1756 +#: ../../reference/datamodel.rst:1713 msgid "" "However, if the looked-up value is an object defining one of the descriptor " "methods, then Python may override the default behavior and invoke the " @@ -2057,47 +1974,47 @@ msgid "" "depends on which descriptor methods were defined and how they were called." msgstr "" -#: ../../reference/datamodel.rst:1761 +#: ../../reference/datamodel.rst:1718 msgid "" "The starting point for descriptor invocation is a binding, ``a.x``. How the " "arguments are assembled depends on ``a``:" msgstr "" -#: ../../reference/datamodel.rst:1766 +#: ../../reference/datamodel.rst:1723 msgid "Direct Call" msgstr "" -#: ../../reference/datamodel.rst:1765 +#: ../../reference/datamodel.rst:1722 msgid "" "The simplest and least common call is when user code directly invokes a " "descriptor method: ``x.__get__(a)``." msgstr "" -#: ../../reference/datamodel.rst:1770 +#: ../../reference/datamodel.rst:1727 msgid "Instance Binding" msgstr "" -#: ../../reference/datamodel.rst:1769 +#: ../../reference/datamodel.rst:1726 msgid "" "If binding to an object instance, ``a.x`` is transformed into the call: " "``type(a).__dict__['x'].__get__(a, type(a))``." msgstr "" -#: ../../reference/datamodel.rst:1774 +#: ../../reference/datamodel.rst:1731 msgid "Class Binding" msgstr "" -#: ../../reference/datamodel.rst:1773 +#: ../../reference/datamodel.rst:1730 msgid "" "If binding to a class, ``A.x`` is transformed into the call: ``A." "__dict__['x'].__get__(None, A)``." msgstr "" -#: ../../reference/datamodel.rst:1780 +#: ../../reference/datamodel.rst:1737 msgid "Super Binding" msgstr "" -#: ../../reference/datamodel.rst:1777 +#: ../../reference/datamodel.rst:1734 msgid "" "If ``a`` is an instance of :class:`super`, then the binding ``super(B, obj)." "m()`` searches ``obj.__class__.__mro__`` for the base class ``A`` " @@ -2105,10 +2022,10 @@ msgid "" "``A.__dict__['m'].__get__(obj, obj.__class__)``." msgstr "" -#: ../../reference/datamodel.rst:1782 +#: ../../reference/datamodel.rst:1739 msgid "" "For instance bindings, the precedence of descriptor invocation depends on " -"which descriptor methods are defined. A descriptor can define any " +"the which descriptor methods are defined. A descriptor can define any " "combination of :meth:`__get__`, :meth:`__set__` and :meth:`__delete__`. If " "it does not define :meth:`__get__`, then accessing the attribute will return " "the descriptor object itself unless there is a value in the object's " @@ -2122,7 +2039,7 @@ msgid "" "instances." msgstr "" -#: ../../reference/datamodel.rst:1795 +#: ../../reference/datamodel.rst:1752 msgid "" "Python methods (including :func:`staticmethod` and :func:`classmethod`) are " "implemented as non-data descriptors. Accordingly, instances can redefine " @@ -2130,30 +2047,30 @@ msgid "" "that differ from other instances of the same class." msgstr "" -#: ../../reference/datamodel.rst:1800 +#: ../../reference/datamodel.rst:1757 msgid "" "The :func:`property` function is implemented as a data descriptor. " "Accordingly, instances cannot override the behavior of a property." msgstr "" -#: ../../reference/datamodel.rst:1807 +#: ../../reference/datamodel.rst:1764 msgid "__slots__" msgstr "" -#: ../../reference/datamodel.rst:1809 +#: ../../reference/datamodel.rst:1766 msgid "" "*__slots__* allow us to explicitly declare data members (like properties) " "and deny the creation of *__dict__* and *__weakref__* (unless explicitly " "declared in *__slots__* or available in a parent.)" msgstr "" -#: ../../reference/datamodel.rst:1813 +#: ../../reference/datamodel.rst:1770 msgid "" "The space saved over using *__dict__* can be significant. Attribute lookup " "speed can be significantly improved as well." msgstr "" -#: ../../reference/datamodel.rst:1818 +#: ../../reference/datamodel.rst:1775 msgid "" "This class variable can be assigned a string, iterable, or sequence of " "strings with variable names used by instances. *__slots__* reserves space " @@ -2161,17 +2078,17 @@ msgid "" "and *__weakref__* for each instance." msgstr "" -#: ../../reference/datamodel.rst:1825 +#: ../../reference/datamodel.rst:1782 msgid "Notes on using *__slots__*" msgstr "" -#: ../../reference/datamodel.rst:1827 +#: ../../reference/datamodel.rst:1784 msgid "" "When inheriting from a class without *__slots__*, the *__dict__* and " "*__weakref__* attribute of the instances will always be accessible." msgstr "" -#: ../../reference/datamodel.rst:1830 +#: ../../reference/datamodel.rst:1787 msgid "" "Without a *__dict__* variable, instances cannot be assigned new variables " "not listed in the *__slots__* definition. Attempts to assign to an unlisted " @@ -2180,7 +2097,7 @@ msgid "" "the *__slots__* declaration." msgstr "" -#: ../../reference/datamodel.rst:1836 +#: ../../reference/datamodel.rst:1793 msgid "" "Without a *__weakref__* variable for each instance, classes defining " "*__slots__* do not support weak references to its instances. If weak " @@ -2188,7 +2105,7 @@ msgid "" "strings in the *__slots__* declaration." msgstr "" -#: ../../reference/datamodel.rst:1841 +#: ../../reference/datamodel.rst:1798 msgid "" "*__slots__* are implemented at the class level by creating descriptors (:ref:" "`descriptors`) for each variable name. As a result, class attributes cannot " @@ -2196,7 +2113,7 @@ msgid "" "otherwise, the class attribute would overwrite the descriptor assignment." msgstr "" -#: ../../reference/datamodel.rst:1847 +#: ../../reference/datamodel.rst:1804 msgid "" "The action of a *__slots__* declaration is not limited to the class where it " "is defined. *__slots__* declared in parents are available in child classes. " @@ -2205,7 +2122,7 @@ msgid "" "*additional* slots)." msgstr "" -#: ../../reference/datamodel.rst:1853 +#: ../../reference/datamodel.rst:1810 msgid "" "If a class defines a slot also defined in a base class, the instance " "variable defined by the base class slot is inaccessible (except by " @@ -2214,43 +2131,43 @@ msgid "" "prevent this." msgstr "" -#: ../../reference/datamodel.rst:1858 +#: ../../reference/datamodel.rst:1815 msgid "" "Nonempty *__slots__* does not work for classes derived from \"variable-length" "\" built-in types such as :class:`int`, :class:`bytes` and :class:`tuple`." msgstr "" -#: ../../reference/datamodel.rst:1861 +#: ../../reference/datamodel.rst:1818 msgid "" "Any non-string iterable may be assigned to *__slots__*. Mappings may also be " "used; however, in the future, special meaning may be assigned to the values " "corresponding to each key." msgstr "" -#: ../../reference/datamodel.rst:1865 +#: ../../reference/datamodel.rst:1822 msgid "" "*__class__* assignment works only if both classes have the same *__slots__*." msgstr "" -#: ../../reference/datamodel.rst:1867 +#: ../../reference/datamodel.rst:1824 msgid "" "Multiple inheritance with multiple slotted parent classes can be used, but " "only one parent is allowed to have attributes created by slots (the other " "bases must have empty slot layouts) - violations raise :exc:`TypeError`." msgstr "" -#: ../../reference/datamodel.rst:1872 +#: ../../reference/datamodel.rst:1829 msgid "" "If an iterator is used for *__slots__* then a descriptor is created for each " "of the iterator's values. However, the *__slots__* attribute will be an " "empty iterator." msgstr "" -#: ../../reference/datamodel.rst:1879 +#: ../../reference/datamodel.rst:1836 msgid "Customizing class creation" msgstr "" -#: ../../reference/datamodel.rst:1881 +#: ../../reference/datamodel.rst:1838 msgid "" "Whenever a class inherits from another class, *__init_subclass__* is called " "on that class. This way, it is possible to write classes which change the " @@ -2260,14 +2177,14 @@ msgid "" "defining the method." msgstr "" -#: ../../reference/datamodel.rst:1890 +#: ../../reference/datamodel.rst:1847 msgid "" "This method is called whenever the containing class is subclassed. *cls* is " "then the new subclass. If defined as a normal instance method, this method " "is implicitly converted to a class method." msgstr "" -#: ../../reference/datamodel.rst:1894 +#: ../../reference/datamodel.rst:1851 msgid "" "Keyword arguments which are given to a new class are passed to the parent's " "class ``__init_subclass__``. For compatibility with other classes using " @@ -2275,13 +2192,13 @@ msgid "" "pass the others over to the base class, as in::" msgstr "" -#: ../../reference/datamodel.rst:1908 +#: ../../reference/datamodel.rst:1865 msgid "" "The default implementation ``object.__init_subclass__`` does nothing, but " "raises an error if it is called with any arguments." msgstr "" -#: ../../reference/datamodel.rst:1913 +#: ../../reference/datamodel.rst:1870 msgid "" "The metaclass hint ``metaclass`` is consumed by the rest of the type " "machinery, and is never passed to ``__init_subclass__`` implementations. The " @@ -2289,18 +2206,18 @@ msgid "" "``type(cls)``." msgstr "" -#: ../../reference/datamodel.rst:1924 +#: ../../reference/datamodel.rst:1881 msgid "Metaclasses" msgstr "" -#: ../../reference/datamodel.rst:1931 +#: ../../reference/datamodel.rst:1888 msgid "" "By default, classes are constructed using :func:`type`. The class body is " "executed in a new namespace and the class name is bound locally to the " "result of ``type(name, bases, namespace)``." msgstr "" -#: ../../reference/datamodel.rst:1935 +#: ../../reference/datamodel.rst:1892 msgid "" "The class creation process can be customized by passing the ``metaclass`` " "keyword argument in the class definition line, or by inheriting from an " @@ -2308,41 +2225,41 @@ msgid "" "both ``MyClass`` and ``MySubclass`` are instances of ``Meta``::" msgstr "" -#: ../../reference/datamodel.rst:1949 +#: ../../reference/datamodel.rst:1906 msgid "" "Any other keyword arguments that are specified in the class definition are " "passed through to all metaclass operations described below." msgstr "" -#: ../../reference/datamodel.rst:1952 +#: ../../reference/datamodel.rst:1909 msgid "When a class definition is executed, the following steps occur:" msgstr "" -#: ../../reference/datamodel.rst:1954 +#: ../../reference/datamodel.rst:1911 msgid "MRO entries are resolved;" msgstr "" -#: ../../reference/datamodel.rst:1955 +#: ../../reference/datamodel.rst:1912 msgid "the appropriate metaclass is determined;" msgstr "" -#: ../../reference/datamodel.rst:1956 +#: ../../reference/datamodel.rst:1913 msgid "the class namespace is prepared;" msgstr "" -#: ../../reference/datamodel.rst:1957 +#: ../../reference/datamodel.rst:1914 msgid "the class body is executed;" msgstr "" -#: ../../reference/datamodel.rst:1958 +#: ../../reference/datamodel.rst:1915 msgid "the class object is created." msgstr "" -#: ../../reference/datamodel.rst:1962 +#: ../../reference/datamodel.rst:1919 msgid "Resolving MRO entries" msgstr "" -#: ../../reference/datamodel.rst:1964 +#: ../../reference/datamodel.rst:1921 msgid "" "If a base that appears in class definition is not an instance of :class:" "`type`, then an ``__mro_entries__`` method is searched on it. If found, it " @@ -2351,37 +2268,37 @@ msgid "" "such case the original base is ignored." msgstr "" -#: ../../reference/datamodel.rst:1972 ../../reference/datamodel.rst:2162 +#: ../../reference/datamodel.rst:1929 ../../reference/datamodel.rst:2119 msgid ":pep:`560` - Core support for typing module and generic types" msgstr "" -#: ../../reference/datamodel.rst:1976 +#: ../../reference/datamodel.rst:1933 msgid "Determining the appropriate metaclass" msgstr "" -#: ../../reference/datamodel.rst:1980 +#: ../../reference/datamodel.rst:1937 msgid "" "The appropriate metaclass for a class definition is determined as follows:" msgstr "" -#: ../../reference/datamodel.rst:1982 +#: ../../reference/datamodel.rst:1939 msgid "" "if no bases and no explicit metaclass are given, then :func:`type` is used;" msgstr "" -#: ../../reference/datamodel.rst:1983 +#: ../../reference/datamodel.rst:1940 msgid "" "if an explicit metaclass is given and it is *not* an instance of :func:" "`type`, then it is used directly as the metaclass;" msgstr "" -#: ../../reference/datamodel.rst:1985 +#: ../../reference/datamodel.rst:1942 msgid "" "if an instance of :func:`type` is given as the explicit metaclass, or bases " "are defined, then the most derived metaclass is used." msgstr "" -#: ../../reference/datamodel.rst:1988 +#: ../../reference/datamodel.rst:1945 msgid "" "The most derived metaclass is selected from the explicitly specified " "metaclass (if any) and the metaclasses (i.e. ``type(cls)``) of all specified " @@ -2390,11 +2307,11 @@ msgid "" "that criterion, then the class definition will fail with ``TypeError``." msgstr "" -#: ../../reference/datamodel.rst:1998 +#: ../../reference/datamodel.rst:1955 msgid "Preparing the class namespace" msgstr "" -#: ../../reference/datamodel.rst:2003 +#: ../../reference/datamodel.rst:1960 msgid "" "Once the appropriate metaclass has been identified, then the class namespace " "is prepared. If the metaclass has a ``__prepare__`` attribute, it is called " @@ -2406,25 +2323,25 @@ msgid "" "``dict``." msgstr "" -#: ../../reference/datamodel.rst:2011 +#: ../../reference/datamodel.rst:1968 msgid "" "If the metaclass has no ``__prepare__`` attribute, then the class namespace " "is initialised as an empty ordered mapping." msgstr "" -#: ../../reference/datamodel.rst:2016 +#: ../../reference/datamodel.rst:1973 msgid ":pep:`3115` - Metaclasses in Python 3000" msgstr "" -#: ../../reference/datamodel.rst:2017 +#: ../../reference/datamodel.rst:1974 msgid "Introduced the ``__prepare__`` namespace hook" msgstr "" -#: ../../reference/datamodel.rst:2021 +#: ../../reference/datamodel.rst:1978 msgid "Executing the class body" msgstr "" -#: ../../reference/datamodel.rst:2026 +#: ../../reference/datamodel.rst:1983 msgid "" "The class body is executed (approximately) as ``exec(body, globals(), " "namespace)``. The key difference from a normal call to :func:`exec` is that " @@ -2433,7 +2350,7 @@ msgid "" "inside a function." msgstr "" -#: ../../reference/datamodel.rst:2032 +#: ../../reference/datamodel.rst:1989 msgid "" "However, even when the class definition occurs inside the function, methods " "defined inside the class still cannot see names defined at the class scope. " @@ -2442,11 +2359,11 @@ msgid "" "reference described in the next section." msgstr "" -#: ../../reference/datamodel.rst:2041 +#: ../../reference/datamodel.rst:1998 msgid "Creating the class object" msgstr "" -#: ../../reference/datamodel.rst:2048 +#: ../../reference/datamodel.rst:2005 msgid "" "Once the class namespace has been populated by executing the class body, the " "class object is created by calling ``metaclass(name, bases, namespace, " @@ -2454,7 +2371,7 @@ msgid "" "to ``__prepare__``)." msgstr "" -#: ../../reference/datamodel.rst:2053 +#: ../../reference/datamodel.rst:2010 msgid "" "This class object is the one that will be referenced by the zero-argument " "form of :func:`super`. ``__class__`` is an implicit closure reference " @@ -2465,7 +2382,7 @@ msgid "" "is identified based on the first argument passed to the method." msgstr "" -#: ../../reference/datamodel.rst:2063 +#: ../../reference/datamodel.rst:2020 msgid "" "In CPython 3.6 and later, the ``__class__`` cell is passed to the metaclass " "as a ``__classcell__`` entry in the class namespace. If present, this must " @@ -2474,39 +2391,39 @@ msgid "" "in Python 3.8." msgstr "" -#: ../../reference/datamodel.rst:2069 +#: ../../reference/datamodel.rst:2026 msgid "" "When using the default metaclass :class:`type`, or any metaclass that " "ultimately calls ``type.__new__``, the following additional customisation " "steps are invoked after creating the class object:" msgstr "" -#: ../../reference/datamodel.rst:2073 +#: ../../reference/datamodel.rst:2030 msgid "" "first, ``type.__new__`` collects all of the descriptors in the class " "namespace that define a :meth:`~object.__set_name__` method;" msgstr "" -#: ../../reference/datamodel.rst:2075 +#: ../../reference/datamodel.rst:2032 msgid "" "second, all of these ``__set_name__`` methods are called with the class " "being defined and the assigned name of that particular descriptor;" msgstr "" -#: ../../reference/datamodel.rst:2077 +#: ../../reference/datamodel.rst:2034 msgid "" "finally, the :meth:`~object.__init_subclass__` hook is called on the " "immediate parent of the new class in its method resolution order." msgstr "" -#: ../../reference/datamodel.rst:2080 +#: ../../reference/datamodel.rst:2037 msgid "" "After the class object is created, it is passed to the class decorators " "included in the class definition (if any) and the resulting object is bound " "in the local namespace as the defined class." msgstr "" -#: ../../reference/datamodel.rst:2084 +#: ../../reference/datamodel.rst:2041 msgid "" "When a new class is created by ``type.__new__``, the object provided as the " "namespace parameter is copied to a new ordered mapping and the original " @@ -2514,19 +2431,19 @@ msgid "" "becomes the :attr:`~object.__dict__` attribute of the class object." msgstr "" -#: ../../reference/datamodel.rst:2091 +#: ../../reference/datamodel.rst:2048 msgid ":pep:`3135` - New super" msgstr "" -#: ../../reference/datamodel.rst:2092 +#: ../../reference/datamodel.rst:2049 msgid "Describes the implicit ``__class__`` closure reference" msgstr "" -#: ../../reference/datamodel.rst:2096 +#: ../../reference/datamodel.rst:2053 msgid "Uses for metaclasses" msgstr "" -#: ../../reference/datamodel.rst:2098 +#: ../../reference/datamodel.rst:2055 msgid "" "The potential uses for metaclasses are boundless. Some ideas that have been " "explored include enum, logging, interface checking, automatic delegation, " @@ -2534,17 +2451,17 @@ msgid "" "locking/synchronization." msgstr "" -#: ../../reference/datamodel.rst:2105 +#: ../../reference/datamodel.rst:2062 msgid "Customizing instance and subclass checks" msgstr "" -#: ../../reference/datamodel.rst:2107 +#: ../../reference/datamodel.rst:2064 msgid "" "The following methods are used to override the default behavior of the :func:" "`isinstance` and :func:`issubclass` built-in functions." msgstr "" -#: ../../reference/datamodel.rst:2110 +#: ../../reference/datamodel.rst:2067 msgid "" "In particular, the metaclass :class:`abc.ABCMeta` implements these methods " "in order to allow the addition of Abstract Base Classes (ABCs) as \"virtual " @@ -2552,21 +2469,21 @@ msgid "" "other ABCs." msgstr "" -#: ../../reference/datamodel.rst:2117 +#: ../../reference/datamodel.rst:2074 msgid "" "Return true if *instance* should be considered a (direct or indirect) " "instance of *class*. If defined, called to implement ``isinstance(instance, " "class)``." msgstr "" -#: ../../reference/datamodel.rst:2124 +#: ../../reference/datamodel.rst:2081 msgid "" "Return true if *subclass* should be considered a (direct or indirect) " "subclass of *class*. If defined, called to implement ``issubclass(subclass, " "class)``." msgstr "" -#: ../../reference/datamodel.rst:2129 +#: ../../reference/datamodel.rst:2086 msgid "" "Note that these methods are looked up on the type (metaclass) of a class. " "They cannot be defined as class methods in the actual class. This is " @@ -2574,11 +2491,11 @@ msgid "" "only in this case the instance is itself a class." msgstr "" -#: ../../reference/datamodel.rst:2140 +#: ../../reference/datamodel.rst:2097 msgid ":pep:`3119` - Introducing Abstract Base Classes" msgstr "" -#: ../../reference/datamodel.rst:2137 +#: ../../reference/datamodel.rst:2094 msgid "" "Includes the specification for customizing :func:`isinstance` and :func:" "`issubclass` behavior through :meth:`~class.__instancecheck__` and :meth:" @@ -2587,23 +2504,23 @@ msgid "" "language." msgstr "" -#: ../../reference/datamodel.rst:2145 +#: ../../reference/datamodel.rst:2102 msgid "Emulating generic types" msgstr "" -#: ../../reference/datamodel.rst:2147 +#: ../../reference/datamodel.rst:2104 msgid "" "One can implement the generic class syntax as specified by :pep:`484` (for " "example ``List[int]``) by defining a special method:" msgstr "" -#: ../../reference/datamodel.rst:2152 +#: ../../reference/datamodel.rst:2109 msgid "" "Return an object representing the specialization of a generic class by type " "arguments found in *key*." msgstr "" -#: ../../reference/datamodel.rst:2155 +#: ../../reference/datamodel.rst:2112 msgid "" "This method is looked up on the class object itself, and when defined in the " "class body, this method is implicitly a class method. Note, this mechanism " @@ -2611,22 +2528,22 @@ msgid "" "discouraged." msgstr "" -#: ../../reference/datamodel.rst:2168 +#: ../../reference/datamodel.rst:2125 msgid "Emulating callable objects" msgstr "" -#: ../../reference/datamodel.rst:2175 +#: ../../reference/datamodel.rst:2132 msgid "" "Called when the instance is \"called\" as a function; if this method is " -"defined, ``x(arg1, arg2, ...)`` roughly translates to ``type(x).__call__(x, " -"arg1, ...)``." +"defined, ``x(arg1, arg2, ...)`` is a shorthand for ``x.__call__(arg1, " +"arg2, ...)``." msgstr "" -#: ../../reference/datamodel.rst:2182 +#: ../../reference/datamodel.rst:2139 msgid "Emulating container types" msgstr "" -#: ../../reference/datamodel.rst:2184 +#: ../../reference/datamodel.rst:2141 msgid "" "The following methods can be defined to implement container objects. " "Containers usually are sequences (such as lists or tuples) or mappings (like " @@ -2659,7 +2576,7 @@ msgid "" "should iterate through the values." msgstr "" -#: ../../reference/datamodel.rst:2219 +#: ../../reference/datamodel.rst:2176 msgid "" "Called to implement the built-in function :func:`len`. Should return the " "length of the object, an integer ``>=`` 0. Also, an object that doesn't " @@ -2667,7 +2584,7 @@ msgid "" "zero is considered to be false in a Boolean context." msgstr "" -#: ../../reference/datamodel.rst:2226 +#: ../../reference/datamodel.rst:2183 msgid "" "In CPython, the length is required to be at most :attr:`sys.maxsize`. If the " "length is larger than :attr:`!sys.maxsize` some features (such as :func:" @@ -2676,7 +2593,7 @@ msgid "" "`__bool__` method." msgstr "" -#: ../../reference/datamodel.rst:2235 +#: ../../reference/datamodel.rst:2192 msgid "" "Called to implement :func:`operator.length_hint`. Should return an estimated " "length for the object (which may be greater or less than the actual length). " @@ -2686,20 +2603,20 @@ msgid "" "never required for correctness." msgstr "" -#: ../../reference/datamodel.rst:2249 +#: ../../reference/datamodel.rst:2206 msgid "" "Slicing is done exclusively with the following three methods. A call like ::" msgstr "" -#: ../../reference/datamodel.rst:2253 +#: ../../reference/datamodel.rst:2210 msgid "is translated to ::" msgstr "" -#: ../../reference/datamodel.rst:2257 +#: ../../reference/datamodel.rst:2214 msgid "and so forth. Missing slice items are always filled in with ``None``." msgstr "" -#: ../../reference/datamodel.rst:2262 +#: ../../reference/datamodel.rst:2219 msgid "" "Called to implement evaluation of ``self[key]``. For sequence types, the " "accepted keys should be integers and slice objects. Note that the special " @@ -2711,13 +2628,13 @@ msgid "" "*key* is missing (not in the container), :exc:`KeyError` should be raised." msgstr "" -#: ../../reference/datamodel.rst:2273 +#: ../../reference/datamodel.rst:2230 msgid "" ":keyword:`for` loops expect that an :exc:`IndexError` will be raised for " "illegal indexes to allow proper detection of the end of the sequence." msgstr "" -#: ../../reference/datamodel.rst:2279 +#: ../../reference/datamodel.rst:2236 msgid "" "Called to implement assignment to ``self[key]``. Same note as for :meth:" "`__getitem__`. This should only be implemented for mappings if the objects " @@ -2726,7 +2643,7 @@ msgid "" "for improper *key* values as for the :meth:`__getitem__` method." msgstr "" -#: ../../reference/datamodel.rst:2288 +#: ../../reference/datamodel.rst:2245 msgid "" "Called to implement deletion of ``self[key]``. Same note as for :meth:" "`__getitem__`. This should only be implemented for mappings if the objects " @@ -2735,13 +2652,13 @@ msgid "" "values as for the :meth:`__getitem__` method." msgstr "" -#: ../../reference/datamodel.rst:2297 +#: ../../reference/datamodel.rst:2254 msgid "" "Called by :class:`dict`\\ .\\ :meth:`__getitem__` to implement ``self[key]`` " "for dict subclasses when key is not in the dictionary." msgstr "" -#: ../../reference/datamodel.rst:2303 +#: ../../reference/datamodel.rst:2260 msgid "" "This method is called when an iterator is required for a container. This " "method should return a new iterator object that can iterate over all the " @@ -2749,21 +2666,21 @@ msgid "" "the container." msgstr "" -#: ../../reference/datamodel.rst:2307 +#: ../../reference/datamodel.rst:2264 msgid "" "Iterator objects also need to implement this method; they are required to " "return themselves. For more information on iterator objects, see :ref:" "`typeiter`." msgstr "" -#: ../../reference/datamodel.rst:2313 +#: ../../reference/datamodel.rst:2270 msgid "" "Called (if present) by the :func:`reversed` built-in to implement reverse " "iteration. It should return a new iterator object that iterates over all " "the objects in the container in reverse order." msgstr "" -#: ../../reference/datamodel.rst:2317 +#: ../../reference/datamodel.rst:2274 msgid "" "If the :meth:`__reversed__` method is not provided, the :func:`reversed` " "built-in will fall back to using the sequence protocol (:meth:`__len__` and :" @@ -2772,7 +2689,7 @@ msgid "" "more efficient than the one provided by :func:`reversed`." msgstr "" -#: ../../reference/datamodel.rst:2324 +#: ../../reference/datamodel.rst:2281 msgid "" "The membership test operators (:keyword:`in` and :keyword:`not in`) are " "normally implemented as an iteration through a container. However, container " @@ -2780,14 +2697,14 @@ msgid "" "implementation, which also does not require the object be iterable." msgstr "" -#: ../../reference/datamodel.rst:2331 +#: ../../reference/datamodel.rst:2288 msgid "" "Called to implement membership test operators. Should return true if *item* " "is in *self*, false otherwise. For mapping objects, this should consider " "the keys of the mapping rather than the values or the key-item pairs." msgstr "" -#: ../../reference/datamodel.rst:2335 +#: ../../reference/datamodel.rst:2292 msgid "" "For objects that don't define :meth:`__contains__`, the membership test " "first tries iteration via :meth:`__iter__`, then the old sequence iteration " @@ -2795,11 +2712,11 @@ msgid "" "reference `." msgstr "" -#: ../../reference/datamodel.rst:2344 +#: ../../reference/datamodel.rst:2301 msgid "Emulating numeric types" msgstr "" -#: ../../reference/datamodel.rst:2346 +#: ../../reference/datamodel.rst:2303 msgid "" "The following methods can be defined to emulate numeric objects. Methods " "corresponding to operations that are not supported by the particular kind of " @@ -2807,7 +2724,7 @@ msgid "" "should be left undefined." msgstr "" -#: ../../reference/datamodel.rst:2372 +#: ../../reference/datamodel.rst:2329 msgid "" "These methods are called to implement the binary arithmetic operations (``" "+``, ``-``, ``*``, ``@``, ``/``, ``//``, ``%``, :func:`divmod`, :func:`pow`, " @@ -2820,13 +2737,13 @@ msgid "" "version of the built-in :func:`pow` function is to be supported." msgstr "" -#: ../../reference/datamodel.rst:2383 +#: ../../reference/datamodel.rst:2340 msgid "" "If one of those methods does not support the operation with the supplied " "arguments, it should return ``NotImplemented``." msgstr "" -#: ../../reference/datamodel.rst:2406 +#: ../../reference/datamodel.rst:2363 msgid "" "These methods are called to implement the binary arithmetic operations (``" "+``, ``-``, ``*``, ``@``, ``/``, ``//``, ``%``, :func:`divmod`, :func:`pow`, " @@ -2838,22 +2755,21 @@ msgid "" "__rsub__(x)`` is called if ``x.__sub__(y)`` returns *NotImplemented*." msgstr "" -#: ../../reference/datamodel.rst:2417 +#: ../../reference/datamodel.rst:2374 msgid "" "Note that ternary :func:`pow` will not try calling :meth:`__rpow__` (the " "coercion rules would become too complicated)." msgstr "" -#: ../../reference/datamodel.rst:2422 +#: ../../reference/datamodel.rst:2379 msgid "" "If the right operand's type is a subclass of the left operand's type and " -"that subclass provides a different implementation of the reflected method " -"for the operation, this method will be called before the left operand's non-" -"reflected method. This behavior allows subclasses to override their " -"ancestors' operations." +"that subclass provides the reflected method for the operation, this method " +"will be called before the left operand's non-reflected method. This " +"behavior allows subclasses to override their ancestors' operations." msgstr "" -#: ../../reference/datamodel.rst:2443 +#: ../../reference/datamodel.rst:2399 msgid "" "These methods are called to implement the augmented arithmetic assignments " "(``+=``, ``-=``, ``*=``, ``@=``, ``/=``, ``//=``, ``%=``, ``**=``, ``<<=``, " @@ -2869,26 +2785,19 @@ msgid "" "fact part of the data model." msgstr "" -#: ../../reference/datamodel.rst:2458 -msgid "" -"Due to a bug in the dispatching mechanism for ``**=``, a class that defines :" -"meth:`__ipow__` but returns ``NotImplemented`` would fail to fall back to " -"``x.__pow__(y)`` and ``y.__rpow__(x)``. This bug is fixed in Python 3.10." -msgstr "" - -#: ../../reference/datamodel.rst:2471 +#: ../../reference/datamodel.rst:2420 msgid "" "Called to implement the unary arithmetic operations (``-``, ``+``, :func:" "`abs` and ``~``)." msgstr "" -#: ../../reference/datamodel.rst:2484 +#: ../../reference/datamodel.rst:2433 msgid "" "Called to implement the built-in functions :func:`complex`, :func:`int` and :" "func:`float`. Should return a value of the appropriate type." msgstr "" -#: ../../reference/datamodel.rst:2491 +#: ../../reference/datamodel.rst:2440 msgid "" "Called to implement :func:`operator.index`, and whenever Python needs to " "losslessly convert the numeric object to an integer object (such as in " @@ -2897,14 +2806,14 @@ msgid "" "integer type. Must return an integer." msgstr "" -#: ../../reference/datamodel.rst:2497 +#: ../../reference/datamodel.rst:2446 msgid "" "If :meth:`__int__`, :meth:`__float__` and :meth:`__complex__` are not " "defined then corresponding built-in functions :func:`int`, :func:`float` " "and :func:`complex` fall back to :meth:`__index__`." msgstr "" -#: ../../reference/datamodel.rst:2509 +#: ../../reference/datamodel.rst:2458 msgid "" "Called to implement the built-in function :func:`round` and :mod:`math` " "functions :func:`~math.trunc`, :func:`~math.floor` and :func:`~math.ceil`. " @@ -2913,17 +2822,17 @@ msgid "" "(typically an :class:`int`)." msgstr "" -#: ../../reference/datamodel.rst:2515 +#: ../../reference/datamodel.rst:2464 msgid "" "If :meth:`__int__` is not defined then the built-in function :func:`int` " "falls back to :meth:`__trunc__`." msgstr "" -#: ../../reference/datamodel.rst:2522 +#: ../../reference/datamodel.rst:2471 msgid "With Statement Context Managers" msgstr "" -#: ../../reference/datamodel.rst:2524 +#: ../../reference/datamodel.rst:2473 msgid "" "A :dfn:`context manager` is an object that defines the runtime context to be " "established when executing a :keyword:`with` statement. The context manager " @@ -2933,32 +2842,32 @@ msgid "" "can also be used by directly invoking their methods." msgstr "" -#: ../../reference/datamodel.rst:2535 +#: ../../reference/datamodel.rst:2484 msgid "" "Typical uses of context managers include saving and restoring various kinds " "of global state, locking and unlocking resources, closing opened files, etc." msgstr "" -#: ../../reference/datamodel.rst:2538 +#: ../../reference/datamodel.rst:2487 msgid "" "For more information on context managers, see :ref:`typecontextmanager`." msgstr "" -#: ../../reference/datamodel.rst:2543 +#: ../../reference/datamodel.rst:2492 msgid "" "Enter the runtime context related to this object. The :keyword:`with` " "statement will bind this method's return value to the target(s) specified in " "the :keyword:`!as` clause of the statement, if any." msgstr "" -#: ../../reference/datamodel.rst:2550 +#: ../../reference/datamodel.rst:2499 msgid "" "Exit the runtime context related to this object. The parameters describe the " "exception that caused the context to be exited. If the context was exited " "without an exception, all three arguments will be :const:`None`." msgstr "" -#: ../../reference/datamodel.rst:2554 +#: ../../reference/datamodel.rst:2503 msgid "" "If an exception is supplied, and the method wishes to suppress the exception " "(i.e., prevent it from being propagated), it should return a true value. " @@ -2966,27 +2875,27 @@ msgid "" "method." msgstr "" -#: ../../reference/datamodel.rst:2558 +#: ../../reference/datamodel.rst:2507 msgid "" "Note that :meth:`__exit__` methods should not reraise the passed-in " "exception; this is the caller's responsibility." msgstr "" -#: ../../reference/datamodel.rst:2565 +#: ../../reference/datamodel.rst:2514 msgid ":pep:`343` - The \"with\" statement" msgstr "" -#: ../../reference/datamodel.rst:2565 +#: ../../reference/datamodel.rst:2514 msgid "" "The specification, background, and examples for the Python :keyword:`with` " "statement." msgstr "" -#: ../../reference/datamodel.rst:2572 +#: ../../reference/datamodel.rst:2521 msgid "Special method lookup" msgstr "" -#: ../../reference/datamodel.rst:2574 +#: ../../reference/datamodel.rst:2523 msgid "" "For custom classes, implicit invocations of special methods are only " "guaranteed to work correctly if defined on an object's type, not in the " @@ -2994,7 +2903,7 @@ msgid "" "following code raises an exception::" msgstr "" -#: ../../reference/datamodel.rst:2589 +#: ../../reference/datamodel.rst:2538 msgid "" "The rationale behind this behaviour lies with a number of special methods " "such as :meth:`__hash__` and :meth:`__repr__` that are implemented by all " @@ -3003,21 +2912,21 @@ msgid "" "type object itself::" msgstr "" -#: ../../reference/datamodel.rst:2602 +#: ../../reference/datamodel.rst:2551 msgid "" "Incorrectly attempting to invoke an unbound method of a class in this way is " "sometimes referred to as 'metaclass confusion', and is avoided by bypassing " "the instance when looking up special methods::" msgstr "" -#: ../../reference/datamodel.rst:2611 +#: ../../reference/datamodel.rst:2560 msgid "" "In addition to bypassing any instance attributes in the interest of " "correctness, implicit special method lookup generally also bypasses the :" "meth:`__getattribute__` method even of the object's metaclass::" msgstr "" -#: ../../reference/datamodel.rst:2637 +#: ../../reference/datamodel.rst:2586 msgid "" "Bypassing the :meth:`__getattribute__` machinery in this fashion provides " "significant scope for speed optimisations within the interpreter, at the " @@ -3026,66 +2935,66 @@ msgid "" "invoked by the interpreter)." msgstr "" -#: ../../reference/datamodel.rst:2648 +#: ../../reference/datamodel.rst:2597 msgid "Coroutines" msgstr "" -#: ../../reference/datamodel.rst:2652 +#: ../../reference/datamodel.rst:2601 msgid "Awaitable Objects" msgstr "" -#: ../../reference/datamodel.rst:2654 +#: ../../reference/datamodel.rst:2603 msgid "" "An :term:`awaitable` object generally implements an :meth:`__await__` " -"method. :term:`Coroutine objects ` returned from :keyword:`async " -"def` functions are awaitable." +"method. :term:`Coroutine` objects returned from :keyword:`async def` " +"functions are awaitable." msgstr "" -#: ../../reference/datamodel.rst:2660 +#: ../../reference/datamodel.rst:2609 msgid "" "The :term:`generator iterator` objects returned from generators decorated " "with :func:`types.coroutine` or :func:`asyncio.coroutine` are also " "awaitable, but they do not implement :meth:`__await__`." msgstr "" -#: ../../reference/datamodel.rst:2666 +#: ../../reference/datamodel.rst:2615 msgid "" "Must return an :term:`iterator`. Should be used to implement :term:" "`awaitable` objects. For instance, :class:`asyncio.Future` implements this " "method to be compatible with the :keyword:`await` expression." msgstr "" -#: ../../reference/datamodel.rst:2672 +#: ../../reference/datamodel.rst:2621 msgid ":pep:`492` for additional information about awaitable objects." msgstr "" -#: ../../reference/datamodel.rst:2678 +#: ../../reference/datamodel.rst:2627 msgid "Coroutine Objects" msgstr "" -#: ../../reference/datamodel.rst:2680 +#: ../../reference/datamodel.rst:2629 msgid "" -":term:`Coroutine objects ` are :term:`awaitable` objects. A " -"coroutine's execution can be controlled by calling :meth:`__await__` and " -"iterating over the result. When the coroutine has finished executing and " -"returns, the iterator raises :exc:`StopIteration`, and the exception's :attr:" +":term:`Coroutine` objects are :term:`awaitable` objects. A coroutine's " +"execution can be controlled by calling :meth:`__await__` and iterating over " +"the result. When the coroutine has finished executing and returns, the " +"iterator raises :exc:`StopIteration`, and the exception's :attr:" "`~StopIteration.value` attribute holds the return value. If the coroutine " "raises an exception, it is propagated by the iterator. Coroutines should " "not directly raise unhandled :exc:`StopIteration` exceptions." msgstr "" -#: ../../reference/datamodel.rst:2688 +#: ../../reference/datamodel.rst:2637 msgid "" "Coroutines also have the methods listed below, which are analogous to those " "of generators (see :ref:`generator-methods`). However, unlike generators, " "coroutines do not directly support iteration." msgstr "" -#: ../../reference/datamodel.rst:2692 +#: ../../reference/datamodel.rst:2641 msgid "It is a :exc:`RuntimeError` to await on a coroutine more than once." msgstr "" -#: ../../reference/datamodel.rst:2698 +#: ../../reference/datamodel.rst:2647 msgid "" "Starts or resumes execution of the coroutine. If *value* is ``None``, this " "is equivalent to advancing the iterator returned by :meth:`__await__`. If " @@ -3095,7 +3004,7 @@ msgid "" "as when iterating over the :meth:`__await__` return value, described above." msgstr "" -#: ../../reference/datamodel.rst:2708 +#: ../../reference/datamodel.rst:2657 msgid "" "Raises the specified exception in the coroutine. This method delegates to " "the :meth:`~generator.throw` method of the iterator that caused the " @@ -3106,7 +3015,7 @@ msgid "" "caught in the coroutine, it propagates back to the caller." msgstr "" -#: ../../reference/datamodel.rst:2719 +#: ../../reference/datamodel.rst:2668 msgid "" "Causes the coroutine to clean itself up and exit. If the coroutine is " "suspended, this method first delegates to the :meth:`~generator.close` " @@ -3116,97 +3025,97 @@ msgid "" "is marked as having finished executing, even if it was never started." msgstr "" -#: ../../reference/datamodel.rst:2727 +#: ../../reference/datamodel.rst:2676 msgid "" "Coroutine objects are automatically closed using the above process when they " "are about to be destroyed." msgstr "" -#: ../../reference/datamodel.rst:2733 +#: ../../reference/datamodel.rst:2682 msgid "Asynchronous Iterators" msgstr "" -#: ../../reference/datamodel.rst:2735 +#: ../../reference/datamodel.rst:2684 msgid "" "An *asynchronous iterator* can call asynchronous code in its ``__anext__`` " "method." msgstr "" -#: ../../reference/datamodel.rst:2738 +#: ../../reference/datamodel.rst:2687 msgid "" "Asynchronous iterators can be used in an :keyword:`async for` statement." msgstr "" -#: ../../reference/datamodel.rst:2742 +#: ../../reference/datamodel.rst:2691 msgid "Must return an *asynchronous iterator* object." msgstr "" -#: ../../reference/datamodel.rst:2746 +#: ../../reference/datamodel.rst:2695 msgid "" "Must return an *awaitable* resulting in a next value of the iterator. " "Should raise a :exc:`StopAsyncIteration` error when the iteration is over." msgstr "" -#: ../../reference/datamodel.rst:2749 +#: ../../reference/datamodel.rst:2698 msgid "An example of an asynchronous iterable object::" msgstr "" -#: ../../reference/datamodel.rst:2766 +#: ../../reference/datamodel.rst:2715 msgid "" "Prior to Python 3.7, ``__aiter__`` could return an *awaitable* that would " "resolve to an :term:`asynchronous iterator `." msgstr "" -#: ../../reference/datamodel.rst:2771 +#: ../../reference/datamodel.rst:2720 msgid "" "Starting with Python 3.7, ``__aiter__`` must return an asynchronous iterator " "object. Returning anything else will result in a :exc:`TypeError` error." msgstr "" -#: ../../reference/datamodel.rst:2779 +#: ../../reference/datamodel.rst:2728 msgid "Asynchronous Context Managers" msgstr "" -#: ../../reference/datamodel.rst:2781 +#: ../../reference/datamodel.rst:2730 msgid "" "An *asynchronous context manager* is a *context manager* that is able to " "suspend execution in its ``__aenter__`` and ``__aexit__`` methods." msgstr "" -#: ../../reference/datamodel.rst:2784 +#: ../../reference/datamodel.rst:2733 msgid "" "Asynchronous context managers can be used in an :keyword:`async with` " "statement." msgstr "" -#: ../../reference/datamodel.rst:2788 +#: ../../reference/datamodel.rst:2737 msgid "" "Semantically similar to :meth:`__enter__`, the only difference being that it " "must return an *awaitable*." msgstr "" -#: ../../reference/datamodel.rst:2793 +#: ../../reference/datamodel.rst:2742 msgid "" "Semantically similar to :meth:`__exit__`, the only difference being that it " "must return an *awaitable*." msgstr "" -#: ../../reference/datamodel.rst:2796 +#: ../../reference/datamodel.rst:2745 msgid "An example of an asynchronous context manager class::" msgstr "" -#: ../../reference/datamodel.rst:2809 +#: ../../reference/datamodel.rst:2758 msgid "Footnotes" msgstr "註解" -#: ../../reference/datamodel.rst:2810 +#: ../../reference/datamodel.rst:2759 msgid "" "It *is* possible in some cases to change an object's type, under certain " "controlled conditions. It generally isn't a good idea though, since it can " "lead to some very strange behaviour if it is handled incorrectly." msgstr "" -#: ../../reference/datamodel.rst:2814 +#: ../../reference/datamodel.rst:2763 msgid "" "The :meth:`__hash__`, :meth:`__iter__`, :meth:`__reversed__`, and :meth:" "`__contains__` methods have special handling for this; others will still " @@ -3214,7 +3123,7 @@ msgid "" "``None`` is not callable." msgstr "" -#: ../../reference/datamodel.rst:2819 +#: ../../reference/datamodel.rst:2768 msgid "" "\"Does not support\" here means that the class has no such method, or the " "method returns ``NotImplemented``. Do not set the method to ``None`` if you " @@ -3222,9 +3131,9 @@ msgid "" "instead have the opposite effect of explicitly *blocking* such fallback." msgstr "" -#: ../../reference/datamodel.rst:2825 +#: ../../reference/datamodel.rst:2774 msgid "" "For operands of the same type, it is assumed that if the non-reflected " -"method -- such as :meth:`__add__` -- fails then the overall operation is not " -"supported, which is why the reflected method is not called." +"method (such as :meth:`__add__`) fails the operation is not supported, which " +"is why the reflected method is not called." msgstr "" diff --git a/reference/expressions.po b/reference/expressions.po index 63319c6666..abffaf7093 100644 --- a/reference/expressions.po +++ b/reference/expressions.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.7\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2021-09-07 06:52+0000\n" +"POT-Creation-Date: 2020-06-20 18:08+0800\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-" @@ -102,7 +102,7 @@ msgid "" "`NameError` exception." msgstr "" -#: ../../reference/expressions.rst:86 +#: ../../reference/expressions.rst:84 msgid "" "**Private name mangling:** When an identifier that textually occurs in a " "class definition begins with two or more underscore characters and does not " @@ -118,15 +118,15 @@ msgid "" "only of underscores, no transformation is done." msgstr "" -#: ../../reference/expressions.rst:102 +#: ../../reference/expressions.rst:100 msgid "Literals" msgstr "" -#: ../../reference/expressions.rst:106 +#: ../../reference/expressions.rst:104 msgid "Python supports string and bytes literals and various numeric literals:" msgstr "" -#: ../../reference/expressions.rst:112 +#: ../../reference/expressions.rst:110 msgid "" "Evaluation of a literal yields an object of the given type (string, bytes, " "integer, floating point number, complex number) with the given value. The " @@ -134,7 +134,7 @@ msgid "" "(complex) literals. See section :ref:`literals` for details." msgstr "" -#: ../../reference/expressions.rst:121 +#: ../../reference/expressions.rst:119 msgid "" "All literals correspond to immutable data types, and hence the object's " "identity is less important than its value. Multiple evaluations of literals " @@ -143,30 +143,30 @@ msgid "" "the same value." msgstr "" -#: ../../reference/expressions.rst:131 +#: ../../reference/expressions.rst:129 msgid "Parenthesized forms" msgstr "" -#: ../../reference/expressions.rst:137 +#: ../../reference/expressions.rst:135 msgid "" "A parenthesized form is an optional expression list enclosed in parentheses:" msgstr "" -#: ../../reference/expressions.rst:142 +#: ../../reference/expressions.rst:140 msgid "" "A parenthesized expression list yields whatever that expression list yields: " "if the list contains at least one comma, it yields a tuple; otherwise, it " "yields the single expression that makes up the expression list." msgstr "" -#: ../../reference/expressions.rst:148 +#: ../../reference/expressions.rst:146 msgid "" "An empty pair of parentheses yields an empty tuple object. Since tuples are " "immutable, the same rules as for literals apply (i.e., two occurrences of " "the empty tuple may or may not yield the same object)." msgstr "" -#: ../../reference/expressions.rst:156 +#: ../../reference/expressions.rst:154 msgid "" "Note that tuples are not formed by the parentheses, but rather by use of the " "comma operator. The exception is the empty tuple, for which parentheses " @@ -174,31 +174,31 @@ msgid "" "cause ambiguities and allow common typos to pass uncaught." msgstr "" -#: ../../reference/expressions.rst:165 +#: ../../reference/expressions.rst:163 msgid "Displays for lists, sets and dictionaries" msgstr "" -#: ../../reference/expressions.rst:169 +#: ../../reference/expressions.rst:165 msgid "" "For constructing a list, a set or a dictionary Python provides special " "syntax called \"displays\", each of them in two flavors:" msgstr "" -#: ../../reference/expressions.rst:172 +#: ../../reference/expressions.rst:168 msgid "either the container contents are listed explicitly, or" msgstr "" -#: ../../reference/expressions.rst:174 +#: ../../reference/expressions.rst:170 msgid "" "they are computed via a set of looping and filtering instructions, called a :" "dfn:`comprehension`." msgstr "" -#: ../../reference/expressions.rst:182 +#: ../../reference/expressions.rst:178 msgid "Common syntax elements for comprehensions are:" msgstr "" -#: ../../reference/expressions.rst:190 +#: ../../reference/expressions.rst:186 msgid "" "The comprehension consists of a single expression followed by at least one :" "keyword:`!for` clause and zero or more :keyword:`!for` or :keyword:`!if` " @@ -208,7 +208,7 @@ msgid "" "expression to produce an element each time the innermost block is reached." msgstr "" -#: ../../reference/expressions.rst:197 +#: ../../reference/expressions.rst:193 msgid "" "However, aside from the iterable expression in the leftmost :keyword:`!for` " "clause, the comprehension is executed in a separate implicitly nested scope. " @@ -216,7 +216,7 @@ msgid "" "the enclosing scope." msgstr "" -#: ../../reference/expressions.rst:201 +#: ../../reference/expressions.rst:197 msgid "" "The iterable expression in the leftmost :keyword:`!for` clause is evaluated " "directly in the enclosing scope and then passed as an argument to the " @@ -226,14 +226,14 @@ msgid "" "iterable. For example: ``[x*y for x in range(10) for y in range(x, x+10)]``." msgstr "" -#: ../../reference/expressions.rst:208 +#: ../../reference/expressions.rst:204 msgid "" "To ensure the comprehension always results in a container of the appropriate " "type, ``yield`` and ``yield from`` expressions are prohibited in the " "implicitly nested scope." msgstr "" -#: ../../reference/expressions.rst:215 +#: ../../reference/expressions.rst:211 msgid "" "Since Python 3.6, in an :keyword:`async def` function, an :keyword:`!async " "for` clause may be used to iterate over a :term:`asynchronous iterator`. A " @@ -247,25 +247,25 @@ msgid "" "function in which it appears. See also :pep:`530`." msgstr "" -#: ../../reference/expressions.rst:227 +#: ../../reference/expressions.rst:223 msgid "Asynchronous comprehensions were introduced." msgstr "" -#: ../../reference/expressions.rst:230 ../../reference/expressions.rst:403 +#: ../../reference/expressions.rst:226 ../../reference/expressions.rst:397 msgid "``yield`` and ``yield from`` prohibited in the implicitly nested scope." msgstr "" -#: ../../reference/expressions.rst:237 +#: ../../reference/expressions.rst:233 msgid "List displays" msgstr "" -#: ../../reference/expressions.rst:247 +#: ../../reference/expressions.rst:243 msgid "" "A list display is a possibly empty series of expressions enclosed in square " "brackets:" msgstr "" -#: ../../reference/expressions.rst:253 +#: ../../reference/expressions.rst:249 msgid "" "A list display yields a new list object, the contents being specified by " "either a list of expressions or a comprehension. When a comma-separated " @@ -275,17 +275,17 @@ msgid "" "comprehension." msgstr "" -#: ../../reference/expressions.rst:263 +#: ../../reference/expressions.rst:259 msgid "Set displays" msgstr "" -#: ../../reference/expressions.rst:272 +#: ../../reference/expressions.rst:267 msgid "" "A set display is denoted by curly braces and distinguishable from dictionary " "displays by the lack of colons separating keys and values:" msgstr "" -#: ../../reference/expressions.rst:278 +#: ../../reference/expressions.rst:273 msgid "" "A set display yields a new mutable set object, the contents being specified " "by either a sequence of expressions or a comprehension. When a comma-" @@ -295,27 +295,27 @@ msgid "" "comprehension." msgstr "" -#: ../../reference/expressions.rst:284 +#: ../../reference/expressions.rst:279 msgid "" "An empty set cannot be constructed with ``{}``; this literal constructs an " "empty dictionary." msgstr "" -#: ../../reference/expressions.rst:291 +#: ../../reference/expressions.rst:286 msgid "Dictionary displays" msgstr "" -#: ../../reference/expressions.rst:302 +#: ../../reference/expressions.rst:296 msgid "" "A dictionary display is a possibly empty series of key/datum pairs enclosed " "in curly braces:" msgstr "" -#: ../../reference/expressions.rst:311 +#: ../../reference/expressions.rst:305 msgid "A dictionary display yields a new dictionary object." msgstr "" -#: ../../reference/expressions.rst:313 +#: ../../reference/expressions.rst:307 msgid "" "If a comma-separated sequence of key/datum pairs is given, they are " "evaluated from left to right to define the entries of the dictionary: each " @@ -325,7 +325,7 @@ msgid "" "last one given." msgstr "" -#: ../../reference/expressions.rst:323 +#: ../../reference/expressions.rst:317 msgid "" "A double asterisk ``**`` denotes :dfn:`dictionary unpacking`. Its operand " "must be a :term:`mapping`. Each mapping item is added to the new " @@ -333,11 +333,11 @@ msgid "" "pairs and earlier dictionary unpackings." msgstr "" -#: ../../reference/expressions.rst:328 +#: ../../reference/expressions.rst:322 msgid "Unpacking into dictionary displays, originally proposed by :pep:`448`." msgstr "" -#: ../../reference/expressions.rst:331 +#: ../../reference/expressions.rst:325 msgid "" "A dict comprehension, in contrast to list and set comprehensions, needs two " "expressions separated with a colon followed by the usual \"for\" and \"if\" " @@ -345,7 +345,7 @@ msgid "" "are inserted in the new dictionary in the order they are produced." msgstr "" -#: ../../reference/expressions.rst:339 +#: ../../reference/expressions.rst:333 msgid "" "Restrictions on the types of the key values are listed earlier in section :" "ref:`types`. (To summarize, the key type should be :term:`hashable`, which " @@ -354,7 +354,7 @@ msgid "" "given key value prevails." msgstr "" -#: ../../reference/expressions.rst:345 +#: ../../reference/expressions.rst:339 msgid "" "Prior to Python 3.8, in dict comprehensions, the evaluation order of key and " "value was not well-defined. In CPython, the value was evaluated before the " @@ -362,22 +362,22 @@ msgid "" "by :pep:`572`." msgstr "" -#: ../../reference/expressions.rst:355 +#: ../../reference/expressions.rst:349 msgid "Generator expressions" msgstr "" -#: ../../reference/expressions.rst:362 +#: ../../reference/expressions.rst:356 msgid "A generator expression is a compact generator notation in parentheses:" msgstr "" -#: ../../reference/expressions.rst:367 +#: ../../reference/expressions.rst:361 msgid "" "A generator expression yields a new generator object. Its syntax is the " "same as for comprehensions, except that it is enclosed in parentheses " "instead of brackets or curly braces." msgstr "" -#: ../../reference/expressions.rst:371 +#: ../../reference/expressions.rst:365 msgid "" "Variables used in the generator expression are evaluated lazily when the :" "meth:`~generator.__next__` method is called for the generator object (in the " @@ -391,20 +391,20 @@ msgid "" "``(x*y for x in range(10) for y in range(x, x+10))``." msgstr "" -#: ../../reference/expressions.rst:382 +#: ../../reference/expressions.rst:376 msgid "" "The parentheses can be omitted on calls with only one argument. See " "section :ref:`calls` for details." msgstr "" -#: ../../reference/expressions.rst:385 +#: ../../reference/expressions.rst:379 msgid "" "To avoid interfering with the expected operation of the generator expression " "itself, ``yield`` and ``yield from`` expressions are prohibited in the " "implicitly defined generator." msgstr "" -#: ../../reference/expressions.rst:389 +#: ../../reference/expressions.rst:383 msgid "" "If a generator expression contains either :keyword:`!async for` clauses or :" "keyword:`await` expressions it is called an :dfn:`asynchronous generator " @@ -413,22 +413,22 @@ msgid "" "`async-iterators`)." msgstr "" -#: ../../reference/expressions.rst:395 +#: ../../reference/expressions.rst:389 msgid "Asynchronous generator expressions were introduced." msgstr "" -#: ../../reference/expressions.rst:398 +#: ../../reference/expressions.rst:392 msgid "" "Prior to Python 3.7, asynchronous generator expressions could only appear " "in :keyword:`async def` coroutines. Starting with 3.7, any function can use " "asynchronous generator expressions." msgstr "" -#: ../../reference/expressions.rst:410 +#: ../../reference/expressions.rst:404 msgid "Yield expressions" msgstr "" -#: ../../reference/expressions.rst:422 +#: ../../reference/expressions.rst:416 msgid "" "The yield expression is used when defining a :term:`generator` function or " "an :term:`asynchronous generator` function and thus can only be used in the " @@ -438,27 +438,27 @@ msgid "" "asynchronous generator. For example::" msgstr "" -#: ../../reference/expressions.rst:435 +#: ../../reference/expressions.rst:429 msgid "" "Due to their side effects on the containing scope, ``yield`` expressions are " "not permitted as part of the implicitly defined scopes used to implement " "comprehensions and generator expressions." msgstr "" -#: ../../reference/expressions.rst:439 +#: ../../reference/expressions.rst:433 msgid "" "Yield expressions prohibited in the implicitly nested scopes used to " "implement comprehensions and generator expressions." msgstr "" -#: ../../reference/expressions.rst:443 +#: ../../reference/expressions.rst:437 msgid "" "Generator functions are described below, while asynchronous generator " "functions are described separately in section :ref:`asynchronous-generator-" "functions`." msgstr "" -#: ../../reference/expressions.rst:447 +#: ../../reference/expressions.rst:441 msgid "" "When a generator function is called, it returns an iterator known as a " "generator. That generator then controls the execution of the generator " @@ -478,7 +478,7 @@ msgid "" "that method." msgstr "" -#: ../../reference/expressions.rst:466 +#: ../../reference/expressions.rst:460 msgid "" "All of this makes generator functions quite similar to coroutines; they " "yield multiple times, they have more than one entry point and their " @@ -487,7 +487,7 @@ msgid "" "the control is always transferred to the generator's caller." msgstr "" -#: ../../reference/expressions.rst:472 +#: ../../reference/expressions.rst:466 msgid "" "Yield expressions are allowed anywhere in a :keyword:`try` construct. If " "the generator is not resumed before it is finalized (by reaching a zero " @@ -496,11 +496,11 @@ msgid "" "`finally` clauses to execute." msgstr "" -#: ../../reference/expressions.rst:481 +#: ../../reference/expressions.rst:475 msgid "" -"When ``yield from `` is used, the supplied expression must be an " -"iterable. The values produced by iterating that iterable are passed directly " -"to the caller of the current generator's methods. Any values passed in with :" +"When ``yield from `` is used, it treats the supplied expression as a " +"subiterator. All values produced by that subiterator are passed directly to " +"the caller of the current generator's methods. Any values passed in with :" "meth:`~generator.send` and any exceptions passed in with :meth:`~generator." "throw` are passed to the underlying iterator if it has the appropriate " "methods. If this is not the case, then :meth:`~generator.send` will raise :" @@ -508,7 +508,7 @@ msgid "" "will just raise the passed in exception immediately." msgstr "" -#: ../../reference/expressions.rst:490 +#: ../../reference/expressions.rst:484 msgid "" "When the underlying iterator is complete, the :attr:`~StopIteration.value` " "attribute of the raised :exc:`StopIteration` instance becomes the value of " @@ -517,73 +517,73 @@ msgid "" "returning a value from the subgenerator)." msgstr "" -#: ../../reference/expressions.rst:496 +#: ../../reference/expressions.rst:490 msgid "Added ``yield from `` to delegate control flow to a subiterator." msgstr "" -#: ../../reference/expressions.rst:499 +#: ../../reference/expressions.rst:493 msgid "" "The parentheses may be omitted when the yield expression is the sole " "expression on the right hand side of an assignment statement." msgstr "" -#: ../../reference/expressions.rst:505 +#: ../../reference/expressions.rst:499 msgid ":pep:`255` - Simple Generators" msgstr "" -#: ../../reference/expressions.rst:505 +#: ../../reference/expressions.rst:499 msgid "" "The proposal for adding generators and the :keyword:`yield` statement to " "Python." msgstr "" -#: ../../reference/expressions.rst:509 +#: ../../reference/expressions.rst:503 msgid ":pep:`342` - Coroutines via Enhanced Generators" msgstr "" -#: ../../reference/expressions.rst:508 +#: ../../reference/expressions.rst:502 msgid "" "The proposal to enhance the API and syntax of generators, making them usable " "as simple coroutines." msgstr "" -#: ../../reference/expressions.rst:513 +#: ../../reference/expressions.rst:507 msgid ":pep:`380` - Syntax for Delegating to a Subgenerator" msgstr "" -#: ../../reference/expressions.rst:512 +#: ../../reference/expressions.rst:506 msgid "" "The proposal to introduce the :token:`yield_from` syntax, making delegation " "to subgenerators easy." msgstr "" -#: ../../reference/expressions.rst:516 +#: ../../reference/expressions.rst:510 msgid ":pep:`525` - Asynchronous Generators" msgstr "" -#: ../../reference/expressions.rst:516 +#: ../../reference/expressions.rst:510 msgid "" "The proposal that expanded on :pep:`492` by adding generator capabilities to " "coroutine functions." msgstr "" -#: ../../reference/expressions.rst:523 +#: ../../reference/expressions.rst:517 msgid "Generator-iterator methods" msgstr "" -#: ../../reference/expressions.rst:525 +#: ../../reference/expressions.rst:519 msgid "" "This subsection describes the methods of a generator iterator. They can be " "used to control the execution of a generator function." msgstr "" -#: ../../reference/expressions.rst:528 +#: ../../reference/expressions.rst:522 msgid "" "Note that calling any of the generator methods below when the generator is " "already executing raises a :exc:`ValueError` exception." msgstr "" -#: ../../reference/expressions.rst:536 +#: ../../reference/expressions.rst:530 msgid "" "Starts the execution of a generator function or resumes it at the last " "executed yield expression. When a generator function is resumed with a :" @@ -595,13 +595,13 @@ msgid "" "exception is raised." msgstr "" -#: ../../reference/expressions.rst:545 +#: ../../reference/expressions.rst:539 msgid "" "This method is normally called implicitly, e.g. by a :keyword:`for` loop, or " "by the built-in :func:`next` function." msgstr "" -#: ../../reference/expressions.rst:551 +#: ../../reference/expressions.rst:545 msgid "" "Resumes the execution and \"sends\" a value into the generator function. " "The *value* argument becomes the result of the current yield expression. " @@ -612,7 +612,7 @@ msgid "" "expression that could receive the value." msgstr "" -#: ../../reference/expressions.rst:562 +#: ../../reference/expressions.rst:556 msgid "" "Raises an exception of type ``type`` at the point where the generator was " "paused, and returns the next value yielded by the generator function. If " @@ -622,7 +622,7 @@ msgid "" "to the caller." msgstr "" -#: ../../reference/expressions.rst:573 +#: ../../reference/expressions.rst:567 msgid "" "Raises a :exc:`GeneratorExit` at the point where the generator function was " "paused. If the generator function then exits gracefully, is already closed, " @@ -633,34 +633,34 @@ msgid "" "has already exited due to an exception or normal exit." msgstr "" -#: ../../reference/expressions.rst:584 +#: ../../reference/expressions.rst:578 msgid "Examples" msgstr "" -#: ../../reference/expressions.rst:586 +#: ../../reference/expressions.rst:580 msgid "" "Here is a simple example that demonstrates the behavior of generators and " "generator functions::" msgstr "" -#: ../../reference/expressions.rst:613 +#: ../../reference/expressions.rst:607 msgid "" "For examples using ``yield from``, see :ref:`pep-380` in \"What's New in " "Python.\"" msgstr "" -#: ../../reference/expressions.rst:619 +#: ../../reference/expressions.rst:613 msgid "Asynchronous generator functions" msgstr "" -#: ../../reference/expressions.rst:621 +#: ../../reference/expressions.rst:615 msgid "" "The presence of a yield expression in a function or method defined using :" "keyword:`async def` further defines the function as an :term:`asynchronous " "generator` function." msgstr "" -#: ../../reference/expressions.rst:625 +#: ../../reference/expressions.rst:619 msgid "" "When an asynchronous generator function is called, it returns an " "asynchronous iterator known as an asynchronous generator object. That object " @@ -670,7 +670,7 @@ msgid "" "keyword:`for` statement." msgstr "" -#: ../../reference/expressions.rst:632 +#: ../../reference/expressions.rst:626 msgid "" "Calling one of the asynchronous generator's methods returns an :term:" "`awaitable` object, and the execution starts when this object is awaited on. " @@ -688,7 +688,7 @@ msgid "" "will be the value passed in to that method." msgstr "" -#: ../../reference/expressions.rst:648 +#: ../../reference/expressions.rst:642 msgid "" "In an asynchronous generator function, yield expressions are allowed " "anywhere in a :keyword:`try` construct. However, if an asynchronous " @@ -702,7 +702,7 @@ msgid "" "finally` clauses to execute." msgstr "" -#: ../../reference/expressions.rst:659 +#: ../../reference/expressions.rst:653 msgid "" "To take care of finalization, an event loop should define a *finalizer* " "function which takes an asynchronous generator-iterator and presumably " @@ -714,23 +714,23 @@ msgid "" "shutdown_asyncgens`` in :source:`Lib/asyncio/base_events.py`." msgstr "" -#: ../../reference/expressions.rst:668 +#: ../../reference/expressions.rst:662 msgid "" "The expression ``yield from `` is a syntax error when used in an " "asynchronous generator function." msgstr "" -#: ../../reference/expressions.rst:675 +#: ../../reference/expressions.rst:669 msgid "Asynchronous generator-iterator methods" msgstr "" -#: ../../reference/expressions.rst:677 +#: ../../reference/expressions.rst:671 msgid "" "This subsection describes the methods of an asynchronous generator iterator, " "which are used to control the execution of a generator function." msgstr "" -#: ../../reference/expressions.rst:685 +#: ../../reference/expressions.rst:679 msgid "" "Returns an awaitable which when run starts to execute the asynchronous " "generator or resumes it at the last executed yield expression. When an " @@ -744,12 +744,12 @@ msgid "" "exception, signalling that the asynchronous iteration has completed." msgstr "" -#: ../../reference/expressions.rst:697 +#: ../../reference/expressions.rst:691 msgid "" "This method is normally called implicitly by a :keyword:`async for` loop." msgstr "" -#: ../../reference/expressions.rst:702 +#: ../../reference/expressions.rst:696 msgid "" "Returns an awaitable which when run resumes the execution of the " "asynchronous generator. As with the :meth:`~generator.send()` method for a " @@ -764,7 +764,7 @@ msgid "" "receive the value." msgstr "" -#: ../../reference/expressions.rst:717 +#: ../../reference/expressions.rst:711 msgid "" "Returns an awaitable that raises an exception of type ``type`` at the point " "where the asynchronous generator was paused, and returns the next value " @@ -776,7 +776,7 @@ msgid "" "that exception propagates to the caller of the awaitable." msgstr "" -#: ../../reference/expressions.rst:732 +#: ../../reference/expressions.rst:726 msgid "" "Returns an awaitable that when run will throw a :exc:`GeneratorExit` into " "the asynchronous generator function at the point where it was paused. If the " @@ -792,25 +792,25 @@ msgid "" "will return an awaitable that does nothing." msgstr "" -#: ../../reference/expressions.rst:748 +#: ../../reference/expressions.rst:742 msgid "Primaries" msgstr "" -#: ../../reference/expressions.rst:752 +#: ../../reference/expressions.rst:746 msgid "" "Primaries represent the most tightly bound operations of the language. Their " "syntax is:" msgstr "" -#: ../../reference/expressions.rst:762 +#: ../../reference/expressions.rst:756 msgid "Attribute references" msgstr "" -#: ../../reference/expressions.rst:768 +#: ../../reference/expressions.rst:762 msgid "An attribute reference is a primary followed by a period and a name:" msgstr "" -#: ../../reference/expressions.rst:778 +#: ../../reference/expressions.rst:772 msgid "" "The primary must evaluate to an object of a type that supports attribute " "references, which most objects do. This object is then asked to produce the " @@ -821,30 +821,30 @@ msgid "" "evaluations of the same attribute reference may yield different objects." msgstr "" -#: ../../reference/expressions.rst:790 +#: ../../reference/expressions.rst:784 msgid "Subscriptions" msgstr "" -#: ../../reference/expressions.rst:805 +#: ../../reference/expressions.rst:799 msgid "" -"Subscription of a sequence (string, tuple or list) or mapping (dictionary) " -"object usually selects an item from the collection:" +"A subscription selects an item of a sequence (string, tuple or list) or " +"mapping (dictionary) object:" msgstr "" -#: ../../reference/expressions.rst:811 +#: ../../reference/expressions.rst:805 msgid "" "The primary must evaluate to an object that supports subscription (lists or " "dictionaries for example). User-defined objects can support subscription by " "defining a :meth:`__getitem__` method." msgstr "" -#: ../../reference/expressions.rst:815 +#: ../../reference/expressions.rst:809 msgid "" "For built-in objects, there are two types of objects that support " "subscription:" msgstr "" -#: ../../reference/expressions.rst:817 +#: ../../reference/expressions.rst:811 msgid "" "If the primary is a mapping, the expression list must evaluate to an object " "whose value is one of the keys of the mapping, and the subscription selects " @@ -852,13 +852,13 @@ msgid "" "is a tuple except if it has exactly one item.)" msgstr "" -#: ../../reference/expressions.rst:822 +#: ../../reference/expressions.rst:816 msgid "" "If the primary is a sequence, the expression list must evaluate to an " "integer or a slice (as discussed in the following section)." msgstr "" -#: ../../reference/expressions.rst:825 +#: ../../reference/expressions.rst:819 msgid "" "The formal syntax makes no special provision for negative indices in " "sequences; however, built-in sequences all provide a :meth:`__getitem__` " @@ -871,32 +871,24 @@ msgid "" "overriding this method will need to explicitly add that support." msgstr "" -#: ../../reference/expressions.rst:839 +#: ../../reference/expressions.rst:833 msgid "" "A string's items are characters. A character is not a separate data type " "but a string of exactly one character." msgstr "" -#: ../../reference/expressions.rst:842 -msgid "" -"Subscription of certain :term:`classes ` or :term:`types ` " -"creates a :ref:`generic alias `. In this case, user-" -"defined classes can support subscription by providing a :meth:" -"`__class_getitem__` classmethod." -msgstr "" - -#: ../../reference/expressions.rst:851 +#: ../../reference/expressions.rst:840 msgid "Slicings" msgstr "" -#: ../../reference/expressions.rst:865 +#: ../../reference/expressions.rst:854 msgid "" "A slicing selects a range of items in a sequence object (e.g., a string, " "tuple or list). Slicings may be used as expressions or as targets in " "assignment or :keyword:`del` statements. The syntax for a slicing:" msgstr "" -#: ../../reference/expressions.rst:878 +#: ../../reference/expressions.rst:867 msgid "" "There is ambiguity in the formal syntax here: anything that looks like an " "expression list also looks like a slice list, so any subscription can be " @@ -906,7 +898,7 @@ msgid "" "the case if the slice list contains no proper slice)." msgstr "" -#: ../../reference/expressions.rst:890 +#: ../../reference/expressions.rst:879 msgid "" "The semantics for a slicing are as follows. The primary is indexed (using " "the same :meth:`__getitem__` method as normal subscription) with a key that " @@ -921,23 +913,23 @@ msgid "" "expressions." msgstr "" -#: ../../reference/expressions.rst:914 +#: ../../reference/expressions.rst:903 msgid "Calls" msgstr "" -#: ../../reference/expressions.rst:916 +#: ../../reference/expressions.rst:905 msgid "" "A call calls a callable object (e.g., a :term:`function`) with a possibly " "empty series of :term:`arguments `:" msgstr "" -#: ../../reference/expressions.rst:933 +#: ../../reference/expressions.rst:922 msgid "" "An optional trailing comma may be present after the positional and keyword " "arguments but does not affect the semantics." msgstr "" -#: ../../reference/expressions.rst:939 +#: ../../reference/expressions.rst:928 msgid "" "The primary must evaluate to a callable object (user-defined functions, " "built-in functions, methods of built-in objects, class objects, methods of " @@ -947,7 +939,7 @@ msgid "" "formal :term:`parameter` lists." msgstr "" -#: ../../reference/expressions.rst:947 +#: ../../reference/expressions.rst:936 msgid "" "If keyword arguments are present, they are first converted to positional " "arguments, as follows. First, a list of unfilled slots is created for the " @@ -969,7 +961,7 @@ msgid "" "call." msgstr "" -#: ../../reference/expressions.rst:967 +#: ../../reference/expressions.rst:956 msgid "" "An implementation may provide built-in functions whose positional parameters " "do not have names, even if they are 'named' for the purpose of " @@ -978,7 +970,7 @@ msgid "" "`PyArg_ParseTuple` to parse their arguments." msgstr "" -#: ../../reference/expressions.rst:973 +#: ../../reference/expressions.rst:962 msgid "" "If there are more positional arguments than there are formal parameter " "slots, a :exc:`TypeError` exception is raised, unless a formal parameter " @@ -987,7 +979,7 @@ msgid "" "empty tuple if there were no excess positional arguments)." msgstr "" -#: ../../reference/expressions.rst:979 +#: ../../reference/expressions.rst:968 msgid "" "If any keyword argument does not correspond to a formal parameter name, a :" "exc:`TypeError` exception is raised, unless a formal parameter using the " @@ -997,7 +989,7 @@ msgid "" "(new) empty dictionary if there were no excess keyword arguments." msgstr "" -#: ../../reference/expressions.rst:990 +#: ../../reference/expressions.rst:979 msgid "" "If the syntax ``*expression`` appears in the function call, ``expression`` " "must evaluate to an :term:`iterable`. Elements from these iterables are " @@ -1007,20 +999,20 @@ msgid "" "*y1*, ..., *yM*, *x3*, *x4*." msgstr "" -#: ../../reference/expressions.rst:997 +#: ../../reference/expressions.rst:986 msgid "" "A consequence of this is that although the ``*expression`` syntax may appear " "*after* explicit keyword arguments, it is processed *before* the keyword " "arguments (and any ``**expression`` arguments -- see below). So::" msgstr "" -#: ../../reference/expressions.rst:1013 +#: ../../reference/expressions.rst:1002 msgid "" "It is unusual for both keyword arguments and the ``*expression`` syntax to " "be used in the same call, so in practice this confusion does not arise." msgstr "" -#: ../../reference/expressions.rst:1019 +#: ../../reference/expressions.rst:1008 msgid "" "If the syntax ``**expression`` appears in the function call, ``expression`` " "must evaluate to a :term:`mapping`, the contents of which are treated as " @@ -1029,35 +1021,35 @@ msgid "" "exception is raised." msgstr "" -#: ../../reference/expressions.rst:1025 +#: ../../reference/expressions.rst:1014 msgid "" "Formal parameters using the syntax ``*identifier`` or ``**identifier`` " "cannot be used as positional argument slots or as keyword argument names." msgstr "" -#: ../../reference/expressions.rst:1028 +#: ../../reference/expressions.rst:1017 msgid "" "Function calls accept any number of ``*`` and ``**`` unpackings, positional " "arguments may follow iterable unpackings (``*``), and keyword arguments may " "follow dictionary unpackings (``**``). Originally proposed by :pep:`448`." msgstr "" -#: ../../reference/expressions.rst:1034 +#: ../../reference/expressions.rst:1023 msgid "" "A call always returns some value, possibly ``None``, unless it raises an " "exception. How this value is computed depends on the type of the callable " "object." msgstr "" -#: ../../reference/expressions.rst:1038 +#: ../../reference/expressions.rst:1027 msgid "If it is---" msgstr "" -#: ../../reference/expressions.rst:1051 +#: ../../reference/expressions.rst:1040 msgid "a user-defined function:" msgstr "" -#: ../../reference/expressions.rst:1047 +#: ../../reference/expressions.rst:1036 msgid "" "The code block for the function is executed, passing it the argument list. " "The first thing the code block will do is bind the formal parameters to the " @@ -1066,73 +1058,73 @@ msgid "" "value of the function call." msgstr "" -#: ../../reference/expressions.rst:1065 +#: ../../reference/expressions.rst:1054 msgid "a built-in function or method:" msgstr "" -#: ../../reference/expressions.rst:1064 +#: ../../reference/expressions.rst:1053 msgid "" "The result is up to the interpreter; see :ref:`built-in-funcs` for the " "descriptions of built-in functions and methods." msgstr "" -#: ../../reference/expressions.rst:1072 +#: ../../reference/expressions.rst:1061 msgid "a class object:" msgstr "" -#: ../../reference/expressions.rst:1072 +#: ../../reference/expressions.rst:1061 msgid "A new instance of that class is returned." msgstr "" -#: ../../reference/expressions.rst:1082 +#: ../../reference/expressions.rst:1071 msgid "a class instance method:" msgstr "" -#: ../../reference/expressions.rst:1080 +#: ../../reference/expressions.rst:1069 msgid "" "The corresponding user-defined function is called, with an argument list " "that is one longer than the argument list of the call: the instance becomes " "the first argument." msgstr "" -#: ../../reference/expressions.rst:1091 +#: ../../reference/expressions.rst:1080 msgid "a class instance:" msgstr "" -#: ../../reference/expressions.rst:1089 +#: ../../reference/expressions.rst:1078 msgid "" "The class must define a :meth:`__call__` method; the effect is then the same " "as if that method was called." msgstr "" -#: ../../reference/expressions.rst:1097 ../../reference/expressions.rst:1862 +#: ../../reference/expressions.rst:1086 ../../reference/expressions.rst:1834 msgid "Await expression" msgstr "" -#: ../../reference/expressions.rst:1099 +#: ../../reference/expressions.rst:1088 msgid "" "Suspend the execution of :term:`coroutine` on an :term:`awaitable` object. " "Can only be used inside a :term:`coroutine function`." msgstr "" -#: ../../reference/expressions.rst:1111 +#: ../../reference/expressions.rst:1100 msgid "The power operator" msgstr "" -#: ../../reference/expressions.rst:1117 +#: ../../reference/expressions.rst:1106 msgid "" "The power operator binds more tightly than unary operators on its left; it " "binds less tightly than unary operators on its right. The syntax is:" msgstr "" -#: ../../reference/expressions.rst:1123 +#: ../../reference/expressions.rst:1112 msgid "" "Thus, in an unparenthesized sequence of power and unary operators, the " "operators are evaluated from right to left (this does not constrain the " "evaluation order for the operands): ``-1**2`` results in ``-1``." msgstr "" -#: ../../reference/expressions.rst:1127 +#: ../../reference/expressions.rst:1116 msgid "" "The power operator has the same semantics as the built-in :func:`pow` " "function, when called with two arguments: it yields its left argument raised " @@ -1140,7 +1132,7 @@ msgid "" "converted to a common type, and the result is of that type." msgstr "" -#: ../../reference/expressions.rst:1132 +#: ../../reference/expressions.rst:1121 msgid "" "For int operands, the result has the same type as the operands unless the " "second argument is negative; in that case, all arguments are converted to " @@ -1148,58 +1140,48 @@ msgid "" "``100``, but ``10**-2`` returns ``0.01``." msgstr "" -#: ../../reference/expressions.rst:1137 +#: ../../reference/expressions.rst:1126 msgid "" "Raising ``0.0`` to a negative power results in a :exc:`ZeroDivisionError`. " "Raising a negative number to a fractional power results in a :class:" "`complex` number. (In earlier versions it raised a :exc:`ValueError`.)" msgstr "" -#: ../../reference/expressions.rst:1141 -msgid "" -"This operation can be customized using the special :meth:`__pow__` method." -msgstr "" - -#: ../../reference/expressions.rst:1146 +#: ../../reference/expressions.rst:1134 msgid "Unary arithmetic and bitwise operations" msgstr "" -#: ../../reference/expressions.rst:1152 +#: ../../reference/expressions.rst:1140 msgid "All unary arithmetic and bitwise operations have the same priority:" msgstr "" -#: ../../reference/expressions.rst:1163 +#: ../../reference/expressions.rst:1151 msgid "" -"The unary ``-`` (minus) operator yields the negation of its numeric " -"argument; the operation can be overridden with the :meth:`__neg__` special " -"method." +"The unary ``-`` (minus) operator yields the negation of its numeric argument." msgstr "" -#: ../../reference/expressions.rst:1171 -msgid "" -"The unary ``+`` (plus) operator yields its numeric argument unchanged; the " -"operation can be overridden with the :meth:`__pos__` special method." +#: ../../reference/expressions.rst:1158 +msgid "The unary ``+`` (plus) operator yields its numeric argument unchanged." msgstr "" -#: ../../reference/expressions.rst:1178 +#: ../../reference/expressions.rst:1164 msgid "" "The unary ``~`` (invert) operator yields the bitwise inversion of its " "integer argument. The bitwise inversion of ``x`` is defined as ``-(x+1)``. " -"It only applies to integral numbers or to custom objects that override the :" -"meth:`__invert__` special method." +"It only applies to integral numbers." msgstr "" -#: ../../reference/expressions.rst:1187 +#: ../../reference/expressions.rst:1170 msgid "" "In all three cases, if the argument does not have the proper type, a :exc:" "`TypeError` exception is raised." msgstr "" -#: ../../reference/expressions.rst:1194 +#: ../../reference/expressions.rst:1177 msgid "Binary arithmetic operations" msgstr "" -#: ../../reference/expressions.rst:1198 +#: ../../reference/expressions.rst:1181 msgid "" "The binary arithmetic operations have the conventional priority levels. " "Note that some of these operations also apply to certain non-numeric types. " @@ -1207,7 +1189,7 @@ msgid "" "multiplicative operators and one for additive operators:" msgstr "" -#: ../../reference/expressions.rst:1213 +#: ../../reference/expressions.rst:1196 msgid "" "The ``*`` (multiplication) operator yields the product of its arguments. " "The arguments must either both be numbers, or one argument must be an " @@ -1217,19 +1199,13 @@ msgid "" "an empty sequence." msgstr "" -#: ../../reference/expressions.rst:1219 -msgid "" -"This operation can be customized using the special :meth:`__mul__` and :meth:" -"`__rmul__` methods." -msgstr "" - -#: ../../reference/expressions.rst:1226 +#: ../../reference/expressions.rst:1206 msgid "" "The ``@`` (at) operator is intended to be used for matrix multiplication. " "No builtin Python types implement this operator." msgstr "" -#: ../../reference/expressions.rst:1237 +#: ../../reference/expressions.rst:1217 msgid "" "The ``/`` (division) and ``//`` (floor division) operators yield the " "quotient of their arguments. The numeric arguments are first converted to a " @@ -1239,13 +1215,7 @@ msgid "" "the :exc:`ZeroDivisionError` exception." msgstr "" -#: ../../reference/expressions.rst:1244 -msgid "" -"This operation can be customized using the special :meth:`__truediv__` and :" -"meth:`__floordiv__` methods." -msgstr "" - -#: ../../reference/expressions.rst:1251 +#: ../../reference/expressions.rst:1228 msgid "" "The ``%`` (modulo) operator yields the remainder from the division of the " "first argument by the second. The numeric arguments are first converted to " @@ -1257,7 +1227,7 @@ msgid "" "absolute value of the second operand [#]_." msgstr "" -#: ../../reference/expressions.rst:1260 +#: ../../reference/expressions.rst:1237 msgid "" "The floor division and modulo operators are connected by the following " "identity: ``x == (x//y)*y + (x%y)``. Floor division and modulo are also " @@ -1265,7 +1235,7 @@ msgid "" "y, x%y)``. [#]_." msgstr "" -#: ../../reference/expressions.rst:1265 +#: ../../reference/expressions.rst:1242 msgid "" "In addition to performing the modulo operation on numbers, the ``%`` " "operator is also overloaded by string objects to perform old-style string " @@ -1274,20 +1244,14 @@ msgid "" "formatting`." msgstr "" -#: ../../reference/expressions.rst:1270 -msgid "" -"The *modulo* operation can be customized using the special :meth:`__mod__` " -"method." -msgstr "" - -#: ../../reference/expressions.rst:1272 +#: ../../reference/expressions.rst:1247 msgid "" "The floor division operator, the modulo operator, and the :func:`divmod` " "function are not defined for complex numbers. Instead, convert to a " "floating point number using the :func:`abs` function if appropriate." msgstr "" -#: ../../reference/expressions.rst:1281 +#: ../../reference/expressions.rst:1256 msgid "" "The ``+`` (addition) operator yields the sum of its arguments. The " "arguments must either both be numbers or both be sequences of the same " @@ -1295,84 +1259,64 @@ msgid "" "then added together. In the latter case, the sequences are concatenated." msgstr "" -#: ../../reference/expressions.rst:1286 -msgid "" -"This operation can be customized using the special :meth:`__add__` and :meth:" -"`__radd__` methods." -msgstr "" - -#: ../../reference/expressions.rst:1294 +#: ../../reference/expressions.rst:1266 msgid "" "The ``-`` (subtraction) operator yields the difference of its arguments. " "The numeric arguments are first converted to a common type." msgstr "" -#: ../../reference/expressions.rst:1297 -msgid "" -"This operation can be customized using the special :meth:`__sub__` method." -msgstr "" - -#: ../../reference/expressions.rst:1303 +#: ../../reference/expressions.rst:1273 msgid "Shifting operations" msgstr "" -#: ../../reference/expressions.rst:1310 +#: ../../reference/expressions.rst:1280 msgid "" "The shifting operations have lower priority than the arithmetic operations:" msgstr "" -#: ../../reference/expressions.rst:1315 +#: ../../reference/expressions.rst:1285 msgid "" "These operators accept integers as arguments. They shift the first argument " "to the left or right by the number of bits given by the second argument." msgstr "" -#: ../../reference/expressions.rst:1318 -msgid "" -"This operation can be customized using the special :meth:`__lshift__` and :" -"meth:`__rshift__` methods." -msgstr "" - -#: ../../reference/expressions.rst:1323 +#: ../../reference/expressions.rst:1290 msgid "" "A right shift by *n* bits is defined as floor division by ``pow(2,n)``. A " "left shift by *n* bits is defined as multiplication with ``pow(2,n)``." msgstr "" -#: ../../reference/expressions.rst:1330 +#: ../../reference/expressions.rst:1297 msgid "Binary bitwise operations" msgstr "" -#: ../../reference/expressions.rst:1334 +#: ../../reference/expressions.rst:1301 msgid "Each of the three bitwise operations has a different priority level:" msgstr "" -#: ../../reference/expressions.rst:1345 +#: ../../reference/expressions.rst:1312 msgid "" "The ``&`` operator yields the bitwise AND of its arguments, which must be " -"integers or one of them must be a custom object overriding :meth:`__and__` " -"or :meth:`__rand__` special methods." +"integers." msgstr "" -#: ../../reference/expressions.rst:1354 +#: ../../reference/expressions.rst:1320 msgid "" "The ``^`` operator yields the bitwise XOR (exclusive OR) of its arguments, " -"which must be integers or one of them must be a custom object overriding :" -"meth:`__xor__` or :meth:`__rxor__` special methods." +"which must be integers." msgstr "" -#: ../../reference/expressions.rst:1363 +#: ../../reference/expressions.rst:1328 msgid "" "The ``|`` operator yields the bitwise (inclusive) OR of its arguments, which " -"must be integers or one of them must be a custom object overriding :meth:" -"`__or__` or :meth:`__ror__` special methods." +"must be integers." msgstr "" -#: ../../reference/expressions.rst:1371 +#: ../../reference/expressions.rst:1335 msgid "Comparisons" msgstr "" -#: ../../reference/expressions.rst:1383 +#: ../../reference/expressions.rst:1347 msgid "" "Unlike C, all comparison operations in Python have the same priority, which " "is lower than that of any arithmetic, shifting or bitwise operation. Also " @@ -1380,14 +1324,11 @@ msgid "" "conventional in mathematics:" msgstr "" -#: ../../reference/expressions.rst:1393 -msgid "" -"Comparisons yield boolean values: ``True`` or ``False``. Custom :dfn:`rich " -"comparison methods` may return non-boolean values. In this case Python will " -"call :func:`bool` on such value in boolean contexts." +#: ../../reference/expressions.rst:1357 +msgid "Comparisons yield boolean values: ``True`` or ``False``." msgstr "" -#: ../../reference/expressions.rst:1399 +#: ../../reference/expressions.rst:1361 msgid "" "Comparisons can be chained arbitrarily, e.g., ``x < y <= z`` is equivalent " "to ``x < y and y <= z``, except that ``y`` is evaluated only once (but in " @@ -1395,7 +1336,7 @@ msgid "" "false)." msgstr "" -#: ../../reference/expressions.rst:1403 +#: ../../reference/expressions.rst:1365 msgid "" "Formally, if *a*, *b*, *c*, ..., *y*, *z* are expressions and *op1*, " "*op2*, ..., *opN* are comparison operators, then ``a op1 b op2 c ... y opN " @@ -1403,24 +1344,24 @@ msgid "" "each expression is evaluated at most once." msgstr "" -#: ../../reference/expressions.rst:1408 +#: ../../reference/expressions.rst:1370 msgid "" "Note that ``a op1 b op2 c`` doesn't imply any kind of comparison between *a* " "and *c*, so that, e.g., ``x < y > z`` is perfectly legal (though perhaps not " "pretty)." msgstr "" -#: ../../reference/expressions.rst:1413 +#: ../../reference/expressions.rst:1375 msgid "Value comparisons" msgstr "" -#: ../../reference/expressions.rst:1415 +#: ../../reference/expressions.rst:1377 msgid "" "The operators ``<``, ``>``, ``==``, ``>=``, ``<=``, and ``!=`` compare the " "values of two objects. The objects do not need to have the same type." msgstr "" -#: ../../reference/expressions.rst:1418 +#: ../../reference/expressions.rst:1380 msgid "" "Chapter :ref:`objects` states that objects have a value (in addition to type " "and identity). The value of an object is a rather abstract notion in " @@ -1432,7 +1373,7 @@ msgid "" "indirectly, by means of their comparison implementation." msgstr "" -#: ../../reference/expressions.rst:1427 +#: ../../reference/expressions.rst:1389 msgid "" "Because all types are (direct or indirect) subtypes of :class:`object`, they " "inherit the default comparison behavior from :class:`object`. Types can " @@ -1440,7 +1381,7 @@ msgid "" "methods` like :meth:`__lt__`, described in :ref:`customization`." msgstr "" -#: ../../reference/expressions.rst:1433 +#: ../../reference/expressions.rst:1395 msgid "" "The default behavior for equality comparison (``==`` and ``!=``) is based on " "the identity of the objects. Hence, equality comparison of instances with " @@ -1450,14 +1391,14 @@ msgid "" "``x is y`` implies ``x == y``)." msgstr "" -#: ../../reference/expressions.rst:1440 +#: ../../reference/expressions.rst:1402 msgid "" "A default order comparison (``<``, ``>``, ``<=``, and ``>=``) is not " "provided; an attempt raises :exc:`TypeError`. A motivation for this default " "behavior is the lack of a similar invariant as for equality." msgstr "" -#: ../../reference/expressions.rst:1444 +#: ../../reference/expressions.rst:1406 msgid "" "The behavior of the default equality comparison, that instances with " "different identities are always unequal, may be in contrast to what types " @@ -1466,13 +1407,13 @@ msgid "" "in fact, a number of built-in types have done that." msgstr "" -#: ../../reference/expressions.rst:1450 +#: ../../reference/expressions.rst:1412 msgid "" "The following list describes the comparison behavior of the most important " "built-in types." msgstr "" -#: ../../reference/expressions.rst:1453 +#: ../../reference/expressions.rst:1415 msgid "" "Numbers of built-in numeric types (:ref:`typesnumeric`) and of the standard " "library types :class:`fractions.Fraction` and :class:`decimal.Decimal` can " @@ -1482,7 +1423,7 @@ msgid "" "of precision." msgstr "" -#: ../../reference/expressions.rst:1460 +#: ../../reference/expressions.rst:1422 msgid "" "The not-a-number values ``float('NaN')`` and ``decimal.Decimal('NaN')`` are " "special. Any ordered comparison of a number to a not-a-number value is " @@ -1492,32 +1433,32 @@ msgid "" "is compliant with IEEE 754." msgstr "" -#: ../../reference/expressions.rst:1467 +#: ../../reference/expressions.rst:1429 msgid "" "``None`` and ``NotImplemented`` are singletons. :PEP:`8` advises that " "comparisons for singletons should always be done with ``is`` or ``is not``, " "never the equality operators." msgstr "" -#: ../../reference/expressions.rst:1471 +#: ../../reference/expressions.rst:1433 msgid "" "Binary sequences (instances of :class:`bytes` or :class:`bytearray`) can be " "compared within and across their types. They compare lexicographically " "using the numeric values of their elements." msgstr "" -#: ../../reference/expressions.rst:1475 +#: ../../reference/expressions.rst:1437 msgid "" "Strings (instances of :class:`str`) compare lexicographically using the " "numerical Unicode code points (the result of the built-in function :func:" "`ord`) of their characters. [#]_" msgstr "" -#: ../../reference/expressions.rst:1479 +#: ../../reference/expressions.rst:1441 msgid "Strings and binary sequences cannot be directly compared." msgstr "" -#: ../../reference/expressions.rst:1481 +#: ../../reference/expressions.rst:1443 msgid "" "Sequences (instances of :class:`tuple`, :class:`list`, or :class:`range`) " "can be compared only within each of their types, with the restriction that " @@ -1526,7 +1467,7 @@ msgid "" "raises :exc:`TypeError`." msgstr "" -#: ../../reference/expressions.rst:1487 +#: ../../reference/expressions.rst:1449 msgid "" "Sequences compare lexicographically using comparison of corresponding " "elements. The built-in containers typically assume identical objects are " @@ -1534,19 +1475,19 @@ msgid "" "objects to improve performance and to maintain their internal invariants." msgstr "" -#: ../../reference/expressions.rst:1492 +#: ../../reference/expressions.rst:1454 msgid "" "Lexicographical comparison between built-in collections works as follows:" msgstr "" -#: ../../reference/expressions.rst:1494 +#: ../../reference/expressions.rst:1456 msgid "" "For two collections to compare equal, they must be of the same type, have " "the same length, and each pair of corresponding elements must compare equal " "(for example, ``[1,2] == (1,2)`` is false because the type is not the same)." msgstr "" -#: ../../reference/expressions.rst:1499 +#: ../../reference/expressions.rst:1461 msgid "" "Collections that support order comparison are ordered the same as their " "first unequal elements (for example, ``[1,2,x] <= [1,2,y]`` has the same " @@ -1555,25 +1496,25 @@ msgid "" "true)." msgstr "" -#: ../../reference/expressions.rst:1505 +#: ../../reference/expressions.rst:1467 msgid "" "Mappings (instances of :class:`dict`) compare equal if and only if they have " "equal `(key, value)` pairs. Equality comparison of the keys and values " "enforces reflexivity." msgstr "" -#: ../../reference/expressions.rst:1509 +#: ../../reference/expressions.rst:1471 msgid "" "Order comparisons (``<``, ``>``, ``<=``, and ``>=``) raise :exc:`TypeError`." msgstr "" -#: ../../reference/expressions.rst:1511 +#: ../../reference/expressions.rst:1473 msgid "" "Sets (instances of :class:`set` or :class:`frozenset`) can be compared " "within and across their types." msgstr "" -#: ../../reference/expressions.rst:1514 +#: ../../reference/expressions.rst:1476 msgid "" "They define order comparison operators to mean subset and superset tests. " "Those relations do not define total orderings (for example, the two sets " @@ -1584,110 +1525,110 @@ msgid "" "sets as inputs)." msgstr "" -#: ../../reference/expressions.rst:1522 +#: ../../reference/expressions.rst:1484 msgid "Comparison of sets enforces reflexivity of its elements." msgstr "" -#: ../../reference/expressions.rst:1524 +#: ../../reference/expressions.rst:1486 msgid "" "Most other built-in types have no comparison methods implemented, so they " "inherit the default comparison behavior." msgstr "" -#: ../../reference/expressions.rst:1527 +#: ../../reference/expressions.rst:1489 msgid "" "User-defined classes that customize their comparison behavior should follow " "some consistency rules, if possible:" msgstr "" -#: ../../reference/expressions.rst:1530 +#: ../../reference/expressions.rst:1492 msgid "" "Equality comparison should be reflexive. In other words, identical objects " "should compare equal:" msgstr "" -#: ../../reference/expressions.rst:1533 +#: ../../reference/expressions.rst:1495 msgid "``x is y`` implies ``x == y``" msgstr "" -#: ../../reference/expressions.rst:1535 +#: ../../reference/expressions.rst:1497 msgid "" "Comparison should be symmetric. In other words, the following expressions " "should have the same result:" msgstr "" -#: ../../reference/expressions.rst:1538 +#: ../../reference/expressions.rst:1500 msgid "``x == y`` and ``y == x``" msgstr "" -#: ../../reference/expressions.rst:1540 +#: ../../reference/expressions.rst:1502 msgid "``x != y`` and ``y != x``" msgstr "" -#: ../../reference/expressions.rst:1542 +#: ../../reference/expressions.rst:1504 msgid "``x < y`` and ``y > x``" msgstr "" -#: ../../reference/expressions.rst:1544 +#: ../../reference/expressions.rst:1506 msgid "``x <= y`` and ``y >= x``" msgstr "" -#: ../../reference/expressions.rst:1546 +#: ../../reference/expressions.rst:1508 msgid "" "Comparison should be transitive. The following (non-exhaustive) examples " "illustrate that:" msgstr "" -#: ../../reference/expressions.rst:1549 +#: ../../reference/expressions.rst:1511 msgid "``x > y and y > z`` implies ``x > z``" msgstr "" -#: ../../reference/expressions.rst:1551 +#: ../../reference/expressions.rst:1513 msgid "``x < y and y <= z`` implies ``x < z``" msgstr "" -#: ../../reference/expressions.rst:1553 +#: ../../reference/expressions.rst:1515 msgid "" "Inverse comparison should result in the boolean negation. In other words, " "the following expressions should have the same result:" msgstr "" -#: ../../reference/expressions.rst:1556 +#: ../../reference/expressions.rst:1518 msgid "``x == y`` and ``not x != y``" msgstr "" -#: ../../reference/expressions.rst:1558 +#: ../../reference/expressions.rst:1520 msgid "``x < y`` and ``not x >= y`` (for total ordering)" msgstr "" -#: ../../reference/expressions.rst:1560 +#: ../../reference/expressions.rst:1522 msgid "``x > y`` and ``not x <= y`` (for total ordering)" msgstr "" -#: ../../reference/expressions.rst:1562 +#: ../../reference/expressions.rst:1524 msgid "" "The last two expressions apply to totally ordered collections (e.g. to " "sequences, but not to sets or mappings). See also the :func:`~functools." "total_ordering` decorator." msgstr "" -#: ../../reference/expressions.rst:1566 +#: ../../reference/expressions.rst:1528 msgid "" "The :func:`hash` result should be consistent with equality. Objects that are " "equal should either have the same hash value, or be marked as unhashable." msgstr "" -#: ../../reference/expressions.rst:1570 +#: ../../reference/expressions.rst:1532 msgid "" "Python does not enforce these consistency rules. In fact, the not-a-number " "values are an example for not following these rules." msgstr "" -#: ../../reference/expressions.rst:1579 +#: ../../reference/expressions.rst:1541 msgid "Membership test operations" msgstr "" -#: ../../reference/expressions.rst:1581 +#: ../../reference/expressions.rst:1543 msgid "" "The operators :keyword:`in` and :keyword:`not in` test for membership. ``x " "in s`` evaluates to ``True`` if *x* is a member of *s*, and ``False`` " @@ -1698,7 +1639,7 @@ msgid "" "expression ``x in y`` is equivalent to ``any(x is e or x == e for e in y)``." msgstr "" -#: ../../reference/expressions.rst:1589 +#: ../../reference/expressions.rst:1551 msgid "" "For the string and bytes types, ``x in y`` is ``True`` if and only if *x* is " "a substring of *y*. An equivalent test is ``y.find(x) != -1``. Empty " @@ -1706,14 +1647,14 @@ msgid "" "\"\" in \"abc\"`` will return ``True``." msgstr "" -#: ../../reference/expressions.rst:1594 +#: ../../reference/expressions.rst:1556 msgid "" "For user-defined classes which define the :meth:`__contains__` method, ``x " "in y`` returns ``True`` if ``y.__contains__(x)`` returns a true value, and " "``False`` otherwise." msgstr "" -#: ../../reference/expressions.rst:1598 +#: ../../reference/expressions.rst:1560 msgid "" "For user-defined classes which do not define :meth:`__contains__` but do " "define :meth:`__iter__`, ``x in y`` is ``True`` if some value ``z``, for " @@ -1722,7 +1663,7 @@ msgid "" "as if :keyword:`in` raised that exception." msgstr "" -#: ../../reference/expressions.rst:1604 +#: ../../reference/expressions.rst:1566 msgid "" "Lastly, the old-style iteration protocol is tried: if a class defines :meth:" "`__getitem__`, ``x in y`` is ``True`` if and only if there is a non-negative " @@ -1731,17 +1672,17 @@ msgid "" "raised, it is as if :keyword:`in` raised that exception)." msgstr "" -#: ../../reference/expressions.rst:1616 +#: ../../reference/expressions.rst:1578 msgid "" "The operator :keyword:`not in` is defined to have the inverse truth value " "of :keyword:`in`." msgstr "" -#: ../../reference/expressions.rst:1629 +#: ../../reference/expressions.rst:1591 msgid "Identity comparisons" msgstr "" -#: ../../reference/expressions.rst:1631 +#: ../../reference/expressions.rst:1593 msgid "" "The operators :keyword:`is` and :keyword:`is not` test for an object's " "identity: ``x is y`` is true if and only if *x* and *y* are the same " @@ -1749,11 +1690,11 @@ msgid "" "``x is not y`` yields the inverse truth value. [#]_" msgstr "" -#: ../../reference/expressions.rst:1643 +#: ../../reference/expressions.rst:1605 msgid "Boolean operations" msgstr "" -#: ../../reference/expressions.rst:1654 +#: ../../reference/expressions.rst:1616 msgid "" "In the context of Boolean operations, and also when expressions are used by " "control flow statements, the following values are interpreted as false: " @@ -1764,25 +1705,25 @@ msgid "" "method." msgstr "" -#: ../../reference/expressions.rst:1663 +#: ../../reference/expressions.rst:1625 msgid "" "The operator :keyword:`not` yields ``True`` if its argument is false, " "``False`` otherwise." msgstr "" -#: ../../reference/expressions.rst:1668 +#: ../../reference/expressions.rst:1630 msgid "" "The expression ``x and y`` first evaluates *x*; if *x* is false, its value " "is returned; otherwise, *y* is evaluated and the resulting value is returned." msgstr "" -#: ../../reference/expressions.rst:1673 +#: ../../reference/expressions.rst:1635 msgid "" "The expression ``x or y`` first evaluates *x*; if *x* is true, its value is " "returned; otherwise, *y* is evaluated and the resulting value is returned." msgstr "" -#: ../../reference/expressions.rst:1676 +#: ../../reference/expressions.rst:1638 msgid "" "Note that neither :keyword:`and` nor :keyword:`or` restrict the value and " "type they return to ``False`` and ``True``, but rather return the last " @@ -1793,55 +1734,40 @@ msgid "" "argument (for example, ``not 'foo'`` produces ``False`` rather than ``''``.)" msgstr "" -#: ../../reference/expressions.rst:1686 +#: ../../reference/expressions.rst:1648 msgid "Assignment expressions" msgstr "" -#: ../../reference/expressions.rst:1691 -msgid "" -"An assignment expression (sometimes also called a \"named expression\" or " -"\"walrus\") assigns an :token:`expression` to an :token:`identifier`, while " -"also returning the value of the :token:`expression`." -msgstr "" - -#: ../../reference/expressions.rst:1695 -msgid "One common use case is when handling matched regular expressions:" -msgstr "" - -#: ../../reference/expressions.rst:1702 -msgid "Or, when processing a file stream in chunks:" -msgstr "" - -#: ../../reference/expressions.rst:1709 +#: ../../reference/expressions.rst:1655 msgid "See :pep:`572` for more details about assignment expressions." msgstr "" -#: ../../reference/expressions.rst:1716 +#: ../../reference/expressions.rst:1661 msgid "Conditional expressions" msgstr "" -#: ../../reference/expressions.rst:1728 +#: ../../reference/expressions.rst:1674 msgid "" "Conditional expressions (sometimes called a \"ternary operator\") have the " "lowest priority of all Python operations." msgstr "" -#: ../../reference/expressions.rst:1731 +#: ../../reference/expressions.rst:1677 msgid "" "The expression ``x if C else y`` first evaluates the condition, *C* rather " "than *x*. If *C* is true, *x* is evaluated and its value is returned; " "otherwise, *y* is evaluated and its value is returned." msgstr "" -#: ../../reference/expressions.rst:1735 +#: ../../reference/expressions.rst:1681 msgid "See :pep:`308` for more details about conditional expressions." msgstr "" -#: ../../reference/expressions.rst:1742 +#: ../../reference/expressions.rst:1688 msgid "Lambdas" msgstr "" -#: ../../reference/expressions.rst:1753 +#: ../../reference/expressions.rst:1700 msgid "" "Lambda expressions (sometimes called lambda forms) are used to create " "anonymous functions. The expression ``lambda parameters: expression`` yields " @@ -1849,25 +1775,25 @@ msgid "" "defined with:" msgstr "" -#: ../../reference/expressions.rst:1762 +#: ../../reference/expressions.rst:1709 msgid "" "See section :ref:`function` for the syntax of parameter lists. Note that " "functions created with lambda expressions cannot contain statements or " "annotations." msgstr "" -#: ../../reference/expressions.rst:1770 +#: ../../reference/expressions.rst:1717 msgid "Expression lists" msgstr "" -#: ../../reference/expressions.rst:1784 +#: ../../reference/expressions.rst:1731 msgid "" "Except when part of a list or set display, an expression list containing at " "least one comma yields a tuple. The length of the tuple is the number of " "expressions in the list. The expressions are evaluated from left to right." msgstr "" -#: ../../reference/expressions.rst:1793 +#: ../../reference/expressions.rst:1740 msgid "" "An asterisk ``*`` denotes :dfn:`iterable unpacking`. Its operand must be " "an :term:`iterable`. The iterable is expanded into a sequence of items, " @@ -1875,12 +1801,12 @@ msgid "" "unpacking." msgstr "" -#: ../../reference/expressions.rst:1798 +#: ../../reference/expressions.rst:1745 msgid "" "Iterable unpacking in expression lists, originally proposed by :pep:`448`." msgstr "" -#: ../../reference/expressions.rst:1803 +#: ../../reference/expressions.rst:1750 msgid "" "The trailing comma is required only to create a single tuple (a.k.a. a " "*singleton*); it is optional in all other cases. A single expression " @@ -1889,206 +1815,206 @@ msgid "" "parentheses: ``()``.)" msgstr "" -#: ../../reference/expressions.rst:1813 +#: ../../reference/expressions.rst:1760 msgid "Evaluation order" msgstr "" -#: ../../reference/expressions.rst:1817 +#: ../../reference/expressions.rst:1764 msgid "" "Python evaluates expressions from left to right. Notice that while " "evaluating an assignment, the right-hand side is evaluated before the left-" "hand side." msgstr "" -#: ../../reference/expressions.rst:1820 +#: ../../reference/expressions.rst:1767 msgid "" "In the following lines, expressions will be evaluated in the arithmetic " "order of their suffixes::" msgstr "" -#: ../../reference/expressions.rst:1834 +#: ../../reference/expressions.rst:1781 msgid "Operator precedence" msgstr "" -#: ../../reference/expressions.rst:1839 +#: ../../reference/expressions.rst:1786 msgid "" "The following table summarizes the operator precedence in Python, from " -"highest precedence (most binding) to lowest precedence (least binding). " +"lowest precedence (least binding) to highest precedence (most binding). " "Operators in the same box have the same precedence. Unless the syntax is " "explicitly given, operators are binary. Operators in the same box group " "left to right (except for exponentiation, which groups from right to left)." msgstr "" -#: ../../reference/expressions.rst:1845 +#: ../../reference/expressions.rst:1792 msgid "" "Note that comparisons, membership tests, and identity tests, all have the " "same precedence and have a left-to-right chaining feature as described in " "the :ref:`comparisons` section." msgstr "" -#: ../../reference/expressions.rst:1851 +#: ../../reference/expressions.rst:1798 msgid "Operator" msgstr "" -#: ../../reference/expressions.rst:1851 +#: ../../reference/expressions.rst:1798 msgid "Description" msgstr "描述" -#: ../../reference/expressions.rst:1853 -msgid "``(expressions...)``," +#: ../../reference/expressions.rst:1800 +msgid "``:=``" msgstr "" -#: ../../reference/expressions.rst:1855 -msgid "``[expressions...]``, ``{key: value...}``, ``{expressions...}``" +#: ../../reference/expressions.rst:1800 +msgid "Assignment expression" msgstr "" -#: ../../reference/expressions.rst:1853 -msgid "" -"Binding or parenthesized expression, list display, dictionary display, set " -"display" +#: ../../reference/expressions.rst:1802 +msgid ":keyword:`lambda`" msgstr "" -#: ../../reference/expressions.rst:1859 -msgid "``x[index]``, ``x[index:index]``, ``x(arguments...)``, ``x.attribute``" +#: ../../reference/expressions.rst:1802 +msgid "Lambda expression" msgstr "" -#: ../../reference/expressions.rst:1859 -msgid "Subscription, slicing, call, attribute reference" +#: ../../reference/expressions.rst:1804 +msgid ":keyword:`if ` -- :keyword:`!else`" msgstr "" -#: ../../reference/expressions.rst:1862 -msgid ":keyword:`await` ``x``" +#: ../../reference/expressions.rst:1804 +msgid "Conditional expression" msgstr "" -#: ../../reference/expressions.rst:1864 -msgid "``**``" +#: ../../reference/expressions.rst:1806 +msgid ":keyword:`or`" msgstr "" -#: ../../reference/expressions.rst:1864 -msgid "Exponentiation [#]_" +#: ../../reference/expressions.rst:1806 +msgid "Boolean OR" msgstr "" -#: ../../reference/expressions.rst:1866 -msgid "``+x``, ``-x``, ``~x``" +#: ../../reference/expressions.rst:1808 +msgid ":keyword:`and`" msgstr "" -#: ../../reference/expressions.rst:1866 -msgid "Positive, negative, bitwise NOT" +#: ../../reference/expressions.rst:1808 +msgid "Boolean AND" msgstr "" -#: ../../reference/expressions.rst:1868 -msgid "``*``, ``@``, ``/``, ``//``, ``%``" +#: ../../reference/expressions.rst:1810 +msgid ":keyword:`not` ``x``" msgstr "" -#: ../../reference/expressions.rst:1868 -msgid "" -"Multiplication, matrix multiplication, division, floor division, remainder " -"[#]_" +#: ../../reference/expressions.rst:1810 +msgid "Boolean NOT" msgstr "" -#: ../../reference/expressions.rst:1872 -msgid "``+``, ``-``" +#: ../../reference/expressions.rst:1812 +msgid "" +":keyword:`in`, :keyword:`not in`, :keyword:`is`, :keyword:`is not`, ``<``, " +"``<=``, ``>``, ``>=``, ``!=``, ``==``" msgstr "" -#: ../../reference/expressions.rst:1872 -msgid "Addition and subtraction" +#: ../../reference/expressions.rst:1812 +msgid "Comparisons, including membership tests and identity tests" msgstr "" -#: ../../reference/expressions.rst:1874 -msgid "``<<``, ``>>``" +#: ../../reference/expressions.rst:1816 +msgid "``|``" msgstr "" -#: ../../reference/expressions.rst:1874 -msgid "Shifts" +#: ../../reference/expressions.rst:1816 +msgid "Bitwise OR" msgstr "" -#: ../../reference/expressions.rst:1876 -msgid "``&``" +#: ../../reference/expressions.rst:1818 +msgid "``^``" msgstr "" -#: ../../reference/expressions.rst:1876 -msgid "Bitwise AND" +#: ../../reference/expressions.rst:1818 +msgid "Bitwise XOR" msgstr "" -#: ../../reference/expressions.rst:1878 -msgid "``^``" +#: ../../reference/expressions.rst:1820 +msgid "``&``" msgstr "" -#: ../../reference/expressions.rst:1878 -msgid "Bitwise XOR" +#: ../../reference/expressions.rst:1820 +msgid "Bitwise AND" msgstr "" -#: ../../reference/expressions.rst:1880 -msgid "``|``" +#: ../../reference/expressions.rst:1822 +msgid "``<<``, ``>>``" msgstr "" -#: ../../reference/expressions.rst:1880 -msgid "Bitwise OR" +#: ../../reference/expressions.rst:1822 +msgid "Shifts" msgstr "" -#: ../../reference/expressions.rst:1882 -msgid "" -":keyword:`in`, :keyword:`not in`, :keyword:`is`, :keyword:`is not`, ``<``, " -"``<=``, ``>``, ``>=``, ``!=``, ``==``" +#: ../../reference/expressions.rst:1824 +msgid "``+``, ``-``" msgstr "" -#: ../../reference/expressions.rst:1882 -msgid "Comparisons, including membership tests and identity tests" +#: ../../reference/expressions.rst:1824 +msgid "Addition and subtraction" msgstr "" -#: ../../reference/expressions.rst:1886 -msgid ":keyword:`not` ``x``" +#: ../../reference/expressions.rst:1826 +msgid "``*``, ``@``, ``/``, ``//``, ``%``" msgstr "" -#: ../../reference/expressions.rst:1886 -msgid "Boolean NOT" +#: ../../reference/expressions.rst:1826 +msgid "" +"Multiplication, matrix multiplication, division, floor division, remainder " +"[#]_" msgstr "" -#: ../../reference/expressions.rst:1888 -msgid ":keyword:`and`" +#: ../../reference/expressions.rst:1830 +msgid "``+x``, ``-x``, ``~x``" msgstr "" -#: ../../reference/expressions.rst:1888 -msgid "Boolean AND" +#: ../../reference/expressions.rst:1830 +msgid "Positive, negative, bitwise NOT" msgstr "" -#: ../../reference/expressions.rst:1890 -msgid ":keyword:`or`" +#: ../../reference/expressions.rst:1832 +msgid "``**``" msgstr "" -#: ../../reference/expressions.rst:1890 -msgid "Boolean OR" +#: ../../reference/expressions.rst:1832 +msgid "Exponentiation [#]_" msgstr "" -#: ../../reference/expressions.rst:1892 -msgid ":keyword:`if ` -- :keyword:`!else`" +#: ../../reference/expressions.rst:1834 +msgid ":keyword:`await` ``x``" msgstr "" -#: ../../reference/expressions.rst:1892 -msgid "Conditional expression" +#: ../../reference/expressions.rst:1836 +msgid "``x[index]``, ``x[index:index]``, ``x(arguments...)``, ``x.attribute``" msgstr "" -#: ../../reference/expressions.rst:1894 -msgid ":keyword:`lambda`" +#: ../../reference/expressions.rst:1836 +msgid "Subscription, slicing, call, attribute reference" msgstr "" -#: ../../reference/expressions.rst:1894 -msgid "Lambda expression" +#: ../../reference/expressions.rst:1839 +msgid "``(expressions...)``," msgstr "" -#: ../../reference/expressions.rst:1896 -msgid "``:=``" +#: ../../reference/expressions.rst:1841 +msgid "``[expressions...]``, ``{key: value...}``, ``{expressions...}``" msgstr "" -#: ../../reference/expressions.rst:1896 -msgid "Assignment expression" +#: ../../reference/expressions.rst:1839 +msgid "" +"Binding or parenthesized expression, list display, dictionary display, set " +"display" msgstr "" -#: ../../reference/expressions.rst:1901 +#: ../../reference/expressions.rst:1848 msgid "Footnotes" msgstr "註解" -#: ../../reference/expressions.rst:1902 +#: ../../reference/expressions.rst:1849 msgid "" "While ``abs(x%y) < abs(y)`` is true mathematically, for floats it may not be " "true numerically due to roundoff. For example, and assuming a platform on " @@ -2100,7 +2026,7 @@ msgid "" "approach is more appropriate depends on the application." msgstr "" -#: ../../reference/expressions.rst:1911 +#: ../../reference/expressions.rst:1858 msgid "" "If x is very close to an exact integer multiple of y, it's possible for ``x//" "y`` to be one larger than ``(x-x%y)//y`` due to rounding. In such cases, " @@ -2108,7 +2034,7 @@ msgid "" "* y + x % y`` be very close to ``x``." msgstr "" -#: ../../reference/expressions.rst:1916 +#: ../../reference/expressions.rst:1863 msgid "" "The Unicode standard distinguishes between :dfn:`code points` (e.g. U+0041) " "and :dfn:`abstract characters` (e.g. \"LATIN CAPITAL LETTER A\"). While most " @@ -2122,7 +2048,7 @@ msgid "" "(COMBINING CEDILLA)." msgstr "" -#: ../../reference/expressions.rst:1927 +#: ../../reference/expressions.rst:1874 msgid "" "The comparison operators on strings compare at the level of Unicode code " "points. This may be counter-intuitive to humans. For example, ``\"\\u00C7\" " @@ -2130,13 +2056,13 @@ msgid "" "same abstract character \"LATIN CAPITAL LETTER C WITH CEDILLA\"." msgstr "" -#: ../../reference/expressions.rst:1932 +#: ../../reference/expressions.rst:1879 msgid "" "To compare strings at the level of abstract characters (that is, in a way " "intuitive to humans), use :func:`unicodedata.normalize`." msgstr "" -#: ../../reference/expressions.rst:1935 +#: ../../reference/expressions.rst:1882 msgid "" "Due to automatic garbage-collection, free lists, and the dynamic nature of " "descriptors, you may notice seemingly unusual behaviour in certain uses of " @@ -2144,14 +2070,14 @@ msgid "" "instance methods, or constants. Check their documentation for more info." msgstr "" -#: ../../reference/expressions.rst:1940 +#: ../../reference/expressions.rst:1887 msgid "" -"The power operator ``**`` binds less tightly than an arithmetic or bitwise " -"unary operator on its right, that is, ``2**-1`` is ``0.5``." +"The ``%`` operator is also used for string formatting; the same precedence " +"applies." msgstr "" -#: ../../reference/expressions.rst:1943 +#: ../../reference/expressions.rst:1890 msgid "" -"The ``%`` operator is also used for string formatting; the same precedence " -"applies." +"The power operator ``**`` binds less tightly than an arithmetic or bitwise " +"unary operator on its right, that is, ``2**-1`` is ``0.5``." msgstr "" diff --git a/reference/grammar.po b/reference/grammar.po index 5bf2342a28..7d465f2515 100644 --- a/reference/grammar.po +++ b/reference/grammar.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.7\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2021-09-07 06:52+0000\n" +"POT-Creation-Date: 2018-06-26 18:54+0800\n" "PO-Revision-Date: 2017-09-22 18:27+0000\n" "Last-Translator: Leon H.\n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -25,18 +25,6 @@ msgstr "完整的語法規格書" #: ../../reference/grammar.rst:4 msgid "" -"This is the full Python grammar, derived directly from the grammar used to " -"generate the CPython parser (see :source:`Grammar/python.gram`). The version " -"here omits details related to code generation and error recovery." -msgstr "" - -#: ../../reference/grammar.rst:9 -msgid "" -"The notation is a mixture of `EBNF `_ and `PEG `_. In particular, ``&`` followed by a symbol, " -"token or parenthesized group indicates a positive lookahead (i.e., is " -"required to match but not consumed), while ``!`` indicates a negative " -"lookahead (i.e., is required _not_ to match). We use the ``|`` separator to " -"mean PEG's \"ordered choice\" (written as ``/`` in traditional PEG grammars)." +"This is the full Python grammar, as it is read by the parser generator and " +"used to parse Python source files:" msgstr "" diff --git a/reference/import.po b/reference/import.po index 30db661974..c4dcddbdeb 100644 --- a/reference/import.po +++ b/reference/import.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.7\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2021-09-07 06:52+0000\n" +"POT-Creation-Date: 2020-06-20 18:08+0800\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-" @@ -869,7 +869,7 @@ msgstr "" #: ../../reference/import.rst:683 msgid "" -"Before Python loads cached bytecode from a ``.pyc`` file, it checks whether " +"Before Python loads cached bytecode from ``.pyc`` file, it checks whether " "the cache is up-to-date with the source ``.py`` file. By default, Python " "does this by storing the source's last-modified timestamp and size in the " "cache file when writing it. At runtime, the import system then validates the " @@ -1102,11 +1102,11 @@ msgstr "" #: ../../reference/import.rst:859 msgid "" "To indicate to the import machinery that the spec represents a namespace :" -"term:`portion`, the path entry finder sets \"submodule_search_locations\" to " -"a list containing the portion." +"term:`portion`, the path entry finder sets \"loader\" on the spec to " +"``None`` and \"submodule_search_locations\" to a list containing the portion." msgstr "" -#: ../../reference/import.rst:863 +#: ../../reference/import.rst:864 msgid "" ":meth:`~importlib.abc.PathEntryFinder.find_spec` replaced :meth:`~importlib." "abc.PathEntryFinder.find_loader` and :meth:`~importlib.abc.PathEntryFinder." @@ -1114,7 +1114,7 @@ msgid "" "``find_spec()`` is not defined." msgstr "" -#: ../../reference/import.rst:869 +#: ../../reference/import.rst:870 msgid "" "Older path entry finders may implement one of these two deprecated methods " "instead of ``find_spec()``. The methods are still respected for the sake of " @@ -1122,15 +1122,29 @@ msgid "" "path entry finder, the legacy methods are ignored." msgstr "" -#: ../../reference/import.rst:874 +#: ../../reference/import.rst:875 msgid "" ":meth:`~importlib.abc.PathEntryFinder.find_loader` takes one argument, the " "fully qualified name of the module being imported. ``find_loader()`` " "returns a 2-tuple where the first item is the loader and the second item is " -"a namespace :term:`portion`." +"a namespace :term:`portion`. When the first item (i.e. the loader) is " +"``None``, this means that while the path entry finder does not have a loader " +"for the named module, it knows that the path entry contributes to a " +"namespace portion for the named module. This will almost always be the case " +"where Python is asked to import a namespace package that has no physical " +"presence on the file system. When a path entry finder returns ``None`` for " +"the loader, the second item of the 2-tuple return value must be a sequence, " +"although it can be empty." msgstr "" -#: ../../reference/import.rst:879 +#: ../../reference/import.rst:887 +msgid "" +"If ``find_loader()`` returns a non-``None`` loader value, the portion is " +"ignored and the loader is returned from the path based finder, terminating " +"the search through the path entries." +msgstr "" + +#: ../../reference/import.rst:891 msgid "" "For backwards compatibility with other implementations of the import " "protocol, many path entry finders also support the same, traditional " @@ -1140,7 +1154,7 @@ msgid "" "initial call to the path hook)." msgstr "" -#: ../../reference/import.rst:886 +#: ../../reference/import.rst:898 msgid "" "The ``find_module()`` method on path entry finders is deprecated, as it does " "not allow the path entry finder to contribute portions to namespace " @@ -1149,18 +1163,18 @@ msgid "" "preference to ``find_module()``." msgstr "" -#: ../../reference/import.rst:894 +#: ../../reference/import.rst:906 msgid "Replacing the standard import system" msgstr "" -#: ../../reference/import.rst:896 +#: ../../reference/import.rst:908 msgid "" "The most reliable mechanism for replacing the entire import system is to " "delete the default contents of :data:`sys.meta_path`, replacing them " "entirely with a custom meta path hook." msgstr "" -#: ../../reference/import.rst:900 +#: ../../reference/import.rst:912 msgid "" "If it is acceptable to only alter the behaviour of import statements without " "affecting other APIs that access the import system, then replacing the " @@ -1169,7 +1183,7 @@ msgid "" "statements within that module." msgstr "" -#: ../../reference/import.rst:906 +#: ../../reference/import.rst:918 msgid "" "To selectively prevent the import of some modules from a hook early on the " "meta path (rather than disabling the standard import system entirely), it is " @@ -1179,11 +1193,11 @@ msgid "" "exception terminates it immediately." msgstr "" -#: ../../reference/import.rst:916 +#: ../../reference/import.rst:928 msgid "Package Relative Imports" msgstr "" -#: ../../reference/import.rst:918 +#: ../../reference/import.rst:930 msgid "" "Relative imports use leading dots. A single leading dot indicates a relative " "import, starting with the current package. Two or more leading dots indicate " @@ -1191,30 +1205,30 @@ msgid "" "after the first. For example, given the following package layout::" msgstr "" -#: ../../reference/import.rst:934 +#: ../../reference/import.rst:946 msgid "" "In either ``subpackage1/moduleX.py`` or ``subpackage1/__init__.py``, the " "following are valid relative imports::" msgstr "" -#: ../../reference/import.rst:944 +#: ../../reference/import.rst:956 msgid "" "Absolute imports may use either the ``import <>`` or ``from <> import <>`` " "syntax, but relative imports may only use the second form; the reason for " "this is that::" msgstr "" -#: ../../reference/import.rst:950 +#: ../../reference/import.rst:962 msgid "" "should expose ``XXX.YYY.ZZZ`` as a usable expression, but .moduleY is not a " "valid expression." msgstr "" -#: ../../reference/import.rst:955 +#: ../../reference/import.rst:967 msgid "Special considerations for __main__" msgstr "" -#: ../../reference/import.rst:957 +#: ../../reference/import.rst:969 msgid "" "The :mod:`__main__` module is a special case relative to Python's import " "system. As noted :ref:`elsewhere `, the ``__main__`` module is " @@ -1225,17 +1239,17 @@ msgid "" "interpreter is invoked." msgstr "" -#: ../../reference/import.rst:968 +#: ../../reference/import.rst:980 msgid "__main__.__spec__" msgstr "" -#: ../../reference/import.rst:970 +#: ../../reference/import.rst:982 msgid "" "Depending on how :mod:`__main__` is initialized, ``__main__.__spec__`` gets " "set appropriately or to ``None``." msgstr "" -#: ../../reference/import.rst:973 +#: ../../reference/import.rst:985 msgid "" "When Python is started with the :option:`-m` option, ``__spec__`` is set to " "the module spec of the corresponding module or package. ``__spec__`` is also " @@ -1243,30 +1257,30 @@ msgid "" "directory, zipfile or other :data:`sys.path` entry." msgstr "" -#: ../../reference/import.rst:978 +#: ../../reference/import.rst:990 msgid "" "In :ref:`the remaining cases ` ``__main__." "__spec__`` is set to ``None``, as the code used to populate the :mod:" "`__main__` does not correspond directly with an importable module:" msgstr "" -#: ../../reference/import.rst:982 +#: ../../reference/import.rst:994 msgid "interactive prompt" msgstr "" -#: ../../reference/import.rst:983 +#: ../../reference/import.rst:995 msgid ":option:`-c` option" msgstr "" -#: ../../reference/import.rst:984 +#: ../../reference/import.rst:996 msgid "running from stdin" msgstr "" -#: ../../reference/import.rst:985 +#: ../../reference/import.rst:997 msgid "running directly from a source or bytecode file" msgstr "" -#: ../../reference/import.rst:987 +#: ../../reference/import.rst:999 msgid "" "Note that ``__main__.__spec__`` is always ``None`` in the last case, *even " "if* the file could technically be imported directly as a module instead. Use " @@ -1274,7 +1288,7 @@ msgid "" "`__main__`." msgstr "" -#: ../../reference/import.rst:992 +#: ../../reference/import.rst:1004 msgid "" "Note also that even when ``__main__`` corresponds with an importable module " "and ``__main__.__spec__`` is set accordingly, they're still considered " @@ -1283,44 +1297,44 @@ msgid "" "populate the ``__main__`` namespace, and not during normal import." msgstr "" -#: ../../reference/import.rst:1000 +#: ../../reference/import.rst:1012 msgid "Open issues" msgstr "" -#: ../../reference/import.rst:1002 +#: ../../reference/import.rst:1014 msgid "XXX It would be really nice to have a diagram." msgstr "" -#: ../../reference/import.rst:1004 +#: ../../reference/import.rst:1016 msgid "" "XXX * (import_machinery.rst) how about a section devoted just to the " "attributes of modules and packages, perhaps expanding upon or supplanting " "the related entries in the data model reference page?" msgstr "" -#: ../../reference/import.rst:1008 +#: ../../reference/import.rst:1020 msgid "" "XXX runpy, pkgutil, et al in the library manual should all get \"See Also\" " "links at the top pointing to the new import system section." msgstr "" -#: ../../reference/import.rst:1011 +#: ../../reference/import.rst:1023 msgid "" "XXX Add more explanation regarding the different ways in which ``__main__`` " "is initialized?" msgstr "" -#: ../../reference/import.rst:1014 +#: ../../reference/import.rst:1026 msgid "" "XXX Add more info on ``__main__`` quirks/pitfalls (i.e. copy from :pep:" "`395`)." msgstr "" -#: ../../reference/import.rst:1019 +#: ../../reference/import.rst:1031 msgid "References" msgstr "" -#: ../../reference/import.rst:1021 +#: ../../reference/import.rst:1033 msgid "" "The import machinery has evolved considerably since Python's early days. " "The original `specification for packages ` for " "Python 3.3. :pep:`420` also introduced the :meth:`find_loader` protocol as " "an alternative to :meth:`find_module`." msgstr "" -#: ../../reference/import.rst:1033 +#: ../../reference/import.rst:1045 msgid "" ":pep:`366` describes the addition of the ``__package__`` attribute for " "explicit relative imports in main modules." msgstr "" -#: ../../reference/import.rst:1036 +#: ../../reference/import.rst:1048 msgid "" ":pep:`328` introduced absolute and explicit relative imports and initially " "proposed ``__name__`` for semantics :pep:`366` would eventually specify for " "``__package__``." msgstr "" -#: ../../reference/import.rst:1040 +#: ../../reference/import.rst:1052 msgid ":pep:`338` defines executing modules as scripts." msgstr "" -#: ../../reference/import.rst:1042 +#: ../../reference/import.rst:1054 msgid "" ":pep:`451` adds the encapsulation of per-module import state in spec " "objects. It also off-loads most of the boilerplate responsibilities of " @@ -1367,15 +1381,15 @@ msgid "" "finders and loaders." msgstr "" -#: ../../reference/import.rst:1049 +#: ../../reference/import.rst:1061 msgid "Footnotes" msgstr "註解" -#: ../../reference/import.rst:1050 +#: ../../reference/import.rst:1062 msgid "See :class:`types.ModuleType`." msgstr "" -#: ../../reference/import.rst:1052 +#: ../../reference/import.rst:1064 msgid "" "The importlib implementation avoids using the return value directly. " "Instead, it gets the module object by looking the module name up in :data:" @@ -1384,7 +1398,7 @@ msgid "" "behavior that is not guaranteed to work in other Python implementations." msgstr "" -#: ../../reference/import.rst:1059 +#: ../../reference/import.rst:1071 msgid "" "In legacy code, it is possible to find instances of :class:`imp." "NullImporter` in the :data:`sys.path_importer_cache`. It is recommended " diff --git a/reference/lexical_analysis.po b/reference/lexical_analysis.po index cf15d1312f..7b6edf8d9c 100644 --- a/reference/lexical_analysis.po +++ b/reference/lexical_analysis.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.7\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2021-09-07 06:52+0000\n" +"POT-Creation-Date: 2020-06-20 18:08+0800\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-" @@ -810,11 +810,11 @@ msgid "" "with plain string literals." msgstr "" -#: ../../reference/lexical_analysis.rst:648 +#: ../../reference/lexical_analysis.rst:646 msgid "Formatted string literals" msgstr "" -#: ../../reference/lexical_analysis.rst:652 +#: ../../reference/lexical_analysis.rst:650 msgid "" "A :dfn:`formatted string literal` or :dfn:`f-string` is a string literal " "that is prefixed with ``'f'`` or ``'F'``. These strings may contain " @@ -823,27 +823,26 @@ msgid "" "are really expressions evaluated at run time." msgstr "" -#: ../../reference/lexical_analysis.rst:658 +#: ../../reference/lexical_analysis.rst:656 msgid "" "Escape sequences are decoded like in ordinary string literals (except when a " "literal is also marked as a raw string). After decoding, the grammar for " "the contents of the string is:" msgstr "" -#: ../../reference/lexical_analysis.rst:672 +#: ../../reference/lexical_analysis.rst:670 msgid "" "The parts of the string outside curly braces are treated literally, except " "that any doubled curly braces ``'{{'`` or ``'}}'`` are replaced with the " "corresponding single curly brace. A single opening curly bracket ``'{'`` " -"marks a replacement field, which starts with a Python expression. To display " -"both the expression text and its value after evaluation, (useful in " -"debugging), an equal sign ``'='`` may be added after the expression. A " -"conversion field, introduced by an exclamation point ``'!'`` may follow. A " -"format specifier may also be appended, introduced by a colon ``':'``. A " -"replacement field ends with a closing curly bracket ``'}'``." +"marks a replacement field, which starts with a Python expression. After the " +"expression, there may be a conversion field, introduced by an exclamation " +"point ``'!'``. A format specifier may also be appended, introduced by a " +"colon ``':'``. A replacement field ends with a closing curly bracket " +"``'}'``." msgstr "" -#: ../../reference/lexical_analysis.rst:682 +#: ../../reference/lexical_analysis.rst:679 msgid "" "Expressions in formatted string literals are treated like regular Python " "expressions surrounded by parentheses, with a few exceptions. An empty " @@ -854,36 +853,21 @@ msgid "" "where the formatted string literal appears, in order from left to right." msgstr "" -#: ../../reference/lexical_analysis.rst:691 +#: ../../reference/lexical_analysis.rst:688 msgid "" "Prior to Python 3.7, an :keyword:`await` expression and comprehensions " "containing an :keyword:`async for` clause were illegal in the expressions in " "formatted string literals due to a problem with the implementation." msgstr "" -#: ../../reference/lexical_analysis.rst:696 -msgid "" -"When the equal sign ``'='`` is provided, the output will have the expression " -"text, the ``'='`` and the evaluated value. Spaces after the opening brace " -"``'{'``, within the expression and after the ``'='`` are all retained in the " -"output. By default, the ``'='`` causes the :func:`repr` of the expression to " -"be provided, unless there is a format specified. When a format is specified " -"it defaults to the :func:`str` of the expression unless a conversion ``'!" -"r'`` is declared." -msgstr "" - -#: ../../reference/lexical_analysis.rst:704 -msgid "The equal sign ``'='``." -msgstr "" - -#: ../../reference/lexical_analysis.rst:707 +#: ../../reference/lexical_analysis.rst:693 msgid "" "If a conversion is specified, the result of evaluating the expression is " "converted before formatting. Conversion ``'!s'`` calls :func:`str` on the " "result, ``'!r'`` calls :func:`repr`, and ``'!a'`` calls :func:`ascii`." msgstr "" -#: ../../reference/lexical_analysis.rst:711 +#: ../../reference/lexical_analysis.rst:697 msgid "" "The result is then formatted using the :func:`format` protocol. The format " "specifier is passed to the :meth:`__format__` method of the expression or " @@ -892,7 +876,7 @@ msgid "" "whole string." msgstr "" -#: ../../reference/lexical_analysis.rst:717 +#: ../../reference/lexical_analysis.rst:703 msgid "" "Top-level format specifiers may include nested replacement fields. These " "nested fields may include their own conversion fields and :ref:`format " @@ -901,111 +885,111 @@ msgid "" "as that used by the :meth:`str.format` method." msgstr "" -#: ../../reference/lexical_analysis.rst:723 +#: ../../reference/lexical_analysis.rst:709 msgid "" "Formatted string literals may be concatenated, but replacement fields cannot " "be split across literals." msgstr "" -#: ../../reference/lexical_analysis.rst:726 +#: ../../reference/lexical_analysis.rst:712 msgid "Some examples of formatted string literals::" msgstr "" -#: ../../reference/lexical_analysis.rst:758 +#: ../../reference/lexical_analysis.rst:731 msgid "" "A consequence of sharing the same syntax as regular string literals is that " "characters in the replacement fields must not conflict with the quoting used " "in the outer formatted string literal::" msgstr "" -#: ../../reference/lexical_analysis.rst:765 +#: ../../reference/lexical_analysis.rst:738 msgid "" "Backslashes are not allowed in format expressions and will raise an error::" msgstr "" -#: ../../reference/lexical_analysis.rst:770 +#: ../../reference/lexical_analysis.rst:743 msgid "" "To include a value in which a backslash escape is required, create a " "temporary variable." msgstr "" -#: ../../reference/lexical_analysis.rst:777 +#: ../../reference/lexical_analysis.rst:750 msgid "" "Formatted string literals cannot be used as docstrings, even if they do not " "include expressions." msgstr "" -#: ../../reference/lexical_analysis.rst:788 +#: ../../reference/lexical_analysis.rst:761 msgid "" "See also :pep:`498` for the proposal that added formatted string literals, " "and :meth:`str.format`, which uses a related format string mechanism." msgstr "" -#: ../../reference/lexical_analysis.rst:795 +#: ../../reference/lexical_analysis.rst:768 msgid "Numeric literals" msgstr "" -#: ../../reference/lexical_analysis.rst:801 +#: ../../reference/lexical_analysis.rst:774 msgid "" "There are three types of numeric literals: integers, floating point numbers, " "and imaginary numbers. There are no complex literals (complex numbers can " "be formed by adding a real number and an imaginary number)." msgstr "" -#: ../../reference/lexical_analysis.rst:805 +#: ../../reference/lexical_analysis.rst:778 msgid "" "Note that numeric literals do not include a sign; a phrase like ``-1`` is " "actually an expression composed of the unary operator '``-``' and the " "literal ``1``." msgstr "" -#: ../../reference/lexical_analysis.rst:819 +#: ../../reference/lexical_analysis.rst:792 msgid "Integer literals" msgstr "" -#: ../../reference/lexical_analysis.rst:821 +#: ../../reference/lexical_analysis.rst:794 msgid "Integer literals are described by the following lexical definitions:" msgstr "" -#: ../../reference/lexical_analysis.rst:835 +#: ../../reference/lexical_analysis.rst:808 msgid "" "There is no limit for the length of integer literals apart from what can be " "stored in available memory." msgstr "" -#: ../../reference/lexical_analysis.rst:838 +#: ../../reference/lexical_analysis.rst:811 msgid "" "Underscores are ignored for determining the numeric value of the literal. " "They can be used to group digits for enhanced readability. One underscore " "can occur between digits, and after base specifiers like ``0x``." msgstr "" -#: ../../reference/lexical_analysis.rst:842 +#: ../../reference/lexical_analysis.rst:815 msgid "" "Note that leading zeros in a non-zero decimal number are not allowed. This " "is for disambiguation with C-style octal literals, which Python used before " "version 3.0." msgstr "" -#: ../../reference/lexical_analysis.rst:846 +#: ../../reference/lexical_analysis.rst:819 msgid "Some examples of integer literals::" msgstr "" -#: ../../reference/lexical_analysis.rst:852 -#: ../../reference/lexical_analysis.rst:884 +#: ../../reference/lexical_analysis.rst:825 +#: ../../reference/lexical_analysis.rst:857 msgid "Underscores are now allowed for grouping purposes in literals." msgstr "" -#: ../../reference/lexical_analysis.rst:863 +#: ../../reference/lexical_analysis.rst:836 msgid "Floating point literals" msgstr "" -#: ../../reference/lexical_analysis.rst:865 +#: ../../reference/lexical_analysis.rst:838 msgid "" "Floating point literals are described by the following lexical definitions:" msgstr "" -#: ../../reference/lexical_analysis.rst:875 +#: ../../reference/lexical_analysis.rst:848 msgid "" "Note that the integer and exponent parts are always interpreted using radix " "10. For example, ``077e010`` is legal, and denotes the same number as " @@ -1014,19 +998,19 @@ msgid "" "grouping." msgstr "" -#: ../../reference/lexical_analysis.rst:880 +#: ../../reference/lexical_analysis.rst:853 msgid "Some examples of floating point literals::" msgstr "" -#: ../../reference/lexical_analysis.rst:893 +#: ../../reference/lexical_analysis.rst:866 msgid "Imaginary literals" msgstr "" -#: ../../reference/lexical_analysis.rst:895 +#: ../../reference/lexical_analysis.rst:868 msgid "Imaginary literals are described by the following lexical definitions:" msgstr "" -#: ../../reference/lexical_analysis.rst:900 +#: ../../reference/lexical_analysis.rst:873 msgid "" "An imaginary literal yields a complex number with a real part of 0.0. " "Complex numbers are represented as a pair of floating point numbers and have " @@ -1035,23 +1019,23 @@ msgid "" "Some examples of imaginary literals::" msgstr "" -#: ../../reference/lexical_analysis.rst:912 +#: ../../reference/lexical_analysis.rst:885 msgid "Operators" msgstr "" -#: ../../reference/lexical_analysis.rst:916 +#: ../../reference/lexical_analysis.rst:889 msgid "The following tokens are operators:" msgstr "" -#: ../../reference/lexical_analysis.rst:929 +#: ../../reference/lexical_analysis.rst:902 msgid "Delimiters" msgstr "" -#: ../../reference/lexical_analysis.rst:933 +#: ../../reference/lexical_analysis.rst:906 msgid "The following tokens serve as delimiters in the grammar:" msgstr "" -#: ../../reference/lexical_analysis.rst:942 +#: ../../reference/lexical_analysis.rst:915 msgid "" "The period can also occur in floating-point and imaginary literals. A " "sequence of three periods has a special meaning as an ellipsis literal. The " @@ -1059,22 +1043,22 @@ msgid "" "as delimiters, but also perform an operation." msgstr "" -#: ../../reference/lexical_analysis.rst:947 +#: ../../reference/lexical_analysis.rst:920 msgid "" "The following printing ASCII characters have special meaning as part of " "other tokens or are otherwise significant to the lexical analyzer:" msgstr "" -#: ../../reference/lexical_analysis.rst:954 +#: ../../reference/lexical_analysis.rst:927 msgid "" "The following printing ASCII characters are not used in Python. Their " "occurrence outside string literals and comments is an unconditional error:" msgstr "" -#: ../../reference/lexical_analysis.rst:963 +#: ../../reference/lexical_analysis.rst:936 msgid "Footnotes" msgstr "註解" -#: ../../reference/lexical_analysis.rst:964 +#: ../../reference/lexical_analysis.rst:937 msgid "https://www.unicode.org/Public/11.0.0/ucd/NameAliases.txt" msgstr "" diff --git a/reference/simple_stmts.po b/reference/simple_stmts.po index 953e1f23b4..de92f94a47 100644 --- a/reference/simple_stmts.po +++ b/reference/simple_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-07 06:52+0000\n" +"POT-Creation-Date: 2020-06-20 18:08+0800\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-" @@ -586,80 +586,77 @@ msgstr "" #: ../../reference/simple_stmts.rst:593 msgid "" "The ``from`` clause is used for exception chaining: if given, the second " -"*expression* must be another exception class or instance. If the second " -"expression is an exception instance, it will be attached to the raised " -"exception as the :attr:`__cause__` attribute (which is writable). If the " -"expression is an exception class, the class will be instantiated and the " -"resulting exception instance will be attached to the raised exception as " -"the :attr:`__cause__` attribute. If the raised exception is not handled, " -"both exceptions will be printed::" +"*expression* must be another exception class or instance, which will then be " +"attached to the raised exception as the :attr:`__cause__` attribute (which " +"is writable). If the raised exception is not handled, both exceptions will " +"be printed::" msgstr "" -#: ../../reference/simple_stmts.rst:617 +#: ../../reference/simple_stmts.rst:614 msgid "" "A similar mechanism works implicitly if an exception is raised inside an " "exception handler or a :keyword:`finally` clause: the previous exception is " "then attached as the new exception's :attr:`__context__` attribute::" msgstr "" -#: ../../reference/simple_stmts.rst:636 +#: ../../reference/simple_stmts.rst:633 msgid "" "Exception chaining can be explicitly suppressed by specifying :const:`None` " "in the ``from`` clause::" msgstr "" -#: ../../reference/simple_stmts.rst:648 +#: ../../reference/simple_stmts.rst:645 msgid "" "Additional information on exceptions can be found in section :ref:" "`exceptions`, and information about handling exceptions is in section :ref:" "`try`." msgstr "" -#: ../../reference/simple_stmts.rst:651 +#: ../../reference/simple_stmts.rst:648 msgid ":const:`None` is now permitted as ``Y`` in ``raise X from Y``." msgstr "" -#: ../../reference/simple_stmts.rst:654 +#: ../../reference/simple_stmts.rst:651 msgid "" "The ``__suppress_context__`` attribute to suppress automatic display of the " "exception context." msgstr "" -#: ../../reference/simple_stmts.rst:661 +#: ../../reference/simple_stmts.rst:658 msgid "The :keyword:`!break` statement" msgstr "" -#: ../../reference/simple_stmts.rst:672 +#: ../../reference/simple_stmts.rst:669 msgid "" ":keyword:`break` may only occur syntactically nested in a :keyword:`for` or :" "keyword:`while` loop, but not nested in a function or class definition " "within that loop." msgstr "" -#: ../../reference/simple_stmts.rst:679 +#: ../../reference/simple_stmts.rst:676 msgid "" "It terminates the nearest enclosing loop, skipping the optional :keyword:`!" "else` clause if the loop has one." msgstr "" -#: ../../reference/simple_stmts.rst:682 +#: ../../reference/simple_stmts.rst:679 msgid "" "If a :keyword:`for` loop is terminated by :keyword:`break`, the loop control " "target keeps its current value." msgstr "" -#: ../../reference/simple_stmts.rst:687 +#: ../../reference/simple_stmts.rst:684 msgid "" "When :keyword:`break` passes control out of a :keyword:`try` statement with " "a :keyword:`finally` clause, that :keyword:`!finally` clause is executed " "before really leaving the loop." msgstr "" -#: ../../reference/simple_stmts.rst:695 +#: ../../reference/simple_stmts.rst:692 msgid "The :keyword:`!continue` statement" msgstr "" -#: ../../reference/simple_stmts.rst:707 +#: ../../reference/simple_stmts.rst:704 msgid "" ":keyword:`continue` may only occur syntactically nested in a :keyword:`for` " "or :keyword:`while` loop, but not nested in a function or class definition " @@ -667,41 +664,41 @@ msgid "" "loop." msgstr "" -#: ../../reference/simple_stmts.rst:711 +#: ../../reference/simple_stmts.rst:708 msgid "" "When :keyword:`continue` passes control out of a :keyword:`try` statement " "with a :keyword:`finally` clause, that :keyword:`!finally` clause is " "executed before really starting the next loop cycle." msgstr "" -#: ../../reference/simple_stmts.rst:720 +#: ../../reference/simple_stmts.rst:717 msgid "The :keyword:`!import` statement" msgstr "" -#: ../../reference/simple_stmts.rst:741 +#: ../../reference/simple_stmts.rst:738 msgid "" "The basic import statement (no :keyword:`from` clause) is executed in two " "steps:" msgstr "" -#: ../../reference/simple_stmts.rst:744 +#: ../../reference/simple_stmts.rst:741 msgid "find a module, loading and initializing it if necessary" msgstr "" -#: ../../reference/simple_stmts.rst:745 +#: ../../reference/simple_stmts.rst:742 msgid "" "define a name or names in the local namespace for the scope where the :" "keyword:`import` statement occurs." msgstr "" -#: ../../reference/simple_stmts.rst:748 +#: ../../reference/simple_stmts.rst:745 msgid "" "When the statement contains multiple clauses (separated by commas) the two " "steps are carried out separately for each clause, just as though the clauses " "had been separated out into individual import statements." msgstr "" -#: ../../reference/simple_stmts.rst:753 +#: ../../reference/simple_stmts.rst:750 msgid "" "The details of the first step, finding and loading modules are described in " "greater detail in the section on the :ref:`import system `, " @@ -712,26 +709,26 @@ msgid "" "module, which includes execution of the module's code." msgstr "" -#: ../../reference/simple_stmts.rst:761 +#: ../../reference/simple_stmts.rst:758 msgid "" "If the requested module is retrieved successfully, it will be made available " "in the local namespace in one of three ways:" msgstr "" -#: ../../reference/simple_stmts.rst:766 +#: ../../reference/simple_stmts.rst:763 msgid "" "If the module name is followed by :keyword:`!as`, then the name following :" "keyword:`!as` is bound directly to the imported module." msgstr "" -#: ../../reference/simple_stmts.rst:768 +#: ../../reference/simple_stmts.rst:765 msgid "" "If no other name is specified, and the module being imported is a top level " "module, the module's name is bound in the local namespace as a reference to " "the imported module" msgstr "" -#: ../../reference/simple_stmts.rst:771 +#: ../../reference/simple_stmts.rst:768 msgid "" "If the module being imported is *not* a top level module, then the name of " "the top level package that contains the module is bound in the local " @@ -739,53 +736,53 @@ msgid "" "be accessed using its full qualified name rather than directly" msgstr "" -#: ../../reference/simple_stmts.rst:781 +#: ../../reference/simple_stmts.rst:778 msgid "The :keyword:`from` form uses a slightly more complex process:" msgstr "" -#: ../../reference/simple_stmts.rst:783 +#: ../../reference/simple_stmts.rst:780 msgid "" "find the module specified in the :keyword:`from` clause, loading and " "initializing it if necessary;" msgstr "" -#: ../../reference/simple_stmts.rst:785 +#: ../../reference/simple_stmts.rst:782 msgid "for each of the identifiers specified in the :keyword:`import` clauses:" msgstr "" -#: ../../reference/simple_stmts.rst:787 +#: ../../reference/simple_stmts.rst:784 msgid "check if the imported module has an attribute by that name" msgstr "" -#: ../../reference/simple_stmts.rst:788 +#: ../../reference/simple_stmts.rst:785 msgid "" "if not, attempt to import a submodule with that name and then check the " "imported module again for that attribute" msgstr "" -#: ../../reference/simple_stmts.rst:790 +#: ../../reference/simple_stmts.rst:787 msgid "if the attribute is not found, :exc:`ImportError` is raised." msgstr "" -#: ../../reference/simple_stmts.rst:791 +#: ../../reference/simple_stmts.rst:788 msgid "" "otherwise, a reference to that value is stored in the local namespace, using " "the name in the :keyword:`!as` clause if it is present, otherwise using the " "attribute name" msgstr "" -#: ../../reference/simple_stmts.rst:795 +#: ../../reference/simple_stmts.rst:792 msgid "Examples::" msgstr "" -#: ../../reference/simple_stmts.rst:805 +#: ../../reference/simple_stmts.rst:802 msgid "" "If the list of identifiers is replaced by a star (``'*'``), all public names " "defined in the module are bound in the local namespace for the scope where " "the :keyword:`import` statement occurs." msgstr "" -#: ../../reference/simple_stmts.rst:811 +#: ../../reference/simple_stmts.rst:808 msgid "" "The *public names* defined by a module are determined by checking the " "module's namespace for a variable named ``__all__``; if defined, it must be " @@ -798,14 +795,14 @@ msgid "" "API (such as library modules which were imported and used within the module)." msgstr "" -#: ../../reference/simple_stmts.rst:821 +#: ../../reference/simple_stmts.rst:818 msgid "" "The wild card form of import --- ``from module import *`` --- is only " "allowed at the module level. Attempting to use it in class or function " "definitions will raise a :exc:`SyntaxError`." msgstr "" -#: ../../reference/simple_stmts.rst:828 +#: ../../reference/simple_stmts.rst:825 msgid "" "When specifying what module to import you do not have to specify the " "absolute name of the module. When a module or package is contained within " @@ -822,31 +819,31 @@ msgid "" "the :ref:`relativeimports` section." msgstr "" -#: ../../reference/simple_stmts.rst:842 +#: ../../reference/simple_stmts.rst:839 msgid "" ":func:`importlib.import_module` is provided to support applications that " "determine dynamically the modules to be loaded." msgstr "" -#: ../../reference/simple_stmts.rst:845 +#: ../../reference/simple_stmts.rst:843 msgid "" "Raises an :ref:`auditing event ` ``import`` with arguments " "``module``, ``filename``, ``sys.path``, ``sys.meta_path``, ``sys." "path_hooks``." msgstr "" -#: ../../reference/simple_stmts.rst:850 +#: ../../reference/simple_stmts.rst:847 msgid "Future statements" msgstr "" -#: ../../reference/simple_stmts.rst:856 +#: ../../reference/simple_stmts.rst:853 msgid "" "A :dfn:`future statement` is a directive to the compiler that a particular " "module should be compiled using syntax or semantics that will be available " "in a specified future release of Python where the feature becomes standard." msgstr "" -#: ../../reference/simple_stmts.rst:860 +#: ../../reference/simple_stmts.rst:857 msgid "" "The future statement is intended to ease migration to future versions of " "Python that introduce incompatible changes to the language. It allows use " @@ -854,35 +851,35 @@ msgid "" "feature becomes standard." msgstr "" -#: ../../reference/simple_stmts.rst:872 +#: ../../reference/simple_stmts.rst:869 msgid "" "A future statement must appear near the top of the module. The only lines " "that can appear before a future statement are:" msgstr "" -#: ../../reference/simple_stmts.rst:875 +#: ../../reference/simple_stmts.rst:872 msgid "the module docstring (if any)," msgstr "" -#: ../../reference/simple_stmts.rst:876 +#: ../../reference/simple_stmts.rst:873 msgid "comments," msgstr "" -#: ../../reference/simple_stmts.rst:877 +#: ../../reference/simple_stmts.rst:874 msgid "blank lines, and" msgstr "" -#: ../../reference/simple_stmts.rst:878 +#: ../../reference/simple_stmts.rst:875 msgid "other future statements." msgstr "" -#: ../../reference/simple_stmts.rst:880 +#: ../../reference/simple_stmts.rst:877 msgid "" -"The only feature that requires using the future statement is ``annotations`` " -"(see :pep:`563`)." +"The only feature in Python 3.7 that requires using the future statement is " +"``annotations``." msgstr "" -#: ../../reference/simple_stmts.rst:883 +#: ../../reference/simple_stmts.rst:880 msgid "" "All historical features enabled by the future statement are still recognized " "by Python 3. The list includes ``absolute_import``, ``division``, " @@ -892,7 +889,7 @@ msgid "" "compatibility." msgstr "" -#: ../../reference/simple_stmts.rst:890 +#: ../../reference/simple_stmts.rst:887 msgid "" "A future statement is recognized and treated specially at compile time: " "Changes to the semantics of core constructs are often implemented by " @@ -902,37 +899,37 @@ msgid "" "cannot be pushed off until runtime." msgstr "" -#: ../../reference/simple_stmts.rst:897 +#: ../../reference/simple_stmts.rst:894 msgid "" "For any given release, the compiler knows which feature names have been " "defined, and raises a compile-time error if a future statement contains a " "feature not known to it." msgstr "" -#: ../../reference/simple_stmts.rst:901 +#: ../../reference/simple_stmts.rst:898 msgid "" "The direct runtime semantics are the same as for any import statement: there " "is a standard module :mod:`__future__`, described later, and it will be " "imported in the usual way at the time the future statement is executed." msgstr "" -#: ../../reference/simple_stmts.rst:905 +#: ../../reference/simple_stmts.rst:902 msgid "" "The interesting runtime semantics depend on the specific feature enabled by " "the future statement." msgstr "" -#: ../../reference/simple_stmts.rst:908 +#: ../../reference/simple_stmts.rst:905 msgid "Note that there is nothing special about the statement::" msgstr "" -#: ../../reference/simple_stmts.rst:912 +#: ../../reference/simple_stmts.rst:909 msgid "" "That is not a future statement; it's an ordinary import statement with no " "special semantics or syntax restrictions." msgstr "" -#: ../../reference/simple_stmts.rst:915 +#: ../../reference/simple_stmts.rst:912 msgid "" "Code compiled by calls to the built-in functions :func:`exec` and :func:" "`compile` that occur in a module :mod:`M` containing a future statement " @@ -941,7 +938,7 @@ msgid "" "--- see the documentation of that function for details." msgstr "" -#: ../../reference/simple_stmts.rst:921 +#: ../../reference/simple_stmts.rst:918 msgid "" "A future statement typed at an interactive interpreter prompt will take " "effect for the rest of the interpreter session. If an interpreter is " @@ -950,19 +947,19 @@ msgid "" "interactive session started after the script is executed." msgstr "" -#: ../../reference/simple_stmts.rst:929 +#: ../../reference/simple_stmts.rst:926 msgid ":pep:`236` - Back to the __future__" msgstr "" -#: ../../reference/simple_stmts.rst:930 +#: ../../reference/simple_stmts.rst:927 msgid "The original proposal for the __future__ mechanism." msgstr "" -#: ../../reference/simple_stmts.rst:936 +#: ../../reference/simple_stmts.rst:933 msgid "The :keyword:`!global` statement" msgstr "" -#: ../../reference/simple_stmts.rst:946 +#: ../../reference/simple_stmts.rst:943 msgid "" "The :keyword:`global` statement is a declaration which holds for the entire " "current code block. It means that the listed identifiers are to be " @@ -971,13 +968,13 @@ msgid "" "globals without being declared global." msgstr "" -#: ../../reference/simple_stmts.rst:952 +#: ../../reference/simple_stmts.rst:949 msgid "" "Names listed in a :keyword:`global` statement must not be used in the same " "code block textually preceding that :keyword:`!global` statement." msgstr "" -#: ../../reference/simple_stmts.rst:955 +#: ../../reference/simple_stmts.rst:952 msgid "" "Names listed in a :keyword:`global` statement must not be defined as formal " "parameters or in a :keyword:`for` loop control target, :keyword:`class` " @@ -985,14 +982,14 @@ msgid "" "annotation." msgstr "" -#: ../../reference/simple_stmts.rst:962 +#: ../../reference/simple_stmts.rst:959 msgid "" "The current implementation does not enforce some of these restrictions, but " "programs should not abuse this freedom, as future implementations may " "enforce them or silently change the meaning of the program." msgstr "" -#: ../../reference/simple_stmts.rst:971 +#: ../../reference/simple_stmts.rst:968 msgid "" "**Programmer's note:** :keyword:`global` is a directive to the parser. It " "applies only to code parsed at the same time as the :keyword:`!global` " @@ -1004,11 +1001,11 @@ msgid "" "func:`compile` functions." msgstr "" -#: ../../reference/simple_stmts.rst:983 +#: ../../reference/simple_stmts.rst:980 msgid "The :keyword:`!nonlocal` statement" msgstr "" -#: ../../reference/simple_stmts.rst:995 +#: ../../reference/simple_stmts.rst:992 msgid "" "The :keyword:`nonlocal` statement causes the listed identifiers to refer to " "previously bound variables in the nearest enclosing scope excluding globals. " @@ -1017,7 +1014,7 @@ msgid "" "variables outside of the local scope besides the global (module) scope." msgstr "" -#: ../../reference/simple_stmts.rst:1005 +#: ../../reference/simple_stmts.rst:1002 msgid "" "Names listed in a :keyword:`nonlocal` statement, unlike those listed in a :" "keyword:`global` statement, must refer to pre-existing bindings in an " @@ -1025,16 +1022,16 @@ msgid "" "be determined unambiguously)." msgstr "" -#: ../../reference/simple_stmts.rst:1010 +#: ../../reference/simple_stmts.rst:1007 msgid "" "Names listed in a :keyword:`nonlocal` statement must not collide with pre-" "existing bindings in the local scope." msgstr "" -#: ../../reference/simple_stmts.rst:1015 +#: ../../reference/simple_stmts.rst:1012 msgid ":pep:`3104` - Access to Names in Outer Scopes" msgstr "" -#: ../../reference/simple_stmts.rst:1016 +#: ../../reference/simple_stmts.rst:1013 msgid "The specification for the :keyword:`nonlocal` statement." msgstr "" diff --git a/sphinx.po b/sphinx.po index fd1036038b..04ffdf1363 100644 --- a/sphinx.po +++ b/sphinx.po @@ -9,7 +9,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.9\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2021-09-07 06:52+0000\n" +"POT-Creation-Date: 2020-06-20 18:08+0800\n" "PO-Revision-Date: 2021-06-02 12:28+0800\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -47,8 +47,7 @@ msgid "Deprecated since version {deprecated}, removed in version {removed}" msgstr "自從版本 {deprecated} 後不推薦使用,已從版本 {removed} 中移除。" #: ../../tools/templates/indexcontent.html:8 -#, fuzzy -msgid "Welcome! This is the official documentation for Python %(release)s." +msgid "Welcome! This is the documentation for Python %(release)s." msgstr "歡迎!這是 Python %(release)s 的說明文件。" #: ../../tools/templates/indexcontent.html:10 @@ -225,59 +224,63 @@ msgstr "下載這些說明文件" msgid "Docs by version" msgstr "各版本說明文件" -#: ../../tools/templates/indexsidebar.html:5 -#, fuzzy -msgid "Python 3.10 (in development)" +#: ../../tools/templates/indexsidebar.html:4 +msgid "Python 3.11 (in development)" msgstr "Python 3.11(開發中)" -#: ../../tools/templates/indexsidebar.html:6 -#, fuzzy -msgid "Python 3.9 (pre-release)" +#: ../../tools/templates/indexsidebar.html:5 +msgid "Python 3.10 (pre-release)" msgstr "Python 3.10(預發行)" -#: ../../tools/templates/indexsidebar.html:7 -#, fuzzy -msgid "Python 3.8 (stable)" +#: ../../tools/templates/indexsidebar.html:6 +msgid "Python 3.9 (stable)" msgstr "Python 3.9(穩定)" +#: ../../tools/templates/indexsidebar.html:7 +msgid "Python 3.8 (security-fixes)" +msgstr "Python 3.8(安全性修護)" + #: ../../tools/templates/indexsidebar.html:8 -#, fuzzy -msgid "Python 3.7 (stable)" -msgstr "Python 3.9(穩定)" +msgid "Python 3.7 (security-fixes)" +msgstr "Python 3.7(安全性修護)" #: ../../tools/templates/indexsidebar.html:9 msgid "Python 3.6 (security-fixes)" msgstr "Python 3.6(安全性修護)" #: ../../tools/templates/indexsidebar.html:10 +msgid "Python 3.5 (EOL)" +msgstr "Python 3.5(終止支援)" + +#: ../../tools/templates/indexsidebar.html:11 msgid "Python 2.7 (EOL)" msgstr "Python 2.7(終止支援)" -#: ../../tools/templates/indexsidebar.html:11 +#: ../../tools/templates/indexsidebar.html:12 msgid "All versions" msgstr "所有版本" -#: ../../tools/templates/indexsidebar.html:14 +#: ../../tools/templates/indexsidebar.html:15 msgid "Other resources" msgstr "其他資源" -#: ../../tools/templates/indexsidebar.html:17 +#: ../../tools/templates/indexsidebar.html:18 msgid "PEP Index" msgstr "PEP 索引" -#: ../../tools/templates/indexsidebar.html:18 +#: ../../tools/templates/indexsidebar.html:19 msgid "Beginner's Guide" msgstr "初學者指南" -#: ../../tools/templates/indexsidebar.html:19 +#: ../../tools/templates/indexsidebar.html:20 msgid "Book List" msgstr "推薦書單" -#: ../../tools/templates/indexsidebar.html:20 +#: ../../tools/templates/indexsidebar.html:21 msgid "Audio/Visual Talks" msgstr "音訊/視訊演講" -#: ../../tools/templates/indexsidebar.html:21 +#: ../../tools/templates/indexsidebar.html:22 msgid "Python Developer’s Guide" msgstr "Python 開發者指南" @@ -294,12 +297,3 @@ msgstr " 當前穩定發行的 Python 版本說明文件" #: ../../tools/templates/layout.html:19 msgid "Documentation " msgstr "說明文件 " - -#~ msgid "Python 3.8 (security-fixes)" -#~ msgstr "Python 3.8(安全性修護)" - -#~ msgid "Python 3.7 (security-fixes)" -#~ msgstr "Python 3.7(安全性修護)" - -#~ msgid "Python 3.5 (EOL)" -#~ msgstr "Python 3.5(終止支援)" diff --git a/tutorial/classes.po b/tutorial/classes.po index e28857402b..9de6062519 100644 --- a/tutorial/classes.po +++ b/tutorial/classes.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.7\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2021-09-07 06:52+0000\n" +"POT-Creation-Date: 2020-06-20 18:08+0800\n" "PO-Revision-Date: 2018-05-23 16:18+0000\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -172,8 +172,8 @@ msgstr "" #: ../../tutorial/classes.rst:116 msgid "" "Although scopes are determined statically, they are used dynamically. At any " -"time during execution, there are 3 or 4 nested scopes whose namespaces are " -"directly accessible:" +"time during execution, there are at least three nested scopes whose " +"namespaces are directly accessible:" msgstr "" #: ../../tutorial/classes.rst:120 @@ -847,12 +847,12 @@ msgstr "" #: ../../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:" -"`yield` statement whenever they want to return data. Each time :func:`next` " -"is called on it, the generator resumes where it left off (it remembers all " -"the data values and which statement was last executed). An example shows " -"that generators can be trivially easy to create::" +":term:`Generator`\\s are a simple and powerful tool for creating iterators. " +"They are written like regular functions but use the :keyword:`yield` " +"statement whenever they want to return data. Each time :func:`next` is " +"called on it, the generator resumes where it left off (it remembers all the " +"data values and which statement was last executed). An example shows that " +"generators can be trivially easy to create::" msgstr "" #: ../../tutorial/classes.rst:873 diff --git a/tutorial/controlflow.po b/tutorial/controlflow.po index 41d2914e86..2555736843 100644 --- a/tutorial/controlflow.po +++ b/tutorial/controlflow.po @@ -11,7 +11,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.9\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2021-09-07 06:52+0000\n" +"POT-Creation-Date: 2021-05-18 12:27+0800\n" "PO-Revision-Date: 2021-06-01 22:43+0800\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -170,11 +170,10 @@ msgstr "" "::" #: ../../tutorial/controlflow.rst:151 -#, fuzzy msgid "" "Later we will see more functions that return iterables and take iterables as " -"arguments. In chapter :ref:`tut-structures`, we will discuss in more detail " -"about :func:`list`." +"arguments. Lastly, maybe you are curious about how to get a list from a " +"range. Here is the solution::" msgstr "" "待會我們可以看到更多回傳 iterable 和使用 iterable 為引數的函式。最後,也許你" "會好奇如何從 range 中得到一個 list。解法如下:\n" @@ -183,13 +182,20 @@ msgstr "" #: ../../tutorial/controlflow.rst:158 msgid "" +"In chapter :ref:`tut-structures`, we will discuss in more detail about :func:" +"`list`." +msgstr "" +"在\\ :ref:`tut-structures`\\ 章節中,我們會討論更多關於 :func:`list` 的細節。" + +#: ../../tutorial/controlflow.rst:164 +msgid "" ":keyword:`!break` and :keyword:`!continue` Statements, and :keyword:`!else` " "Clauses on Loops" msgstr "" "迴圈內的 :keyword:`!break` 和 :keyword:`!continue` 陳述式及 :keyword:`!else` " "子句" -#: ../../tutorial/controlflow.rst:160 +#: ../../tutorial/controlflow.rst:166 msgid "" "The :keyword:`break` statement, like in C, breaks out of the innermost " "enclosing :keyword:`for` or :keyword:`while` loop." @@ -197,7 +203,7 @@ msgstr "" ":keyword:`break` 陳述式,如同 C 語言,終止包含它的最內部 :keyword:`for` 或 :" "keyword:`while` 迴圈。" -#: ../../tutorial/controlflow.rst:163 +#: ../../tutorial/controlflow.rst:169 msgid "" "Loop statements may have an :keyword:`!else` clause; it is executed when the " "loop terminates through exhaustion of the iterable (with :keyword:`for`) or " @@ -212,7 +218,7 @@ msgstr "" "\n" "::" -#: ../../tutorial/controlflow.rst:187 +#: ../../tutorial/controlflow.rst:193 msgid "" "(Yes, this is the correct code. Look closely: the ``else`` clause belongs " "to the :keyword:`for` loop, **not** the :keyword:`if` statement.)" @@ -220,7 +226,7 @@ msgstr "" "(沒錯,這是正確的程式碼。請看仔細:``else`` 子句屬於 :keyword:`for` 迴圈,**" "並非** :keyword:`if` 陳述式。)" -#: ../../tutorial/controlflow.rst:190 +#: ../../tutorial/controlflow.rst:196 msgid "" "When used with a loop, the ``else`` clause has more in common with the " "``else`` clause of a :keyword:`try` statement than it does with that of :" @@ -235,7 +241,7 @@ msgstr "" "任何 ``break`` 發生時執行。更多有關 :keyword:`!try` 陳述式和例外的介紹,見" "\\ :ref:`tut-handling`\\ 。" -#: ../../tutorial/controlflow.rst:197 +#: ../../tutorial/controlflow.rst:203 msgid "" "The :keyword:`continue` statement, also borrowed from C, continues with the " "next iteration of the loop::" @@ -244,11 +250,11 @@ msgstr "" "\n" "::" -#: ../../tutorial/controlflow.rst:218 +#: ../../tutorial/controlflow.rst:224 msgid ":keyword:`!pass` Statements" msgstr ":keyword:`!pass` 陳述式" -#: ../../tutorial/controlflow.rst:220 +#: ../../tutorial/controlflow.rst:226 msgid "" "The :keyword:`pass` statement does nothing. It can be used when a statement " "is required syntactically but the program requires no action. For example::" @@ -258,14 +264,14 @@ msgstr "" "\n" "::" -#: ../../tutorial/controlflow.rst:227 +#: ../../tutorial/controlflow.rst:233 msgid "This is commonly used for creating minimal classes::" msgstr "" "這經常用於建立簡單的 class(類別):\n" "\n" "::" -#: ../../tutorial/controlflow.rst:233 +#: ../../tutorial/controlflow.rst:239 msgid "" "Another place :keyword:`pass` can be used is as a place-holder for a " "function or conditional body when you are working on new code, allowing you " @@ -277,11 +283,11 @@ msgstr "" "\n" "::" -#: ../../tutorial/controlflow.rst:244 +#: ../../tutorial/controlflow.rst:250 msgid "Defining Functions" msgstr "定義函式 (function)" -#: ../../tutorial/controlflow.rst:246 +#: ../../tutorial/controlflow.rst:252 msgid "" "We can create a function that writes the Fibonacci series to an arbitrary " "boundary::" @@ -290,7 +296,7 @@ msgstr "" "\n" "::" -#: ../../tutorial/controlflow.rst:266 +#: ../../tutorial/controlflow.rst:272 msgid "" "The keyword :keyword:`def` introduces a function *definition*. It must be " "followed by the function name and the parenthesized list of formal " @@ -300,7 +306,7 @@ msgstr "" "關鍵字 :keyword:`def` 介紹一個函式的\\ *定義*\\ 。它之後必須連著該函式的名稱" "和置於括號之中的一串參數。自下一行起,所有縮排的陳述式成為該函式的主體。" -#: ../../tutorial/controlflow.rst:271 +#: ../../tutorial/controlflow.rst:277 msgid "" "The first statement of the function body can optionally be a string literal; " "this string literal is the function's documentation string, or :dfn:" @@ -316,7 +322,7 @@ msgstr "" "件,或讓使用者能以互動的方式在原始碼中瀏覽文件。在原始碼中加入 docstring 是個" "好慣例,應該養成這樣的習慣。" -#: ../../tutorial/controlflow.rst:278 +#: ../../tutorial/controlflow.rst:284 msgid "" "The *execution* of a function introduces a new symbol table used for the " "local variables of the function. More precisely, all variable assignments " @@ -337,7 +343,7 @@ msgstr "" "域變數是在 :keyword:`global` 陳述式中被定義,或外層函式變數在 :keyword:" "`nonlocal` 陳述式中被定義)。" -#: ../../tutorial/controlflow.rst:289 +#: ../../tutorial/controlflow.rst:295 msgid "" "The actual parameters (arguments) to a function call are introduced in the " "local symbol table of the called function when it is called; thus, arguments " @@ -352,7 +358,7 @@ msgstr "" "函式呼叫別的函式或遞迴呼叫它自己時,在被呼叫的函式中會建立一個新的區域符號" "表。" -#: ../../tutorial/controlflow.rst:296 +#: ../../tutorial/controlflow.rst:302 msgid "" "A function definition associates the function name with the function object " "in the current symbol table. The interpreter recognizes the object pointed " @@ -365,7 +371,7 @@ msgstr "" "\n" "::" -#: ../../tutorial/controlflow.rst:307 +#: ../../tutorial/controlflow.rst:313 msgid "" "Coming from other languages, you might object that ``fib`` is not a function " "but a procedure since it doesn't return a value. In fact, even functions " @@ -382,7 +388,7 @@ msgstr "" "\n" "::" -#: ../../tutorial/controlflow.rst:318 +#: ../../tutorial/controlflow.rst:324 msgid "" "It is simple to write a function that returns a list of the numbers of the " "Fibonacci series, instead of printing it::" @@ -391,11 +397,11 @@ msgstr "" "\n" "::" -#: ../../tutorial/controlflow.rst:334 +#: ../../tutorial/controlflow.rst:340 msgid "This example, as usual, demonstrates some new Python features:" msgstr "這個例子一樣示範了一些新的 Python 特性:" -#: ../../tutorial/controlflow.rst:336 +#: ../../tutorial/controlflow.rst:342 msgid "" "The :keyword:`return` statement returns with a value from a function. :" "keyword:`!return` without an expression argument returns ``None``. Falling " @@ -405,7 +411,7 @@ msgstr "" "不外加一個運算式作為引數時會回傳 ``None``\\ 。一個函式執行到結束也會回傳 " "``None``\\ 。" -#: ../../tutorial/controlflow.rst:340 +#: ../../tutorial/controlflow.rst:346 msgid "" "The statement ``result.append(a)`` calls a *method* of the list object " "``result``. A method is a function that 'belongs' to an object and is named " @@ -427,22 +433,22 @@ msgstr "" "method 定義在 list 物件中;它會在該 list 的末端加入一個新的元素。這個例子等同" "於 ``result = result + [a]``\\ ,但更有效率。" -#: ../../tutorial/controlflow.rst:355 +#: ../../tutorial/controlflow.rst:361 msgid "More on Defining Functions" msgstr "深入了解函式定義" -#: ../../tutorial/controlflow.rst:357 +#: ../../tutorial/controlflow.rst:363 msgid "" "It is also possible to define functions with a variable number of arguments. " "There are three forms, which can be combined." msgstr "" "定義函式時使用的引數 (argument) 數量是可變的。總共有三種可以組合使用的形式。" -#: ../../tutorial/controlflow.rst:364 +#: ../../tutorial/controlflow.rst:370 msgid "Default Argument Values" msgstr "預設引數值" -#: ../../tutorial/controlflow.rst:366 +#: ../../tutorial/controlflow.rst:372 msgid "" "The most useful form is to specify a default value for one or more " "arguments. This creates a function that can be called with fewer arguments " @@ -453,22 +459,22 @@ msgstr "" "\n" "::" -#: ../../tutorial/controlflow.rst:382 +#: ../../tutorial/controlflow.rst:388 msgid "This function can be called in several ways:" msgstr "該函式可以用以下幾種方式被呼叫:" -#: ../../tutorial/controlflow.rst:384 +#: ../../tutorial/controlflow.rst:390 msgid "" "giving only the mandatory argument: ``ask_ok('Do you really want to quit?')``" msgstr "只給必要引數:\\ ``ask_ok('Do you really want to quit?')``" -#: ../../tutorial/controlflow.rst:386 +#: ../../tutorial/controlflow.rst:392 msgid "" "giving one of the optional arguments: ``ask_ok('OK to overwrite the file?', " "2)``" msgstr "給予一個選擇性引數:\\ ``ask_ok('OK to overwrite the file?', 2)``" -#: ../../tutorial/controlflow.rst:388 +#: ../../tutorial/controlflow.rst:394 msgid "" "or even giving all arguments: ``ask_ok('OK to overwrite the file?', 2, 'Come " "on, only yes or no!')``" @@ -476,14 +482,14 @@ msgstr "" "給予所有引數:\\ ``ask_ok('OK to overwrite the file?', 2, 'Come on, only yes " "or no!')``" -#: ../../tutorial/controlflow.rst:391 +#: ../../tutorial/controlflow.rst:397 msgid "" "This example also introduces the :keyword:`in` keyword. This tests whether " "or not a sequence contains a certain value." msgstr "" "此例也使用了關鍵字 :keyword:`in`\\ ,用於測試序列中是否包含某個特定值。" -#: ../../tutorial/controlflow.rst:394 +#: ../../tutorial/controlflow.rst:400 msgid "" "The default values are evaluated at the point of function definition in the " "*defining* scope, so that ::" @@ -492,11 +498,11 @@ msgstr "" "\n" "::" -#: ../../tutorial/controlflow.rst:405 +#: ../../tutorial/controlflow.rst:411 msgid "will print ``5``." msgstr "將會輸出 ``5``\\ 。" -#: ../../tutorial/controlflow.rst:407 +#: ../../tutorial/controlflow.rst:413 msgid "" "**Important warning:** The default value is evaluated only once. This makes " "a difference when the default is a mutable object such as a list, " @@ -509,24 +515,24 @@ msgstr "" "\n" "::" -#: ../../tutorial/controlflow.rst:420 +#: ../../tutorial/controlflow.rst:426 msgid "This will print ::" msgstr "" "將會輸出:\n" "\n" "::" -#: ../../tutorial/controlflow.rst:426 +#: ../../tutorial/controlflow.rst:432 msgid "" "If you don't want the default to be shared between subsequent calls, you can " "write the function like this instead::" msgstr "如果不想在後續呼叫之間共用預設值,應以如下方式編寫函式:" -#: ../../tutorial/controlflow.rst:439 +#: ../../tutorial/controlflow.rst:445 msgid "Keyword Arguments" msgstr "關鍵字引數" -#: ../../tutorial/controlflow.rst:441 +#: ../../tutorial/controlflow.rst:447 msgid "" "Functions can also be called using :term:`keyword arguments ` of the form ``kwarg=value``. For instance, the following " @@ -537,7 +543,7 @@ msgstr "" "\n" "::" -#: ../../tutorial/controlflow.rst:450 +#: ../../tutorial/controlflow.rst:456 msgid "" "accepts one required argument (``voltage``) and three optional arguments " "(``state``, ``action``, and ``type``). This function can be called in any " @@ -548,14 +554,14 @@ msgstr "" "\n" "::" -#: ../../tutorial/controlflow.rst:461 +#: ../../tutorial/controlflow.rst:467 msgid "but all the following calls would be invalid::" msgstr "" "但以下呼叫方式都無效:\n" "\n" "::" -#: ../../tutorial/controlflow.rst:468 +#: ../../tutorial/controlflow.rst:474 msgid "" "In a function call, keyword arguments must follow positional arguments. All " "the keyword arguments passed must match one of the arguments accepted by the " @@ -573,7 +579,7 @@ msgstr "" "\n" "::" -#: ../../tutorial/controlflow.rst:484 +#: ../../tutorial/controlflow.rst:490 msgid "" "When a final formal parameter of the form ``**name`` is present, it receives " "a dictionary (see :ref:`typesmapping`) containing all keyword arguments " @@ -591,31 +597,31 @@ msgstr "" "\n" "::" -#: ../../tutorial/controlflow.rst:501 +#: ../../tutorial/controlflow.rst:507 msgid "It could be called like this::" msgstr "" "它可以被如此呼叫:\n" "\n" "::" -#: ../../tutorial/controlflow.rst:509 +#: ../../tutorial/controlflow.rst:515 msgid "and of course it would print:" msgstr "" "輸出結果如下:\n" "\n" "::" -#: ../../tutorial/controlflow.rst:522 +#: ../../tutorial/controlflow.rst:528 msgid "" "Note that the order in which the keyword arguments are printed is guaranteed " "to match the order in which they were provided in the function call." msgstr "注意,關鍵字引數的輸出順序與呼叫函式時被提供的順序必定一致。" -#: ../../tutorial/controlflow.rst:526 +#: ../../tutorial/controlflow.rst:532 msgid "Special parameters" msgstr "特殊參數" -#: ../../tutorial/controlflow.rst:528 +#: ../../tutorial/controlflow.rst:534 msgid "" "By default, arguments may be passed to a Python function either by position " "or explicitly by keyword. For readability and performance, it makes sense to " @@ -627,11 +633,11 @@ msgstr "" "及效能,限制引數的傳遞方式是合理的,如此,開發者只需查看函式定義,即可確定各" "項目是按位置,按位置或關鍵字,還是按關鍵字傳遞。" -#: ../../tutorial/controlflow.rst:534 +#: ../../tutorial/controlflow.rst:540 msgid "A function definition may look like:" msgstr "函式定義可能如以下樣式:" -#: ../../tutorial/controlflow.rst:545 +#: ../../tutorial/controlflow.rst:551 msgid "" "where ``/`` and ``*`` are optional. If used, these symbols indicate the kind " "of parameter by how the arguments may be passed to the function: positional-" @@ -642,22 +648,22 @@ msgstr "" "類:僅限位置、位置或關鍵字、僅限關鍵字。關鍵字參數也稱為附名參數 (named " "parameters)。" -#: ../../tutorial/controlflow.rst:552 +#: ../../tutorial/controlflow.rst:558 msgid "Positional-or-Keyword Arguments" msgstr "位置或關鍵字引數 (Positional-or-Keyword Arguments)" -#: ../../tutorial/controlflow.rst:554 +#: ../../tutorial/controlflow.rst:560 msgid "" "If ``/`` and ``*`` are not present in the function definition, arguments may " "be passed to a function by position or by keyword." msgstr "" "若函式定義中未使用 ``/`` 和 ``*`` 時,引數可以按位置或關鍵字傳遞給函式。" -#: ../../tutorial/controlflow.rst:559 +#: ../../tutorial/controlflow.rst:565 msgid "Positional-Only Parameters" msgstr "僅限位置參數 (Positional-Only Parameters)" -#: ../../tutorial/controlflow.rst:561 +#: ../../tutorial/controlflow.rst:567 msgid "" "Looking at this in a bit more detail, it is possible to mark certain " "parameters as *positional-only*. If *positional-only*, the parameters' order " @@ -672,17 +678,17 @@ msgstr "" "``\\ (斜線)之前。\\ ``/`` 用於在邏輯上分開僅限位置參數與其餘參數。如果函式" "定義中沒有 ``/``\\ ,則表示沒有任何僅限位置參數。" -#: ../../tutorial/controlflow.rst:569 +#: ../../tutorial/controlflow.rst:575 msgid "" "Parameters following the ``/`` may be *positional-or-keyword* or *keyword-" "only*." msgstr "``/`` 後面的參數可以是\\ *位置或關鍵字*\\ 或\\ *僅限關鍵字*\\ 參數。" -#: ../../tutorial/controlflow.rst:573 +#: ../../tutorial/controlflow.rst:579 msgid "Keyword-Only Arguments" msgstr "僅限關鍵字引數 (Keyword-Only Arguments)" -#: ../../tutorial/controlflow.rst:575 +#: ../../tutorial/controlflow.rst:581 msgid "" "To mark parameters as *keyword-only*, indicating the parameters must be " "passed by keyword argument, place an ``*`` in the arguments list just before " @@ -691,11 +697,11 @@ msgstr "" "要把參數標記為\\ *僅限關鍵字*\\ ,表明參數必須以關鍵字引數傳遞,必須在引數列" "表中第一個\\ *僅限關鍵字*\\ 參數前放上 ``*``\\ 。" -#: ../../tutorial/controlflow.rst:581 +#: ../../tutorial/controlflow.rst:587 msgid "Function Examples" msgstr "函式範例" -#: ../../tutorial/controlflow.rst:583 +#: ../../tutorial/controlflow.rst:589 msgid "" "Consider the following example function definitions paying close attention " "to the markers ``/`` and ``*``::" @@ -704,7 +710,7 @@ msgstr "" "\n" "::" -#: ../../tutorial/controlflow.rst:599 +#: ../../tutorial/controlflow.rst:605 msgid "" "The first function definition, ``standard_arg``, the most familiar form, " "places no restrictions on the calling convention and arguments may be passed " @@ -715,7 +721,7 @@ msgstr "" "\n" "::" -#: ../../tutorial/controlflow.rst:609 +#: ../../tutorial/controlflow.rst:615 msgid "" "The second function ``pos_only_arg`` is restricted to only use positional " "parameters as there is a ``/`` in the function definition::" @@ -724,7 +730,7 @@ msgstr "" "\n" "::" -#: ../../tutorial/controlflow.rst:620 +#: ../../tutorial/controlflow.rst:626 msgid "" "The third function ``kwd_only_args`` only allows keyword arguments as " "indicated by a ``*`` in the function definition::" @@ -733,7 +739,7 @@ msgstr "" "\n" "::" -#: ../../tutorial/controlflow.rst:631 +#: ../../tutorial/controlflow.rst:637 msgid "" "And the last uses all three calling conventions in the same function " "definition::" @@ -742,7 +748,7 @@ msgstr "" "\n" "::" -#: ../../tutorial/controlflow.rst:651 +#: ../../tutorial/controlflow.rst:657 msgid "" "Finally, consider this function definition which has a potential collision " "between the positional argument ``name`` and ``**kwds`` which has ``name`` " @@ -753,7 +759,7 @@ msgstr "" "\n" "::" -#: ../../tutorial/controlflow.rst:656 +#: ../../tutorial/controlflow.rst:662 msgid "" "There is no possible call that will make it return ``True`` as the keyword " "``'name'`` will always bind to the first parameter. For example::" @@ -763,7 +769,7 @@ msgstr "" "\n" "::" -#: ../../tutorial/controlflow.rst:665 +#: ../../tutorial/controlflow.rst:671 msgid "" "But using ``/`` (positional only arguments), it is possible since it allows " "``name`` as a positional argument and ``'name'`` as a key in the keyword " @@ -774,17 +780,17 @@ msgstr "" "\n" "::" -#: ../../tutorial/controlflow.rst:672 +#: ../../tutorial/controlflow.rst:678 msgid "" "In other words, the names of positional-only parameters can be used in " "``**kwds`` without ambiguity." msgstr "換句話說,僅限位置參數的名稱可以在 ``**kwds`` 中使用,而不產生歧義。" -#: ../../tutorial/controlflow.rst:677 +#: ../../tutorial/controlflow.rst:683 msgid "Recap" msgstr "回顧" -#: ../../tutorial/controlflow.rst:679 +#: ../../tutorial/controlflow.rst:685 msgid "" "The use case will determine which parameters to use in the function " "definition::" @@ -793,11 +799,11 @@ msgstr "" "\n" "::" -#: ../../tutorial/controlflow.rst:683 +#: ../../tutorial/controlflow.rst:689 msgid "As guidance:" msgstr "說明:" -#: ../../tutorial/controlflow.rst:685 +#: ../../tutorial/controlflow.rst:691 msgid "" "Use positional-only if you want the name of the parameters to not be " "available to the user. This is useful when parameter names have no real " @@ -809,7 +815,7 @@ msgstr "" "想控制引數在函式呼叫的排列順序,或同時使用位置參數和任意關鍵字時,這種方式很" "有用。" -#: ../../tutorial/controlflow.rst:690 +#: ../../tutorial/controlflow.rst:696 msgid "" "Use keyword-only when names have meaning and the function definition is more " "understandable by being explicit with names or you want to prevent users " @@ -818,7 +824,7 @@ msgstr "" "當參數名稱有意義,且明確的名稱可讓函式定義更易理解,或是你不希望使用者依賴引" "數被傳遞時的位置時,請使用僅限關鍵字。" -#: ../../tutorial/controlflow.rst:693 +#: ../../tutorial/controlflow.rst:699 msgid "" "For an API, use positional-only to prevent breaking API changes if the " "parameter's name is modified in the future." @@ -826,11 +832,11 @@ msgstr "" "對於應用程式介面 (API),使用僅限位置,以防止未來參數名稱被修改時造成 API 的中" "斷性變更。" -#: ../../tutorial/controlflow.rst:699 +#: ../../tutorial/controlflow.rst:705 msgid "Arbitrary Argument Lists" msgstr "任意引數列表 (Arbitrary Argument Lists)" -#: ../../tutorial/controlflow.rst:704 +#: ../../tutorial/controlflow.rst:710 msgid "" "Finally, the least frequently used option is to specify that a function can " "be called with an arbitrary number of arguments. These arguments will be " @@ -843,7 +849,7 @@ msgstr "" "\n" "::" -#: ../../tutorial/controlflow.rst:713 +#: ../../tutorial/controlflow.rst:719 msgid "" "Normally, these ``variadic`` arguments will be last in the list of formal " "parameters, because they scoop up all remaining input arguments that are " @@ -858,11 +864,11 @@ msgstr "" "\n" "::" -#: ../../tutorial/controlflow.rst:730 +#: ../../tutorial/controlflow.rst:736 msgid "Unpacking Argument Lists" msgstr "拆解引數列表(Unpacking Argument Lists)" -#: ../../tutorial/controlflow.rst:732 +#: ../../tutorial/controlflow.rst:738 msgid "" "The reverse situation occurs when the arguments are already in a list or " "tuple but need to be unpacked for a function call requiring separate " @@ -878,7 +884,7 @@ msgstr "" "\n" "::" -#: ../../tutorial/controlflow.rst:748 +#: ../../tutorial/controlflow.rst:754 msgid "" "In the same fashion, dictionaries can deliver keyword arguments with the " "``**``\\ -operator::" @@ -887,11 +893,11 @@ msgstr "" "\n" "::" -#: ../../tutorial/controlflow.rst:764 +#: ../../tutorial/controlflow.rst:770 msgid "Lambda Expressions" msgstr "Lambda 運算式" -#: ../../tutorial/controlflow.rst:766 +#: ../../tutorial/controlflow.rst:772 msgid "" "Small anonymous functions can be created with the :keyword:`lambda` keyword. " "This function returns the sum of its two arguments: ``lambda a, b: a+b``. " @@ -908,7 +914,7 @@ msgstr "" "\n" "::" -#: ../../tutorial/controlflow.rst:783 +#: ../../tutorial/controlflow.rst:789 msgid "" "The above example uses a lambda expression to return a function. Another " "use is to pass a small function as an argument::" @@ -918,17 +924,17 @@ msgstr "" "\n" "::" -#: ../../tutorial/controlflow.rst:795 +#: ../../tutorial/controlflow.rst:801 msgid "Documentation Strings" msgstr "說明文件字串 (Documentation Strings)" -#: ../../tutorial/controlflow.rst:802 +#: ../../tutorial/controlflow.rst:808 msgid "" "Here are some conventions about the content and formatting of documentation " "strings." msgstr "以下是關於說明文件字串內容和格式的慣例。" -#: ../../tutorial/controlflow.rst:805 +#: ../../tutorial/controlflow.rst:811 msgid "" "The first line should always be a short, concise summary of the object's " "purpose. For brevity, it should not explicitly state the object's name or " @@ -940,7 +946,7 @@ msgstr "" "的名稱或型別,因為有其他方法可以達到相同目的(除非該名稱剛好是一個描述函式運" "算的動詞)。這一行應以大寫字母開頭,以句號結尾。" -#: ../../tutorial/controlflow.rst:811 +#: ../../tutorial/controlflow.rst:817 msgid "" "If there are more lines in the documentation string, the second line should " "be blank, visually separating the summary from the rest of the description. " @@ -950,7 +956,7 @@ msgstr "" "文件字串為多行時,第二行應為空白行,在視覺上將摘要與其餘描述分開。後面幾行可" "包含一或多個段落,描述此物件的呼叫慣例、副作用等。" -#: ../../tutorial/controlflow.rst:816 +#: ../../tutorial/controlflow.rst:822 msgid "" "The Python parser does not strip indentation from multi-line string literals " "in Python, so tools that process documentation have to strip indentation if " @@ -972,18 +978,18 @@ msgstr "" "出現了,這些行的全部前導空白字元都應被去除。展開 tab 鍵後(通常為八個空格)," "應測試空白字元量是否等價。" -#: ../../tutorial/controlflow.rst:828 +#: ../../tutorial/controlflow.rst:834 msgid "Here is an example of a multi-line docstring::" msgstr "" "下面是多行說明字串的一個範例:\n" "\n" "::" -#: ../../tutorial/controlflow.rst:846 +#: ../../tutorial/controlflow.rst:852 msgid "Function Annotations" msgstr "函式註釋 (Function Annotations)" -#: ../../tutorial/controlflow.rst:854 +#: ../../tutorial/controlflow.rst:860 msgid "" ":ref:`Function annotations ` are completely optional metadata " "information about the types used by user-defined functions (see :pep:`3107` " @@ -992,7 +998,7 @@ msgstr "" ":ref:`函式註釋 `\\ 是選擇性的元資料(metadata)資訊,描述使用者定義" "函式所使用的型別(更多資訊詳見 :pep:`3107` 和 :pep:`484`\\ )。" -#: ../../tutorial/controlflow.rst:858 +#: ../../tutorial/controlflow.rst:864 msgid "" ":term:`Annotations ` are stored in the :attr:" "`__annotations__` attribute of the function as a dictionary and have no " @@ -1012,11 +1018,11 @@ msgstr "" "\n" "::" -#: ../../tutorial/controlflow.rst:880 +#: ../../tutorial/controlflow.rst:886 msgid "Intermezzo: Coding Style" msgstr "間奏曲:程式碼風格 (Coding Style)" -#: ../../tutorial/controlflow.rst:885 +#: ../../tutorial/controlflow.rst:891 msgid "" "Now that you are about to write longer, more complex pieces of Python, it is " "a good time to talk about *coding style*. Most languages can be written (or " @@ -1029,7 +1035,7 @@ msgstr "" "式比其他的更具可讀性。能讓其他人輕鬆閱讀你的程式碼永遠是一個好主意,而使用優" "良的編碼樣式對此有極大的幫助。" -#: ../../tutorial/controlflow.rst:891 +#: ../../tutorial/controlflow.rst:897 msgid "" "For Python, :pep:`8` has emerged as the style guide that most projects " "adhere to; it promotes a very readable and eye-pleasing coding style. Every " @@ -1039,11 +1045,11 @@ msgstr "" "對於 Python,大多數的專案都遵循 :pep:`8` 的樣式指南;它推行的編碼樣式相當可讀" "且賞心悅目。每個 Python 開發者都應該花點時間研讀;這裡是該指南的核心重點:" -#: ../../tutorial/controlflow.rst:896 +#: ../../tutorial/controlflow.rst:902 msgid "Use 4-space indentation, and no tabs." msgstr "用 4 個空格縮排,不要用 tab 鍵。" -#: ../../tutorial/controlflow.rst:898 +#: ../../tutorial/controlflow.rst:904 msgid "" "4 spaces are a good compromise between small indentation (allows greater " "nesting depth) and large indentation (easier to read). Tabs introduce " @@ -1052,11 +1058,11 @@ msgstr "" "4 個空格是小縮排(容許更大的巢套深度)和大縮排(較易閱讀)之間的折衷方案。" "Tab 鍵會造成混亂,最好別用。" -#: ../../tutorial/controlflow.rst:902 +#: ../../tutorial/controlflow.rst:908 msgid "Wrap lines so that they don't exceed 79 characters." msgstr "換行,使一行不超過 79 個字元。" -#: ../../tutorial/controlflow.rst:904 +#: ../../tutorial/controlflow.rst:910 msgid "" "This helps users with small displays and makes it possible to have several " "code files side-by-side on larger displays." @@ -1064,21 +1070,21 @@ msgstr "" "換行能讓使用小顯示器的使用者方便閱讀,也可以在較大顯示器上並排陳列多個程式碼" "檔案。" -#: ../../tutorial/controlflow.rst:907 +#: ../../tutorial/controlflow.rst:913 msgid "" "Use blank lines to separate functions and classes, and larger blocks of code " "inside functions." msgstr "用空行分隔函式和 class(類別),及函式內較大塊的程式碼。" -#: ../../tutorial/controlflow.rst:910 +#: ../../tutorial/controlflow.rst:916 msgid "When possible, put comments on a line of their own." msgstr "如果可以,把註解放在單獨一行。" -#: ../../tutorial/controlflow.rst:912 +#: ../../tutorial/controlflow.rst:918 msgid "Use docstrings." msgstr "使用說明字串。" -#: ../../tutorial/controlflow.rst:914 +#: ../../tutorial/controlflow.rst:920 msgid "" "Use spaces around operators and after commas, but not directly inside " "bracketing constructs: ``a = f(1, 2) + g(3, 4)``." @@ -1086,7 +1092,7 @@ msgstr "" "運算子前後、逗號後要加空格,但不要直接放在括號內側:\\ ``a = f(1, 2) + g(3, " "4)``\\ 。" -#: ../../tutorial/controlflow.rst:917 +#: ../../tutorial/controlflow.rst:923 msgid "" "Name your classes and functions consistently; the convention is to use " "``UpperCamelCase`` for classes and ``lowercase_with_underscores`` for " @@ -1098,7 +1104,7 @@ msgstr "" "底線)。永遠用 ``self`` 作為 method 第一個引數的名稱(關於 class 和 method," "詳見 :ref:`tut-firstclasses`\\ )。" -#: ../../tutorial/controlflow.rst:922 +#: ../../tutorial/controlflow.rst:928 msgid "" "Don't use fancy encodings if your code is meant to be used in international " "environments. Python's default, UTF-8, or even plain ASCII work best in any " @@ -1107,7 +1113,7 @@ msgstr "" "若程式碼是為了用於國際環境時,不要用花俏的編碼。Python 預設的 UTF-8 或甚至普" "通的 ASCII,就可以勝任各種情況。" -#: ../../tutorial/controlflow.rst:926 +#: ../../tutorial/controlflow.rst:932 msgid "" "Likewise, don't use non-ASCII characters in identifiers if there is only the " "slightest chance people speaking a different language will read or maintain " @@ -1116,11 +1122,11 @@ msgstr "" "同樣地,若不同語言使用者閱讀或維護程式碼的可能性微乎其微,就不要在命名時使用" "非 ASCII 字元。" -#: ../../tutorial/controlflow.rst:932 +#: ../../tutorial/controlflow.rst:938 msgid "Footnotes" msgstr "註解" -#: ../../tutorial/controlflow.rst:933 +#: ../../tutorial/controlflow.rst:939 msgid "" "Actually, *call by object reference* would be a better description, since if " "a mutable object is passed, the caller will see any changes the callee makes " @@ -1130,13 +1136,6 @@ msgstr "" "傳遞的是一個可變物件時,呼叫者將看得見被呼叫者對物件做出的任何改變(例如被插" "入 list 內的新項目)。" -#~ msgid "" -#~ "In chapter :ref:`tut-structures`, we will discuss in more detail about :" -#~ "func:`list`." -#~ msgstr "" -#~ "在\\ :ref:`tut-structures`\\ 章節中,我們會討論更多關於 :func:`list` 的細" -#~ "節。" - #~ msgid "" #~ "If you need to modify the sequence you are iterating over while inside " #~ "the loop (for example to duplicate selected items), it is recommended " diff --git a/tutorial/errors.po b/tutorial/errors.po index 8dda4eadce..687c0fbe46 100644 --- a/tutorial/errors.po +++ b/tutorial/errors.po @@ -9,7 +9,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.9\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2021-09-07 06:52+0000\n" +"POT-Creation-Date: 2020-06-20 18:08+0800\n" "PO-Revision-Date: 2021-06-29 22:16+0800\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -377,11 +377,11 @@ msgid "" "For more information about chaining mechanics, see :ref:`bltin-exceptions`." msgstr "更多關於鏈接機制的資訊,詳見\\ :ref:`bltin-exceptions`\\ 。" -#: ../../tutorial/errors.rst:321 +#: ../../tutorial/errors.rst:320 msgid "User-defined Exceptions" msgstr "使用者自定的例外" -#: ../../tutorial/errors.rst:323 +#: ../../tutorial/errors.rst:322 msgid "" "Programs may name their own exceptions by creating a new exception class " "(see :ref:`tut-classes` for more about Python classes). Exceptions should " @@ -392,7 +392,7 @@ msgstr "" "\\ :ref:`tut-classes`\\ )。不論是直接還是間接地,例外通常應該從 :exc:" "`Exception` class 衍生出來。" -#: ../../tutorial/errors.rst:327 +#: ../../tutorial/errors.rst:326 msgid "" "Exception classes can be defined which do anything any other class can do, " "but are usually kept simple, often only offering a number of attributes that " @@ -409,13 +409,13 @@ msgstr "" "\n" "::" -#: ../../tutorial/errors.rst:365 +#: ../../tutorial/errors.rst:364 msgid "" "Most exceptions are defined with names that end in \"Error\", similar to the " "naming of the standard exceptions." msgstr "大多數的例外定義,都會以「Error」作為名稱結尾,類似於標準例外的命名。" -#: ../../tutorial/errors.rst:368 +#: ../../tutorial/errors.rst:367 msgid "" "Many standard modules define their own exceptions to report errors that may " "occur in functions they define. More information on classes is presented in " @@ -424,11 +424,11 @@ msgstr "" "許多標準模組會定義它們自己的例外,以報告在其定義的函式中發生的錯誤。更多有關 " "class 的資訊,詳見\\ :ref:`tut-classes`\\ 章節。" -#: ../../tutorial/errors.rst:376 +#: ../../tutorial/errors.rst:375 msgid "Defining Clean-up Actions" msgstr "定義清理動作" -#: ../../tutorial/errors.rst:378 +#: ../../tutorial/errors.rst:377 msgid "" "The :keyword:`try` statement has another optional clause which is intended " "to define clean-up actions that must be executed under all circumstances. " @@ -439,7 +439,7 @@ msgstr "" "\n" "::" -#: ../../tutorial/errors.rst:392 +#: ../../tutorial/errors.rst:391 msgid "" "If a :keyword:`finally` clause is present, the :keyword:`!finally` clause " "will execute as the last task before the :keyword:`try` statement completes. " @@ -452,7 +452,7 @@ msgstr "" "外,都會執行 :keyword:`!finally` 子句。以下幾點將探討例外發生時,比較複雜的情" "況:" -#: ../../tutorial/errors.rst:398 +#: ../../tutorial/errors.rst:397 msgid "" "If an exception occurs during execution of the :keyword:`!try` clause, the " "exception may be handled by an :keyword:`except` clause. If the exception is " @@ -463,7 +463,7 @@ msgstr "" "`except` 子句處理。如果該例外沒有被 :keyword:`!except` 子句處理,它會在 :" "keyword:`!finally` 子句執行後被重新引發。" -#: ../../tutorial/errors.rst:404 +#: ../../tutorial/errors.rst:403 msgid "" "An exception could occur during execution of an :keyword:`!except` or :" "keyword:`!else` clause. Again, the exception is re-raised after the :keyword:" @@ -472,7 +472,7 @@ msgstr "" "一個例外可能發生於 :keyword:`!except` 或 :keyword:`!else` 子句的執行過程。同" "樣地,該例外會在 :keyword:`!finally` 子句執行後被重新引發。" -#: ../../tutorial/errors.rst:408 +#: ../../tutorial/errors.rst:407 msgid "" "If the :keyword:`!finally` clause executes a :keyword:`break`, :keyword:" "`continue` or :keyword:`return` statement, exceptions are not re-raised." @@ -480,7 +480,7 @@ msgstr "" "如果 :keyword:`!finally` 子句執行 :keyword:`break`\\ 、\\ :keyword:" "`continue` 或 :keyword:`return` 陳述式,則例外不會被重新引發。" -#: ../../tutorial/errors.rst:412 +#: ../../tutorial/errors.rst:411 msgid "" "If the :keyword:`!try` statement reaches a :keyword:`break`, :keyword:" "`continue` or :keyword:`return` statement, the :keyword:`!finally` clause " @@ -491,7 +491,7 @@ msgstr "" "或 :keyword:`return` 陳述式,則 :keyword:`!finally` 子句會在執行 :keyword:`!" "break`\\ 、\\ :keyword:`!continue` 或 :keyword:`!return` 陳述式之前先執行。" -#: ../../tutorial/errors.rst:418 +#: ../../tutorial/errors.rst:413 msgid "" "If a :keyword:`!finally` clause includes a :keyword:`!return` statement, the " "returned value will be the one from the :keyword:`!finally` clause's :" @@ -502,21 +502,21 @@ msgstr "" "自 :keyword:`!finally` 子句的 :keyword:`!return` 陳述式的回傳值,而不是來自 :" "keyword:`!try` 子句的 :keyword:`!return` 陳述式的回傳值。" -#: ../../tutorial/errors.rst:424 +#: ../../tutorial/errors.rst:419 msgid "For example::" msgstr "" "例如:\n" "\n" "::" -#: ../../tutorial/errors.rst:435 +#: ../../tutorial/errors.rst:430 msgid "A more complicated example::" msgstr "" "另一個比較複雜的範例:\n" "\n" "::" -#: ../../tutorial/errors.rst:460 +#: ../../tutorial/errors.rst:455 msgid "" "As you can see, the :keyword:`finally` clause is executed in any event. " "The :exc:`TypeError` raised by dividing two strings is not handled by the :" @@ -527,7 +527,7 @@ msgstr "" "發的 :exc:`TypeError` 沒有被 :keyword:`except` 子句處理,因此會在 :keyword:`!" "finally` 子句執行後被重新引發。" -#: ../../tutorial/errors.rst:465 +#: ../../tutorial/errors.rst:460 msgid "" "In real world applications, the :keyword:`finally` clause is useful for " "releasing external resources (such as files or network connections), " @@ -536,11 +536,11 @@ msgstr "" "在真實應用程式中,\\ :keyword:`finally` 子句對於釋放外部資源(例如檔案或網路" "連線)很有用,無論該資源的使用是否成功。" -#: ../../tutorial/errors.rst:473 +#: ../../tutorial/errors.rst:468 msgid "Predefined Clean-up Actions" msgstr "預定義的清理動作" -#: ../../tutorial/errors.rst:475 +#: ../../tutorial/errors.rst:470 msgid "" "Some objects define standard clean-up actions to be undertaken when the " "object is no longer needed, regardless of whether or not the operation using " @@ -552,7 +552,7 @@ msgstr "" "\n" "::" -#: ../../tutorial/errors.rst:483 +#: ../../tutorial/errors.rst:478 msgid "" "The problem with this code is that it leaves the file open for an " "indeterminate amount of time after this part of the code has finished " @@ -568,7 +568,7 @@ msgstr "" "\n" "::" -#: ../../tutorial/errors.rst:493 +#: ../../tutorial/errors.rst:488 msgid "" "After the statement is executed, the file *f* is always closed, even if a " "problem was encountered while processing the lines. Objects which, like " diff --git a/tutorial/inputoutput.po b/tutorial/inputoutput.po index 108db01172..7ea6c7ed9b 100644 --- a/tutorial/inputoutput.po +++ b/tutorial/inputoutput.po @@ -9,7 +9,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.9\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2021-09-07 06:52+0000\n" +"POT-Creation-Date: 2020-06-20 18:08+0800\n" "PO-Revision-Date: 2021-06-27 20:51+0800\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -452,17 +452,17 @@ msgstr "" "\n" "::" -#: ../../tutorial/inputoutput.rst:357 +#: ../../tutorial/inputoutput.rst:352 msgid "Methods of File Objects" msgstr "檔案物件的 method" -#: ../../tutorial/inputoutput.rst:359 +#: ../../tutorial/inputoutput.rst:354 msgid "" "The rest of the examples in this section will assume that a file object " "called ``f`` has already been created." msgstr "本節其餘的範例皆假設一個名為 ``f`` 的檔案物件已被建立。" -#: ../../tutorial/inputoutput.rst:362 +#: ../../tutorial/inputoutput.rst:357 msgid "" "To read a file's contents, call ``f.read(size)``, which reads some quantity " "of data and returns it as a string (in text mode) or bytes object (in binary " @@ -482,7 +482,7 @@ msgstr "" "\n" "::" -#: ../../tutorial/inputoutput.rst:376 +#: ../../tutorial/inputoutput.rst:371 msgid "" "``f.readline()`` reads a single line from the file; a newline character (``" "\\n``) is left at the end of the string, and is only omitted on the last " @@ -498,7 +498,7 @@ msgstr "" "\n" "::" -#: ../../tutorial/inputoutput.rst:390 +#: ../../tutorial/inputoutput.rst:385 msgid "" "For reading lines from a file, you can loop over the file object. This is " "memory efficient, fast, and leads to simple code::" @@ -508,7 +508,7 @@ msgstr "" "\n" "::" -#: ../../tutorial/inputoutput.rst:399 +#: ../../tutorial/inputoutput.rst:394 msgid "" "If you want to read all the lines of a file in a list you can also use " "``list(f)`` or ``f.readlines()``." @@ -516,7 +516,7 @@ msgstr "" "如果你想把一個檔案的所有行讀進一個 list 裡,可以用 ``list(f)`` 或 ``f." "readlines()``。" -#: ../../tutorial/inputoutput.rst:402 +#: ../../tutorial/inputoutput.rst:397 msgid "" "``f.write(string)`` writes the contents of *string* to the file, returning " "the number of characters written. ::" @@ -525,7 +525,7 @@ msgstr "" "\n" "::" -#: ../../tutorial/inputoutput.rst:408 +#: ../../tutorial/inputoutput.rst:403 msgid "" "Other types of objects need to be converted -- either to a string (in text " "mode) or a bytes object (in binary mode) -- before writing them::" @@ -535,7 +535,7 @@ msgstr "" "\n" "::" -#: ../../tutorial/inputoutput.rst:416 +#: ../../tutorial/inputoutput.rst:411 msgid "" "``f.tell()`` returns an integer giving the file object's current position in " "the file represented as number of bytes from the beginning of the file when " @@ -544,7 +544,7 @@ msgstr "" "``f.tell()`` 回傳一個整數,它給出檔案物件在檔案中的當前位置,在二進制模式下表" "示為檔案開始至今的位元組數,在文字模式下表示為一個意義不明的數字。" -#: ../../tutorial/inputoutput.rst:420 +#: ../../tutorial/inputoutput.rst:415 msgid "" "To change the file object's position, use ``f.seek(offset, whence)``. The " "position is computed from adding *offset* to a reference point; the " @@ -561,7 +561,7 @@ msgstr "" "\n" "::" -#: ../../tutorial/inputoutput.rst:439 +#: ../../tutorial/inputoutput.rst:434 msgid "" "In text files (those opened without a ``b`` in the mode string), only seeks " "relative to the beginning of the file are allowed (the exception being " @@ -574,7 +574,7 @@ msgstr "" "的值,或是 0,才是有效的 *offset* 值。其他任何 *offset* 值都會產生未定義的行" "為。" -#: ../../tutorial/inputoutput.rst:445 +#: ../../tutorial/inputoutput.rst:440 msgid "" "File objects have some additional methods, such as :meth:`~file.isatty` and :" "meth:`~file.truncate` which are less frequently used; consult the Library " @@ -583,11 +583,11 @@ msgstr "" "檔案物件還有一些附加的 method,像是較不常使用的 :meth:`~file.isatty` 和 :" "meth:`~file.truncate`\\ ;檔案物件的完整指南詳見程式庫參考手冊。" -#: ../../tutorial/inputoutput.rst:453 +#: ../../tutorial/inputoutput.rst:448 msgid "Saving structured data with :mod:`json`" msgstr "使用 :mod:`json` 儲存結構化資料" -#: ../../tutorial/inputoutput.rst:457 +#: ../../tutorial/inputoutput.rst:452 msgid "" "Strings can easily be written to and read from a file. Numbers take a bit " "more effort, since the :meth:`read` method only returns strings, which will " @@ -601,7 +601,7 @@ msgstr "" "樣的字串,並回傳數值 123。當你想儲存像是巢狀 list 和 dictionary(字典)等複雜" "的資料類型時,手動剖析 (parsing) 和序列化 (serializing) 就變得複雜。" -#: ../../tutorial/inputoutput.rst:464 +#: ../../tutorial/inputoutput.rst:459 msgid "" "Rather than having users constantly writing and debugging code to save " "complicated data types to files, Python allows you to use the popular data " @@ -620,7 +620,7 @@ msgstr "" "料則稱為 :dfn:`deserializing`\\ (反序列化)。在序列化和反序列化之間,表示物" "件的字串可以被儲存在檔案或資料中,或通過網路連接發送到遠端的機器。" -#: ../../tutorial/inputoutput.rst:475 +#: ../../tutorial/inputoutput.rst:470 msgid "" "The JSON format is commonly used by modern applications to allow for data " "exchange. Many programmers are already familiar with it, which makes it a " @@ -629,7 +629,7 @@ msgstr "" "JSON 格式經常地使用於現代應用程式的資料交換。許多程序設計師早已對它耳熟能詳," "使它成為提升互操作性 (interoperability) 的好選擇。" -#: ../../tutorial/inputoutput.rst:479 +#: ../../tutorial/inputoutput.rst:474 msgid "" "If you have an object ``x``, you can view its JSON string representation " "with a simple line of code::" @@ -638,7 +638,7 @@ msgstr "" "\n" "::" -#: ../../tutorial/inputoutput.rst:487 +#: ../../tutorial/inputoutput.rst:481 msgid "" "Another variant of the :func:`~json.dumps` function, called :func:`~json." "dump`, simply serializes the object to a :term:`text file`. So if ``f`` is " @@ -650,7 +650,7 @@ msgstr "" "\n" "::" -#: ../../tutorial/inputoutput.rst:493 +#: ../../tutorial/inputoutput.rst:487 msgid "" "To decode the object again, if ``f`` is a :term:`text file` object which has " "been opened for reading::" @@ -660,7 +660,7 @@ msgstr "" "\n" "::" -#: ../../tutorial/inputoutput.rst:498 +#: ../../tutorial/inputoutput.rst:492 msgid "" "This simple serialization technique can handle lists and dictionaries, but " "serializing arbitrary class instances in JSON requires a bit of extra " @@ -671,11 +671,11 @@ msgstr "" "class(類別)實例,則需要一些額外的工作。\\ :mod:`json` 模組的參考資料包含對" "此的說明。" -#: ../../tutorial/inputoutput.rst:504 +#: ../../tutorial/inputoutput.rst:498 msgid ":mod:`pickle` - the pickle module" msgstr ":mod:`pickle` - pickle 模組" -#: ../../tutorial/inputoutput.rst:506 +#: ../../tutorial/inputoutput.rst:500 msgid "" "Contrary to :ref:`JSON `, *pickle* is a protocol which allows the " "serialization of arbitrarily complex Python objects. As such, it is " diff --git a/tutorial/introduction.po b/tutorial/introduction.po index 8f8d9afc6a..6ecb3b4a38 100644 --- a/tutorial/introduction.po +++ b/tutorial/introduction.po @@ -10,7 +10,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.9\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2021-09-07 06:52+0000\n" +"POT-Creation-Date: 2020-06-20 18:08+0800\n" "PO-Revision-Date: 2021-06-08 13:21+0800\n" "Last-Translator: Ching-Hao Liu \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -332,21 +332,21 @@ msgstr "" #: ../../tutorial/introduction.rst:272 msgid "" -"Slice indices have useful defaults; an omitted first index defaults to zero, " -"an omitted second index defaults to the size of the string being sliced. ::" +"Note how the start is always included, and the end always excluded. This " +"makes sure that ``s[:i] + s[i:]`` is always equal to ``s``::" msgstr "" -"切片索引 (slice indices) 有很常用的預設值,省略起點索引值時預設為 0,而省略第" -"二個索引值時預設整個字串被包含在 slice 中:\n" +"注意到起點永遠被包含,而結尾永遠不被包含。這確保了 ``s[:i] + s[i:]`` 永遠等" +"於 ``s``:\n" "\n" "::" -#: ../../tutorial/introduction.rst:282 +#: ../../tutorial/introduction.rst:280 msgid "" -"Note how the start is always included, and the end always excluded. This " -"makes sure that ``s[:i] + s[i:]`` is always equal to ``s``::" +"Slice indices have useful defaults; an omitted first index defaults to zero, " +"an omitted second index defaults to the size of the string being sliced. ::" msgstr "" -"注意到起點永遠被包含,而結尾永遠不被包含。這確保了 ``s[:i] + s[i:]`` 永遠等" -"於 ``s``:\n" +"切片索引 (slice indices) 有很常用的預設值,省略起點索引值時預設為 0,而省略第" +"二個索引值時預設整個字串被包含在 slice 中:\n" "\n" "::" diff --git a/tutorial/modules.po b/tutorial/modules.po index 9fe2d8da13..5f15f088f6 100644 --- a/tutorial/modules.po +++ b/tutorial/modules.po @@ -9,17 +9,17 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.9\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2021-09-07 06:52+0000\n" +"POT-Creation-Date: 2018-06-28 20:03+0800\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-" "tw)\n" "Language: zh_TW\n" -"MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" "Plural-Forms: nplurals=1; plural=0;\n" "X-Generator: Poedit 2.4.3\n" +"MIME-Version: 1.0\n" #: ../../tutorial/modules.rst:5 msgid "Modules" @@ -187,11 +187,11 @@ msgstr "" #: ../../tutorial/modules.rst:115 msgid "" -"If the module name is followed by :keyword:`!as`, then the name following :" -"keyword:`!as` is bound directly to the imported module." +"If the module name is followed by :keyword:`!as`, then the name following " +":keyword:`!as` is bound directly to the imported module." msgstr "" -"如果模組名稱後面出現 :keyword:`!as`\\ ,則 :keyword:`!as` 之後的名稱將直接和" -"被 import 模組綁定在一起。" +"如果模組名稱後面出現 :keyword:`!as`\\ ,則 :keyword:`!as` 之後的名稱將直接和被 " +"import 模組綁定在一起。" #: ../../tutorial/modules.rst:124 msgid "" @@ -474,7 +474,7 @@ msgstr "" "\n" "::" -#: ../../tutorial/modules.rst:331 +#: ../../tutorial/modules.rst:327 msgid "" "Without arguments, :func:`dir` lists the names you have defined currently::" msgstr "" @@ -482,12 +482,12 @@ msgstr "" "\n" "::" -#: ../../tutorial/modules.rst:339 +#: ../../tutorial/modules.rst:335 msgid "" "Note that it lists all types of names: variables, modules, functions, etc." msgstr "請注意,它列出所有類型的名稱:變數、模組、函式等。" -#: ../../tutorial/modules.rst:343 +#: ../../tutorial/modules.rst:339 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 +498,11 @@ msgstr "" "\n" "::" -#: ../../tutorial/modules.rst:382 +#: ../../tutorial/modules.rst:378 msgid "Packages" msgstr "套件 (Package)" -#: ../../tutorial/modules.rst:384 +#: ../../tutorial/modules.rst:380 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 +517,7 @@ msgstr "" "的作者不需擔心與其他模組的全域變數名稱重複,點分隔模組名稱的使用,也讓多模組" "套件(像 NumPy 或 Pillow)的作者們不須擔心其他套件的模組名稱。" -#: ../../tutorial/modules.rst:392 +#: ../../tutorial/modules.rst:388 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 +539,13 @@ msgstr "" "一系列無止盡的模組來執行這些作業。以下是你的套件可能的架構(以階層式檔案系統" "的方式表示):" -#: ../../tutorial/modules.rst:429 +#: ../../tutorial/modules.rst:425 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:428 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 +559,7 @@ msgstr "" "尋路徑中的有效模組。在最簡單的情況,\\ :file:`__init__.py` 可以只是一個空白檔" "案;但它也可以執行套件的初始化程式碼,或設置 ``__all__`` 變數,之後會詳述。" -#: ../../tutorial/modules.rst:439 +#: ../../tutorial/modules.rst:435 msgid "" "Users of the package can import individual modules from the package, for " "example::" @@ -568,7 +568,7 @@ msgstr "" "\n" "::" -#: ../../tutorial/modules.rst:444 +#: ../../tutorial/modules.rst:440 msgid "" "This loads the submodule :mod:`sound.effects.echo`. It must be referenced " "with its full name. ::" @@ -577,14 +577,14 @@ msgstr "" "\n" "::" -#: ../../tutorial/modules.rst:449 +#: ../../tutorial/modules.rst:445 msgid "An alternative way of importing the submodule is::" msgstr "" "另一種 import 子模組的方法是:\n" "\n" "::" -#: ../../tutorial/modules.rst:453 +#: ../../tutorial/modules.rst:449 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 +594,7 @@ msgstr "" "\n" "::" -#: ../../tutorial/modules.rst:458 +#: ../../tutorial/modules.rst:454 msgid "" "Yet another variation is to import the desired function or variable " "directly::" @@ -603,7 +603,7 @@ msgstr "" "\n" "::" -#: ../../tutorial/modules.rst:462 +#: ../../tutorial/modules.rst:458 msgid "" "Again, this loads the submodule :mod:`echo`, but this makes its function :" "func:`echofilter` directly available::" @@ -613,7 +613,7 @@ msgstr "" "\n" "::" -#: ../../tutorial/modules.rst:467 +#: ../../tutorial/modules.rst:463 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 +627,7 @@ msgstr "" "陳述式首先測試套件中有沒有定義該 item;如果沒有,則會假設它是模組,並嘗試載" "入。如果還是找不到 item,則會引發 :exc:`ImportError` 例外。" -#: ../../tutorial/modules.rst:474 +#: ../../tutorial/modules.rst:470 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 +638,11 @@ msgstr "" "一項都必須是套件;最後一項可以是模組或套件,但不能是前一項中定義的 class、函" "式或變數。" -#: ../../tutorial/modules.rst:483 +#: ../../tutorial/modules.rst:479 msgid "Importing \\* From a Package" msgstr "從套件中 import \\*" -#: ../../tutorial/modules.rst:487 +#: ../../tutorial/modules.rst:483 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 +655,7 @@ msgstr "" "會花費較長的時間,且 import 子模組的過程可能會有不必要的副作用,這些副作用只" "有在明確地 import 子模組時才會發生。" -#: ../../tutorial/modules.rst:493 +#: ../../tutorial/modules.rst:489 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 +676,7 @@ msgstr "" "\n" "::" -#: ../../tutorial/modules.rst:505 +#: ../../tutorial/modules.rst:501 msgid "" "This would mean that ``from sound.effects import *`` would import the three " "named submodules of the :mod:`sound` package." @@ -684,7 +684,7 @@ msgstr "" "意思是,\\ ``from sound.effects import *`` 將會 import :mod:`sound` 套件中," "這三個被提名的子模組。" -#: ../../tutorial/modules.rst:508 +#: ../../tutorial/modules.rst:504 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 +705,7 @@ msgstr "" "\n" "::" -#: ../../tutorial/modules.rst:521 +#: ../../tutorial/modules.rst:517 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 +716,7 @@ msgstr "" "`surround` 模組被 import 進當前的命名空間,因為它們是在 :mod:`sound.effects` " "套件裡定義的。(當 ``__all__`` 有被定義時,這規則也有效。)" -#: ../../tutorial/modules.rst:526 +#: ../../tutorial/modules.rst:522 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 +725,7 @@ msgstr "" "雖然,有些特定模組的設計,讓你使用 ``import *`` 時,該模組只會輸出遵循特定樣" "式的名稱,但在正式環境 (production) 的程式碼中這仍然被視為是不良習慣。" -#: ../../tutorial/modules.rst:530 +#: ../../tutorial/modules.rst:526 msgid "" "Remember, there is nothing wrong with using ``from package import " "specific_submodule``! In fact, this is the recommended notation unless the " @@ -735,11 +735,11 @@ msgstr "" "記住,使用 ``from package import specific_submodule`` 不會有任何問題!實際" "上,這是推薦用法,除非 import 的模組需要用到的子模組和其他套件的子模組同名。" -#: ../../tutorial/modules.rst:537 +#: ../../tutorial/modules.rst:533 msgid "Intra-package References" msgstr "套件內引用" -#: ../../tutorial/modules.rst:539 +#: ../../tutorial/modules.rst:535 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 +752,7 @@ msgstr "" "filters.vocoder` 模組中使用 :mod:`sound.effects` 中的 :mod:`echo` 模組時,可" "以用 ``from sound.effects import echo``\\ 。" -#: ../../tutorial/modules.rst:545 +#: ../../tutorial/modules.rst:541 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 +765,7 @@ msgstr "" "\n" "::" -#: ../../tutorial/modules.rst:554 +#: ../../tutorial/modules.rst:550 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 +776,11 @@ msgstr "" "\"__main__\"``\\ ,所以如果一個模組預期被用作 Python 應用程式的主模組,那它必" "須永遠使用絕對 import。" -#: ../../tutorial/modules.rst:560 +#: ../../tutorial/modules.rst:556 msgid "Packages in Multiple Directories" msgstr "多目錄中的套件" -#: ../../tutorial/modules.rst:562 +#: ../../tutorial/modules.rst:558 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 +793,17 @@ msgstr "" "執行之前。這個變數可以被修改,但這樣做會影響將來對套件內的模組和子套件的搜" "尋。" -#: ../../tutorial/modules.rst:568 +#: ../../tutorial/modules.rst:564 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:569 msgid "Footnotes" msgstr "註解" -#: ../../tutorial/modules.rst:574 +#: ../../tutorial/modules.rst:570 msgid "" "In fact function definitions are also 'statements' that are 'executed'; the " "execution of a module-level function definition enters the function name in " diff --git a/tutorial/venv.po b/tutorial/venv.po index d80f80bd6e..1ce514e22d 100644 --- a/tutorial/venv.po +++ b/tutorial/venv.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.9\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2021-09-07 06:52+0000\n" +"POT-Creation-Date: 2020-06-20 18:08+0800\n" "PO-Revision-Date: 2021-06-27 20:20+0800\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -176,7 +176,7 @@ msgstr "" "會從 Python Package Index 安裝套件。你可以透過你的網頁瀏覽" "器瀏覽 Python Package Index。" -#: ../../tutorial/venv.rst:100 +#: ../../tutorial/venv.rst:111 msgid "" "``pip`` has a number of subcommands: \"install\", \"uninstall\", \"freeze\", " "etc. (Consult the :ref:`installing-index` guide for complete documentation " @@ -185,19 +185,19 @@ msgstr "" "``pip`` 有好幾個子指令:\"install\"、\"uninstall\"、\"freeze\" 等等。(可以參" "考\\ :ref:`installing-index`\\ 指南,來取得 ``pip`` 的完整說明文件。)" -#: ../../tutorial/venv.rst:104 +#: ../../tutorial/venv.rst:115 msgid "" "You can install the latest version of a package by specifying a package's " "name:" msgstr "你可以透過指定套件名字來安裝最新版本的套件:" -#: ../../tutorial/venv.rst:115 +#: ../../tutorial/venv.rst:126 msgid "" "You can also install a specific version of a package by giving the package " "name followed by ``==`` and the version number:" msgstr "你也可以透過在套件名稱之後接上 ``==`` 和版號來指定特定版本:" -#: ../../tutorial/venv.rst:126 +#: ../../tutorial/venv.rst:137 msgid "" "If you re-run this command, ``pip`` will notice that the requested version " "is already installed and do nothing. You can supply a different version " @@ -208,23 +208,23 @@ msgstr "" "提供不同的版本號碼來取得該版本,或是可以執行 ``pip install --upgrade`` 來把套" "件升級到最新的版本:" -#: ../../tutorial/venv.rst:141 +#: ../../tutorial/venv.rst:152 msgid "" "``pip uninstall`` followed by one or more package names will remove the " "packages from the virtual environment." msgstr "``pip uninstall`` 後面接一個或是多個套件名稱可以從虛擬環境中移除套件。" -#: ../../tutorial/venv.rst:144 +#: ../../tutorial/venv.rst:155 msgid "``pip show`` will display information about a particular package:" msgstr "``pip show`` 可以顯示一個特定套件的資訊:" -#: ../../tutorial/venv.rst:161 +#: ../../tutorial/venv.rst:172 msgid "" "``pip list`` will display all of the packages installed in the virtual " "environment:" msgstr "``pip list`` 會顯示虛擬環境中所有已經安裝的套件:" -#: ../../tutorial/venv.rst:173 +#: ../../tutorial/venv.rst:184 msgid "" "``pip freeze`` will produce a similar list of the installed packages, but " "the output uses the format that ``pip install`` expects. A common convention " @@ -234,7 +234,7 @@ msgstr "" "install`` 可以讀懂的格式。一個常見的慣例是放這整個清單到一個叫做 " "``requirements.txt`` 的檔案:" -#: ../../tutorial/venv.rst:185 +#: ../../tutorial/venv.rst:196 msgid "" "The ``requirements.txt`` can then be committed to version control and " "shipped as part of an application. Users can then install all the necessary " @@ -243,7 +243,7 @@ msgstr "" "``requirements.txt`` 可以提交到版本控制,並且作為釋出應用程式的一部分。使用者" "可以透過 ``install -r`` 安裝對應的的套件:" -#: ../../tutorial/venv.rst:202 +#: ../../tutorial/venv.rst:213 msgid "" "``pip`` has many more options. Consult the :ref:`installing-index` guide " "for complete documentation for ``pip``. When you've written a package and " diff --git a/using/cmdline.po b/using/cmdline.po index ae4334bd56..6f09749006 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-07 06:52+0000\n" +"POT-Creation-Date: 2020-06-20 18:08+0800\n" "PO-Revision-Date: 2018-05-23 16:19+0000\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -177,7 +177,7 @@ msgid "" "execution as a script. An example is the :mod:`timeit` module::" msgstr "" -#: ../../using/cmdline.rst:115 +#: ../../using/cmdline.rst:116 msgid "" "Raises an :ref:`auditing event ` ``cpython.run_module`` with " "argument ``module-name``." @@ -258,7 +258,7 @@ msgid "" "too." msgstr "" -#: ../../using/cmdline.rst:167 +#: ../../using/cmdline.rst:168 msgid "" "Raises an :ref:`auditing event ` ``cpython.run_file`` with " "argument ``filename``." @@ -723,7 +723,7 @@ msgid "" "file." msgstr "" -#: ../../using/cmdline.rst:558 +#: ../../using/cmdline.rst:None msgid "" "Raises an :ref:`auditing event ` ``cpython.run_startup`` with " "argument ``filename``." diff --git a/using/editors.po b/using/editors.po index 14de5d08ea..1a8ec96866 100644 --- a/using/editors.po +++ b/using/editors.po @@ -8,11 +8,10 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.9\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2021-09-07 06:52+0000\n" +"POT-Creation-Date: 2020-06-20 18:08+0800\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" -"Language: \n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" diff --git a/using/windows.po b/using/windows.po index 730d21c48d..bbe4541832 100644 --- a/using/windows.po +++ b/using/windows.po @@ -9,7 +9,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.7\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2021-09-07 06:52+0000\n" +"POT-Creation-Date: 2020-06-20 18:08+0800\n" "PO-Revision-Date: 2018-05-23 16:19+0000\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -46,8 +46,8 @@ msgstr "" msgid "" "As specified in :pep:`11`, a Python release only supports a Windows platform " "while Microsoft considers the platform under extended support. This means " -"that Python |version| supports Windows 8.1 and newer. If you require Windows " -"7 support, please install Python 3.8." +"that Python |version| supports Windows Vista and newer. If you require " +"Windows XP support then please install Python 3.4." msgstr "" #: ../../using/windows.rst:29 @@ -199,9 +199,9 @@ msgstr "" msgid "" "In the latest versions of Windows, this limitation can be expanded to " "approximately 32,000 characters. Your administrator will need to activate " -"the \"Enable Win32 long paths\" group policy, or set ``LongPathsEnabled`` to " -"``1`` in the registry key ``HKEY_LOCAL_MACHINE\\SYSTEM\\CurrentControlSet" -"\\Control\\FileSystem``." +"the \"Enable Win32 long paths\" group policy, or set the registry value " +"``HKEY_LOCAL_MACHINE\\SYSTEM\\CurrentControlSet\\Control" +"\\FileSystem@LongPathsEnabled`` to ``1``." msgstr "" #: ../../using/windows.rst:110 @@ -659,20 +659,11 @@ msgid "" "shared locations, you will need to install the full installer." msgstr "" -#: ../../using/windows.rst:342 -msgid "" -"For more detail on the technical basis for these limitations, please consult " -"Microsoft's documentation on packaged full-trust apps, currently available " -"at `docs.microsoft.com/en-us/windows/msix/desktop/desktop-to-uwp-behind-the-" -"scenes `_" -msgstr "" - -#: ../../using/windows.rst:351 +#: ../../using/windows.rst:346 msgid "The nuget.org packages" msgstr "" -#: ../../using/windows.rst:355 +#: ../../using/windows.rst:350 msgid "" "The nuget.org package is a reduced size Python environment intended for use " "on continuous integration and build systems that do not have a system-wide " @@ -680,14 +671,14 @@ msgid "" "works perfectly fine for packages containing build-time tools." msgstr "" -#: ../../using/windows.rst:360 +#: ../../using/windows.rst:355 msgid "" "Visit `nuget.org `_ for the most up-to-date " "information on using nuget. What follows is a summary that is sufficient for " "Python developers." msgstr "" -#: ../../using/windows.rst:364 +#: ../../using/windows.rst:359 msgid "" "The ``nuget.exe`` command line tool may be downloaded directly from " "``https://aka.ms/nugetclidl``, for example, using curl or PowerShell. With " @@ -695,7 +686,7 @@ msgid "" "installed using::" msgstr "" -#: ../../using/windows.rst:372 +#: ../../using/windows.rst:367 msgid "" "To select a particular version, add a ``-Version 3.x.y``. The output " "directory may be changed from ``.``, and the package will be installed into " @@ -705,7 +696,7 @@ msgid "" "directory that contains the Python installation::" msgstr "" -#: ../../using/windows.rst:387 +#: ../../using/windows.rst:382 msgid "" "In general, nuget packages are not upgradeable, and newer versions should be " "installed side-by-side and referenced using the full path. Alternatively, " @@ -713,7 +704,7 @@ msgid "" "will do this automatically if they do not preserve files between builds." msgstr "" -#: ../../using/windows.rst:392 +#: ../../using/windows.rst:387 msgid "" "Alongside the ``tools`` directory is a ``build\\native`` directory. This " "contains a MSBuild properties file ``python.props`` that can be used in a C+" @@ -721,7 +712,7 @@ msgid "" "automatically use the headers and import libraries in your build." msgstr "" -#: ../../using/windows.rst:397 +#: ../../using/windows.rst:392 msgid "" "The package information pages on nuget.org are `www.nuget.org/packages/" "python `_ for the 64-bit version and " @@ -729,18 +720,18 @@ msgid "" "pythonx86>`_ for the 32-bit version." msgstr "" -#: ../../using/windows.rst:406 +#: ../../using/windows.rst:401 msgid "The embeddable package" msgstr "" -#: ../../using/windows.rst:410 +#: ../../using/windows.rst:405 msgid "" "The embedded distribution is a ZIP file containing a minimal Python " "environment. It is intended for acting as part of another application, " "rather than being directly accessed by end-users." msgstr "" -#: ../../using/windows.rst:414 +#: ../../using/windows.rst:409 msgid "" "When extracted, the embedded distribution is (almost) fully isolated from " "the user's system, including environment variables, system registry " @@ -751,7 +742,7 @@ msgid "" "documentation are not included." msgstr "" -#: ../../using/windows.rst:423 +#: ../../using/windows.rst:418 msgid "" "The embedded distribution does not include the `Microsoft C Runtime `_ and it is the " @@ -761,7 +752,7 @@ msgid "" "system directory." msgstr "" -#: ../../using/windows.rst:430 +#: ../../using/windows.rst:425 msgid "" "Third-party packages should be installed by the application installer " "alongside the embedded distribution. Using pip to manage dependencies as for " @@ -772,16 +763,16 @@ msgid "" "compatibility with newer versions before providing updates to users." msgstr "" -#: ../../using/windows.rst:438 +#: ../../using/windows.rst:433 msgid "" "The two recommended use cases for this distribution are described below." msgstr "" -#: ../../using/windows.rst:441 +#: ../../using/windows.rst:436 msgid "Python Application" msgstr "" -#: ../../using/windows.rst:443 +#: ../../using/windows.rst:438 msgid "" "An application written in Python does not necessarily require users to be " "aware of that fact. The embedded distribution may be used in this case to " @@ -790,7 +781,7 @@ msgid "" "there are two options." msgstr "" -#: ../../using/windows.rst:449 +#: ../../using/windows.rst:444 msgid "" "Using a specialized executable as a launcher requires some coding, but " "provides the most transparent experience for users. With a customized " @@ -801,7 +792,7 @@ msgid "" "line." msgstr "" -#: ../../using/windows.rst:456 +#: ../../using/windows.rst:451 msgid "" "The simpler approach is to provide a batch file or generated shortcut that " "directly calls the ``python.exe`` or ``pythonw.exe`` with the required " @@ -810,7 +801,7 @@ msgid "" "from other running Python processes or file associations." msgstr "" -#: ../../using/windows.rst:462 +#: ../../using/windows.rst:457 msgid "" "With the latter approach, packages should be installed as directories " "alongside the Python executable to ensure they are available on the path. " @@ -819,11 +810,11 @@ msgid "" "application." msgstr "" -#: ../../using/windows.rst:468 +#: ../../using/windows.rst:463 msgid "Embedding Python" msgstr "嵌入 Python" -#: ../../using/windows.rst:470 +#: ../../using/windows.rst:465 msgid "" "Applications written in native code often require some form of scripting " "language, and the embedded Python distribution can be used for this purpose. " @@ -834,7 +825,7 @@ msgid "" "interpreter." msgstr "" -#: ../../using/windows.rst:477 +#: ../../using/windows.rst:472 msgid "" "As with the application use, packages can be installed to any location as " "there is an opportunity to specify search paths before initializing the " @@ -842,66 +833,66 @@ msgid "" "the embedded distribution and a regular installation." msgstr "" -#: ../../using/windows.rst:484 +#: ../../using/windows.rst:479 msgid "Alternative bundles" msgstr "" -#: ../../using/windows.rst:486 +#: ../../using/windows.rst:481 msgid "" "Besides the standard CPython distribution, there are modified packages " "including additional functionality. The following is a list of popular " "versions and their key features:" msgstr "" -#: ../../using/windows.rst:491 +#: ../../using/windows.rst:486 msgid "`ActivePython `_" msgstr "" -#: ../../using/windows.rst:491 +#: ../../using/windows.rst:486 msgid "Installer with multi-platform compatibility, documentation, PyWin32" msgstr "" -#: ../../using/windows.rst:495 +#: ../../using/windows.rst:490 msgid "`Anaconda `_" msgstr "" -#: ../../using/windows.rst:494 +#: ../../using/windows.rst:489 msgid "" "Popular scientific modules (such as numpy, scipy and pandas) and the " "``conda`` package manager." msgstr "" -#: ../../using/windows.rst:499 +#: ../../using/windows.rst:494 msgid "`Canopy `_" msgstr "" -#: ../../using/windows.rst:498 +#: ../../using/windows.rst:493 msgid "" "A \"comprehensive Python analysis environment\" with editors and other " "development tools." msgstr "" -#: ../../using/windows.rst:503 +#: ../../using/windows.rst:498 msgid "`WinPython `_" msgstr "" -#: ../../using/windows.rst:502 +#: ../../using/windows.rst:497 msgid "" "Windows-specific distribution with prebuilt scientific packages and tools " "for building packages." msgstr "" -#: ../../using/windows.rst:505 +#: ../../using/windows.rst:500 msgid "" "Note that these packages may not include the latest versions of Python or " "other libraries, and are not maintained or supported by the core Python team." msgstr "" -#: ../../using/windows.rst:511 +#: ../../using/windows.rst:506 msgid "Configuring Python" msgstr "設定 Python" -#: ../../using/windows.rst:513 +#: ../../using/windows.rst:508 msgid "" "To run Python conveniently from a command prompt, you might consider " "changing some default environment variables in Windows. While the installer " @@ -910,29 +901,29 @@ msgid "" "use multiple versions of Python, consider using the :ref:`launcher`." msgstr "" -#: ../../using/windows.rst:523 +#: ../../using/windows.rst:518 msgid "Excursus: Setting environment variables" msgstr "" -#: ../../using/windows.rst:525 +#: ../../using/windows.rst:520 msgid "" "Windows allows environment variables to be configured permanently at both " "the User level and the System level, or temporarily in a command prompt." msgstr "" -#: ../../using/windows.rst:528 +#: ../../using/windows.rst:523 msgid "" "To temporarily set environment variables, open Command Prompt and use the :" "command:`set` command:" msgstr "" -#: ../../using/windows.rst:537 +#: ../../using/windows.rst:532 msgid "" "These changes will apply to any further commands executed in that console, " "and will be inherited by any applications started from the console." msgstr "" -#: ../../using/windows.rst:540 +#: ../../using/windows.rst:535 msgid "" "Including the variable name within percent signs will expand to the existing " "value, allowing you to add your new value at either the start or the end. " @@ -941,7 +932,7 @@ msgid "" "launched." msgstr "" -#: ../../using/windows.rst:546 +#: ../../using/windows.rst:541 msgid "" "To permanently modify the default environment variables, click Start and " "search for 'edit environment variables', or open System properties, :" @@ -951,13 +942,13 @@ msgid "" "your machine (i.e. Administrator rights)." msgstr "" -#: ../../using/windows.rst:555 +#: ../../using/windows.rst:550 msgid "" "Windows will concatenate User variables *after* System variables, which may " "cause unexpected results when modifying :envvar:`PATH`." msgstr "" -#: ../../using/windows.rst:558 +#: ../../using/windows.rst:553 msgid "" "The :envvar:`PYTHONPATH` variable is used by all versions of Python 2 and " "Python 3, so you should not permanently configure this variable unless it " @@ -965,60 +956,60 @@ msgid "" "versions." msgstr "" -#: ../../using/windows.rst:566 +#: ../../using/windows.rst:561 msgid "https://www.microsoft.com/en-us/wdsi/help/folder-variables" msgstr "" -#: ../../using/windows.rst:566 +#: ../../using/windows.rst:561 msgid "Environment variables in Windows NT" msgstr "環境變數於 Windows NT" -#: ../../using/windows.rst:569 +#: ../../using/windows.rst:564 msgid "https://technet.microsoft.com/en-us/library/cc754250.aspx" msgstr "" -#: ../../using/windows.rst:569 +#: ../../using/windows.rst:564 msgid "The SET command, for temporarily modifying environment variables" msgstr "" -#: ../../using/windows.rst:572 +#: ../../using/windows.rst:567 msgid "https://technet.microsoft.com/en-us/library/cc755104.aspx" msgstr "" -#: ../../using/windows.rst:572 +#: ../../using/windows.rst:567 msgid "The SETX command, for permanently modifying environment variables" msgstr "" -#: ../../using/windows.rst:575 +#: ../../using/windows.rst:570 msgid "" "https://support.microsoft.com/en-us/help/310519/how-to-manage-environment-" "variables-in-windows-xp" msgstr "" -#: ../../using/windows.rst:575 +#: ../../using/windows.rst:570 msgid "How To Manage Environment Variables in Windows XP" msgstr "如何管理環境變數於 Windows XP" -#: ../../using/windows.rst:577 +#: ../../using/windows.rst:572 msgid "https://www.chem.gla.ac.uk/~louis/software/faq/q1.html" msgstr "" -#: ../../using/windows.rst:578 +#: ../../using/windows.rst:573 msgid "Setting Environment variables, Louis J. Farrugia" msgstr "設定環境變數-Louis J. Farrugia" -#: ../../using/windows.rst:583 +#: ../../using/windows.rst:578 msgid "Finding the Python executable" msgstr "" -#: ../../using/windows.rst:587 +#: ../../using/windows.rst:582 msgid "" "Besides using the automatically created start menu entry for the Python " "interpreter, you might want to start Python in the command prompt. The " "installer has an option to set that up for you." msgstr "" -#: ../../using/windows.rst:591 +#: ../../using/windows.rst:586 msgid "" "On the first page of the installer, an option labelled \"Add Python to PATH" "\" may be selected to have the installer add the install location into the :" @@ -1029,7 +1020,7 @@ msgid "" "documentation." msgstr "" -#: ../../using/windows.rst:598 +#: ../../using/windows.rst:593 msgid "" "If you don't enable this option at install time, you can always re-run the " "installer, select Modify, and enable it. Alternatively, you can manually " @@ -1040,24 +1031,24 @@ msgid "" "entries already existed)::" msgstr "" -#: ../../using/windows.rst:611 +#: ../../using/windows.rst:606 msgid "UTF-8 mode" msgstr "" -#: ../../using/windows.rst:615 +#: ../../using/windows.rst:610 msgid "" "Windows still uses legacy encodings for the system encoding (the ANSI Code " "Page). Python uses it for the default encoding of text files (e.g. :func:" "`locale.getpreferredencoding`)." msgstr "" -#: ../../using/windows.rst:619 +#: ../../using/windows.rst:614 msgid "" "This may cause issues because UTF-8 is widely used on the internet and most " "Unix systems, including WSL (Windows Subsystem for Linux)." msgstr "" -#: ../../using/windows.rst:622 +#: ../../using/windows.rst:617 msgid "" "You can use UTF-8 mode to change the default text encoding to UTF-8. You can " "enable UTF-8 mode via the ``-X utf8`` command line option, or the " @@ -1066,11 +1057,11 @@ msgid "" "environment variables." msgstr "" -#: ../../using/windows.rst:628 +#: ../../using/windows.rst:623 msgid "When UTF-8 mode is enabled:" msgstr "" -#: ../../using/windows.rst:630 +#: ../../using/windows.rst:625 msgid "" ":func:`locale.getpreferredencoding` returns ``'UTF-8'`` instead of the " "system encoding. This function is used for the default text encoding in " @@ -1078,17 +1069,17 @@ msgid "" "etc." msgstr "" -#: ../../using/windows.rst:634 +#: ../../using/windows.rst:629 msgid "" ":data:`sys.stdin`, :data:`sys.stdout`, and :data:`sys.stderr` all use UTF-8 " "as their text encoding." msgstr "" -#: ../../using/windows.rst:636 +#: ../../using/windows.rst:631 msgid "You can still use the system encoding via the \"mbcs\" codec." msgstr "" -#: ../../using/windows.rst:638 +#: ../../using/windows.rst:633 msgid "" "Note that adding ``PYTHONUTF8=1`` to the default environment variables will " "affect all Python 3.7+ applications on your system. If you have any Python " @@ -1097,25 +1088,25 @@ msgid "" "utf8`` command line option." msgstr "" -#: ../../using/windows.rst:645 +#: ../../using/windows.rst:640 msgid "" "Even when UTF-8 mode is disabled, Python uses UTF-8 by default on Windows " "for:" msgstr "" -#: ../../using/windows.rst:648 +#: ../../using/windows.rst:643 msgid "Console I/O including standard I/O (see :pep:`528` for details)." msgstr "" -#: ../../using/windows.rst:649 +#: ../../using/windows.rst:644 msgid "The filesystem encoding (see :pep:`529` for details)." msgstr "" -#: ../../using/windows.rst:655 +#: ../../using/windows.rst:650 msgid "Python Launcher for Windows" msgstr "" -#: ../../using/windows.rst:659 +#: ../../using/windows.rst:654 msgid "" "The Python launcher for Windows is a utility which aids in locating and " "executing of different Python versions. It allows scripts (or the command-" @@ -1123,7 +1114,7 @@ msgid "" "locate and execute that version." msgstr "" -#: ../../using/windows.rst:664 +#: ../../using/windows.rst:659 msgid "" "Unlike the :envvar:`PATH` variable, the launcher will correctly select the " "most appropriate version of Python. It will prefer per-user installations " @@ -1131,19 +1122,19 @@ msgid "" "most recently installed version." msgstr "" -#: ../../using/windows.rst:669 +#: ../../using/windows.rst:664 msgid "The launcher was originally specified in :pep:`397`." msgstr "" -#: ../../using/windows.rst:672 +#: ../../using/windows.rst:667 msgid "Getting started" msgstr "開始" -#: ../../using/windows.rst:675 +#: ../../using/windows.rst:670 msgid "From the command-line" msgstr "" -#: ../../using/windows.rst:679 +#: ../../using/windows.rst:674 msgid "" "System-wide installations of Python 3.3 and later will put the launcher on " "your :envvar:`PATH`. The launcher is compatible with all available versions " @@ -1151,45 +1142,45 @@ msgid "" "the launcher is available, execute the following command in Command Prompt:" msgstr "" -#: ../../using/windows.rst:688 +#: ../../using/windows.rst:683 msgid "" "You should find that the latest version of Python you have installed is " "started - it can be exited as normal, and any additional command-line " "arguments specified will be sent directly to Python." msgstr "" -#: ../../using/windows.rst:692 +#: ../../using/windows.rst:687 msgid "" "If you have multiple versions of Python installed (e.g., 2.7 and |version|) " "you will have noticed that Python |version| was started - to launch Python " "2.7, try the command:" msgstr "" -#: ../../using/windows.rst:700 +#: ../../using/windows.rst:695 msgid "" "If you want the latest version of Python 2.x you have installed, try the " "command:" msgstr "" -#: ../../using/windows.rst:707 +#: ../../using/windows.rst:702 msgid "You should find the latest version of Python 2.x starts." msgstr "" -#: ../../using/windows.rst:709 +#: ../../using/windows.rst:704 msgid "If you see the following error, you do not have the launcher installed:" msgstr "" -#: ../../using/windows.rst:716 +#: ../../using/windows.rst:711 msgid "" "Per-user installations of Python do not add the launcher to :envvar:`PATH` " "unless the option was selected on installation." msgstr "" -#: ../../using/windows.rst:720 +#: ../../using/windows.rst:715 msgid "Virtual environments" msgstr "虛擬環境(Virtual environment)" -#: ../../using/windows.rst:724 +#: ../../using/windows.rst:719 msgid "" "If the launcher is run with no explicit Python version specification, and a " "virtual environment (created with the standard library :mod:`venv` module or " @@ -1199,27 +1190,27 @@ msgid "" "specify the global Python version." msgstr "" -#: ../../using/windows.rst:732 +#: ../../using/windows.rst:727 msgid "From a script" msgstr "" -#: ../../using/windows.rst:734 +#: ../../using/windows.rst:729 msgid "" "Let's create a test Python script - create a file called ``hello.py`` with " "the following contents" msgstr "" -#: ../../using/windows.rst:743 +#: ../../using/windows.rst:738 msgid "From the directory in which hello.py lives, execute the command:" msgstr "" -#: ../../using/windows.rst:749 +#: ../../using/windows.rst:744 msgid "" "You should notice the version number of your latest Python 2.x installation " "is printed. Now try changing the first line to be:" msgstr "" -#: ../../using/windows.rst:756 +#: ../../using/windows.rst:751 msgid "" "Re-executing the command should now print the latest Python 3.x information. " "As with the above command-line examples, you can specify a more explicit " @@ -1228,7 +1219,7 @@ msgid "" "information printed." msgstr "" -#: ../../using/windows.rst:762 +#: ../../using/windows.rst:757 msgid "" "Note that unlike interactive use, a bare \"python\" will use the latest " "version of Python 2.x that you have installed. This is for backward " @@ -1236,11 +1227,11 @@ msgid "" "typically refers to Python 2." msgstr "" -#: ../../using/windows.rst:768 +#: ../../using/windows.rst:763 msgid "From file associations" msgstr "從檔案關聯" -#: ../../using/windows.rst:770 +#: ../../using/windows.rst:765 msgid "" "The launcher should have been associated with Python files (i.e. ``.py``, ``." "pyw``, ``.pyc`` files) when it was installed. This means that when you " @@ -1249,17 +1240,17 @@ msgid "" "have the script specify the version which should be used." msgstr "" -#: ../../using/windows.rst:776 +#: ../../using/windows.rst:771 msgid "" "The key benefit of this is that a single launcher can support multiple " "Python versions at the same time depending on the contents of the first line." msgstr "" -#: ../../using/windows.rst:780 +#: ../../using/windows.rst:775 msgid "Shebang Lines" msgstr "" -#: ../../using/windows.rst:782 +#: ../../using/windows.rst:777 msgid "" "If the first line of a script file starts with ``#!``, it is known as a " "\"shebang\" line. Linux and other Unix like operating systems have native " @@ -1269,34 +1260,34 @@ msgid "" "demonstrate their use." msgstr "" -#: ../../using/windows.rst:789 +#: ../../using/windows.rst:784 msgid "" "To allow shebang lines in Python scripts to be portable between Unix and " "Windows, this launcher supports a number of 'virtual' commands to specify " "which interpreter to use. The supported virtual commands are:" msgstr "" -#: ../../using/windows.rst:793 +#: ../../using/windows.rst:788 msgid "``/usr/bin/env python``" msgstr "``/usr/bin/env python``" -#: ../../using/windows.rst:794 +#: ../../using/windows.rst:789 msgid "``/usr/bin/python``" msgstr "``/usr/bin/python``" -#: ../../using/windows.rst:795 +#: ../../using/windows.rst:790 msgid "``/usr/local/bin/python``" msgstr "`/usr/local/bin/python``" -#: ../../using/windows.rst:796 +#: ../../using/windows.rst:791 msgid "``python``" msgstr "``python``" -#: ../../using/windows.rst:798 +#: ../../using/windows.rst:793 msgid "For example, if the first line of your script starts with" msgstr "" -#: ../../using/windows.rst:804 +#: ../../using/windows.rst:799 msgid "" "The default Python will be located and used. As many Python scripts written " "to work on Unix will already have this line, you should find these scripts " @@ -1305,7 +1296,7 @@ msgid "" "of the shebang lines starting with ``/usr``." msgstr "" -#: ../../using/windows.rst:810 +#: ../../using/windows.rst:805 msgid "" "Any of the above virtual commands can be suffixed with an explicit version " "(either just the major version, or the major and minor version). Furthermore " @@ -1314,14 +1305,14 @@ msgid "" "python 2.7." msgstr "" -#: ../../using/windows.rst:818 +#: ../../using/windows.rst:813 msgid "" "Beginning with python launcher 3.7 it is possible to request 64-bit version " "by the \"-64\" suffix. Furthermore it is possible to specify a major and " "architecture without minor (i.e. ``/usr/bin/python3-64``)." msgstr "" -#: ../../using/windows.rst:822 +#: ../../using/windows.rst:817 msgid "" "The ``/usr/bin/env`` form of shebang line has one further special property. " "Before looking for installed Python interpreters, this form will search the " @@ -1330,29 +1321,29 @@ msgid "" "search." msgstr "" -#: ../../using/windows.rst:828 +#: ../../using/windows.rst:823 msgid "Arguments in shebang lines" msgstr "" -#: ../../using/windows.rst:830 +#: ../../using/windows.rst:825 msgid "" "The shebang lines can also specify additional options to be passed to the " "Python interpreter. For example, if you have a shebang line:" msgstr "" -#: ../../using/windows.rst:837 +#: ../../using/windows.rst:832 msgid "Then Python will be started with the ``-v`` option" msgstr "" -#: ../../using/windows.rst:840 +#: ../../using/windows.rst:835 msgid "Customization" msgstr "" -#: ../../using/windows.rst:843 +#: ../../using/windows.rst:838 msgid "Customization via INI files" msgstr "" -#: ../../using/windows.rst:845 +#: ../../using/windows.rst:840 msgid "" "Two .ini files will be searched by the launcher - ``py.ini`` in the current " "user's \"application data\" directory (i.e. the directory returned by " @@ -1362,7 +1353,7 @@ msgid "" "launcher (i.e. py.exe) and for the 'windows' version (i.e. pyw.exe)." msgstr "" -#: ../../using/windows.rst:852 +#: ../../using/windows.rst:847 msgid "" "Customization specified in the \"application directory\" will have " "precedence over the one next to the executable, so a user, who may not have " @@ -1370,11 +1361,11 @@ msgid "" "that global .ini file." msgstr "" -#: ../../using/windows.rst:857 +#: ../../using/windows.rst:852 msgid "Customizing default Python versions" msgstr "" -#: ../../using/windows.rst:859 +#: ../../using/windows.rst:854 msgid "" "In some cases, a version qualifier can be included in a command to dictate " "which version of Python will be used by the command. A version qualifier " @@ -1384,13 +1375,13 @@ msgid "" "\"-32\" or \"-64\"." msgstr "" -#: ../../using/windows.rst:865 +#: ../../using/windows.rst:860 msgid "" "For example, a shebang line of ``#!python`` has no version qualifier, while " "``#!python3`` has a version qualifier which specifies only a major version." msgstr "" -#: ../../using/windows.rst:868 +#: ../../using/windows.rst:863 msgid "" "If no version qualifiers are found in a command, the environment variable :" "envvar:`PY_PYTHON` can be set to specify the default version qualifier. If " @@ -1400,7 +1391,7 @@ msgid "" "launcher included with Python 3.7 or newer.)" msgstr "" -#: ../../using/windows.rst:875 +#: ../../using/windows.rst:870 msgid "" "If no minor version qualifiers are found, the environment variable " "``PY_PYTHON{major}`` (where ``{major}`` is the current major version " @@ -1411,7 +1402,7 @@ msgid "" "version in that family." msgstr "" -#: ../../using/windows.rst:883 +#: ../../using/windows.rst:878 msgid "" "On 64-bit Windows with both 32-bit and 64-bit implementations of the same " "(major.minor) Python version installed, the 64-bit version will always be " @@ -1425,30 +1416,30 @@ msgid "" "suffix can be used on a version specifier to change this behaviour." msgstr "" -#: ../../using/windows.rst:894 +#: ../../using/windows.rst:889 msgid "Examples:" msgstr "" -#: ../../using/windows.rst:896 +#: ../../using/windows.rst:891 msgid "" "If no relevant options are set, the commands ``python`` and ``python2`` will " "use the latest Python 2.x version installed and the command ``python3`` will " "use the latest Python 3.x installed." msgstr "" -#: ../../using/windows.rst:900 +#: ../../using/windows.rst:895 msgid "" "The commands ``python3.1`` and ``python2.7`` will not consult any options at " "all as the versions are fully specified." msgstr "" -#: ../../using/windows.rst:903 +#: ../../using/windows.rst:898 msgid "" "If ``PY_PYTHON=3``, the commands ``python`` and ``python3`` will both use " "the latest installed Python 3 version." msgstr "" -#: ../../using/windows.rst:906 +#: ../../using/windows.rst:901 msgid "" "If ``PY_PYTHON=3.1-32``, the command ``python`` will use the 32-bit " "implementation of 3.1 whereas the command ``python3`` will use the latest " @@ -1456,13 +1447,13 @@ msgid "" "specified.)" msgstr "" -#: ../../using/windows.rst:911 +#: ../../using/windows.rst:906 msgid "" "If ``PY_PYTHON=3`` and ``PY_PYTHON3=3.1``, the commands ``python`` and " "``python3`` will both use specifically 3.1" msgstr "" -#: ../../using/windows.rst:914 +#: ../../using/windows.rst:909 msgid "" "In addition to environment variables, the same settings can be configured in " "the .INI file used by the launcher. The section in the INI file is called " @@ -1472,25 +1463,25 @@ msgid "" "will override things specified in the INI file." msgstr "" -#: ../../using/windows.rst:921 +#: ../../using/windows.rst:916 msgid "For example:" msgstr "" -#: ../../using/windows.rst:923 +#: ../../using/windows.rst:918 msgid "Setting ``PY_PYTHON=3.1`` is equivalent to the INI file containing:" msgstr "" -#: ../../using/windows.rst:930 +#: ../../using/windows.rst:925 msgid "" "Setting ``PY_PYTHON=3`` and ``PY_PYTHON3=3.1`` is equivalent to the INI file " "containing:" msgstr "" -#: ../../using/windows.rst:940 +#: ../../using/windows.rst:935 msgid "Diagnostics" msgstr "" -#: ../../using/windows.rst:942 +#: ../../using/windows.rst:937 msgid "" "If an environment variable ``PYLAUNCH_DEBUG`` is set (to any value), the " "launcher will print diagnostic information to stderr (i.e. to the console). " @@ -1500,11 +1491,11 @@ msgid "" "target Python." msgstr "" -#: ../../using/windows.rst:954 +#: ../../using/windows.rst:949 msgid "Finding modules" msgstr "" -#: ../../using/windows.rst:956 +#: ../../using/windows.rst:951 msgid "" "Python usually stores its library (and thereby your site-packages folder) in " "the installation directory. So, if you had installed Python to :file:`C:\\" @@ -1513,7 +1504,7 @@ msgid "" "\\\\site-packages\\\\`." msgstr "" -#: ../../using/windows.rst:962 +#: ../../using/windows.rst:957 msgid "" "To completely override :data:`sys.path`, create a ``._pth`` file with the " "same name as the DLL (``python37._pth``) or the executable (``python._pth``) " @@ -1522,7 +1513,7 @@ msgid "" "allows paths to be restricted for any program loading the runtime if desired." msgstr "" -#: ../../using/windows.rst:968 +#: ../../using/windows.rst:963 msgid "" "When the file exists, all registry and environment variables are ignored, " "isolated mode is enabled, and :mod:`site` is not imported unless one line in " @@ -1532,25 +1523,25 @@ msgid "" "arbitrary code cannot be specified." msgstr "" -#: ../../using/windows.rst:975 +#: ../../using/windows.rst:970 msgid "" "Note that ``.pth`` files (without leading underscore) will be processed " "normally by the :mod:`site` module when ``import site`` has been specified." msgstr "" -#: ../../using/windows.rst:978 +#: ../../using/windows.rst:973 msgid "" "When no ``._pth`` file is found, this is how :data:`sys.path` is populated " "on Windows:" msgstr "" -#: ../../using/windows.rst:981 +#: ../../using/windows.rst:976 msgid "" "An empty entry is added at the start, which corresponds to the current " "directory." msgstr "" -#: ../../using/windows.rst:984 +#: ../../using/windows.rst:979 msgid "" "If the environment variable :envvar:`PYTHONPATH` exists, as described in :" "ref:`using-on-envvars`, its entries are added next. Note that on Windows, " @@ -1558,7 +1549,7 @@ msgid "" "from the colon used in drive identifiers (``C:\\`` etc.)." msgstr "" -#: ../../using/windows.rst:989 +#: ../../using/windows.rst:984 msgid "" "Additional \"application paths\" can be added in the registry as subkeys of :" "samp:`\\\\SOFTWARE\\\\Python\\\\PythonCore\\\\{version}\\\\PythonPath` under " @@ -1568,7 +1559,7 @@ msgid "" "installers only use HKLM, so HKCU is typically empty.)" msgstr "" -#: ../../using/windows.rst:996 +#: ../../using/windows.rst:991 msgid "" "If the environment variable :envvar:`PYTHONHOME` is set, it is assumed as " "\"Python Home\". Otherwise, the path of the main Python executable is used " @@ -1579,31 +1570,31 @@ msgid "" "PythonPath stored in the registry." msgstr "" -#: ../../using/windows.rst:1004 +#: ../../using/windows.rst:999 msgid "" "If the Python Home cannot be located, no :envvar:`PYTHONPATH` is specified " "in the environment, and no registry entries can be found, a default path " "with relative entries is used (e.g. ``.\\Lib;.\\plat-win``, etc)." msgstr "" -#: ../../using/windows.rst:1008 +#: ../../using/windows.rst:1003 msgid "" "If a ``pyvenv.cfg`` file is found alongside the main executable or in the " "directory one level above the executable, the following variations apply:" msgstr "" -#: ../../using/windows.rst:1011 +#: ../../using/windows.rst:1006 msgid "" "If ``home`` is an absolute path and :envvar:`PYTHONHOME` is not set, this " "path is used instead of the path to the main executable when deducing the " "home location." msgstr "" -#: ../../using/windows.rst:1015 +#: ../../using/windows.rst:1010 msgid "The end result of all this is:" msgstr "最終這所有的結果為:" -#: ../../using/windows.rst:1017 +#: ../../using/windows.rst:1012 msgid "" "When running :file:`python.exe`, or any other .exe in the main Python " "directory (either an installed version, or directly from the PCbuild " @@ -1611,7 +1602,7 @@ msgid "" "ignored. Other \"application paths\" in the registry are always read." msgstr "" -#: ../../using/windows.rst:1022 +#: ../../using/windows.rst:1017 msgid "" "When Python is hosted in another .exe (different directory, embedded via " "COM, etc), the \"Python Home\" will not be deduced, so the core path from " @@ -1619,20 +1610,20 @@ msgid "" "always read." msgstr "" -#: ../../using/windows.rst:1026 +#: ../../using/windows.rst:1021 msgid "" "If Python can't find its home and there are no registry value (frozen .exe, " "some very strange installation setup) you get a path with some default, but " "relative, paths." msgstr "" -#: ../../using/windows.rst:1030 +#: ../../using/windows.rst:1025 msgid "" "For those who want to bundle Python into their application or distribution, " "the following advice will prevent conflicts with other installations:" msgstr "" -#: ../../using/windows.rst:1033 +#: ../../using/windows.rst:1028 msgid "" "Include a ``._pth`` file alongside your executable containing the " "directories to include. This will ignore paths listed in the registry and " @@ -1640,20 +1631,20 @@ msgid "" "listed." msgstr "" -#: ../../using/windows.rst:1038 +#: ../../using/windows.rst:1033 msgid "" "If you are loading :file:`python3.dll` or :file:`python37.dll` in your own " "executable, explicitly call :c:func:`Py_SetPath` or (at least) :c:func:" "`Py_SetProgramName` before :c:func:`Py_Initialize`." msgstr "" -#: ../../using/windows.rst:1042 +#: ../../using/windows.rst:1037 msgid "" "Clear and/or overwrite :envvar:`PYTHONPATH` and set :envvar:`PYTHONHOME` " "before launching :file:`python.exe` from your application." msgstr "" -#: ../../using/windows.rst:1045 +#: ../../using/windows.rst:1040 msgid "" "If you cannot use the previous suggestions (for example, you are a " "distribution that allows people to run :file:`python.exe` directly), ensure " @@ -1662,7 +1653,7 @@ msgid "" "correctly named ZIP file will be detected instead.)" msgstr "" -#: ../../using/windows.rst:1051 +#: ../../using/windows.rst:1046 msgid "" "These will ensure that the files in a system-wide installation will not take " "precedence over the copy of the standard library bundled with your " @@ -1672,19 +1663,19 @@ msgid "" "packages." msgstr "" -#: ../../using/windows.rst:1060 +#: ../../using/windows.rst:1055 msgid "" "Adds ``._pth`` file support and removes ``applocal`` option from ``pyvenv." "cfg``." msgstr "" -#: ../../using/windows.rst:1062 +#: ../../using/windows.rst:1057 msgid "" "Adds ``pythonXX.zip`` as a potential landmark when directly adjacent to the " "executable." msgstr "" -#: ../../using/windows.rst:1068 +#: ../../using/windows.rst:1063 msgid "" "Modules specified in the registry under ``Modules`` (not ``PythonPath``) may " "be imported by :class:`importlib.machinery.WindowsRegistryFinder`. This " @@ -1692,117 +1683,117 @@ msgid "" "explicitly added to :attr:`sys.meta_path` in the future." msgstr "" -#: ../../using/windows.rst:1074 +#: ../../using/windows.rst:1069 msgid "Additional modules" msgstr "" -#: ../../using/windows.rst:1076 +#: ../../using/windows.rst:1071 msgid "" "Even though Python aims to be portable among all platforms, there are " "features that are unique to Windows. A couple of modules, both in the " "standard library and external, and snippets exist to use these features." msgstr "" -#: ../../using/windows.rst:1080 +#: ../../using/windows.rst:1075 msgid "" "The Windows-specific standard modules are documented in :ref:`mswin-specific-" "services`." msgstr "" -#: ../../using/windows.rst:1084 +#: ../../using/windows.rst:1079 msgid "PyWin32" msgstr "PyWin32" -#: ../../using/windows.rst:1086 +#: ../../using/windows.rst:1081 msgid "" "The `PyWin32 `_ module by Mark Hammond is " "a collection of modules for advanced Windows-specific support. This " "includes utilities for:" msgstr "" -#: ../../using/windows.rst:1090 +#: ../../using/windows.rst:1085 msgid "" "`Component Object Model `_ (COM)" msgstr "" -#: ../../using/windows.rst:1093 +#: ../../using/windows.rst:1088 msgid "Win32 API calls" msgstr "" -#: ../../using/windows.rst:1094 +#: ../../using/windows.rst:1089 msgid "Registry" msgstr "登錄檔(Registry)" -#: ../../using/windows.rst:1095 +#: ../../using/windows.rst:1090 msgid "Event log" msgstr "事件日誌(Event log)" -#: ../../using/windows.rst:1096 +#: ../../using/windows.rst:1091 msgid "" "`Microsoft Foundation Classes `_ (MFC) user interfaces" msgstr "" -#: ../../using/windows.rst:1099 +#: ../../using/windows.rst:1094 msgid "" "`PythonWin `_ is a sample MFC application shipped with PyWin32. " "It is an embeddable IDE with a built-in debugger." msgstr "" -#: ../../using/windows.rst:1106 +#: ../../using/windows.rst:1101 msgid "" "`Win32 How Do I...? `_" msgstr "" -#: ../../using/windows.rst:1106 +#: ../../using/windows.rst:1101 msgid "by Tim Golden" msgstr "" -#: ../../using/windows.rst:1108 +#: ../../using/windows.rst:1103 msgid "`Python and COM `_" msgstr "" -#: ../../using/windows.rst:1109 +#: ../../using/windows.rst:1104 msgid "by David and Paul Boddie" msgstr "" -#: ../../using/windows.rst:1113 +#: ../../using/windows.rst:1108 msgid "cx_Freeze" msgstr "" -#: ../../using/windows.rst:1115 +#: ../../using/windows.rst:1110 msgid "" -"`cx_Freeze `_ is a :mod:" +"`cx_Freeze `_ is a :mod:" "`distutils` extension (see :ref:`extending-distutils`) which wraps Python " "scripts into executable Windows programs (:file:`{*}.exe` files). When you " "have done this, you can distribute your application without requiring your " "users to install Python." msgstr "" -#: ../../using/windows.rst:1123 +#: ../../using/windows.rst:1118 msgid "WConio" msgstr "" -#: ../../using/windows.rst:1125 +#: ../../using/windows.rst:1120 msgid "" "Since Python's advanced terminal handling layer, :mod:`curses`, is " "restricted to Unix-like systems, there is a library exclusive to Windows as " "well: Windows Console I/O for Python." msgstr "" -#: ../../using/windows.rst:1129 +#: ../../using/windows.rst:1124 msgid "" "`WConio `_ is a wrapper " "for Turbo-C's :file:`CONIO.H`, used to create text user interfaces." msgstr "" -#: ../../using/windows.rst:1135 +#: ../../using/windows.rst:1130 msgid "Compiling Python on Windows" msgstr "編譯 Python 在 Windows" -#: ../../using/windows.rst:1137 +#: ../../using/windows.rst:1132 msgid "" "If you want to compile CPython yourself, first thing you should do is get " "the `source `_. You can download " @@ -1810,52 +1801,56 @@ msgid "" "devguide.python.org/setup/#getting-the-source-code>`_." msgstr "" -#: ../../using/windows.rst:1142 +#: ../../using/windows.rst:1137 msgid "" "The source tree contains a build solution and project files for Microsoft " "Visual Studio 2015, which is the compiler used to build the official Python " "releases. These files are in the :file:`PCbuild` directory." msgstr "" -#: ../../using/windows.rst:1146 +#: ../../using/windows.rst:1141 msgid "" "Check :file:`PCbuild/readme.txt` for general information on the build " "process." msgstr "" -#: ../../using/windows.rst:1149 +#: ../../using/windows.rst:1144 msgid "For extension modules, consult :ref:`building-on-windows`." msgstr "" -#: ../../using/windows.rst:1155 +#: ../../using/windows.rst:1151 msgid "" "`Python + Windows + distutils + SWIG + gcc MinGW `_" msgstr "" -#: ../../using/windows.rst:1154 +#: ../../using/windows.rst:1149 msgid "" "or \"Creating Python extensions in C/C++ with SWIG and compiling them with " "MinGW gcc under Windows\" or \"Installing Python extension with distutils " "and without Microsoft Visual C++\" by Sébastien Sauvage, 2003" msgstr "" -#: ../../using/windows.rst:1160 +#: ../../using/windows.rst:1153 +msgid "`MingW -- Python extensions `_" +msgstr "" + +#: ../../using/windows.rst:1157 msgid "Other Platforms" msgstr "其他平台" -#: ../../using/windows.rst:1162 +#: ../../using/windows.rst:1159 msgid "" "With ongoing development of Python, some platforms that used to be supported " "earlier are no longer supported (due to the lack of users or developers). " "Check :pep:`11` for details on all unsupported platforms." msgstr "" -#: ../../using/windows.rst:1166 +#: ../../using/windows.rst:1163 msgid "`Windows CE `_ is still supported." msgstr "" -#: ../../using/windows.rst:1167 +#: ../../using/windows.rst:1164 msgid "" "The `Cygwin `_ installer offers to install the Python " "interpreter as well (cf. `Cygwin package source `_)" msgstr "" -#: ../../using/windows.rst:1173 +#: ../../using/windows.rst:1170 msgid "" "See `Python for Windows `_ for " "detailed information about platforms with pre-compiled installers." diff --git a/whatsnew/3.2.po b/whatsnew/3.2.po index fe6632c83c..be7dae962e 100644 --- a/whatsnew/3.2.po +++ b/whatsnew/3.2.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.7\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2021-09-07 06:52+0000\n" +"POT-Creation-Date: 2020-06-20 18:08+0800\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-" @@ -2543,12 +2543,12 @@ msgstr "" #: ../../whatsnew/3.2.rst:2313 msgid "" "The mechanism for serializing execution of concurrently running Python " -"threads (generally known as the :term:`GIL` or Global Interpreter Lock) has " -"been rewritten. Among the objectives were more predictable switching " -"intervals and reduced overhead due to lock contention and the number of " -"ensuing system calls. The notion of a \"check interval\" to allow thread " -"switches has been abandoned and replaced by an absolute duration expressed " -"in seconds. This parameter is tunable through :func:`sys." +"threads (generally known as the :term:`GIL` or :term:`Global Interpreter " +"Lock`) has been rewritten. Among the objectives were more predictable " +"switching intervals and reduced overhead due to lock contention and the " +"number of ensuing system calls. The notion of a \"check interval\" to allow " +"thread switches has been abandoned and replaced by an absolute duration " +"expressed in seconds. This parameter is tunable through :func:`sys." "setswitchinterval()`. It currently defaults to 5 milliseconds." msgstr "" diff --git a/whatsnew/3.3.po b/whatsnew/3.3.po index 633e1e6bf4..b72ec0e921 100644 --- a/whatsnew/3.3.po +++ b/whatsnew/3.3.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.7\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2021-09-07 06:52+0000\n" +"POT-Creation-Date: 2020-06-20 18:08+0800\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-" @@ -3501,13 +3501,13 @@ msgstr "" #: ../../whatsnew/3.3.rst:2312 msgid "" -":c:func:`PyUnicode_EncodeUnicodeEscape` use :c:func:" +":c:func:`PyUnicode_EncodeUnicodeEscape:` use :c:func:" "`PyUnicode_AsUnicodeEscapeString`" msgstr "" #: ../../whatsnew/3.3.rst:2314 msgid "" -":c:func:`PyUnicode_EncodeRawUnicodeEscape` use :c:func:" +":c:func:`PyUnicode_EncodeRawUnicodeEscape:` use :c:func:" "`PyUnicode_AsRawUnicodeEscapeString`" msgstr "" diff --git a/whatsnew/3.5.po b/whatsnew/3.5.po index 844e8dbe99..5b521903e4 100644 --- a/whatsnew/3.5.po +++ b/whatsnew/3.5.po @@ -9,7 +9,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.7\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2021-09-07 06:52+0000\n" +"POT-Creation-Date: 2018-11-05 17:14+0800\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-" @@ -433,7 +433,7 @@ msgstr "" #: ../../whatsnew/3.5.rst:415 msgid "" -":pep:`484` introduces a :term:`provisional module ` to " +":pep:`484` introduces a :term:`provisional module ` to " "provide these standard definitions and tools, along with some conventions " "for situations where annotations are not available." msgstr "" @@ -831,7 +831,7 @@ msgstr "" #: ../../whatsnew/3.5.rst:729 msgid "" -"The new :mod:`typing` :term:`provisional ` module provides " +"The new :mod:`typing` :term:`provisional ` module provides " "standard definitions and tools for function type annotations. See :ref:`Type " "Hints ` for more information." msgstr "" @@ -887,7 +887,7 @@ msgstr "" #: ../../whatsnew/3.5.rst:775 msgid "" -"Since the :mod:`asyncio` module is :term:`provisional `, " +"Since the :mod:`asyncio` module is :term:`provisional `, " "all changes introduced in Python 3.5 have also been backported to Python 3.4." "x." msgstr "" @@ -2285,7 +2285,7 @@ msgid "" "hook that will be called whenever a :term:`coroutine object ` is " "created by an :keyword:`async def` function. A corresponding :func:`~sys." "get_coroutine_wrapper` can be used to obtain a currently set wrapper. Both " -"functions are :term:`provisional `, and are intended for " +"functions are :term:`provisional `, and are intended for " "debugging purposes only. (Contributed by Yury Selivanov in :issue:`24017`.)" msgstr "" diff --git a/whatsnew/3.6.po b/whatsnew/3.6.po index 3732d4e63c..1d5b433401 100644 --- a/whatsnew/3.6.po +++ b/whatsnew/3.6.po @@ -5,7 +5,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.7\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2021-09-07 06:52+0000\n" +"POT-Creation-Date: 2020-06-20 18:08+0800\n" "PO-Revision-Date: 2018-07-15 18:56+0800\n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" "tw)\n" @@ -2047,7 +2047,7 @@ msgstr "" #: ../../whatsnew/3.6.rst:1600 msgid "" -"Since the :mod:`typing` module is :term:`provisional `, all " +"Since the :mod:`typing` module is :term:`provisional `, all " "changes introduced in Python 3.6 have also been backported to Python 3.5.x." msgstr "" @@ -3216,19 +3216,3 @@ msgid "" "(Contributed by Kyle Stanley, Antoine Pitrou, and Yury Selivanov in :issue:" "`37228`.)" msgstr "" - -#: ../../whatsnew/3.6.rst:2448 -msgid "Notable changes in Python 3.6.13" -msgstr "" - -#: ../../whatsnew/3.6.rst:2450 -msgid "" -"Earlier Python versions allowed using both ``;`` and ``&`` as query " -"parameter separators in :func:`urllib.parse.parse_qs` and :func:`urllib." -"parse.parse_qsl`. Due to security concerns, and to conform with newer W3C " -"recommendations, this has been changed to allow only a single separator key, " -"with ``&`` as the default. This change also affects :func:`cgi.parse` and :" -"func:`cgi.parse_multipart` as they use the affected functions internally. " -"For more details, please see their respective documentation. (Contributed by " -"Adam Goldschmidt, Senthil Kumaran and Ken Jin in :issue:`42967`.)" -msgstr "" diff --git a/whatsnew/3.7.po b/whatsnew/3.7.po index 2ed4b5bae0..9f79ca421c 100644 --- a/whatsnew/3.7.po +++ b/whatsnew/3.7.po @@ -5,7 +5,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.7\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2021-09-07 06:52+0000\n" +"POT-Creation-Date: 2020-06-20 18:08+0800\n" "PO-Revision-Date: 2018-07-15 18:56+0800\n" "Last-Translator: \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -237,7 +237,7 @@ msgid "" msgstr "" #: ../../whatsnew/3.7.rst:174 -msgid "It will become the default in Python 3.10." +msgid "It will become the default in Python 4.0." msgstr "" #: ../../whatsnew/3.7.rst:178 @@ -878,7 +878,7 @@ msgstr "" #: ../../whatsnew/3.7.rst:639 msgid "" -"The new :term:`provisional ` :func:`asyncio.run` function " +"The new :term:`provisional ` :func:`asyncio.run` function " "can be used to run a coroutine from synchronous code by automatically " "creating and destroying the event loop. (Contributed by Yury Selivanov in :" "issue:`32314`.)" @@ -3599,19 +3599,3 @@ msgid "" "(Contributed by Kyle Stanley, Antoine Pitrou, and Yury Selivanov in :issue:" "`37228`.)" msgstr "" - -#: ../../whatsnew/3.7.rst:2561 -msgid "Notable changes in Python 3.7.10" -msgstr "" - -#: ../../whatsnew/3.7.rst:2563 -msgid "" -"Earlier Python versions allowed using both ``;`` and ``&`` as query " -"parameter separators in :func:`urllib.parse.parse_qs` and :func:`urllib." -"parse.parse_qsl`. Due to security concerns, and to conform with newer W3C " -"recommendations, this has been changed to allow only a single separator key, " -"with ``&`` as the default. This change also affects :func:`cgi.parse` and :" -"func:`cgi.parse_multipart` as they use the affected functions internally. " -"For more details, please see their respective documentation. (Contributed by " -"Adam Goldschmidt, Senthil Kumaran and Ken Jin in :issue:`42967`.)" -msgstr "" diff --git a/whatsnew/3.8.po b/whatsnew/3.8.po index 6115935ca3..1515ceee4b 100644 --- a/whatsnew/3.8.po +++ b/whatsnew/3.8.po @@ -8,11 +8,10 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.9\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2021-09-07 06:52+0000\n" +"POT-Creation-Date: 2020-06-20 18:08+0800\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" -"Language: \n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" @@ -782,40 +781,39 @@ msgstr "" msgid "(Contributed by Yury Selivanov in :issue:`37028`.)" msgstr "" -#: ../../whatsnew/3.8.rst:648 ../../whatsnew/3.8.rst:1964 +#: ../../whatsnew/3.8.rst:648 ../../whatsnew/3.8.rst:1953 msgid "" "The exception :class:`asyncio.CancelledError` now inherits from :class:" -"`BaseException` rather than :class:`Exception` and no longer inherits from :" -"class:`concurrent.futures.CancelledError`. (Contributed by Yury Selivanov " -"in :issue:`32528`.)" +"`BaseException` rather than :class:`Exception`. (Contributed by Yury " +"Selivanov in :issue:`32528`.)" msgstr "" -#: ../../whatsnew/3.8.rst:653 +#: ../../whatsnew/3.8.rst:652 msgid "" "On Windows, the default event loop is now :class:`~asyncio." "ProactorEventLoop`. (Contributed by Victor Stinner in :issue:`34687`.)" msgstr "" -#: ../../whatsnew/3.8.rst:656 +#: ../../whatsnew/3.8.rst:655 msgid "" ":class:`~asyncio.ProactorEventLoop` now also supports UDP. (Contributed by " "Adam Meily and Andrew Svetlov in :issue:`29883`.)" msgstr "" -#: ../../whatsnew/3.8.rst:659 +#: ../../whatsnew/3.8.rst:658 msgid "" ":class:`~asyncio.ProactorEventLoop` can now be interrupted by :exc:" "`KeyboardInterrupt` (\"CTRL+C\"). (Contributed by Vladimir Matveev in :issue:" "`23057`.)" msgstr "" -#: ../../whatsnew/3.8.rst:663 +#: ../../whatsnew/3.8.rst:662 msgid "" "Added :meth:`asyncio.Task.get_coro` for getting the wrapped coroutine within " "an :class:`asyncio.Task`. (Contributed by Alex Grönholm in :issue:`36999`.)" msgstr "" -#: ../../whatsnew/3.8.rst:667 +#: ../../whatsnew/3.8.rst:666 msgid "" "Asyncio tasks can now be named, either by passing the ``name`` keyword " "argument to :func:`asyncio.create_task` or the :meth:`~asyncio.loop." @@ -826,7 +824,7 @@ msgid "" "issue:`34270`.)" msgstr "" -#: ../../whatsnew/3.8.rst:675 +#: ../../whatsnew/3.8.rst:674 msgid "" "Added support for `Happy Eyeballs `_ to :func:`asyncio.loop.create_connection`. To specify the " @@ -836,11 +834,11 @@ msgid "" "connect using both. (Contributed by twisteroid ambassador in :issue:`33530`.)" msgstr "" -#: ../../whatsnew/3.8.rst:685 +#: ../../whatsnew/3.8.rst:684 msgid "builtins" msgstr "" -#: ../../whatsnew/3.8.rst:687 +#: ../../whatsnew/3.8.rst:686 msgid "" "The :func:`compile` built-in has been improved to accept the ``ast." "PyCF_ALLOW_TOP_LEVEL_AWAIT`` flag. With this new flag passed, :func:" @@ -850,11 +848,11 @@ msgid "" "(Contributed by Matthias Bussonnier in :issue:`34616`)" msgstr "" -#: ../../whatsnew/3.8.rst:696 +#: ../../whatsnew/3.8.rst:695 msgid "collections" msgstr "" -#: ../../whatsnew/3.8.rst:698 +#: ../../whatsnew/3.8.rst:697 msgid "" "The :meth:`~collections.somenamedtuple._asdict` method for :func:" "`collections.namedtuple` now returns a :class:`dict` instead of a :class:" @@ -865,25 +863,25 @@ msgid "" "issue:`35864`.)" msgstr "" -#: ../../whatsnew/3.8.rst:708 +#: ../../whatsnew/3.8.rst:707 msgid "cProfile" msgstr "" -#: ../../whatsnew/3.8.rst:710 +#: ../../whatsnew/3.8.rst:709 msgid "" "The :class:`cProfile.Profile ` class can now be used as a " "context manager. Profile a block of code by running::" msgstr "" -#: ../../whatsnew/3.8.rst:719 +#: ../../whatsnew/3.8.rst:718 msgid "(Contributed by Scott Sanderson in :issue:`29235`.)" msgstr "" -#: ../../whatsnew/3.8.rst:723 +#: ../../whatsnew/3.8.rst:722 msgid "csv" msgstr "" -#: ../../whatsnew/3.8.rst:725 +#: ../../whatsnew/3.8.rst:724 msgid "" "The :class:`csv.DictReader` now returns instances of :class:`dict` instead " "of a :class:`collections.OrderedDict`. The tool is now faster and uses less " @@ -891,22 +889,22 @@ msgid "" "in :issue:`34003`.)" msgstr "" -#: ../../whatsnew/3.8.rst:732 +#: ../../whatsnew/3.8.rst:731 msgid "curses" msgstr "" -#: ../../whatsnew/3.8.rst:734 +#: ../../whatsnew/3.8.rst:733 msgid "" "Added a new variable holding structured version information for the " "underlying ncurses library: :data:`~curses.ncurses_version`. (Contributed by " "Serhiy Storchaka in :issue:`31680`.)" msgstr "" -#: ../../whatsnew/3.8.rst:740 +#: ../../whatsnew/3.8.rst:739 msgid "ctypes" msgstr "" -#: ../../whatsnew/3.8.rst:742 +#: ../../whatsnew/3.8.rst:741 msgid "" "On Windows, :class:`~ctypes.CDLL` and subclasses now accept a *winmode* " "parameter to specify flags for the underlying ``LoadLibraryEx`` call. The " @@ -916,11 +914,11 @@ msgid "" "add_dll_directory`. (Contributed by Steve Dower in :issue:`36085`.)" msgstr "" -#: ../../whatsnew/3.8.rst:751 +#: ../../whatsnew/3.8.rst:750 msgid "datetime" msgstr "" -#: ../../whatsnew/3.8.rst:753 +#: ../../whatsnew/3.8.rst:752 msgid "" "Added new alternate constructors :meth:`datetime.date.fromisocalendar` and :" "meth:`datetime.datetime.fromisocalendar`, which construct :class:`date` and :" @@ -929,85 +927,85 @@ msgid "" "(Contributed by Paul Ganssle in :issue:`36004`.)" msgstr "" -#: ../../whatsnew/3.8.rst:761 +#: ../../whatsnew/3.8.rst:760 msgid "functools" msgstr "" -#: ../../whatsnew/3.8.rst:763 +#: ../../whatsnew/3.8.rst:762 msgid "" ":func:`functools.lru_cache` can now be used as a straight decorator rather " "than as a function returning a decorator. So both of these are now " "supported::" msgstr "" -#: ../../whatsnew/3.8.rst:774 +#: ../../whatsnew/3.8.rst:773 msgid "(Contributed by Raymond Hettinger in :issue:`36772`.)" msgstr "" -#: ../../whatsnew/3.8.rst:776 +#: ../../whatsnew/3.8.rst:775 msgid "" "Added a new :func:`functools.cached_property` decorator, for computed " "properties cached for the life of the instance. ::" msgstr "" -#: ../../whatsnew/3.8.rst:790 +#: ../../whatsnew/3.8.rst:789 msgid "(Contributed by Carl Meyer in :issue:`21145`)" msgstr "" -#: ../../whatsnew/3.8.rst:793 +#: ../../whatsnew/3.8.rst:792 msgid "" "Added a new :func:`functools.singledispatchmethod` decorator that converts " "methods into :term:`generic functions ` using :term:" "`single dispatch`::" msgstr "" -#: ../../whatsnew/3.8.rst:815 +#: ../../whatsnew/3.8.rst:814 msgid "(Contributed by Ethan Smith in :issue:`32380`)" msgstr "" -#: ../../whatsnew/3.8.rst:818 +#: ../../whatsnew/3.8.rst:817 msgid "gc" msgstr "" -#: ../../whatsnew/3.8.rst:820 +#: ../../whatsnew/3.8.rst:819 msgid "" ":func:`~gc.get_objects` can now receive an optional *generation* parameter " "indicating a generation to get objects from. (Contributed by Pablo Galindo " "in :issue:`36016`.)" msgstr "" -#: ../../whatsnew/3.8.rst:826 +#: ../../whatsnew/3.8.rst:825 msgid "gettext" msgstr "" -#: ../../whatsnew/3.8.rst:828 +#: ../../whatsnew/3.8.rst:827 msgid "" "Added :func:`~gettext.pgettext` and its variants. (Contributed by Franz " "Glasner, Éric Araujo, and Cheryl Sabella in :issue:`2504`.)" msgstr "" -#: ../../whatsnew/3.8.rst:833 +#: ../../whatsnew/3.8.rst:832 msgid "gzip" msgstr "" -#: ../../whatsnew/3.8.rst:835 +#: ../../whatsnew/3.8.rst:834 msgid "" "Added the *mtime* parameter to :func:`gzip.compress` for reproducible " "output. (Contributed by Guo Ci Teo in :issue:`34898`.)" msgstr "" -#: ../../whatsnew/3.8.rst:838 +#: ../../whatsnew/3.8.rst:837 msgid "" "A :exc:`~gzip.BadGzipFile` exception is now raised instead of :exc:`OSError` " "for certain types of invalid or corrupt gzip files. (Contributed by Filip " "Gruszczyński, Michele Orrù, and Zackery Spytz in :issue:`6584`.)" msgstr "" -#: ../../whatsnew/3.8.rst:845 +#: ../../whatsnew/3.8.rst:844 msgid "IDLE and idlelib" msgstr "" -#: ../../whatsnew/3.8.rst:847 +#: ../../whatsnew/3.8.rst:846 msgid "" "Output over N lines (50 by default) is squeezed down to a button. N can be " "changed in the PyShell section of the General page of the Settings dialog. " @@ -1017,7 +1015,7 @@ msgid "" "button. (Contributed by Tal Einat in :issue:`1529353`.)" msgstr "" -#: ../../whatsnew/3.8.rst:854 +#: ../../whatsnew/3.8.rst:853 msgid "" "Add \"Run Customized\" to the Run menu to run a module with customized " "settings. Any command line arguments entered are added to sys.argv. They " @@ -1026,7 +1024,7 @@ msgid "" "Sabella, Terry Jan Reedy, and others in :issue:`5680` and :issue:`37627`.)" msgstr "" -#: ../../whatsnew/3.8.rst:860 +#: ../../whatsnew/3.8.rst:859 msgid "" "Added optional line numbers for IDLE editor windows. Windows open without " "line numbers unless set otherwise in the General tab of the configuration " @@ -1035,7 +1033,7 @@ msgid "" "`17535`.)" msgstr "" -#: ../../whatsnew/3.8.rst:866 +#: ../../whatsnew/3.8.rst:865 msgid "" "OS native encoding is now used for converting between Python strings and Tcl " "objects. This allows IDLE to work with emoji and other non-BMP characters. " @@ -1045,37 +1043,15 @@ msgid "" "solved by Serhiy Storchaka in :issue:`13153`.)" msgstr "" -#: ../../whatsnew/3.8.rst:873 -msgid "New in 3.8.1:" -msgstr "" - -#: ../../whatsnew/3.8.rst:875 -msgid "" -"Add option to toggle cursor blink off. (Contributed by Zackery Spytz in :" -"issue:`4603`.)" -msgstr "" - -#: ../../whatsnew/3.8.rst:878 -msgid "" -"Escape key now closes IDLE completion windows. (Contributed by Johnny " -"Najera in :issue:`38944`.)" -msgstr "" - -#: ../../whatsnew/3.8.rst:881 +#: ../../whatsnew/3.8.rst:872 msgid "The changes above have been backported to 3.7 maintenance releases." msgstr "" -#: ../../whatsnew/3.8.rst:883 -msgid "" -"Add keywords to module name completion list. (Contributed by Terry J. Reedy " -"in :issue:`37765`.)" -msgstr "" - -#: ../../whatsnew/3.8.rst:887 +#: ../../whatsnew/3.8.rst:876 msgid "inspect" msgstr "" -#: ../../whatsnew/3.8.rst:889 +#: ../../whatsnew/3.8.rst:878 msgid "" "The :func:`inspect.getdoc` function can now find docstrings for " "``__slots__`` if that attribute is a :class:`dict` where the values are " @@ -1083,15 +1059,15 @@ msgid "" "have for :func:`property`, :func:`classmethod`, and :func:`staticmethod`::" msgstr "" -#: ../../whatsnew/3.8.rst:901 +#: ../../whatsnew/3.8.rst:890 msgid "(Contributed by Raymond Hettinger in :issue:`36326`.)" msgstr "" -#: ../../whatsnew/3.8.rst:905 +#: ../../whatsnew/3.8.rst:894 msgid "io" msgstr "" -#: ../../whatsnew/3.8.rst:907 +#: ../../whatsnew/3.8.rst:896 msgid "" "In development mode (:option:`-X` ``env``) and in debug build, the :class:" "`io.IOBase` finalizer now logs the exception if the ``close()`` method " @@ -1099,35 +1075,35 @@ msgid "" "(Contributed by Victor Stinner in :issue:`18748`.)" msgstr "" -#: ../../whatsnew/3.8.rst:914 +#: ../../whatsnew/3.8.rst:903 msgid "itertools" msgstr "" -#: ../../whatsnew/3.8.rst:916 +#: ../../whatsnew/3.8.rst:905 msgid "" "The :func:`itertools.accumulate` function added an option *initial* keyword " "argument to specify an initial value::" msgstr "" -#: ../../whatsnew/3.8.rst:923 +#: ../../whatsnew/3.8.rst:912 msgid "(Contributed by Lisa Roach in :issue:`34659`.)" msgstr "" -#: ../../whatsnew/3.8.rst:927 +#: ../../whatsnew/3.8.rst:916 msgid "json.tool" msgstr "" -#: ../../whatsnew/3.8.rst:929 +#: ../../whatsnew/3.8.rst:918 msgid "" "Add option ``--json-lines`` to parse every input line as a separate JSON " "object. (Contributed by Weipeng Hong in :issue:`31553`.)" msgstr "" -#: ../../whatsnew/3.8.rst:934 +#: ../../whatsnew/3.8.rst:923 msgid "logging" msgstr "" -#: ../../whatsnew/3.8.rst:936 +#: ../../whatsnew/3.8.rst:925 msgid "" "Added a *force* keyword argument to :func:`logging.basicConfig()` When set " "to true, any existing handlers attached to the root logger are removed and " @@ -1135,7 +1111,7 @@ msgid "" "arguments." msgstr "" -#: ../../whatsnew/3.8.rst:941 +#: ../../whatsnew/3.8.rst:930 msgid "" "This solves a long-standing problem. Once a logger or *basicConfig()* had " "been called, subsequent calls to *basicConfig()* were silently ignored. This " @@ -1143,53 +1119,53 @@ msgid "" "configuration options using the interactive prompt or a Jupyter notebook." msgstr "" -#: ../../whatsnew/3.8.rst:947 +#: ../../whatsnew/3.8.rst:936 msgid "" "(Suggested by Raymond Hettinger, implemented by Dong-hee Na, and reviewed by " "Vinay Sajip in :issue:`33897`.)" msgstr "" -#: ../../whatsnew/3.8.rst:952 +#: ../../whatsnew/3.8.rst:941 msgid "math" msgstr "" -#: ../../whatsnew/3.8.rst:954 +#: ../../whatsnew/3.8.rst:943 msgid "" "Added new function :func:`math.dist` for computing Euclidean distance " "between two points. (Contributed by Raymond Hettinger in :issue:`33089`.)" msgstr "" -#: ../../whatsnew/3.8.rst:957 +#: ../../whatsnew/3.8.rst:946 msgid "" "Expanded the :func:`math.hypot` function to handle multiple dimensions. " "Formerly, it only supported the 2-D case. (Contributed by Raymond Hettinger " "in :issue:`33089`.)" msgstr "" -#: ../../whatsnew/3.8.rst:961 +#: ../../whatsnew/3.8.rst:950 msgid "" "Added new function, :func:`math.prod`, as analogous function to :func:`sum` " "that returns the product of a 'start' value (default: 1) times an iterable " "of numbers::" msgstr "" -#: ../../whatsnew/3.8.rst:970 +#: ../../whatsnew/3.8.rst:959 msgid "(Contributed by Pablo Galindo in :issue:`35606`.)" msgstr "" -#: ../../whatsnew/3.8.rst:972 +#: ../../whatsnew/3.8.rst:961 msgid "" "Added two new combinatoric functions :func:`math.perm` and :func:`math." "comb`::" msgstr "" -#: ../../whatsnew/3.8.rst:979 +#: ../../whatsnew/3.8.rst:968 msgid "" "(Contributed by Yash Aggarwal, Keller Fuchs, Serhiy Storchaka, and Raymond " "Hettinger in :issue:`37128`, :issue:`37178`, and :issue:`35431`.)" msgstr "" -#: ../../whatsnew/3.8.rst:982 +#: ../../whatsnew/3.8.rst:971 msgid "" "Added a new function :func:`math.isqrt` for computing accurate integer " "square roots without conversion to floating point. The new function " @@ -1197,48 +1173,48 @@ msgid "" "but slower than :func:`math.sqrt`::" msgstr "" -#: ../../whatsnew/3.8.rst:994 +#: ../../whatsnew/3.8.rst:983 msgid "(Contributed by Mark Dickinson in :issue:`36887`.)" msgstr "" -#: ../../whatsnew/3.8.rst:996 +#: ../../whatsnew/3.8.rst:985 msgid "" "The function :func:`math.factorial` no longer accepts arguments that are not " "int-like. (Contributed by Pablo Galindo in :issue:`33083`.)" msgstr "" -#: ../../whatsnew/3.8.rst:1001 +#: ../../whatsnew/3.8.rst:990 msgid "mmap" msgstr "" -#: ../../whatsnew/3.8.rst:1003 +#: ../../whatsnew/3.8.rst:992 msgid "" "The :class:`mmap.mmap` class now has an :meth:`~mmap.mmap.madvise` method to " "access the ``madvise()`` system call. (Contributed by Zackery Spytz in :" "issue:`32941`.)" msgstr "" -#: ../../whatsnew/3.8.rst:1009 +#: ../../whatsnew/3.8.rst:998 msgid "multiprocessing" msgstr "" -#: ../../whatsnew/3.8.rst:1011 +#: ../../whatsnew/3.8.rst:1000 msgid "" "Added new :mod:`multiprocessing.shared_memory` module. (Contributed by Davin " "Potts in :issue:`35813`.)" msgstr "" -#: ../../whatsnew/3.8.rst:1014 +#: ../../whatsnew/3.8.rst:1003 msgid "" "On macOS, the *spawn* start method is now used by default. (Contributed by " "Victor Stinner in :issue:`33725`.)" msgstr "" -#: ../../whatsnew/3.8.rst:1019 +#: ../../whatsnew/3.8.rst:1008 msgid "os" msgstr "" -#: ../../whatsnew/3.8.rst:1021 +#: ../../whatsnew/3.8.rst:1010 msgid "" "Added new function :func:`~os.add_dll_directory` on Windows for providing " "additional search paths for native dependencies when importing extension " @@ -1246,14 +1222,14 @@ msgid "" "issue:`36085`.)" msgstr "" -#: ../../whatsnew/3.8.rst:1026 +#: ../../whatsnew/3.8.rst:1015 msgid "" "A new :func:`os.memfd_create` function was added to wrap the " "``memfd_create()`` syscall. (Contributed by Zackery Spytz and Christian " "Heimes in :issue:`26836`.)" msgstr "" -#: ../../whatsnew/3.8.rst:1030 +#: ../../whatsnew/3.8.rst:1019 msgid "" "On Windows, much of the manual logic for handling reparse points (including " "symlinks and directory junctions) has been delegated to the operating " @@ -1266,7 +1242,7 @@ msgid "" "st_reparse_tag` attribute." msgstr "" -#: ../../whatsnew/3.8.rst:1039 +#: ../../whatsnew/3.8.rst:1028 msgid "" "On Windows, :func:`os.readlink` is now able to read directory junctions. " "Note that :func:`~os.path.islink` will return ``False`` for directory " @@ -1275,15 +1251,15 @@ msgid "" "readlink` may now treat junctions as links." msgstr "" -#: ../../whatsnew/3.8.rst:1045 ../../whatsnew/3.8.rst:1070 +#: ../../whatsnew/3.8.rst:1034 ../../whatsnew/3.8.rst:1059 msgid "(Contributed by Steve Dower in :issue:`37834`.)" msgstr "" -#: ../../whatsnew/3.8.rst:1049 +#: ../../whatsnew/3.8.rst:1038 msgid "os.path" msgstr "" -#: ../../whatsnew/3.8.rst:1051 +#: ../../whatsnew/3.8.rst:1040 msgid "" ":mod:`os.path` functions that return a boolean result like :func:`~os.path." "exists`, :func:`~os.path.lexists`, :func:`~os.path.isdir`, :func:`~os.path." @@ -1294,7 +1270,7 @@ msgid "" "Storchaka in :issue:`33721`.)" msgstr "" -#: ../../whatsnew/3.8.rst:1059 ../../whatsnew/3.8.rst:1959 +#: ../../whatsnew/3.8.rst:1048 ../../whatsnew/3.8.rst:1948 msgid "" ":func:`~os.path.expanduser` on Windows now prefers the :envvar:`USERPROFILE` " "environment variable and does not use :envvar:`HOME`, which is not normally " @@ -1302,23 +1278,23 @@ msgid "" "`36264`.)" msgstr "" -#: ../../whatsnew/3.8.rst:1064 +#: ../../whatsnew/3.8.rst:1053 msgid "" ":func:`~os.path.isdir` on Windows no longer returns ``True`` for a link to a " "non-existent directory." msgstr "" -#: ../../whatsnew/3.8.rst:1067 +#: ../../whatsnew/3.8.rst:1056 msgid "" ":func:`~os.path.realpath` on Windows now resolves reparse points, including " "symlinks and directory junctions." msgstr "" -#: ../../whatsnew/3.8.rst:1074 +#: ../../whatsnew/3.8.rst:1063 msgid "pathlib" msgstr "" -#: ../../whatsnew/3.8.rst:1076 +#: ../../whatsnew/3.8.rst:1065 msgid "" ":mod:`pathlib.Path` methods that return a boolean result like :meth:" "`~pathlib.Path.exists()`, :meth:`~pathlib.Path.is_dir()`, :meth:`~pathlib." @@ -1331,17 +1307,17 @@ msgid "" "`33721`.)" msgstr "" -#: ../../whatsnew/3.8.rst:1086 +#: ../../whatsnew/3.8.rst:1075 msgid "" "Added :meth:`pathlib.Path.link_to()` which creates a hard link pointing to a " "path. (Contributed by Joannah Nanjekye in :issue:`26978`)" msgstr "" -#: ../../whatsnew/3.8.rst:1092 +#: ../../whatsnew/3.8.rst:1081 msgid "pickle" msgstr "" -#: ../../whatsnew/3.8.rst:1094 +#: ../../whatsnew/3.8.rst:1083 msgid "" ":mod:`pickle` extensions subclassing the C-optimized :class:`~pickle." "Pickler` can now override the pickling logic of functions and classes by " @@ -1349,22 +1325,22 @@ msgid "" "(Contributed by Pierre Glaser and Olivier Grisel in :issue:`35900`.)" msgstr "" -#: ../../whatsnew/3.8.rst:1101 +#: ../../whatsnew/3.8.rst:1090 msgid "plistlib" msgstr "" -#: ../../whatsnew/3.8.rst:1103 +#: ../../whatsnew/3.8.rst:1092 msgid "" "Added new :class:`plistlib.UID` and enabled support for reading and writing " "NSKeyedArchiver-encoded binary plists. (Contributed by Jon Janzen in :issue:" "`26707`.)" msgstr "" -#: ../../whatsnew/3.8.rst:1109 +#: ../../whatsnew/3.8.rst:1098 msgid "pprint" msgstr "" -#: ../../whatsnew/3.8.rst:1111 +#: ../../whatsnew/3.8.rst:1100 msgid "" "The :mod:`pprint` module added a *sort_dicts* parameter to several " "functions. By default, those functions continue to sort dictionaries before " @@ -1373,47 +1349,47 @@ msgid "" "for comparison to JSON inputs during debugging." msgstr "" -#: ../../whatsnew/3.8.rst:1117 +#: ../../whatsnew/3.8.rst:1106 msgid "" "In addition, there is a convenience new function, :func:`pprint.pp` that is " "like :func:`pprint.pprint` but with *sort_dicts* defaulting to ``False``::" msgstr "" -#: ../../whatsnew/3.8.rst:1131 +#: ../../whatsnew/3.8.rst:1120 msgid "(Contributed by Rémi Lapeyre in :issue:`30670`.)" msgstr "" -#: ../../whatsnew/3.8.rst:1135 +#: ../../whatsnew/3.8.rst:1124 msgid "py_compile" msgstr "" -#: ../../whatsnew/3.8.rst:1137 +#: ../../whatsnew/3.8.rst:1126 msgid "" ":func:`py_compile.compile` now supports silent mode. (Contributed by Joannah " "Nanjekye in :issue:`22640`.)" msgstr "" -#: ../../whatsnew/3.8.rst:1142 +#: ../../whatsnew/3.8.rst:1131 msgid "shlex" msgstr "" -#: ../../whatsnew/3.8.rst:1144 +#: ../../whatsnew/3.8.rst:1133 msgid "" "The new :func:`shlex.join` function acts as the inverse of :func:`shlex." "split`. (Contributed by Bo Bayles in :issue:`32102`.)" msgstr "" -#: ../../whatsnew/3.8.rst:1149 +#: ../../whatsnew/3.8.rst:1138 msgid "shutil" msgstr "" -#: ../../whatsnew/3.8.rst:1151 +#: ../../whatsnew/3.8.rst:1140 msgid "" ":func:`shutil.copytree` now accepts a new ``dirs_exist_ok`` keyword " "argument. (Contributed by Josh Bronson in :issue:`20849`.)" msgstr "" -#: ../../whatsnew/3.8.rst:1154 +#: ../../whatsnew/3.8.rst:1143 msgid "" ":func:`shutil.make_archive` now defaults to the modern pax (POSIX.1-2001) " "format for new archives to improve portability and standards conformance, " @@ -1421,18 +1397,18 @@ msgid "" "(Contributed by C.A.M. Gerlach in :issue:`30661`.)" msgstr "" -#: ../../whatsnew/3.8.rst:1159 +#: ../../whatsnew/3.8.rst:1148 msgid "" ":func:`shutil.rmtree` on Windows now removes directory junctions without " "recursively removing their contents first. (Contributed by Steve Dower in :" "issue:`37834`.)" msgstr "" -#: ../../whatsnew/3.8.rst:1165 +#: ../../whatsnew/3.8.rst:1154 msgid "socket" msgstr "" -#: ../../whatsnew/3.8.rst:1167 +#: ../../whatsnew/3.8.rst:1156 msgid "" "Added :meth:`~socket.create_server()` and :meth:`~socket." "has_dualstack_ipv6()` convenience functions to automate the necessary tasks " @@ -1441,66 +1417,66 @@ msgid "" "Rodolà in :issue:`17561`.)" msgstr "" -#: ../../whatsnew/3.8.rst:1172 +#: ../../whatsnew/3.8.rst:1161 msgid "" "The :func:`socket.if_nameindex()`, :func:`socket.if_nametoindex()`, and :" "func:`socket.if_indextoname()` functions have been implemented on Windows. " "(Contributed by Zackery Spytz in :issue:`37007`.)" msgstr "" -#: ../../whatsnew/3.8.rst:1178 +#: ../../whatsnew/3.8.rst:1167 msgid "ssl" msgstr "" -#: ../../whatsnew/3.8.rst:1180 +#: ../../whatsnew/3.8.rst:1169 msgid "" "Added :attr:`~ssl.SSLContext.post_handshake_auth` to enable and :meth:`~ssl." "SSLSocket.verify_client_post_handshake` to initiate TLS 1.3 post-handshake " "authentication. (Contributed by Christian Heimes in :issue:`34670`.)" msgstr "" -#: ../../whatsnew/3.8.rst:1187 +#: ../../whatsnew/3.8.rst:1176 msgid "statistics" msgstr "" -#: ../../whatsnew/3.8.rst:1189 +#: ../../whatsnew/3.8.rst:1178 msgid "" "Added :func:`statistics.fmean` as a faster, floating point variant of :func:" "`statistics.mean()`. (Contributed by Raymond Hettinger and Steven D'Aprano " "in :issue:`35904`.)" msgstr "" -#: ../../whatsnew/3.8.rst:1193 +#: ../../whatsnew/3.8.rst:1182 msgid "" "Added :func:`statistics.geometric_mean()` (Contributed by Raymond Hettinger " "in :issue:`27181`.)" msgstr "" -#: ../../whatsnew/3.8.rst:1196 +#: ../../whatsnew/3.8.rst:1185 msgid "" "Added :func:`statistics.multimode` that returns a list of the most common " "values. (Contributed by Raymond Hettinger in :issue:`35892`.)" msgstr "" -#: ../../whatsnew/3.8.rst:1199 +#: ../../whatsnew/3.8.rst:1188 msgid "" "Added :func:`statistics.quantiles` that divides data or a distribution in to " "equiprobable intervals (e.g. quartiles, deciles, or percentiles). " "(Contributed by Raymond Hettinger in :issue:`36546`.)" msgstr "" -#: ../../whatsnew/3.8.rst:1203 +#: ../../whatsnew/3.8.rst:1192 msgid "" "Added :class:`statistics.NormalDist`, a tool for creating and manipulating " "normal distributions of a random variable. (Contributed by Raymond Hettinger " "in :issue:`36018`.)" msgstr "" -#: ../../whatsnew/3.8.rst:1233 +#: ../../whatsnew/3.8.rst:1222 msgid "sys" msgstr "" -#: ../../whatsnew/3.8.rst:1235 +#: ../../whatsnew/3.8.rst:1224 msgid "" "Add new :func:`sys.unraisablehook` function which can be overridden to " "control how \"unraisable exceptions\" are handled. It is called when an " @@ -1509,11 +1485,11 @@ msgid "" "(:func:`gc.collect`). (Contributed by Victor Stinner in :issue:`36829`.)" msgstr "" -#: ../../whatsnew/3.8.rst:1244 +#: ../../whatsnew/3.8.rst:1233 msgid "tarfile" msgstr "" -#: ../../whatsnew/3.8.rst:1246 +#: ../../whatsnew/3.8.rst:1235 msgid "" "The :mod:`tarfile` module now defaults to the modern pax (POSIX.1-2001) " "format for new archives, instead of the previous GNU-specific one. This " @@ -1522,11 +1498,11 @@ msgid "" "(Contributed by C.A.M. Gerlach in :issue:`36268`.)" msgstr "" -#: ../../whatsnew/3.8.rst:1254 +#: ../../whatsnew/3.8.rst:1243 msgid "threading" msgstr "" -#: ../../whatsnew/3.8.rst:1256 +#: ../../whatsnew/3.8.rst:1245 msgid "" "Add a new :func:`threading.excepthook` function which handles uncaught :meth:" "`threading.Thread.run` exception. It can be overridden to control how " @@ -1534,7 +1510,7 @@ msgid "" "by Victor Stinner in :issue:`1230540`.)" msgstr "" -#: ../../whatsnew/3.8.rst:1261 +#: ../../whatsnew/3.8.rst:1250 msgid "" "Add a new :func:`threading.get_native_id` function and a :data:`~threading." "Thread.native_id` attribute to the :class:`threading.Thread` class. These " @@ -1544,11 +1520,11 @@ msgid "" "by Jake Tesler in :issue:`36084`.)" msgstr "" -#: ../../whatsnew/3.8.rst:1271 +#: ../../whatsnew/3.8.rst:1260 msgid "tokenize" msgstr "" -#: ../../whatsnew/3.8.rst:1273 +#: ../../whatsnew/3.8.rst:1262 msgid "" "The :mod:`tokenize` module now implicitly emits a ``NEWLINE`` token when " "provided with input that does not have a trailing new line. This behavior " @@ -1556,11 +1532,11 @@ msgid "" "Askar in :issue:`33899`.)" msgstr "" -#: ../../whatsnew/3.8.rst:1280 +#: ../../whatsnew/3.8.rst:1269 msgid "tkinter" msgstr "" -#: ../../whatsnew/3.8.rst:1282 +#: ../../whatsnew/3.8.rst:1271 msgid "" "Added methods :meth:`~tkinter.Spinbox.selection_from`, :meth:`~tkinter." "Spinbox.selection_present`, :meth:`~tkinter.Spinbox.selection_range` and :" @@ -1568,38 +1544,38 @@ msgid "" "(Contributed by Juliette Monsel in :issue:`34829`.)" msgstr "" -#: ../../whatsnew/3.8.rst:1289 +#: ../../whatsnew/3.8.rst:1278 msgid "" "Added method :meth:`~tkinter.Canvas.moveto` in the :class:`tkinter.Canvas` " "class. (Contributed by Juliette Monsel in :issue:`23831`.)" msgstr "" -#: ../../whatsnew/3.8.rst:1293 +#: ../../whatsnew/3.8.rst:1282 msgid "" "The :class:`tkinter.PhotoImage` class now has :meth:`~tkinter.PhotoImage." "transparency_get` and :meth:`~tkinter.PhotoImage.transparency_set` methods. " "(Contributed by Zackery Spytz in :issue:`25451`.)" msgstr "" -#: ../../whatsnew/3.8.rst:1300 +#: ../../whatsnew/3.8.rst:1289 msgid "time" msgstr "" -#: ../../whatsnew/3.8.rst:1302 +#: ../../whatsnew/3.8.rst:1291 msgid "" "Added new clock :data:`~time.CLOCK_UPTIME_RAW` for macOS 10.12. (Contributed " "by Joannah Nanjekye in :issue:`35702`.)" msgstr "" -#: ../../whatsnew/3.8.rst:1307 +#: ../../whatsnew/3.8.rst:1296 msgid "typing" msgstr "" -#: ../../whatsnew/3.8.rst:1309 +#: ../../whatsnew/3.8.rst:1298 msgid "The :mod:`typing` module incorporates several new features:" msgstr "" -#: ../../whatsnew/3.8.rst:1311 +#: ../../whatsnew/3.8.rst:1300 msgid "" "A dictionary type with per-key types. See :pep:`589` and :class:`typing." "TypedDict`. TypedDict uses only string keys. By default, every key is " @@ -1607,46 +1583,46 @@ msgid "" "optional::" msgstr "" -#: ../../whatsnew/3.8.rst:1321 +#: ../../whatsnew/3.8.rst:1310 msgid "" "Literal types. See :pep:`586` and :class:`typing.Literal`. Literal types " "indicate that a parameter or return value is constrained to one or more " "specific literal values::" msgstr "" -#: ../../whatsnew/3.8.rst:1328 +#: ../../whatsnew/3.8.rst:1317 msgid "" "\"Final\" variables, functions, methods and classes. See :pep:`591`, :class:" "`typing.Final` and :func:`typing.final`. The final qualifier instructs a " "static type checker to restrict subclassing, overriding, or reassignment::" msgstr "" -#: ../../whatsnew/3.8.rst:1335 +#: ../../whatsnew/3.8.rst:1324 msgid "" "Protocol definitions. See :pep:`544`, :class:`typing.Protocol` and :func:" "`typing.runtime_checkable`. Simple ABCs like :class:`typing.SupportsInt` " "are now ``Protocol`` subclasses." msgstr "" -#: ../../whatsnew/3.8.rst:1339 +#: ../../whatsnew/3.8.rst:1328 msgid "New protocol class :class:`typing.SupportsIndex`." msgstr "" -#: ../../whatsnew/3.8.rst:1341 +#: ../../whatsnew/3.8.rst:1330 msgid "New functions :func:`typing.get_origin` and :func:`typing.get_args`." msgstr "" -#: ../../whatsnew/3.8.rst:1345 +#: ../../whatsnew/3.8.rst:1334 msgid "unicodedata" msgstr "" -#: ../../whatsnew/3.8.rst:1347 +#: ../../whatsnew/3.8.rst:1336 msgid "" "The :mod:`unicodedata` module has been upgraded to use the `Unicode 12.1.0 " "`_ release." msgstr "" -#: ../../whatsnew/3.8.rst:1350 +#: ../../whatsnew/3.8.rst:1339 msgid "" "New function :func:`~unicodedata.is_normalized` can be used to verify a " "string is in a specific normal form, often much faster than by actually " @@ -1654,11 +1630,11 @@ msgid "" "Greg Price in :issue:`32285` and :issue:`37966`)." msgstr "" -#: ../../whatsnew/3.8.rst:1357 +#: ../../whatsnew/3.8.rst:1346 msgid "unittest" msgstr "" -#: ../../whatsnew/3.8.rst:1359 +#: ../../whatsnew/3.8.rst:1348 msgid "" "Added :class:`~unittest.mock.AsyncMock` to support an asynchronous version " "of :class:`~unittest.mock.Mock`. Appropriate new assert functions for " @@ -1666,7 +1642,7 @@ msgid "" "`26467`)." msgstr "" -#: ../../whatsnew/3.8.rst:1364 +#: ../../whatsnew/3.8.rst:1353 msgid "" "Added :func:`~unittest.addModuleCleanup()` and :meth:`~unittest.TestCase." "addClassCleanup()` to unittest to support cleanups for :func:`~unittest." @@ -1674,57 +1650,57 @@ msgid "" "Lisa Roach in :issue:`24412`.)" msgstr "" -#: ../../whatsnew/3.8.rst:1370 +#: ../../whatsnew/3.8.rst:1359 msgid "" "Several mock assert functions now also print a list of actual calls upon " "failure. (Contributed by Petter Strandmark in :issue:`35047`.)" msgstr "" -#: ../../whatsnew/3.8.rst:1373 +#: ../../whatsnew/3.8.rst:1362 msgid "" ":mod:`unittest` module gained support for coroutines to be used as test " "cases with :class:`unittest.IsolatedAsyncioTestCase`. (Contributed by Andrew " "Svetlov in :issue:`32972`.)" msgstr "" -#: ../../whatsnew/3.8.rst:1377 +#: ../../whatsnew/3.8.rst:1366 msgid "Example::" msgstr "" -#: ../../whatsnew/3.8.rst:1400 +#: ../../whatsnew/3.8.rst:1389 msgid "venv" msgstr "" -#: ../../whatsnew/3.8.rst:1402 +#: ../../whatsnew/3.8.rst:1391 msgid "" ":mod:`venv` now includes an ``Activate.ps1`` script on all platforms for " "activating virtual environments under PowerShell Core 6.1. (Contributed by " "Brett Cannon in :issue:`32718`.)" msgstr "" -#: ../../whatsnew/3.8.rst:1408 +#: ../../whatsnew/3.8.rst:1397 msgid "weakref" msgstr "" -#: ../../whatsnew/3.8.rst:1410 +#: ../../whatsnew/3.8.rst:1399 msgid "" "The proxy objects returned by :func:`weakref.proxy` now support the matrix " "multiplication operators ``@`` and ``@=`` in addition to the other numeric " "operators. (Contributed by Mark Dickinson in :issue:`36669`.)" msgstr "" -#: ../../whatsnew/3.8.rst:1416 +#: ../../whatsnew/3.8.rst:1405 msgid "xml" msgstr "" -#: ../../whatsnew/3.8.rst:1418 +#: ../../whatsnew/3.8.rst:1407 msgid "" "As mitigation against DTD and external entity retrieval, the :mod:`xml.dom." "minidom` and :mod:`xml.sax` modules no longer process external entities by " "default. (Contributed by Christian Heimes in :issue:`17239`.)" msgstr "" -#: ../../whatsnew/3.8.rst:1423 +#: ../../whatsnew/3.8.rst:1412 msgid "" "The ``.find*()`` methods in the :mod:`xml.etree.ElementTree` module support " "wildcard searches like ``{*}tag`` which ignores the namespace and " @@ -1732,14 +1708,14 @@ msgid "" "by Stefan Behnel in :issue:`28238`.)" msgstr "" -#: ../../whatsnew/3.8.rst:1428 +#: ../../whatsnew/3.8.rst:1417 msgid "" "The :mod:`xml.etree.ElementTree` module provides a new function :func:`–xml." "etree.ElementTree.canonicalize()` that implements C14N 2.0. (Contributed by " "Stefan Behnel in :issue:`13611`.)" msgstr "" -#: ../../whatsnew/3.8.rst:1432 +#: ../../whatsnew/3.8.rst:1421 msgid "" "The target object of :class:`xml.etree.ElementTree.XMLParser` can receive " "namespace declaration events through the new callback methods ``start_ns()`` " @@ -1749,11 +1725,11 @@ msgid "" "by Stefan Behnel in :issue:`36676` and :issue:`36673`.)" msgstr "" -#: ../../whatsnew/3.8.rst:1442 +#: ../../whatsnew/3.8.rst:1431 msgid "xmlrpc" msgstr "" -#: ../../whatsnew/3.8.rst:1444 +#: ../../whatsnew/3.8.rst:1433 msgid "" ":class:`xmlrpc.client.ServerProxy` now supports an optional *headers* " "keyword argument for a sequence of HTTP headers to be sent with each " @@ -1762,36 +1738,36 @@ msgid "" "Cédric Krier in :issue:`35153`.)" msgstr "" -#: ../../whatsnew/3.8.rst:1452 +#: ../../whatsnew/3.8.rst:1441 msgid "Optimizations" msgstr "" -#: ../../whatsnew/3.8.rst:1454 +#: ../../whatsnew/3.8.rst:1443 msgid "" "The :mod:`subprocess` module can now use the :func:`os.posix_spawn` function " "in some cases for better performance. Currently, it is only used on macOS " "and Linux (using glibc 2.24 or newer) if all these conditions are met:" msgstr "" -#: ../../whatsnew/3.8.rst:1458 +#: ../../whatsnew/3.8.rst:1447 msgid "*close_fds* is false;" msgstr "" -#: ../../whatsnew/3.8.rst:1459 +#: ../../whatsnew/3.8.rst:1448 msgid "" "*preexec_fn*, *pass_fds*, *cwd* and *start_new_session* parameters are not " "set;" msgstr "" -#: ../../whatsnew/3.8.rst:1461 +#: ../../whatsnew/3.8.rst:1450 msgid "the *executable* path contains a directory." msgstr "" -#: ../../whatsnew/3.8.rst:1463 +#: ../../whatsnew/3.8.rst:1452 msgid "(Contributed by Joannah Nanjekye and Victor Stinner in :issue:`35537`.)" msgstr "" -#: ../../whatsnew/3.8.rst:1465 +#: ../../whatsnew/3.8.rst:1454 msgid "" ":func:`shutil.copyfile`, :func:`shutil.copy`, :func:`shutil.copy2`, :func:" "`shutil.copytree` and :func:`shutil.move` use platform-specific \"fast-copy" @@ -1807,7 +1783,7 @@ msgid "" "Rodolà in :issue:`33671`.)" msgstr "" -#: ../../whatsnew/3.8.rst:1481 +#: ../../whatsnew/3.8.rst:1470 msgid "" ":func:`shutil.copytree` uses :func:`os.scandir` function and all copy " "functions depending from it use cached :func:`os.stat` values. The speedup " @@ -1817,27 +1793,27 @@ msgid "" "on network filesystems. (Contributed by Giampaolo Rodolà in :issue:`33695`.)" msgstr "" -#: ../../whatsnew/3.8.rst:1488 +#: ../../whatsnew/3.8.rst:1477 msgid "" "The default protocol in the :mod:`pickle` module is now Protocol 4, first " "introduced in Python 3.4. It offers better performance and smaller size " "compared to Protocol 3 available since Python 3.0." msgstr "" -#: ../../whatsnew/3.8.rst:1492 +#: ../../whatsnew/3.8.rst:1481 msgid "" "Removed one ``Py_ssize_t`` member from ``PyGC_Head``. All GC tracked " "objects (e.g. tuple, list, dict) size is reduced 4 or 8 bytes. (Contributed " "by Inada Naoki in :issue:`33597`.)" msgstr "" -#: ../../whatsnew/3.8.rst:1496 +#: ../../whatsnew/3.8.rst:1485 msgid "" ":class:`uuid.UUID` now uses ``__slots__`` to reduce its memory footprint. " "(Contributed by Wouter Bolsterlee and Tal Einat in :issue:`30977`)" msgstr "" -#: ../../whatsnew/3.8.rst:1499 +#: ../../whatsnew/3.8.rst:1488 msgid "" "Improved performance of :func:`operator.itemgetter` by 33%. Optimized " "argument handling and added a fast path for the common case of a single non-" @@ -1845,7 +1821,7 @@ msgid "" "standard library). (Contributed by Raymond Hettinger in :issue:`35664`.)" msgstr "" -#: ../../whatsnew/3.8.rst:1505 +#: ../../whatsnew/3.8.rst:1494 msgid "" "Sped-up field lookups in :func:`collections.namedtuple`. They are now more " "than two times faster, making them the fastest form of instance variable " @@ -1853,7 +1829,7 @@ msgid "" "Jevnik, Serhiy Storchaka in :issue:`32492`.)" msgstr "" -#: ../../whatsnew/3.8.rst:1510 +#: ../../whatsnew/3.8.rst:1499 msgid "" "The :class:`list` constructor does not overallocate the internal item buffer " "if the input iterable has a known length (the input implements ``__len__``). " @@ -1861,7 +1837,7 @@ msgid "" "Hettinger and Pablo Galindo in :issue:`33234`.)" msgstr "" -#: ../../whatsnew/3.8.rst:1515 +#: ../../whatsnew/3.8.rst:1504 msgid "" "Doubled the speed of class variable writes. When a non-dunder attribute was " "updated, there was an unnecessary call to update slots. (Contributed by " @@ -1869,7 +1845,7 @@ msgid "" "and Serhiy Storchaka in :issue:`36012`.)" msgstr "" -#: ../../whatsnew/3.8.rst:1520 +#: ../../whatsnew/3.8.rst:1509 msgid "" "Reduced an overhead of converting arguments passed to many builtin functions " "and methods. This sped up calling some simple builtin functions and methods " @@ -1877,18 +1853,18 @@ msgid "" "`35582` and :issue:`36127`.)" msgstr "" -#: ../../whatsnew/3.8.rst:1525 +#: ../../whatsnew/3.8.rst:1514 msgid "" "``LOAD_GLOBAL`` instruction now uses new \"per opcode cache\" mechanism. It " "is about 40% faster now. (Contributed by Yury Selivanov and Inada Naoki in :" "issue:`26219`.)" msgstr "" -#: ../../whatsnew/3.8.rst:1531 +#: ../../whatsnew/3.8.rst:1520 msgid "Build and C API Changes" msgstr "" -#: ../../whatsnew/3.8.rst:1533 +#: ../../whatsnew/3.8.rst:1522 msgid "" "Default :data:`sys.abiflags` became an empty string: the ``m`` flag for " "pymalloc became useless (builds with and without pymalloc are ABI " @@ -1896,22 +1872,22 @@ msgid "" "issue:`36707`.)" msgstr "" -#: ../../whatsnew/3.8.rst:1537 +#: ../../whatsnew/3.8.rst:1526 msgid "Example of changes:" msgstr "" -#: ../../whatsnew/3.8.rst:1539 +#: ../../whatsnew/3.8.rst:1528 msgid "" "Only ``python3.8`` program is installed, ``python3.8m`` program is gone." msgstr "" -#: ../../whatsnew/3.8.rst:1540 +#: ../../whatsnew/3.8.rst:1529 msgid "" "Only ``python3.8-config`` script is installed, ``python3.8m-config`` script " "is gone." msgstr "" -#: ../../whatsnew/3.8.rst:1542 +#: ../../whatsnew/3.8.rst:1531 msgid "" "The ``m`` flag has been removed from the suffix of dynamic library " "filenames: extension modules in the standard library as well as those " @@ -1920,23 +1896,23 @@ msgid "" "linux-gnu.so`` became ``.cpython-38-x86_64-linux-gnu.so`` in Python 3.8." msgstr "" -#: ../../whatsnew/3.8.rst:1549 +#: ../../whatsnew/3.8.rst:1538 msgid "" "The header files have been reorganized to better separate the different " "kinds of APIs:" msgstr "" -#: ../../whatsnew/3.8.rst:1552 +#: ../../whatsnew/3.8.rst:1541 msgid "``Include/*.h`` should be the portable public stable C API." msgstr "" -#: ../../whatsnew/3.8.rst:1553 +#: ../../whatsnew/3.8.rst:1542 msgid "" "``Include/cpython/*.h`` should be the unstable C API specific to CPython; " "public API, with some private API prefixed by ``_Py`` or ``_PY``." msgstr "" -#: ../../whatsnew/3.8.rst:1555 +#: ../../whatsnew/3.8.rst:1544 msgid "" "``Include/internal/*.h`` is the private internal C API very specific to " "CPython. This API comes with no backward compatibility warranty and should " @@ -1945,42 +1921,42 @@ msgid "" "calling functions. This API is now installed by ``make install``." msgstr "" -#: ../../whatsnew/3.8.rst:1561 +#: ../../whatsnew/3.8.rst:1550 msgid "" "(Contributed by Victor Stinner in :issue:`35134` and :issue:`35081`, work " "initiated by Eric Snow in Python 3.7.)" msgstr "" -#: ../../whatsnew/3.8.rst:1564 +#: ../../whatsnew/3.8.rst:1553 msgid "" "Some macros have been converted to static inline functions: parameter types " "and return type are well defined, they don't have issues specific to macros, " "variables have a local scopes. Examples:" msgstr "" -#: ../../whatsnew/3.8.rst:1568 +#: ../../whatsnew/3.8.rst:1557 msgid ":c:func:`Py_INCREF`, :c:func:`Py_DECREF`" msgstr "" -#: ../../whatsnew/3.8.rst:1569 +#: ../../whatsnew/3.8.rst:1558 msgid ":c:func:`Py_XINCREF`, :c:func:`Py_XDECREF`" msgstr "" -#: ../../whatsnew/3.8.rst:1570 +#: ../../whatsnew/3.8.rst:1559 msgid ":c:func:`PyObject_INIT`, :c:func:`PyObject_INIT_VAR`" msgstr "" -#: ../../whatsnew/3.8.rst:1571 +#: ../../whatsnew/3.8.rst:1560 msgid "" "Private functions: :c:func:`_PyObject_GC_TRACK`, :c:func:" "`_PyObject_GC_UNTRACK`, :c:func:`_Py_Dealloc`" msgstr "" -#: ../../whatsnew/3.8.rst:1574 +#: ../../whatsnew/3.8.rst:1563 msgid "(Contributed by Victor Stinner in :issue:`35059`.)" msgstr "" -#: ../../whatsnew/3.8.rst:1576 +#: ../../whatsnew/3.8.rst:1565 msgid "" "The :c:func:`PyByteArray_Init` and :c:func:`PyByteArray_Fini` functions have " "been removed. They did nothing since Python 2.7.4 and Python 3.2.0, were " @@ -1988,14 +1964,14 @@ msgid "" "(Contributed by Victor Stinner in :issue:`35713`.)" msgstr "" -#: ../../whatsnew/3.8.rst:1581 +#: ../../whatsnew/3.8.rst:1570 msgid "" "The result of :c:func:`PyExceptionClass_Name` is now of type ``const char " "*`` rather of ``char *``. (Contributed by Serhiy Storchaka in :issue:" "`33818`.)" msgstr "" -#: ../../whatsnew/3.8.rst:1585 +#: ../../whatsnew/3.8.rst:1574 msgid "" "The duality of ``Modules/Setup.dist`` and ``Modules/Setup`` has been " "removed. Previously, when updating the CPython source tree, one had to " @@ -2006,7 +1982,7 @@ msgid "" "the file could produce build failures." msgstr "" -#: ../../whatsnew/3.8.rst:1593 +#: ../../whatsnew/3.8.rst:1582 msgid "" "Now the build system always reads from ``Modules/Setup`` inside the source " "tree. People who want to customize that file are encouraged to maintain " @@ -2014,11 +1990,11 @@ msgid "" "for any other change to the source tree." msgstr "" -#: ../../whatsnew/3.8.rst:1598 +#: ../../whatsnew/3.8.rst:1587 msgid "(Contributed by Antoine Pitrou in :issue:`32430`.)" msgstr "" -#: ../../whatsnew/3.8.rst:1600 +#: ../../whatsnew/3.8.rst:1589 msgid "" "Functions that convert Python number to C integer like :c:func:" "`PyLong_AsLong` and argument parsing functions like :c:func:" @@ -2034,7 +2010,7 @@ msgid "" "`20092`.)" msgstr "" -#: ../../whatsnew/3.8.rst:1614 +#: ../../whatsnew/3.8.rst:1603 msgid "" "Heap-allocated type objects will now increase their reference count in :c:" "func:`PyObject_Init` (and its parallel macro ``PyObject_INIT``) instead of " @@ -2043,7 +2019,7 @@ msgid "" "issue:`35810`.)" msgstr "" -#: ../../whatsnew/3.8.rst:1620 +#: ../../whatsnew/3.8.rst:1609 msgid "" "The new function :c:func:`PyCode_NewWithPosOnlyArgs` allows to create code " "objects like :c:func:`PyCode_New`, but with an extra *posonlyargcount* " @@ -2051,25 +2027,25 @@ msgid "" "(Contributed by Pablo Galindo in :issue:`37221`.)" msgstr "" -#: ../../whatsnew/3.8.rst:1625 +#: ../../whatsnew/3.8.rst:1614 msgid "" ":c:func:`Py_SetPath` now sets :data:`sys.executable` to the program full " "path (:c:func:`Py_GetProgramFullPath`) rather than to the program name (:c:" "func:`Py_GetProgramName`). (Contributed by Victor Stinner in :issue:`38234`.)" msgstr "" -#: ../../whatsnew/3.8.rst:1632 +#: ../../whatsnew/3.8.rst:1621 msgid "Deprecated" msgstr "" -#: ../../whatsnew/3.8.rst:1634 +#: ../../whatsnew/3.8.rst:1623 msgid "" "The distutils ``bdist_wininst`` command is now deprecated, use " "``bdist_wheel`` (wheel packages) instead. (Contributed by Victor Stinner in :" "issue:`37481`.)" msgstr "" -#: ../../whatsnew/3.8.rst:1638 +#: ../../whatsnew/3.8.rst:1627 msgid "" "Deprecated methods ``getchildren()`` and ``getiterator()`` in the :mod:`~xml." "etree.ElementTree` module now emit a :exc:`DeprecationWarning` instead of :" @@ -2077,7 +2053,7 @@ msgid "" "(Contributed by Serhiy Storchaka in :issue:`29209`.)" msgstr "" -#: ../../whatsnew/3.8.rst:1644 +#: ../../whatsnew/3.8.rst:1633 msgid "" "Passing an object that is not an instance of :class:`concurrent.futures." "ThreadPoolExecutor` to :meth:`loop.set_default_executor() `. (Contributed by Serhiy Storchaka in :issue:`36492`.)" msgstr "" -#: ../../whatsnew/3.8.rst:1745 +#: ../../whatsnew/3.8.rst:1734 msgid "API and Feature Removals" msgstr "" -#: ../../whatsnew/3.8.rst:1747 +#: ../../whatsnew/3.8.rst:1736 msgid "The following features and APIs have been removed from Python 3.8:" msgstr "" -#: ../../whatsnew/3.8.rst:1749 +#: ../../whatsnew/3.8.rst:1738 msgid "" "Starting with Python 3.3, importing ABCs from :mod:`collections` was " "deprecated, and importing should be done from :mod:`collections.abc`. Being " @@ -2248,20 +2224,20 @@ msgid "" "delayed to 3.9. (See :issue:`36952`.)" msgstr "" -#: ../../whatsnew/3.8.rst:1754 +#: ../../whatsnew/3.8.rst:1743 msgid "" "The :mod:`macpath` module, deprecated in Python 3.7, has been removed. " "(Contributed by Victor Stinner in :issue:`35471`.)" msgstr "" -#: ../../whatsnew/3.8.rst:1757 ../../whatsnew/3.8.rst:1876 +#: ../../whatsnew/3.8.rst:1746 ../../whatsnew/3.8.rst:1865 msgid "" "The function :func:`platform.popen` has been removed, after having been " "deprecated since Python 3.3: use :func:`os.popen` instead. (Contributed by " "Victor Stinner in :issue:`35345`.)" msgstr "" -#: ../../whatsnew/3.8.rst:1761 +#: ../../whatsnew/3.8.rst:1750 msgid "" "The function :func:`time.clock` has been removed, after having been " "deprecated since Python 3.3: use :func:`time.perf_counter` or :func:`time." @@ -2269,27 +2245,27 @@ msgid "" "behavior. (Contributed by Matthias Bussonnier in :issue:`36895`.)" msgstr "" -#: ../../whatsnew/3.8.rst:1767 +#: ../../whatsnew/3.8.rst:1756 msgid "" "The ``pyvenv`` script has been removed in favor of ``python3.8 -m venv`` to " "help eliminate confusion as to what Python interpreter the ``pyvenv`` script " "is tied to. (Contributed by Brett Cannon in :issue:`25427`.)" msgstr "" -#: ../../whatsnew/3.8.rst:1771 +#: ../../whatsnew/3.8.rst:1760 msgid "" "``parse_qs``, ``parse_qsl``, and ``escape`` are removed from the :mod:`cgi` " "module. They are deprecated in Python 3.2 or older. They should be imported " "from the ``urllib.parse`` and ``html`` modules instead." msgstr "" -#: ../../whatsnew/3.8.rst:1775 +#: ../../whatsnew/3.8.rst:1764 msgid "" "``filemode`` function is removed from the :mod:`tarfile` module. It is not " "documented and deprecated since Python 3.3." msgstr "" -#: ../../whatsnew/3.8.rst:1778 +#: ../../whatsnew/3.8.rst:1767 msgid "" "The :class:`~xml.etree.ElementTree.XMLParser` constructor no longer accepts " "the *html* argument. It never had an effect and was deprecated in Python " @@ -2297,53 +2273,53 @@ msgid "" "only_parameter>`. (Contributed by Serhiy Storchaka in :issue:`29209`.)" msgstr "" -#: ../../whatsnew/3.8.rst:1783 +#: ../../whatsnew/3.8.rst:1772 msgid "" "Removed the ``doctype()`` method of :class:`~xml.etree.ElementTree." "XMLParser`. (Contributed by Serhiy Storchaka in :issue:`29209`.)" msgstr "" -#: ../../whatsnew/3.8.rst:1786 +#: ../../whatsnew/3.8.rst:1775 msgid "" "\"unicode_internal\" codec is removed. (Contributed by Inada Naoki in :issue:" "`36297`.)" msgstr "" -#: ../../whatsnew/3.8.rst:1789 +#: ../../whatsnew/3.8.rst:1778 msgid "" "The ``Cache`` and ``Statement`` objects of the :mod:`sqlite3` module are not " "exposed to the user. (Contributed by Aviv Palivoda in :issue:`30262`.)" msgstr "" -#: ../../whatsnew/3.8.rst:1793 +#: ../../whatsnew/3.8.rst:1782 msgid "" "The ``bufsize`` keyword argument of :func:`fileinput.input` and :func:" "`fileinput.FileInput` which was ignored and deprecated since Python 3.6 has " "been removed. :issue:`36952` (Contributed by Matthias Bussonnier.)" msgstr "" -#: ../../whatsnew/3.8.rst:1797 +#: ../../whatsnew/3.8.rst:1786 msgid "" "The functions :func:`sys.set_coroutine_wrapper` and :func:`sys." "get_coroutine_wrapper` deprecated in Python 3.7 have been removed; :issue:" "`36933` (Contributed by Matthias Bussonnier.)" msgstr "" -#: ../../whatsnew/3.8.rst:1803 +#: ../../whatsnew/3.8.rst:1792 msgid "Porting to Python 3.8" msgstr "" -#: ../../whatsnew/3.8.rst:1805 +#: ../../whatsnew/3.8.rst:1794 msgid "" "This section lists previously described changes and other bugfixes that may " "require changes to your code." msgstr "" -#: ../../whatsnew/3.8.rst:1810 +#: ../../whatsnew/3.8.rst:1799 msgid "Changes in Python behavior" msgstr "" -#: ../../whatsnew/3.8.rst:1812 +#: ../../whatsnew/3.8.rst:1801 msgid "" "Yield expressions (both ``yield`` and ``yield from`` clauses) are now " "disallowed in comprehensions and generator expressions (aside from the " @@ -2351,7 +2327,7 @@ msgid "" "Serhiy Storchaka in :issue:`10544`.)" msgstr "" -#: ../../whatsnew/3.8.rst:1817 +#: ../../whatsnew/3.8.rst:1806 msgid "" "The compiler now produces a :exc:`SyntaxWarning` when identity checks " "(``is`` and ``is not``) are used with certain types of literals (e.g. " @@ -2361,7 +2337,7 @@ msgid "" "issue:`34850`.)" msgstr "" -#: ../../whatsnew/3.8.rst:1824 +#: ../../whatsnew/3.8.rst:1813 msgid "" "The CPython interpreter can swallow exceptions in some circumstances. In " "Python 3.8 this happens in fewer cases. In particular, exceptions raised " @@ -2369,7 +2345,7 @@ msgid "" "(Contributed by Serhiy Storchaka in :issue:`35459`.)" msgstr "" -#: ../../whatsnew/3.8.rst:1829 +#: ../../whatsnew/3.8.rst:1818 msgid "" "Removed ``__str__`` implementations from builtin types :class:`bool`, :class:" "`int`, :class:`float`, :class:`complex` and few classes from the standard " @@ -2379,7 +2355,7 @@ msgid "" "issue:`36793`.)" msgstr "" -#: ../../whatsnew/3.8.rst:1836 +#: ../../whatsnew/3.8.rst:1825 msgid "" "On AIX, :attr:`sys.platform` doesn't contain the major version anymore. It " "is always ``'aix'``, instead of ``'aix3'`` .. ``'aix7'``. Since older " @@ -2388,7 +2364,7 @@ msgid "" "`36588`.)" msgstr "" -#: ../../whatsnew/3.8.rst:1842 +#: ../../whatsnew/3.8.rst:1831 msgid "" ":c:func:`PyEval_AcquireLock` and :c:func:`PyEval_AcquireThread` now " "terminate the current thread if called while the interpreter is finalizing, " @@ -2399,11 +2375,11 @@ msgid "" "`36475`.)" msgstr "" -#: ../../whatsnew/3.8.rst:1852 +#: ../../whatsnew/3.8.rst:1841 msgid "Changes in the Python API" msgstr "" -#: ../../whatsnew/3.8.rst:1854 +#: ../../whatsnew/3.8.rst:1843 msgid "" "The :func:`os.getcwdb` function now uses the UTF-8 encoding on Windows, " "rather than the ANSI code page: see :pep:`529` for the rationale. The " @@ -2411,7 +2387,7 @@ msgid "" "in :issue:`37412`.)" msgstr "" -#: ../../whatsnew/3.8.rst:1859 +#: ../../whatsnew/3.8.rst:1848 msgid "" ":class:`subprocess.Popen` can now use :func:`os.posix_spawn` in some cases " "for better performance. On Windows Subsystem for Linux and QEMU User " @@ -2421,7 +2397,7 @@ msgid "" "by Joannah Nanjekye and Victor Stinner in :issue:`35537`.)" msgstr "" -#: ../../whatsnew/3.8.rst:1866 +#: ../../whatsnew/3.8.rst:1855 msgid "" "The *preexec_fn* argument of * :class:`subprocess.Popen` is no longer " "compatible with subinterpreters. The use of the parameter in a " @@ -2429,20 +2405,20 @@ msgid "" "issue:`34651`, modified by Christian Heimes in :issue:`37951`.)" msgstr "" -#: ../../whatsnew/3.8.rst:1872 +#: ../../whatsnew/3.8.rst:1861 msgid "" "The :meth:`imap.IMAP4.logout` method no longer silently ignores arbitrary " "exceptions. (Contributed by Victor Stinner in :issue:`36348`.)" msgstr "" -#: ../../whatsnew/3.8.rst:1880 +#: ../../whatsnew/3.8.rst:1869 msgid "" "The :func:`statistics.mode` function no longer raises an exception when " "given multimodal data. Instead, it returns the first mode encountered in " "the input data. (Contributed by Raymond Hettinger in :issue:`35892`.)" msgstr "" -#: ../../whatsnew/3.8.rst:1885 +#: ../../whatsnew/3.8.rst:1874 msgid "" "The :meth:`~tkinter.ttk.Treeview.selection` method of the :class:`tkinter." "ttk.Treeview` class no longer takes arguments. Using it with arguments for " @@ -2451,7 +2427,7 @@ msgid "" "selection. (Contributed by Serhiy Storchaka in :issue:`31508`.)" msgstr "" -#: ../../whatsnew/3.8.rst:1891 +#: ../../whatsnew/3.8.rst:1880 msgid "" "The :meth:`writexml`, :meth:`toxml` and :meth:`toprettyxml` methods of :mod:" "`xml.dom.minidom`, and the :meth:`write` method of :mod:`xml.etree`, now " @@ -2459,14 +2435,14 @@ msgid "" "Rojas and Raymond Hettinger in :issue:`34160`.)" msgstr "" -#: ../../whatsnew/3.8.rst:1896 +#: ../../whatsnew/3.8.rst:1885 msgid "" "A :mod:`dbm.dumb` database opened with flags ``'r'`` is now read-only. :func:" "`dbm.dumb.open` with flags ``'r'`` and ``'w'`` no longer creates a database " "if it does not exist. (Contributed by Serhiy Storchaka in :issue:`32749`.)" msgstr "" -#: ../../whatsnew/3.8.rst:1901 +#: ../../whatsnew/3.8.rst:1890 msgid "" "The ``doctype()`` method defined in a subclass of :class:`~xml.etree." "ElementTree.XMLParser` will no longer be called and will emit a :exc:" @@ -2476,7 +2452,7 @@ msgid "" "in :issue:`29209`.)" msgstr "" -#: ../../whatsnew/3.8.rst:1908 +#: ../../whatsnew/3.8.rst:1897 msgid "" "A :exc:`RuntimeError` is now raised when the custom metaclass doesn't " "provide the ``__classcell__`` entry in the namespace passed to ``type." @@ -2484,13 +2460,13 @@ msgid "" "(Contributed by Serhiy Storchaka in :issue:`23722`.)" msgstr "" -#: ../../whatsnew/3.8.rst:1913 +#: ../../whatsnew/3.8.rst:1902 msgid "" "The :class:`cProfile.Profile` class can now be used as a context manager. " "(Contributed by Scott Sanderson in :issue:`29235`.)" msgstr "" -#: ../../whatsnew/3.8.rst:1916 +#: ../../whatsnew/3.8.rst:1905 msgid "" ":func:`shutil.copyfile`, :func:`shutil.copy`, :func:`shutil.copy2`, :func:" "`shutil.copytree` and :func:`shutil.move` use platform-specific \"fast-copy" @@ -2498,19 +2474,19 @@ msgid "" "section)." msgstr "" -#: ../../whatsnew/3.8.rst:1921 +#: ../../whatsnew/3.8.rst:1910 msgid "" ":func:`shutil.copyfile` default buffer size on Windows was changed from 16 " "KiB to 1 MiB." msgstr "" -#: ../../whatsnew/3.8.rst:1924 +#: ../../whatsnew/3.8.rst:1913 msgid "" "The ``PyGC_Head`` struct has changed completely. All code that touched the " "struct member should be rewritten. (See :issue:`33597`.)" msgstr "" -#: ../../whatsnew/3.8.rst:1927 +#: ../../whatsnew/3.8.rst:1916 msgid "" "The :c:type:`PyInterpreterState` struct has been moved into the \"internal\" " "header files (specifically Include/internal/pycore_pystate.h). An opaque " @@ -2522,7 +2498,7 @@ msgid "" "functions to the public API). (See :issue:`35886`.)" msgstr "" -#: ../../whatsnew/3.8.rst:1937 +#: ../../whatsnew/3.8.rst:1926 msgid "" "The :meth:`mmap.flush() ` method now returns ``None`` on " "success and raises an exception on error under all platforms. Previously, " @@ -2532,13 +2508,13 @@ msgid "" "(Contributed by Berker Peksag in :issue:`2122`.)" msgstr "" -#: ../../whatsnew/3.8.rst:1944 +#: ../../whatsnew/3.8.rst:1933 msgid "" ":mod:`xml.dom.minidom` and :mod:`xml.sax` modules no longer process external " "entities by default. (Contributed by Christian Heimes in :issue:`17239`.)" msgstr "" -#: ../../whatsnew/3.8.rst:1948 +#: ../../whatsnew/3.8.rst:1937 msgid "" "Deleting a key from a read-only :mod:`dbm` database (:mod:`dbm.dumb`, :mod:" "`dbm.gnu` or :mod:`dbm.ndbm`) raises :attr:`error` (:exc:`dbm.dumb.error`, :" @@ -2546,7 +2522,7 @@ msgid "" "(Contributed by Xiang Zhang in :issue:`33106`.)" msgstr "" -#: ../../whatsnew/3.8.rst:1953 +#: ../../whatsnew/3.8.rst:1942 msgid "" "Simplified AST for literals. All constants will be represented as :class:" "`ast.Constant` instances. Instantiating old classes ``Num``, ``Str``, " @@ -2554,7 +2530,7 @@ msgid "" "``Constant``. (Contributed by Serhiy Storchaka in :issue:`32892`.)" msgstr "" -#: ../../whatsnew/3.8.rst:1969 +#: ../../whatsnew/3.8.rst:1957 msgid "" "The function :func:`asyncio.wait_for` now correctly waits for cancellation " "when using an instance of :class:`asyncio.Task`. Previously, upon reaching " @@ -2562,18 +2538,18 @@ msgid "" "Pranskevichus in :issue:`32751`.)" msgstr "" -#: ../../whatsnew/3.8.rst:1974 +#: ../../whatsnew/3.8.rst:1962 msgid "" "The function :func:`asyncio.BaseTransport.get_extra_info` now returns a safe " "to use socket object when 'socket' is passed to the *name* parameter. " "(Contributed by Yury Selivanov in :issue:`37027`.)" msgstr "" -#: ../../whatsnew/3.8.rst:1978 +#: ../../whatsnew/3.8.rst:1966 msgid ":class:`asyncio.BufferedProtocol` has graduated to the stable API." msgstr "" -#: ../../whatsnew/3.8.rst:1982 +#: ../../whatsnew/3.8.rst:1970 msgid "" "DLL dependencies for extension modules and DLLs loaded with :mod:`ctypes` on " "Windows are now resolved more securely. Only the system paths, the directory " @@ -2588,14 +2564,14 @@ msgid "" "verified by the installer). (Contributed by Steve Dower in :issue:`36085`.)" msgstr "" -#: ../../whatsnew/3.8.rst:1995 +#: ../../whatsnew/3.8.rst:1983 msgid "" "The header files and functions related to pgen have been removed after its " "replacement by a pure Python implementation. (Contributed by Pablo Galindo " "in :issue:`36623`.)" msgstr "" -#: ../../whatsnew/3.8.rst:1999 +#: ../../whatsnew/3.8.rst:1987 msgid "" ":class:`types.CodeType` has a new parameter in the second position of the " "constructor (*posonlyargcount*) to support positional-only arguments defined " @@ -2605,11 +2581,11 @@ msgid "" "code future-proof." msgstr "" -#: ../../whatsnew/3.8.rst:2008 +#: ../../whatsnew/3.8.rst:1996 msgid "Changes in the C API" msgstr "" -#: ../../whatsnew/3.8.rst:2010 +#: ../../whatsnew/3.8.rst:1998 msgid "" "The :c:type:`PyCompilerFlags` structure got a new *cf_feature_version* " "field. It should be initialized to ``PY_MINOR_VERSION``. The field is " @@ -2617,14 +2593,14 @@ msgid "" "in *cf_flags*. (Contributed by Guido van Rossum in :issue:`35766`.)" msgstr "" -#: ../../whatsnew/3.8.rst:2016 +#: ../../whatsnew/3.8.rst:2004 msgid "" "The :c:func:`PyEval_ReInitThreads` function has been removed from the C API. " "It should not be called explicitly: use :c:func:`PyOS_AfterFork_Child` " "instead. (Contributed by Victor Stinner in :issue:`36728`.)" msgstr "" -#: ../../whatsnew/3.8.rst:2021 +#: ../../whatsnew/3.8.rst:2009 msgid "" "On Unix, C extensions are no longer linked to libpython except on Android " "and Cygwin. When Python is embedded, ``libpython`` must not be loaded with " @@ -2635,7 +2611,7 @@ msgid "" "Stinner in :issue:`21536`.)" msgstr "" -#: ../../whatsnew/3.8.rst:2029 +#: ../../whatsnew/3.8.rst:2017 msgid "" "Use of ``#`` variants of formats in parsing or building value (e.g. :c:func:" "`PyArg_ParseTuple`, :c:func:`Py_BuildValue`, :c:func:" @@ -2644,7 +2620,7 @@ msgid "" "`arg-parsing` for detail. (Contributed by Inada Naoki in :issue:`36381`.)" msgstr "" -#: ../../whatsnew/3.8.rst:2035 +#: ../../whatsnew/3.8.rst:2023 msgid "" "Instances of heap-allocated types (such as those created with :c:func:" "`PyType_FromSpec`) hold a reference to their type object. Increasing the " @@ -2654,11 +2630,11 @@ msgid "" "through :c:func:`PyType_FromSpec` behave like other classes in managed code." msgstr "" -#: ../../whatsnew/3.8.rst:2043 +#: ../../whatsnew/3.8.rst:2031 msgid "Statically allocated types are not affected." msgstr "" -#: ../../whatsnew/3.8.rst:2045 +#: ../../whatsnew/3.8.rst:2033 msgid "" "For the vast majority of cases, there should be no side effect. However, " "types that manually increase the reference count after allocating an " @@ -2667,12 +2643,12 @@ msgid "" "instance deallocation." msgstr "" -#: ../../whatsnew/3.8.rst:2051 +#: ../../whatsnew/3.8.rst:2039 msgid "" "To correctly port these types into 3.8, please apply the following changes:" msgstr "" -#: ../../whatsnew/3.8.rst:2054 +#: ../../whatsnew/3.8.rst:2042 msgid "" "Remove :c:macro:`Py_INCREF` on the type object after allocating an instance " "- if any. This may happen after calling :c:func:`PyObject_New`, :c:func:" @@ -2681,32 +2657,32 @@ msgid "" "`PyObject_INIT`." msgstr "" -#: ../../whatsnew/3.8.rst:2061 ../../whatsnew/3.8.rst:2080 -#: ../../whatsnew/3.8.rst:2099 +#: ../../whatsnew/3.8.rst:2049 ../../whatsnew/3.8.rst:2068 +#: ../../whatsnew/3.8.rst:2087 msgid "Example:" msgstr "" -#: ../../whatsnew/3.8.rst:2077 +#: ../../whatsnew/3.8.rst:2065 msgid "" "Ensure that all custom ``tp_dealloc`` functions of heap-allocated types " "decrease the type's reference count." msgstr "" -#: ../../whatsnew/3.8.rst:2094 +#: ../../whatsnew/3.8.rst:2082 msgid "(Contributed by Eddie Elizondo in :issue:`35810`.)" msgstr "" -#: ../../whatsnew/3.8.rst:2096 +#: ../../whatsnew/3.8.rst:2084 msgid "" "The :c:macro:`Py_DEPRECATED()` macro has been implemented for MSVC. The " "macro now must be placed before the symbol name." msgstr "" -#: ../../whatsnew/3.8.rst:2105 +#: ../../whatsnew/3.8.rst:2093 msgid "(Contributed by Zackery Spytz in :issue:`33407`.)" msgstr "" -#: ../../whatsnew/3.8.rst:2107 +#: ../../whatsnew/3.8.rst:2095 msgid "" "The interpreter does not pretend to support binary compatibility of " "extension types across feature releases, anymore. A :c:type:`PyTypeObject` " @@ -2716,17 +2692,24 @@ msgid "" "before reading :c:member:`~PyTypeObject.tp_finalize`)." msgstr "" -#: ../../whatsnew/3.8.rst:2114 +#: ../../whatsnew/3.8.rst:2102 msgid "(Contributed by Antoine Pitrou in :issue:`32388`.)" msgstr "" -#: ../../whatsnew/3.8.rst:2116 +#: ../../whatsnew/3.8.rst:2104 +msgid "" +"The :c:func:`PyCode_New` has a new parameter in the second position " +"(*posonlyargcount*) to support :pep:`570`, indicating the number of " +"positional-only arguments." +msgstr "" + +#: ../../whatsnew/3.8.rst:2107 msgid "" "The functions :c:func:`PyNode_AddChild` and :c:func:`PyParser_AddToken` now " "accept two additional ``int`` arguments *end_lineno* and *end_col_offset*." msgstr "" -#: ../../whatsnew/3.8.rst:2119 +#: ../../whatsnew/3.8.rst:2110 msgid "" "The :file:`libpython38.a` file to allow MinGW tools to link directly " "against :file:`python38.dll` is no longer included in the regular Windows " @@ -2735,7 +2718,7 @@ msgid "" "package:" msgstr "" -#: ../../whatsnew/3.8.rst:2129 +#: ../../whatsnew/3.8.rst:2120 msgid "" "The location of an installed :file:`pythonXY.dll` will depend on the " "installation options and the version and language of Windows. See :ref:" @@ -2744,15 +2727,15 @@ msgid "" "the :file:`libs` directory under your Python installation." msgstr "" -#: ../../whatsnew/3.8.rst:2135 +#: ../../whatsnew/3.8.rst:2126 msgid "(Contributed by Steve Dower in :issue:`37351`.)" msgstr "" -#: ../../whatsnew/3.8.rst:2139 +#: ../../whatsnew/3.8.rst:2130 msgid "CPython bytecode changes" msgstr "" -#: ../../whatsnew/3.8.rst:2141 +#: ../../whatsnew/3.8.rst:2132 msgid "" "The interpreter loop has been simplified by moving the logic of unrolling " "the stack of blocks into the compiler. The compiler emits now explicit " @@ -2760,7 +2743,7 @@ msgid "" "code for :keyword:`break`, :keyword:`continue` and :keyword:`return`." msgstr "" -#: ../../whatsnew/3.8.rst:2147 +#: ../../whatsnew/3.8.rst:2138 msgid "" "Removed opcodes :opcode:`BREAK_LOOP`, :opcode:`CONTINUE_LOOP`, :opcode:" "`SETUP_LOOP` and :opcode:`SETUP_EXCEPT`. Added new opcodes :opcode:" @@ -2769,20 +2752,20 @@ msgid "" "`WITH_CLEANUP_START`." msgstr "" -#: ../../whatsnew/3.8.rst:2153 +#: ../../whatsnew/3.8.rst:2144 msgid "" "(Contributed by Mark Shannon, Antoine Pitrou and Serhiy Storchaka in :issue:" "`17611`.)" msgstr "" -#: ../../whatsnew/3.8.rst:2156 +#: ../../whatsnew/3.8.rst:2147 msgid "" "Added new opcode :opcode:`END_ASYNC_FOR` for handling exceptions raised when " "awaiting a next item in an :keyword:`async for` loop. (Contributed by Serhiy " "Storchaka in :issue:`33041`.)" msgstr "" -#: ../../whatsnew/3.8.rst:2160 +#: ../../whatsnew/3.8.rst:2151 msgid "" "The :opcode:`MAP_ADD` now expects the value as the first element in the " "stack and the key as the second element. This change was made so the key is " @@ -2790,22 +2773,22 @@ msgid "" "by :pep:`572`. (Contributed by Jörn Heissler in :issue:`35224`.)" msgstr "" -#: ../../whatsnew/3.8.rst:2167 +#: ../../whatsnew/3.8.rst:2158 msgid "Demos and Tools" msgstr "" -#: ../../whatsnew/3.8.rst:2169 +#: ../../whatsnew/3.8.rst:2160 msgid "" "Added a benchmark script for timing various ways to access variables: " "``Tools/scripts/var_access_benchmark.py``. (Contributed by Raymond Hettinger " "in :issue:`35884`.)" msgstr "" -#: ../../whatsnew/3.8.rst:2173 +#: ../../whatsnew/3.8.rst:2164 msgid "Here's a summary of performance improvements since Python 3.3:" msgstr "" -#: ../../whatsnew/3.8.rst:2220 +#: ../../whatsnew/3.8.rst:2211 msgid "" "The benchmarks were measured on an `Intel® Core™ i7-4960HQ processor " "\n" "Language-Team: LANGUAGE \n" -"Language: \n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" @@ -37,18 +36,8 @@ msgstr "" msgid "|today|" msgstr "" -#: ../../whatsnew/3.9.rst:0 -msgid "Editor" -msgstr "" - -#: ../../whatsnew/3.9.rst:7 -msgid "Łukasz Langa" -msgstr "" - -#: ../../whatsnew/3.9.rst:47 -msgid "" -"This article explains the new features in Python 3.9, compared to 3.8. " -"Python 3.9 was released on October 5th, 2020." +#: ../../whatsnew/3.9.rst:48 +msgid "This article explains the new features in Python 3.9, compared to 3.8." msgstr "" #: ../../whatsnew/3.9.rst:50 @@ -56,131 +45,32 @@ msgid "For full details, see the :ref:`changelog `." msgstr "" #: ../../whatsnew/3.9.rst:54 -msgid ":pep:`596` - Python 3.9 Release Schedule" -msgstr "" - -#: ../../whatsnew/3.9.rst:58 -msgid "Summary -- Release highlights" -msgstr "" - -#: ../../whatsnew/3.9.rst:63 -msgid "New syntax features:" -msgstr "" - -#: ../../whatsnew/3.9.rst:65 -msgid ":pep:`584`, union operators added to ``dict``;" -msgstr "" - -#: ../../whatsnew/3.9.rst:66 -msgid ":pep:`585`, type hinting generics in standard collections;" -msgstr "" - -#: ../../whatsnew/3.9.rst:67 -msgid ":pep:`614`, relaxed grammar restrictions on decorators." -msgstr "" - -#: ../../whatsnew/3.9.rst:69 -msgid "New built-in features:" -msgstr "" - -#: ../../whatsnew/3.9.rst:71 -msgid ":pep:`616`, string methods to remove prefixes and suffixes." -msgstr "" - -#: ../../whatsnew/3.9.rst:73 -msgid "New features in the standard library:" -msgstr "" - -#: ../../whatsnew/3.9.rst:75 -msgid ":pep:`593`, flexible function and variable annotations;" -msgstr "" - -#: ../../whatsnew/3.9.rst:76 -msgid "" -":func:`os.pidfd_open` added that allows process management without races and " -"signals." -msgstr "" - -#: ../../whatsnew/3.9.rst:79 -msgid "Interpreter improvements:" -msgstr "" - -#: ../../whatsnew/3.9.rst:81 -msgid "" -":pep:`573`, fast access to module state from methods of C extension types;" -msgstr "" - -#: ../../whatsnew/3.9.rst:83 -msgid ":pep:`617`, CPython now uses a new parser based on PEG;" -msgstr "" - -#: ../../whatsnew/3.9.rst:84 -msgid "" -"a number of Python builtins (range, tuple, set, frozenset, list, dict) are " -"now sped up using :pep:`590` vectorcall;" -msgstr "" - -#: ../../whatsnew/3.9.rst:86 -msgid "garbage collection does not block on resurrected objects;" -msgstr "" - -#: ../../whatsnew/3.9.rst:87 -msgid "" -"a number of Python modules (:mod:`_abc`, :mod:`audioop`, :mod:`_bz2`, :mod:" -"`_codecs`, :mod:`_contextvars`, :mod:`_crypt`, :mod:`_functools`, :mod:" -"`_json`, :mod:`_locale`, :mod:`math`, :mod:`operator`, :mod:`resource`, :mod:" -"`time`, :mod:`_weakref`) now use multiphase initialization as defined by PEP " -"489;" -msgstr "" - -#: ../../whatsnew/3.9.rst:92 -msgid "" -"a number of standard library modules (:mod:`audioop`, :mod:`ast`, :mod:" -"`grp`, :mod:`_hashlib`, :mod:`pwd`, :mod:`_posixsubprocess`, :mod:`random`, :" -"mod:`select`, :mod:`struct`, :mod:`termios`, :mod:`zlib`) are now using the " -"stable ABI defined by PEP 384." -msgstr "" - -#: ../../whatsnew/3.9.rst:97 -msgid "New library modules:" -msgstr "" - -#: ../../whatsnew/3.9.rst:99 -msgid "" -":pep:`615`, the IANA Time Zone Database is now present in the standard " -"library in the :mod:`zoneinfo` module;" -msgstr "" - -#: ../../whatsnew/3.9.rst:101 msgid "" -"an implementation of a topological sort of a graph is now provided in the " -"new :mod:`graphlib` module." +"Prerelease users should be aware that this document is currently in draft " +"form. It will be updated substantially as Python 3.9 moves towards release, " +"so it's worth checking back even after reading earlier versions." msgstr "" -#: ../../whatsnew/3.9.rst:104 -msgid "Release process changes:" -msgstr "" - -#: ../../whatsnew/3.9.rst:106 -msgid ":pep:`602`, CPython adopts an annual release cycle." +#: ../../whatsnew/3.9.rst:60 +msgid "Summary -- Release highlights" msgstr "" -#: ../../whatsnew/3.9.rst:110 +#: ../../whatsnew/3.9.rst:70 msgid "You should check for DeprecationWarning in your code" msgstr "" -#: ../../whatsnew/3.9.rst:112 +#: ../../whatsnew/3.9.rst:72 msgid "" -"When Python 2.7 was still supported, a lot of functionality in Python 3 was " -"kept for backward compatibility with Python 2.7. With the end of Python 2 " -"support, these backward compatibility layers have been removed, or will be " -"removed soon. Most of them emitted a :exc:`DeprecationWarning` warning for " -"several years. For example, using ``collections.Mapping`` instead of " -"``collections.abc.Mapping`` emits a :exc:`DeprecationWarning` since Python " -"3.3, released in 2012." +"When Python 2.7 was still supported, many functions were kept for backward " +"compatibility with Python 2.7. With the end of Python 2.7 support, these " +"backward compatibility layers have been removed, or will be removed soon. " +"Most of them emitted a :exc:`DeprecationWarning` warning for several years. " +"For example, using ``collections.Mapping`` instead of ``collections.abc." +"Mapping`` emits a :exc:`DeprecationWarning` since Python 3.3, released in " +"2012." msgstr "" -#: ../../whatsnew/3.9.rst:120 +#: ../../whatsnew/3.9.rst:79 msgid "" "Test your application with the :option:`-W` ``default`` command-line option " "to see :exc:`DeprecationWarning` and :exc:`PendingDeprecationWarning`, or " @@ -189,14 +79,14 @@ msgid "" "code." msgstr "" -#: ../../whatsnew/3.9.rst:125 +#: ../../whatsnew/3.9.rst:84 msgid "" -"Python 3.9 is the last version providing those Python 2 backward " -"compatibility layers, to give more time to Python projects maintainers to " -"organize the removal of the Python 2 support and add support for Python 3.9." +"It has been decided to keep a few backward compatibility layers for one last " +"release, to give more time to Python projects maintainers to organize the " +"removal of the Python 2 support and add support for Python 3.9." msgstr "" -#: ../../whatsnew/3.9.rst:129 +#: ../../whatsnew/3.9.rst:88 msgid "" "Aliases to :ref:`Abstract Base Classes ` " "in the :mod:`collections` module, like ``collections.Mapping`` alias to :" @@ -204,49 +94,33 @@ msgid "" "compatibility. They will be removed from Python 3.10." msgstr "" -#: ../../whatsnew/3.9.rst:134 +#: ../../whatsnew/3.9.rst:93 msgid "" "More generally, try to run your tests in the :ref:`Python Development Mode " "` which helps to prepare your code to make it compatible with the " "next Python version." msgstr "" -#: ../../whatsnew/3.9.rst:138 -msgid "" -"Note: a number of pre-existing deprecations were removed in this version of " -"Python as well. Consult the :ref:`removed-in-python-39` section." -msgstr "" - -#: ../../whatsnew/3.9.rst:143 ../../whatsnew/3.9.rst:1258 +#: ../../whatsnew/3.9.rst:99 ../../whatsnew/3.9.rst:1017 msgid "New Features" msgstr "" -#: ../../whatsnew/3.9.rst:146 +#: ../../whatsnew/3.9.rst:102 msgid "Dictionary Merge & Update Operators" msgstr "" -#: ../../whatsnew/3.9.rst:148 +#: ../../whatsnew/3.9.rst:104 msgid "" "Merge (``|``) and update (``|=``) operators have been added to the built-in :" -"class:`dict` class. Those complement the existing ``dict.update`` and " -"``{**d1, **d2}`` methods of merging dictionaries." +"class:`dict` class. See :pep:`584` for a full description. (Contributed by " +"Brandt Bucher in :issue:`36144`.)" msgstr "" -#: ../../whatsnew/3.9.rst:152 ../../whatsnew/3.9.rst:285 -msgid "Example::" +#: ../../whatsnew/3.9.rst:109 +msgid "PEP 616: New removeprefix() and removesuffix() string methods" msgstr "" -#: ../../whatsnew/3.9.rst:161 -msgid "" -"See :pep:`584` for a full description. (Contributed by Brandt Bucher in :" -"issue:`36144`.)" -msgstr "" - -#: ../../whatsnew/3.9.rst:165 -msgid "New String Methods to Remove Prefixes and Suffixes" -msgstr "" - -#: ../../whatsnew/3.9.rst:167 +#: ../../whatsnew/3.9.rst:111 msgid "" ":meth:`str.removeprefix(prefix)` and :meth:`str." "removesuffix(suffix)` have been added to easily remove an " @@ -256,11 +130,11 @@ msgid "" "issue:`39939`.)" msgstr "" -#: ../../whatsnew/3.9.rst:175 -msgid "Type Hinting Generics in Standard Collections" +#: ../../whatsnew/3.9.rst:119 +msgid "PEP 585: Builtin Generic Types" msgstr "" -#: ../../whatsnew/3.9.rst:177 +#: ../../whatsnew/3.9.rst:121 msgid "" "In type annotations you can now use built-in collection types such as " "``list`` and ``dict`` as generic types instead of importing the " @@ -269,21 +143,21 @@ msgid "" "for example ``queue.Queue``." msgstr "" -#: ../../whatsnew/3.9.rst:183 ../../whatsnew/3.9.rst:1147 +#: ../../whatsnew/3.9.rst:127 ../../whatsnew/3.9.rst:949 msgid "Example:" msgstr "" -#: ../../whatsnew/3.9.rst:191 +#: ../../whatsnew/3.9.rst:135 msgid "" "See :pep:`585` for more details. (Contributed by Guido van Rossum, Ethan " "Smith, and Batuhan Taşkaya in :issue:`39481`.)" msgstr "" -#: ../../whatsnew/3.9.rst:195 -msgid "New Parser" +#: ../../whatsnew/3.9.rst:139 +msgid "PEP 617: New Parser" msgstr "" -#: ../../whatsnew/3.9.rst:197 +#: ../../whatsnew/3.9.rst:141 msgid "" "Python 3.9 uses a new parser, based on `PEG `_ instead of `LL(1) ` and in debug build, the " "*encoding* and *errors* arguments are now checked for string encoding and " @@ -344,14 +218,14 @@ msgid "" "`bytes.decode`." msgstr "" -#: ../../whatsnew/3.9.rst:239 +#: ../../whatsnew/3.9.rst:184 msgid "" "By default, for best performance, the *errors* argument is only checked at " "the first encoding/decoding error and the *encoding* argument is sometimes " "ignored for empty strings. (Contributed by Victor Stinner in :issue:`37388`.)" msgstr "" -#: ../../whatsnew/3.9.rst:244 +#: ../../whatsnew/3.9.rst:189 msgid "" "``\"\".replace(\"\", s, n)`` now returns ``s`` instead of an empty string " "for all non-zero ``n``. It is now consistent with ``\"\".replace(\"\", " @@ -359,14 +233,14 @@ msgid "" "objects. (Contributed by Serhiy Storchaka in :issue:`28029`.)" msgstr "" -#: ../../whatsnew/3.9.rst:249 +#: ../../whatsnew/3.9.rst:194 msgid "" "Any valid expression can now be used as a :term:`decorator`. Previously, " "the grammar was much more restrictive. See :pep:`614` for details. " "(Contributed by Brandt Bucher in :issue:`39702`.)" msgstr "" -#: ../../whatsnew/3.9.rst:253 +#: ../../whatsnew/3.9.rst:198 msgid "" "Improved help for the :mod:`typing` module. Docstrings are now shown for all " "special forms and special generic aliases (like ``Union`` and ``List``). " @@ -375,88 +249,69 @@ msgid "" "Serhiy Storchaka in :issue:`40257`.)" msgstr "" -#: ../../whatsnew/3.9.rst:259 -msgid "" -"Parallel running of :meth:`~agen.aclose` / :meth:`~agen.asend` / :meth:" -"`~agen.athrow` is now prohibited, and ``ag_running`` now reflects the actual " -"running status of the async generator. (Contributed by Yury Selivanov in :" -"issue:`30773`.)" -msgstr "" - -#: ../../whatsnew/3.9.rst:264 -msgid "" -"Unexpected errors in calling the ``__iter__`` method are no longer masked by " -"``TypeError`` in the :keyword:`in` operator and functions :func:`~operator." -"contains`, :func:`~operator.indexOf` and :func:`~operator.countOf` of the :" -"mod:`operator` module. (Contributed by Serhiy Storchaka in :issue:`40824`.)" -msgstr "" - -#: ../../whatsnew/3.9.rst:270 -msgid "" -"Unparenthesized lambda expressions can no longer be the expression part in " -"an ``if`` clause in comprehensions and generator expressions. See :issue:" -"`41848` and :issue:`43755` for details." -msgstr "" - -#: ../../whatsnew/3.9.rst:276 +#: ../../whatsnew/3.9.rst:206 msgid "New Modules" msgstr "" -#: ../../whatsnew/3.9.rst:279 +#: ../../whatsnew/3.9.rst:209 msgid "zoneinfo" msgstr "" -#: ../../whatsnew/3.9.rst:281 +#: ../../whatsnew/3.9.rst:211 msgid "" "The :mod:`zoneinfo` module brings support for the IANA time zone database to " "the standard library. It adds :class:`zoneinfo.ZoneInfo`, a concrete :class:" "`datetime.tzinfo` implementation backed by the system's time zone data." msgstr "" -#: ../../whatsnew/3.9.rst:305 +#: ../../whatsnew/3.9.rst:215 +msgid "Example::" +msgstr "" + +#: ../../whatsnew/3.9.rst:235 msgid "" "As a fall-back source of data for platforms that don't ship the IANA " "database, the |tzdata|_ module was released as a first-party package -- " "distributed via PyPI and maintained by the CPython core team." msgstr "" -#: ../../whatsnew/3.9.rst:314 +#: ../../whatsnew/3.9.rst:244 msgid "" ":pep:`615` -- Support for the IANA Time Zone Database in the Standard Library" msgstr "" -#: ../../whatsnew/3.9.rst:315 +#: ../../whatsnew/3.9.rst:245 msgid "PEP written and implemented by Paul Ganssle" msgstr "" -#: ../../whatsnew/3.9.rst:319 +#: ../../whatsnew/3.9.rst:249 msgid "graphlib" msgstr "" -#: ../../whatsnew/3.9.rst:321 +#: ../../whatsnew/3.9.rst:251 msgid "" -"A new module, :mod:`graphlib`, was added that contains the :class:`graphlib." +"Add the :mod:`graphlib` that contains the :class:`graphlib." "TopologicalSorter` class to offer functionality to perform topological " "sorting of graphs. (Contributed by Pablo Galindo, Tim Peters and Larry " "Hastings in :issue:`17005`.)" msgstr "" -#: ../../whatsnew/3.9.rst:328 +#: ../../whatsnew/3.9.rst:257 msgid "Improved Modules" msgstr "" -#: ../../whatsnew/3.9.rst:331 +#: ../../whatsnew/3.9.rst:260 msgid "ast" msgstr "" -#: ../../whatsnew/3.9.rst:333 +#: ../../whatsnew/3.9.rst:262 msgid "" "Added the *indent* option to :func:`~ast.dump` which allows it to produce a " "multiline indented output. (Contributed by Serhiy Storchaka in :issue:" "`37995`.)" msgstr "" -#: ../../whatsnew/3.9.rst:337 +#: ../../whatsnew/3.9.rst:266 msgid "" "Added :func:`ast.unparse` as a function in the :mod:`ast` module that can be " "used to unparse an :class:`ast.AST` object and produce a string with code " @@ -464,17 +319,17 @@ msgid "" "(Contributed by Pablo Galindo and Batuhan Taskaya in :issue:`38870`.)" msgstr "" -#: ../../whatsnew/3.9.rst:342 +#: ../../whatsnew/3.9.rst:271 msgid "" "Added docstrings to AST nodes that contains the ASDL signature used to " "construct that node. (Contributed by Batuhan Taskaya in :issue:`39638`.)" msgstr "" -#: ../../whatsnew/3.9.rst:346 +#: ../../whatsnew/3.9.rst:275 msgid "asyncio" msgstr "" -#: ../../whatsnew/3.9.rst:348 +#: ../../whatsnew/3.9.rst:277 msgid "" "Due to significant security concerns, the *reuse_address* parameter of :meth:" "`asyncio.loop.create_datagram_endpoint` is no longer supported. This is " @@ -484,7 +339,7 @@ msgid "" "`37228`.)" msgstr "" -#: ../../whatsnew/3.9.rst:355 +#: ../../whatsnew/3.9.rst:284 msgid "" "Added a new :term:`coroutine` :meth:`~asyncio.loop." "shutdown_default_executor` that schedules a shutdown for the default " @@ -493,13 +348,13 @@ msgid "" "new :term:`coroutine`. (Contributed by Kyle Stanley in :issue:`34037`.)" msgstr "" -#: ../../whatsnew/3.9.rst:361 +#: ../../whatsnew/3.9.rst:290 msgid "" "Added :class:`asyncio.PidfdChildWatcher`, a Linux-specific child watcher " "implementation that polls process file descriptors. (:issue:`38692`)" msgstr "" -#: ../../whatsnew/3.9.rst:364 +#: ../../whatsnew/3.9.rst:293 msgid "" "Added a new :term:`coroutine` :func:`asyncio.to_thread`. It is mainly used " "for running IO-bound functions in a separate thread to avoid blocking the " @@ -508,33 +363,18 @@ msgid "" "by Kyle Stanley and Yury Selivanov in :issue:`32309`.)" msgstr "" -#: ../../whatsnew/3.9.rst:370 -msgid "" -"When cancelling the task due to a timeout, :meth:`asyncio.wait_for` will now " -"wait until the cancellation is complete also in the case when *timeout* is " -"<= 0, like it does with positive timeouts. (Contributed by Elvis " -"Pranskevichus in :issue:`32751`.)" -msgstr "" - -#: ../../whatsnew/3.9.rst:375 -msgid "" -":mod:`asyncio` now raises :exc:`TyperError` when calling incompatible " -"methods with an :class:`ssl.SSLSocket` socket. (Contributed by Ido Michael " -"in :issue:`37404`.)" -msgstr "" - -#: ../../whatsnew/3.9.rst:380 +#: ../../whatsnew/3.9.rst:300 msgid "compileall" msgstr "" -#: ../../whatsnew/3.9.rst:382 +#: ../../whatsnew/3.9.rst:302 msgid "" "Added new possibility to use hardlinks for duplicated ``.pyc`` files: " "*hardlink_dupes* parameter and --hardlink-dupes command line option. " "(Contributed by Lumír 'Frenzy' Balhar in :issue:`40495`.)" msgstr "" -#: ../../whatsnew/3.9.rst:385 +#: ../../whatsnew/3.9.rst:305 msgid "" "Added new options for path manipulation in resulting ``.pyc`` files: " "*stripdir*, *prependdir*, *limit_sl_dest* parameters and -s, -p, -e command " @@ -543,11 +383,11 @@ msgid "" "issue:`38112`.)" msgstr "" -#: ../../whatsnew/3.9.rst:390 +#: ../../whatsnew/3.9.rst:310 msgid "concurrent.futures" msgstr "" -#: ../../whatsnew/3.9.rst:392 +#: ../../whatsnew/3.9.rst:312 msgid "" "Added a new *cancel_futures* parameter to :meth:`concurrent.futures.Executor." "shutdown` that cancels all pending futures which have not started running, " @@ -555,7 +395,7 @@ msgid "" "(Contributed by Kyle Stanley in :issue:`39349`.)" msgstr "" -#: ../../whatsnew/3.9.rst:398 +#: ../../whatsnew/3.9.rst:318 msgid "" "Removed daemon threads from :class:`~concurrent.futures.ThreadPoolExecutor` " "and :class:`~concurrent.futures.ProcessPoolExecutor`. This improves " @@ -563,7 +403,7 @@ msgid "" "processes. (Contributed by Kyle Stanley in :issue:`39812`.)" msgstr "" -#: ../../whatsnew/3.9.rst:403 +#: ../../whatsnew/3.9.rst:323 msgid "" "Workers in :class:`~concurrent.futures.ProcessPoolExecutor` are now spawned " "on demand, only when there are no available idle workers to reuse. This " @@ -571,22 +411,22 @@ msgid "" "workers. (Contributed by Kyle Stanley in :issue:`39207`.)" msgstr "" -#: ../../whatsnew/3.9.rst:409 +#: ../../whatsnew/3.9.rst:329 msgid "curses" msgstr "" -#: ../../whatsnew/3.9.rst:411 +#: ../../whatsnew/3.9.rst:331 msgid "" -"Added :func:`curses.get_escdelay`, :func:`curses.set_escdelay`, :func:" -"`curses.get_tabsize`, and :func:`curses.set_tabsize` functions. (Contributed " -"by Anthony Sottile in :issue:`38312`.)" +"Add :func:`curses.get_escdelay`, :func:`curses.set_escdelay`, :func:`curses." +"get_tabsize`, and :func:`curses.set_tabsize` functions. (Contributed by " +"Anthony Sottile in :issue:`38312`.)" msgstr "" -#: ../../whatsnew/3.9.rst:416 +#: ../../whatsnew/3.9.rst:336 msgid "datetime" msgstr "" -#: ../../whatsnew/3.9.rst:417 +#: ../../whatsnew/3.9.rst:337 msgid "" "The :meth:`~datetime.date.isocalendar()` of :class:`datetime.date` and :meth:" "`~datetime.datetime.isocalendar()` of :class:`datetime.datetime` methods now " @@ -594,32 +434,32 @@ msgid "" "(Contributed by Dong-hee Na in :issue:`24416`.)" msgstr "" -#: ../../whatsnew/3.9.rst:423 +#: ../../whatsnew/3.9.rst:343 msgid "distutils" msgstr "" -#: ../../whatsnew/3.9.rst:425 +#: ../../whatsnew/3.9.rst:345 msgid "" "The :command:`upload` command now creates SHA2-256 and Blake2b-256 hash " "digests. It skips MD5 on platforms that block MD5 digest. (Contributed by " "Christian Heimes in :issue:`40698`.)" msgstr "" -#: ../../whatsnew/3.9.rst:430 +#: ../../whatsnew/3.9.rst:350 msgid "fcntl" msgstr "" -#: ../../whatsnew/3.9.rst:432 +#: ../../whatsnew/3.9.rst:352 msgid "" "Added constants :data:`~fcntl.F_OFD_GETLK`, :data:`~fcntl.F_OFD_SETLK` and :" "data:`~fcntl.F_OFD_SETLKW`. (Contributed by Dong-hee Na in :issue:`38602`.)" msgstr "" -#: ../../whatsnew/3.9.rst:437 +#: ../../whatsnew/3.9.rst:357 msgid "ftplib" msgstr "" -#: ../../whatsnew/3.9.rst:439 +#: ../../whatsnew/3.9.rst:359 msgid "" ":class:`~ftplib.FTP` and :class:`~ftplib.FTP_TLS` now raise a :class:" "`ValueError` if the given timeout for their constructor is zero to prevent " @@ -627,11 +467,11 @@ msgid "" "`39259`.)" msgstr "" -#: ../../whatsnew/3.9.rst:444 +#: ../../whatsnew/3.9.rst:364 msgid "gc" msgstr "" -#: ../../whatsnew/3.9.rst:446 +#: ../../whatsnew/3.9.rst:366 msgid "" "When the garbage collector makes a collection in which some objects " "resurrect (they are reachable from outside the isolated cycles after the " @@ -640,24 +480,18 @@ msgid "" "issue:`38379`.)" msgstr "" -#: ../../whatsnew/3.9.rst:451 +#: ../../whatsnew/3.9.rst:371 msgid "" "Added a new function :func:`gc.is_finalized` to check if an object has been " "finalized by the garbage collector. (Contributed by Pablo Galindo in :issue:" "`39322`.)" msgstr "" -#: ../../whatsnew/3.9.rst:456 +#: ../../whatsnew/3.9.rst:376 msgid "hashlib" msgstr "" -#: ../../whatsnew/3.9.rst:458 -msgid "" -"The :mod:`hashlib` module can now use SHA3 hashes and SHAKE XOF from OpenSSL " -"when available. (Contributed by Christian Heimes in :issue:`37630`.)" -msgstr "" - -#: ../../whatsnew/3.9.rst:462 +#: ../../whatsnew/3.9.rst:378 msgid "" "Builtin hash modules can now be disabled with ``./configure --without-" "builtin-hashlib-hashes`` or selectively enabled with e.g. ``./configure --" @@ -665,48 +499,22 @@ msgid "" "implementation. (Contributed by Christian Heimes in :issue:`40479`)" msgstr "" -#: ../../whatsnew/3.9.rst:470 +#: ../../whatsnew/3.9.rst:385 msgid "http" msgstr "" -#: ../../whatsnew/3.9.rst:472 +#: ../../whatsnew/3.9.rst:387 msgid "" "HTTP status codes ``103 EARLY_HINTS``, ``418 IM_A_TEAPOT`` and ``425 " "TOO_EARLY`` are added to :class:`http.HTTPStatus`. (Contributed by Dong-hee " "Na in :issue:`39509` and Ross Rhodes in :issue:`39507`.)" msgstr "" -#: ../../whatsnew/3.9.rst:476 -msgid "IDLE and idlelib" -msgstr "" - -#: ../../whatsnew/3.9.rst:478 -msgid "" -"Added option to toggle cursor blink off. (Contributed by Zackery Spytz in :" -"issue:`4603`.)" -msgstr "" - -#: ../../whatsnew/3.9.rst:481 -msgid "" -"Escape key now closes IDLE completion windows. (Contributed by Johnny " -"Najera in :issue:`38944`.)" -msgstr "" - -#: ../../whatsnew/3.9.rst:484 -msgid "" -"Added keywords to module name completion list. (Contributed by Terry J. " -"Reedy in :issue:`37765`.)" -msgstr "" - -#: ../../whatsnew/3.9.rst:487 -msgid "The changes above have been backported to 3.8 maintenance releases." -msgstr "" - -#: ../../whatsnew/3.9.rst:490 +#: ../../whatsnew/3.9.rst:391 msgid "imaplib" msgstr "" -#: ../../whatsnew/3.9.rst:492 +#: ../../whatsnew/3.9.rst:393 msgid "" ":class:`~imaplib.IMAP4` and :class:`~imaplib.IMAP4_SSL` now have an optional " "*timeout* parameter for their constructors. Also, the :meth:`~imaplib.IMAP4." @@ -716,7 +524,7 @@ msgid "" "issue:`38615`.)" msgstr "" -#: ../../whatsnew/3.9.rst:499 +#: ../../whatsnew/3.9.rst:400 msgid "" ":meth:`imaplib.IMAP4.unselect` is added. :meth:`imaplib.IMAP4.unselect` " "frees server's resources associated with the selected mailbox and returns " @@ -726,11 +534,11 @@ msgid "" "Dong-hee Na in :issue:`40375`.)" msgstr "" -#: ../../whatsnew/3.9.rst:507 +#: ../../whatsnew/3.9.rst:408 msgid "importlib" msgstr "" -#: ../../whatsnew/3.9.rst:509 +#: ../../whatsnew/3.9.rst:410 msgid "" "To improve consistency with import statements, :func:`importlib.util." "resolve_name` now raises :exc:`ImportError` instead of :exc:`ValueError` for " @@ -738,47 +546,28 @@ msgid "" "`37444`.)" msgstr "" -#: ../../whatsnew/3.9.rst:514 -msgid "" -"Import loaders which publish immutable module objects can now publish " -"immutable packages in addition to individual modules. (Contributed by Dino " -"Viehland in :issue:`39336`.)" -msgstr "" - -#: ../../whatsnew/3.9.rst:518 -msgid "" -"Added :func:`importlib.resources.files` function with support for " -"subdirectories in package data, matching backport in ``importlib_resources`` " -"version 1.5. (Contributed by Jason R. Coombs in :issue:`39791`.)" -msgstr "" - -#: ../../whatsnew/3.9.rst:523 -msgid "" -"Refreshed ``importlib.metadata`` from ``importlib_metadata`` version 1.6.1." -msgstr "" - -#: ../../whatsnew/3.9.rst:526 +#: ../../whatsnew/3.9.rst:416 msgid "inspect" msgstr "" -#: ../../whatsnew/3.9.rst:528 +#: ../../whatsnew/3.9.rst:418 msgid "" ":attr:`inspect.BoundArguments.arguments` is changed from ``OrderedDict`` to " "regular dict. (Contributed by Inada Naoki in :issue:`36350` and :issue:" "`39775`.)" msgstr "" -#: ../../whatsnew/3.9.rst:532 +#: ../../whatsnew/3.9.rst:422 msgid "ipaddress" msgstr "" -#: ../../whatsnew/3.9.rst:534 +#: ../../whatsnew/3.9.rst:424 msgid "" ":mod:`ipaddress` now supports IPv6 Scoped Addresses (IPv6 address with " "suffix ``%``)." msgstr "" -#: ../../whatsnew/3.9.rst:536 +#: ../../whatsnew/3.9.rst:426 msgid "" "Scoped IPv6 addresses can be parsed using :class:`ipaddress.IPv6Address`. If " "present, scope zone ID is available through the :attr:`~ipaddress." @@ -786,59 +575,52 @@ msgid "" "`34788`.)" msgstr "" -#: ../../whatsnew/3.9.rst:540 -msgid "" -"Starting with Python 3.9.5 the :mod:`ipaddress` module no longer accepts any " -"leading zeros in IPv4 address strings. (Contributed by Christian Heimes in :" -"issue:`36384`)." -msgstr "" - -#: ../../whatsnew/3.9.rst:545 +#: ../../whatsnew/3.9.rst:431 msgid "math" msgstr "" -#: ../../whatsnew/3.9.rst:547 +#: ../../whatsnew/3.9.rst:433 msgid "" "Expanded the :func:`math.gcd` function to handle multiple arguments. " "Formerly, it only supported two arguments. (Contributed by Serhiy Storchaka " "in :issue:`39648`.)" msgstr "" -#: ../../whatsnew/3.9.rst:551 +#: ../../whatsnew/3.9.rst:437 msgid "" -"Added :func:`math.lcm`: return the least common multiple of specified " +"Add :func:`math.lcm`: return the least common multiple of specified " "arguments. (Contributed by Mark Dickinson, Ananthakrishnan and Serhiy " "Storchaka in :issue:`39479` and :issue:`39648`.)" msgstr "" -#: ../../whatsnew/3.9.rst:555 +#: ../../whatsnew/3.9.rst:441 msgid "" -"Added :func:`math.nextafter`: return the next floating-point value after *x* " +"Add :func:`math.nextafter`: return the next floating-point value after *x* " "towards *y*. (Contributed by Victor Stinner in :issue:`39288`.)" msgstr "" -#: ../../whatsnew/3.9.rst:559 +#: ../../whatsnew/3.9.rst:445 msgid "" -"Added :func:`math.ulp`: return the value of the least significant bit of a " +"Add :func:`math.ulp`: return the value of the least significant bit of a " "float. (Contributed by Victor Stinner in :issue:`39310`.)" msgstr "" -#: ../../whatsnew/3.9.rst:564 +#: ../../whatsnew/3.9.rst:450 msgid "multiprocessing" msgstr "" -#: ../../whatsnew/3.9.rst:566 +#: ../../whatsnew/3.9.rst:452 msgid "" "The :class:`multiprocessing.SimpleQueue` class has a new :meth:" "`~multiprocessing.SimpleQueue.close` method to explicitly close the queue. " "(Contributed by Victor Stinner in :issue:`30966`.)" msgstr "" -#: ../../whatsnew/3.9.rst:572 +#: ../../whatsnew/3.9.rst:458 msgid "nntplib" msgstr "" -#: ../../whatsnew/3.9.rst:574 +#: ../../whatsnew/3.9.rst:460 msgid "" ":class:`~nntplib.NNTP` and :class:`~nntplib.NNTP_SSL` now raise a :class:" "`ValueError` if the given timeout for their constructor is zero to prevent " @@ -846,65 +628,55 @@ msgid "" "`39259`.)" msgstr "" -#: ../../whatsnew/3.9.rst:579 +#: ../../whatsnew/3.9.rst:465 msgid "os" msgstr "" -#: ../../whatsnew/3.9.rst:581 +#: ../../whatsnew/3.9.rst:467 msgid "" "Added :data:`~os.CLD_KILLED` and :data:`~os.CLD_STOPPED` for :attr:" "`si_code`. (Contributed by Dong-hee Na in :issue:`38493`.)" msgstr "" -#: ../../whatsnew/3.9.rst:584 +#: ../../whatsnew/3.9.rst:470 msgid "" "Exposed the Linux-specific :func:`os.pidfd_open` (:issue:`38692`) and :data:" "`os.P_PIDFD` (:issue:`38713`) for process management with file descriptors." msgstr "" -#: ../../whatsnew/3.9.rst:588 +#: ../../whatsnew/3.9.rst:474 msgid "" "The :func:`os.unsetenv` function is now also available on Windows. " "(Contributed by Victor Stinner in :issue:`39413`.)" msgstr "" -#: ../../whatsnew/3.9.rst:591 +#: ../../whatsnew/3.9.rst:477 msgid "" "The :func:`os.putenv` and :func:`os.unsetenv` functions are now always " "available. (Contributed by Victor Stinner in :issue:`39395`.)" msgstr "" -#: ../../whatsnew/3.9.rst:595 +#: ../../whatsnew/3.9.rst:481 msgid "" -"Added :func:`os.waitstatus_to_exitcode` function: convert a wait status to " -"an exit code. (Contributed by Victor Stinner in :issue:`40094`.)" +"Add :func:`os.waitstatus_to_exitcode` function: convert a wait status to an " +"exit code. (Contributed by Victor Stinner in :issue:`40094`.)" msgstr "" -#: ../../whatsnew/3.9.rst:600 +#: ../../whatsnew/3.9.rst:486 msgid "pathlib" msgstr "" -#: ../../whatsnew/3.9.rst:602 +#: ../../whatsnew/3.9.rst:488 msgid "" "Added :meth:`pathlib.Path.readlink()` which acts similarly to :func:`os." "readlink`. (Contributed by Girts Folkmanis in :issue:`30618`)" msgstr "" -#: ../../whatsnew/3.9.rst:607 -msgid "pdb" -msgstr "" - -#: ../../whatsnew/3.9.rst:609 -msgid "" -"On Windows now :class:`~pdb.Pdb` supports ``~/.pdbrc``. (Contributed by Tim " -"Hopper and Dan Lidral-Porter in :issue:`20523`.)" -msgstr "" - -#: ../../whatsnew/3.9.rst:613 +#: ../../whatsnew/3.9.rst:493 msgid "poplib" msgstr "" -#: ../../whatsnew/3.9.rst:615 +#: ../../whatsnew/3.9.rst:495 msgid "" ":class:`~poplib.POP3` and :class:`~poplib.POP3_SSL` now raise a :class:" "`ValueError` if the given timeout for their constructor is zero to prevent " @@ -912,53 +684,53 @@ msgid "" "`39259`.)" msgstr "" -#: ../../whatsnew/3.9.rst:620 +#: ../../whatsnew/3.9.rst:500 msgid "pprint" msgstr "" -#: ../../whatsnew/3.9.rst:622 +#: ../../whatsnew/3.9.rst:502 msgid "" ":mod:`pprint` can now pretty-print :class:`types.SimpleNamespace`. " "(Contributed by Carl Bordum Hansen in :issue:`37376`.)" msgstr "" -#: ../../whatsnew/3.9.rst:626 +#: ../../whatsnew/3.9.rst:506 msgid "pydoc" msgstr "" -#: ../../whatsnew/3.9.rst:628 +#: ../../whatsnew/3.9.rst:508 msgid "" "The documentation string is now shown not only for class, function, method " "etc, but for any object that has its own ``__doc__`` attribute. (Contributed " "by Serhiy Storchaka in :issue:`40257`.)" msgstr "" -#: ../../whatsnew/3.9.rst:633 +#: ../../whatsnew/3.9.rst:513 msgid "random" msgstr "" -#: ../../whatsnew/3.9.rst:635 +#: ../../whatsnew/3.9.rst:515 msgid "" -"Added a new :attr:`random.Random.randbytes` method: generate random bytes. " +"Add a new :attr:`random.Random.randbytes` method: generate random bytes. " "(Contributed by Victor Stinner in :issue:`40286`.)" msgstr "" -#: ../../whatsnew/3.9.rst:639 +#: ../../whatsnew/3.9.rst:519 msgid "signal" msgstr "" -#: ../../whatsnew/3.9.rst:641 +#: ../../whatsnew/3.9.rst:521 msgid "" "Exposed the Linux-specific :func:`signal.pidfd_send_signal` for sending to " "signals to a process using a file descriptor instead of a pid. (:issue:" "`38712`)" msgstr "" -#: ../../whatsnew/3.9.rst:645 +#: ../../whatsnew/3.9.rst:525 msgid "smtplib" msgstr "" -#: ../../whatsnew/3.9.rst:647 +#: ../../whatsnew/3.9.rst:527 msgid "" ":class:`~smtplib.SMTP` and :class:`~smtplib.SMTP_SSL` now raise a :class:" "`ValueError` if the given timeout for their constructor is zero to prevent " @@ -966,41 +738,34 @@ msgid "" "`39259`.)" msgstr "" -#: ../../whatsnew/3.9.rst:651 +#: ../../whatsnew/3.9.rst:531 msgid "" ":class:`~smtplib.LMTP` constructor now has an optional *timeout* parameter. " "(Contributed by Dong-hee Na in :issue:`39329`.)" msgstr "" -#: ../../whatsnew/3.9.rst:655 +#: ../../whatsnew/3.9.rst:535 msgid "socket" msgstr "" -#: ../../whatsnew/3.9.rst:657 +#: ../../whatsnew/3.9.rst:537 msgid "" "The :mod:`socket` module now exports the :data:`~socket." "CAN_RAW_JOIN_FILTERS` constant on Linux 4.1 and greater. (Contributed by " "Stefan Tatschner and Zackery Spytz in :issue:`25780`.)" msgstr "" -#: ../../whatsnew/3.9.rst:661 +#: ../../whatsnew/3.9.rst:541 msgid "" "The socket module now supports the :data:`~socket.CAN_J1939` protocol on " "platforms that support it. (Contributed by Karl Ding in :issue:`40291`.)" msgstr "" -#: ../../whatsnew/3.9.rst:664 -msgid "" -"The socket module now has the :func:`socket.send_fds` and :func:`socket." -"recv_fds` functions. (Contributed by Joannah Nanjekye, Shinya Okano and " -"Victor Stinner in :issue:`28724`.)" -msgstr "" - -#: ../../whatsnew/3.9.rst:670 +#: ../../whatsnew/3.9.rst:545 msgid "time" msgstr "" -#: ../../whatsnew/3.9.rst:672 +#: ../../whatsnew/3.9.rst:547 msgid "" "On AIX, :func:`~time.thread_time` is now implemented with " "``thread_cputime()`` which has nanosecond resolution, rather than " @@ -1008,13 +773,13 @@ msgid "" "(Contributed by Batuhan Taskaya in :issue:`40192`)" msgstr "" -#: ../../whatsnew/3.9.rst:678 +#: ../../whatsnew/3.9.rst:553 msgid "sys" msgstr "" -#: ../../whatsnew/3.9.rst:680 +#: ../../whatsnew/3.9.rst:555 msgid "" -"Added a new :attr:`sys.platlibdir` attribute: name of the platform-specific " +"Add a new :attr:`sys.platlibdir` attribute: name of the platform-specific " "library directory. It is used to build the path of standard library and the " "paths of installed extension modules. It is equal to ``\"lib\"`` on most " "platforms. On Fedora and SuSE, it is equal to ``\"lib64\"`` on 64-bit " @@ -1022,29 +787,29 @@ msgid "" "and Victor Stinner in :issue:`1294959`.)" msgstr "" -#: ../../whatsnew/3.9.rst:686 +#: ../../whatsnew/3.9.rst:561 msgid "" "Previously, :attr:`sys.stderr` was block-buffered when non-interactive. Now " "``stderr`` defaults to always being line-buffered. (Contributed by Jendrik " "Seipp in :issue:`13601`.)" msgstr "" -#: ../../whatsnew/3.9.rst:691 +#: ../../whatsnew/3.9.rst:566 msgid "tracemalloc" msgstr "" -#: ../../whatsnew/3.9.rst:693 +#: ../../whatsnew/3.9.rst:568 msgid "" "Added :func:`tracemalloc.reset_peak` to set the peak size of traced memory " "blocks to the current size, to measure the peak of specific pieces of code. " "(Contributed by Huon Wilson in :issue:`40630`.)" msgstr "" -#: ../../whatsnew/3.9.rst:698 ../../whatsnew/3.9.rst:1484 +#: ../../whatsnew/3.9.rst:573 msgid "typing" msgstr "" -#: ../../whatsnew/3.9.rst:700 +#: ../../whatsnew/3.9.rst:575 msgid "" ":pep:`593` introduced an :data:`typing.Annotated` type to decorate existing " "types with context-specific metadata and new ``include_extras`` parameter " @@ -1052,20 +817,20 @@ msgid "" "(Contributed by Till Varoquaux and Konstantin Kashin.)" msgstr "" -#: ../../whatsnew/3.9.rst:706 +#: ../../whatsnew/3.9.rst:581 msgid "unicodedata" msgstr "" -#: ../../whatsnew/3.9.rst:708 +#: ../../whatsnew/3.9.rst:583 msgid "" "The Unicode database has been updated to version 13.0.0. (:issue:`39926`)." msgstr "" -#: ../../whatsnew/3.9.rst:711 +#: ../../whatsnew/3.9.rst:586 msgid "venv" msgstr "" -#: ../../whatsnew/3.9.rst:713 +#: ../../whatsnew/3.9.rst:588 msgid "" "The activation scripts provided by :mod:`venv` now all specify their prompt " "customization consistently by always using the value specified by " @@ -1075,11 +840,11 @@ msgid "" "Cannon in :issue:`37663`.)" msgstr "" -#: ../../whatsnew/3.9.rst:721 +#: ../../whatsnew/3.9.rst:596 msgid "xml" msgstr "" -#: ../../whatsnew/3.9.rst:723 +#: ../../whatsnew/3.9.rst:598 msgid "" "White space characters within attributes are now preserved when serializing :" "mod:`xml.etree.ElementTree` to XML file. EOLNs are no longer normalized to " @@ -1087,104 +852,61 @@ msgid "" "2.11 of XML spec. (Contributed by Mefistotelis in :issue:`39011`.)" msgstr "" -#: ../../whatsnew/3.9.rst:731 +#: ../../whatsnew/3.9.rst:606 msgid "Optimizations" msgstr "" -#: ../../whatsnew/3.9.rst:733 +#: ../../whatsnew/3.9.rst:608 msgid "" "Optimized the idiom for assignment a temporary variable in comprehensions. " "Now ``for y in [expr]`` in comprehensions is as fast as a simple assignment " "``y = expr``. For example:" msgstr "" -#: ../../whatsnew/3.9.rst:737 +#: ../../whatsnew/3.9.rst:612 msgid "sums = [s for s in [0] for x in data for s in [s + x]]" msgstr "" -#: ../../whatsnew/3.9.rst:739 +#: ../../whatsnew/3.9.rst:614 msgid "" "Unlike the ``:=`` operator this idiom does not leak a variable to the outer " "scope." msgstr "" -#: ../../whatsnew/3.9.rst:742 +#: ../../whatsnew/3.9.rst:617 msgid "(Contributed by Serhiy Storchaka in :issue:`32856`.)" msgstr "" -#: ../../whatsnew/3.9.rst:744 +#: ../../whatsnew/3.9.rst:619 msgid "" -"Optimized signal handling in multithreaded applications. If a thread " +"Optimize signal handling in multithreaded applications. If a thread " "different than the main thread gets a signal, the bytecode evaluation loop " "is no longer interrupted at each bytecode instruction to check for pending " "signals which cannot be handled. Only the main thread of the main " "interpreter can handle signals." msgstr "" -#: ../../whatsnew/3.9.rst:750 +#: ../../whatsnew/3.9.rst:625 msgid "" "Previously, the bytecode evaluation loop was interrupted at each instruction " "until the main thread handles signals. (Contributed by Victor Stinner in :" "issue:`40010`.)" msgstr "" -#: ../../whatsnew/3.9.rst:754 +#: ../../whatsnew/3.9.rst:629 msgid "" -"Optimized the :mod:`subprocess` module on FreeBSD using ``closefrom()``. " +"Optimize the :mod:`subprocess` module on FreeBSD using ``closefrom()``. " "(Contributed by Ed Maste, Conrad Meyer, Kyle Evans, Kubilay Kocak and Victor " "Stinner in :issue:`38061`.)" msgstr "" -#: ../../whatsnew/3.9.rst:758 -msgid "" -":c:func:`PyLong_FromDouble` is now up to 1.87x faster for values that fit " -"into :c:type:`long`. (Contributed by Sergey Fedoseev in :issue:`37986`.)" -msgstr "" - -#: ../../whatsnew/3.9.rst:762 -msgid "" -"A number of Python builtins (:class:`range`, :class:`tuple`, :class:`set`, :" -"class:`frozenset`, :class:`list`, :class:`dict`) are now sped up by using :" -"pep:`590` vectorcall protocol. (Contributed by Dong-hee Na, Mark Shannon, " -"Jeroen Demeyer and Petr Viktorin in :issue:`37207`.)" -msgstr "" - -#: ../../whatsnew/3.9.rst:767 -msgid "" -"Optimized :func:`~set.difference_update` for the case when the other set is " -"much larger than the base set. (Suggested by Evgeny Kapun with code " -"contributed by Michele Orrù in :issue:`8425`.)" -msgstr "" - -#: ../../whatsnew/3.9.rst:771 -msgid "" -"Python's small object allocator (``obmalloc.c``) now allows (no more than) " -"one empty arena to remain available for immediate reuse, without returning " -"it to the OS. This prevents thrashing in simple loops where an arena could " -"be created and destroyed anew on each iteration. (Contributed by Tim Peters " -"in :issue:`37257`.)" -msgstr "" - -#: ../../whatsnew/3.9.rst:777 -msgid "" -":term:`floor division` of float operation now has a better performance. Also " -"the message of :exc:`ZeroDivisionError` for this operation is updated. " -"(Contributed by Dong-hee Na in :issue:`39434`.)" -msgstr "" - -#: ../../whatsnew/3.9.rst:781 -msgid "" -"Decoding short ASCII strings with UTF-8 and ascii codecs is now about 15% " -"faster. (Contributed by Inada Naoki in :issue:`37348`.)" -msgstr "" - -#: ../../whatsnew/3.9.rst:784 +#: ../../whatsnew/3.9.rst:633 msgid "" "Here's a summary of performance improvements from Python 3.4 through Python " "3.9:" msgstr "" -#: ../../whatsnew/3.9.rst:831 +#: ../../whatsnew/3.9.rst:680 msgid "" "These results were generated from the variable access benchmark script at: " "``Tools/scripts/var_access_benchmark.py``. The benchmark script displays " @@ -1195,18 +917,18 @@ msgid "" "python.org/downloads/mac-osx/>`_." msgstr "" -#: ../../whatsnew/3.9.rst:841 +#: ../../whatsnew/3.9.rst:690 msgid "Deprecated" msgstr "" -#: ../../whatsnew/3.9.rst:843 +#: ../../whatsnew/3.9.rst:692 msgid "" "The distutils ``bdist_msi`` command is now deprecated, use ``bdist_wheel`` " "(wheel packages) instead. (Contributed by Hugo van Kemenade in :issue:" "`39586`.)" msgstr "" -#: ../../whatsnew/3.9.rst:847 +#: ../../whatsnew/3.9.rst:696 msgid "" "Currently :func:`math.factorial` accepts :class:`float` instances with non-" "negative integer values (like ``5.0``). It raises a :exc:`ValueError` for " @@ -1215,7 +937,7 @@ msgid "" "Serhiy Storchaka in :issue:`37315`.)" msgstr "" -#: ../../whatsnew/3.9.rst:853 +#: ../../whatsnew/3.9.rst:702 msgid "" "The :mod:`parser` and :mod:`symbol` modules are deprecated and will be " "removed in future versions of Python. For the majority of use cases, users " @@ -1223,15 +945,7 @@ msgid "" "stage, using the :mod:`ast` module." msgstr "" -#: ../../whatsnew/3.9.rst:858 -msgid "" -"The Public C API functions :c:func:`PyParser_SimpleParseStringFlags`, :c:" -"func:`PyParser_SimpleParseStringFlagsFilename`, :c:func:" -"`PyParser_SimpleParseFileFlags` and :c:func:`PyNode_Compile` are deprecated " -"and will be removed in Python 3.10 together with the old parser." -msgstr "" - -#: ../../whatsnew/3.9.rst:863 +#: ../../whatsnew/3.9.rst:707 msgid "" "Using :data:`NotImplemented` in a boolean context has been deprecated, as it " "is almost exclusively the result of incorrect rich comparator " @@ -1239,7 +953,7 @@ msgid "" "Python. (Contributed by Josh Rosenberg in :issue:`35712`.)" msgstr "" -#: ../../whatsnew/3.9.rst:869 +#: ../../whatsnew/3.9.rst:713 msgid "" "The :mod:`random` module currently accepts any hashable type as a possible " "seed value. Unfortunately, some of those types are not guaranteed to have a " @@ -1248,7 +962,7 @@ msgid "" "`bytes`, and :class:`bytearray`." msgstr "" -#: ../../whatsnew/3.9.rst:875 +#: ../../whatsnew/3.9.rst:719 msgid "" "Opening the :class:`~gzip.GzipFile` file for writing without specifying the " "*mode* argument is deprecated. In future Python versions it will always be " @@ -1257,48 +971,48 @@ msgid "" "issue:`28286`.)" msgstr "" -#: ../../whatsnew/3.9.rst:881 +#: ../../whatsnew/3.9.rst:725 msgid "" "Deprecated the ``split()`` method of :class:`_tkinter.TkappType` in favour " "of the ``splitlist()`` method which has more consistent and predicable " "behavior. (Contributed by Serhiy Storchaka in :issue:`38371`.)" msgstr "" -#: ../../whatsnew/3.9.rst:886 +#: ../../whatsnew/3.9.rst:730 msgid "" "The explicit passing of coroutine objects to :func:`asyncio.wait` has been " "deprecated and will be removed in version 3.11. (Contributed by Yury " "Selivanov and Kyle Stanley in :issue:`34790`.)" msgstr "" -#: ../../whatsnew/3.9.rst:890 +#: ../../whatsnew/3.9.rst:734 msgid "" "binhex4 and hexbin4 standards are now deprecated. The :mod:`binhex` module " "and the following :mod:`binascii` functions are now deprecated:" msgstr "" -#: ../../whatsnew/3.9.rst:893 +#: ../../whatsnew/3.9.rst:737 msgid ":func:`~binascii.b2a_hqx`, :func:`~binascii.a2b_hqx`" msgstr "" -#: ../../whatsnew/3.9.rst:894 +#: ../../whatsnew/3.9.rst:738 msgid ":func:`~binascii.rlecode_hqx`, :func:`~binascii.rledecode_hqx`" msgstr "" -#: ../../whatsnew/3.9.rst:896 +#: ../../whatsnew/3.9.rst:740 msgid "(Contributed by Victor Stinner in :issue:`39353`.)" msgstr "" -#: ../../whatsnew/3.9.rst:898 +#: ../../whatsnew/3.9.rst:742 msgid "" ":mod:`ast` classes ``slice``, ``Index`` and ``ExtSlice`` are considered " "deprecated and will be removed in future Python versions. ``value`` itself " "should be used instead of ``Index(value)``. ``Tuple(slices, Load())`` " "should be used instead of ``ExtSlice(slices)``. (Contributed by Serhiy " -"Storchaka in :issue:`34822`.)" +"Storchaka in :issue:`32892`.)" msgstr "" -#: ../../whatsnew/3.9.rst:904 +#: ../../whatsnew/3.9.rst:748 msgid "" ":mod:`ast` classes ``Suite``, ``Param``, ``AugLoad`` and ``AugStore`` are " "considered deprecated and will be removed in future Python versions. They " @@ -1307,7 +1021,7 @@ msgid "" "`39969` and Serhiy Storchaka in :issue:`39988`.)" msgstr "" -#: ../../whatsnew/3.9.rst:911 +#: ../../whatsnew/3.9.rst:755 msgid "" "The :c:func:`PyEval_InitThreads` and :c:func:`PyEval_ThreadsInitialized` " "functions are now deprecated and will be removed in Python 3.11. Calling :c:" @@ -1316,20 +1030,13 @@ msgid "" "Stinner in :issue:`39877`.)" msgstr "" -#: ../../whatsnew/3.9.rst:917 +#: ../../whatsnew/3.9.rst:761 msgid "" "Passing ``None`` as the first argument to the :func:`shlex.split` function " "has been deprecated. (Contributed by Zackery Spytz in :issue:`33262`.)" msgstr "" -#: ../../whatsnew/3.9.rst:920 -msgid "" -":func:`smtpd.MailmanProxy` is now deprecated as it is unusable without an " -"external module, ``mailman``. (Contributed by Samuel Colvin in :issue:" -"`35800`.)" -msgstr "" - -#: ../../whatsnew/3.9.rst:923 +#: ../../whatsnew/3.9.rst:764 msgid "" "The :mod:`lib2to3` module now emits a :exc:`PendingDeprecationWarning`. " "Python 3.9 switched to a PEG parser (see :pep:`617`), and Python 3.10 may " @@ -1339,22 +1046,22 @@ msgid "" "`parso`_. (Contributed by Carl Meyer in :issue:`40360`.)" msgstr "" -#: ../../whatsnew/3.9.rst:931 +#: ../../whatsnew/3.9.rst:772 msgid "" "The *random* parameter of :func:`random.shuffle` has been deprecated. " "(Contributed by Raymond Hettinger in :issue:`40465`)" msgstr "" -#: ../../whatsnew/3.9.rst:940 ../../whatsnew/3.9.rst:1398 +#: ../../whatsnew/3.9.rst:779 ../../whatsnew/3.9.rst:1108 msgid "Removed" msgstr "" -#: ../../whatsnew/3.9.rst:942 +#: ../../whatsnew/3.9.rst:781 msgid "" "The erroneous version at :data:`unittest.mock.__version__` has been removed." msgstr "" -#: ../../whatsnew/3.9.rst:944 +#: ../../whatsnew/3.9.rst:783 msgid "" ":class:`nntplib.NNTP`: ``xpath()`` and ``xgtitle()`` methods have been " "removed. These methods are deprecated since Python 3.3. Generally, these " @@ -1364,14 +1071,14 @@ msgid "" "`39366`.)" msgstr "" -#: ../../whatsnew/3.9.rst:951 +#: ../../whatsnew/3.9.rst:790 msgid "" ":class:`array.array`: ``tostring()`` and ``fromstring()`` methods have been " "removed. They were aliases to ``tobytes()`` and ``frombytes()``, deprecated " "since Python 3.2. (Contributed by Victor Stinner in :issue:`38916`.)" msgstr "" -#: ../../whatsnew/3.9.rst:956 +#: ../../whatsnew/3.9.rst:795 msgid "" "The undocumented ``sys.callstats()`` function has been removed. Since Python " "3.7, it was deprecated and always returned :const:`None`. It required a " @@ -1379,7 +1086,7 @@ msgid "" "3.7. (Contributed by Victor Stinner in :issue:`37414`.)" msgstr "" -#: ../../whatsnew/3.9.rst:961 +#: ../../whatsnew/3.9.rst:800 msgid "" "The ``sys.getcheckinterval()`` and ``sys.setcheckinterval()`` functions have " "been removed. They were deprecated since Python 3.2. Use :func:`sys." @@ -1387,21 +1094,21 @@ msgid "" "by Victor Stinner in :issue:`37392`.)" msgstr "" -#: ../../whatsnew/3.9.rst:966 +#: ../../whatsnew/3.9.rst:805 msgid "" "The C function ``PyImport_Cleanup()`` has been removed. It was documented " "as: \"Empty the module table. For internal use only.\" (Contributed by " "Victor Stinner in :issue:`36710`.)" msgstr "" -#: ../../whatsnew/3.9.rst:970 +#: ../../whatsnew/3.9.rst:809 msgid "" "``_dummy_thread`` and ``dummy_threading`` modules have been removed. These " "modules were deprecated since Python 3.7 which requires threading support. " "(Contributed by Victor Stinner in :issue:`37312`.)" msgstr "" -#: ../../whatsnew/3.9.rst:974 +#: ../../whatsnew/3.9.rst:813 msgid "" "``aifc.openfp()`` alias to ``aifc.open()``, ``sunau.openfp()`` alias to " "``sunau.open()``, and ``wave.openfp()`` alias to :func:`wave.open()` have " @@ -1409,14 +1116,14 @@ msgid "" "Stinner in :issue:`37320`.)" msgstr "" -#: ../../whatsnew/3.9.rst:979 +#: ../../whatsnew/3.9.rst:818 msgid "" "The :meth:`~threading.Thread.isAlive()` method of :class:`threading.Thread` " "has been removed. It was deprecated since Python 3.8. Use :meth:`~threading." "Thread.is_alive()` instead. (Contributed by Dong-hee Na in :issue:`37804`.)" msgstr "" -#: ../../whatsnew/3.9.rst:984 +#: ../../whatsnew/3.9.rst:823 msgid "" "Methods ``getchildren()`` and ``getiterator()`` of classes :class:`~xml." "etree.ElementTree.ElementTree` and :class:`~xml.etree.ElementTree.Element` " @@ -1426,7 +1133,7 @@ msgid "" "getiterator()``. (Contributed by Serhiy Storchaka in :issue:`36543`.)" msgstr "" -#: ../../whatsnew/3.9.rst:992 +#: ../../whatsnew/3.9.rst:831 msgid "" "The old :mod:`plistlib` API has been removed, it was deprecated since Python " "3.4. Use the :func:`~plistlib.load`, :func:`~plistlib.loads`, :func:" @@ -1435,7 +1142,7 @@ msgid "" "are always used instead. (Contributed by Jon Janzen in :issue:`36409`.)" msgstr "" -#: ../../whatsnew/3.9.rst:998 +#: ../../whatsnew/3.9.rst:837 msgid "" "The C function ``PyGen_NeedsFinalizing`` has been removed. It was not " "documented, tested, or used anywhere within CPython after the implementation " @@ -1443,7 +1150,7 @@ msgid "" "in :issue:`15088`)" msgstr "" -#: ../../whatsnew/3.9.rst:1003 +#: ../../whatsnew/3.9.rst:842 msgid "" "``base64.encodestring()`` and ``base64.decodestring()``, aliases deprecated " "since Python 3.1, have been removed: use :func:`base64.encodebytes` and :" @@ -1451,14 +1158,14 @@ msgid "" "`39351`.)" msgstr "" -#: ../../whatsnew/3.9.rst:1008 +#: ../../whatsnew/3.9.rst:847 msgid "" "``fractions.gcd()`` function has been removed, it was deprecated since " "Python 3.5 (:issue:`22486`): use :func:`math.gcd` instead. (Contributed by " "Victor Stinner in :issue:`39350`.)" msgstr "" -#: ../../whatsnew/3.9.rst:1012 +#: ../../whatsnew/3.9.rst:851 msgid "" "The *buffering* parameter of :class:`bz2.BZ2File` has been removed. Since " "Python 3.0, it was ignored and using it emitted a :exc:`DeprecationWarning`. " @@ -1466,7 +1173,7 @@ msgid "" "Victor Stinner in :issue:`39357`.)" msgstr "" -#: ../../whatsnew/3.9.rst:1017 +#: ../../whatsnew/3.9.rst:856 msgid "" "The *encoding* parameter of :func:`json.loads` has been removed. As of " "Python 3.1, it was deprecated and ignored; using it has emitted a :exc:" @@ -1474,7 +1181,7 @@ msgid "" "`39377`)" msgstr "" -#: ../../whatsnew/3.9.rst:1022 +#: ../../whatsnew/3.9.rst:861 msgid "" "``with (await asyncio.lock):`` and ``with (yield from asyncio.lock):`` " "statements are not longer supported, use ``async with lock`` instead. The " @@ -1482,7 +1189,7 @@ msgid "" "(Contributed by Andrew Svetlov in :issue:`34793`.)" msgstr "" -#: ../../whatsnew/3.9.rst:1027 +#: ../../whatsnew/3.9.rst:866 msgid "" "The :func:`sys.getcounts` function, the ``-X showalloccount`` command line " "option and the ``show_alloc_count`` field of the C structure :c:type:" @@ -1491,52 +1198,36 @@ msgid "" "`39489`.)" msgstr "" -#: ../../whatsnew/3.9.rst:1033 +#: ../../whatsnew/3.9.rst:872 msgid "" "The ``_field_types`` attribute of the :class:`typing.NamedTuple` class has " -"been removed. It was deprecated since Python 3.8. Use the " +"been removed. It was deprecated deprecated since Python 3.8. Use the " "``__annotations__`` attribute instead. (Contributed by Serhiy Storchaka in :" "issue:`40182`.)" msgstr "" -#: ../../whatsnew/3.9.rst:1038 +#: ../../whatsnew/3.9.rst:877 msgid "" "The :meth:`symtable.SymbolTable.has_exec` method has been removed. It was " "deprecated since 2006, and only returning ``False`` when it's called. " "(Contributed by Batuhan Taskaya in :issue:`40208`)" msgstr "" -#: ../../whatsnew/3.9.rst:1042 -msgid "" -"The :meth:`asyncio.Task.current_task` and :meth:`asyncio.Task.all_tasks` " -"have been removed. They were deprecated since Python 3.7 and you can use :" -"func:`asyncio.current_task` and :func:`asyncio.all_tasks` instead. " -"(Contributed by Rémi Lapeyre in :issue:`40967`)" -msgstr "" - -#: ../../whatsnew/3.9.rst:1047 -msgid "" -"The ``unescape()`` method in the :class:`html.parser.HTMLParser` class has " -"been removed (it was deprecated since Python 3.4). :func:`html.unescape` " -"should be used for converting character references to the corresponding " -"unicode characters." -msgstr "" - -#: ../../whatsnew/3.9.rst:1054 ../../whatsnew/3.9.rst:1320 +#: ../../whatsnew/3.9.rst:883 ../../whatsnew/3.9.rst:1064 msgid "Porting to Python 3.9" msgstr "" -#: ../../whatsnew/3.9.rst:1056 +#: ../../whatsnew/3.9.rst:885 msgid "" "This section lists previously described changes and other bugfixes that may " "require changes to your code." msgstr "" -#: ../../whatsnew/3.9.rst:1061 +#: ../../whatsnew/3.9.rst:890 msgid "Changes in the Python API" msgstr "" -#: ../../whatsnew/3.9.rst:1063 +#: ../../whatsnew/3.9.rst:892 msgid "" ":func:`__import__` and :func:`importlib.util.resolve_name` now raise :exc:" "`ImportError` where it previously raised :exc:`ValueError`. Callers catching " @@ -1544,26 +1235,26 @@ msgid "" "versions will need to catch both using ``except (ImportError, ValueError):``." msgstr "" -#: ../../whatsnew/3.9.rst:1068 +#: ../../whatsnew/3.9.rst:897 msgid "" "The :mod:`venv` activation scripts no longer special-case when " "``__VENV_PROMPT__`` is set to ``\"\"``." msgstr "" -#: ../../whatsnew/3.9.rst:1071 +#: ../../whatsnew/3.9.rst:900 msgid "" "The :meth:`select.epoll.unregister` method no longer ignores the :data:" "`~errno.EBADF` error. (Contributed by Victor Stinner in :issue:`39239`.)" msgstr "" -#: ../../whatsnew/3.9.rst:1075 +#: ../../whatsnew/3.9.rst:904 msgid "" "The *compresslevel* parameter of :class:`bz2.BZ2File` became keyword-only, " "since the *buffering* parameter has been removed. (Contributed by Victor " "Stinner in :issue:`39357`.)" msgstr "" -#: ../../whatsnew/3.9.rst:1079 +#: ../../whatsnew/3.9.rst:908 msgid "" "Simplified AST for subscription. Simple indices will be represented by their " "value, extended slices will be represented as tuples. ``Index(value)`` will " @@ -1571,21 +1262,21 @@ msgid "" "Load())``. (Contributed by Serhiy Storchaka in :issue:`34822`.)" msgstr "" -#: ../../whatsnew/3.9.rst:1085 +#: ../../whatsnew/3.9.rst:914 msgid "" "The :mod:`importlib` module now ignores the :envvar:`PYTHONCASEOK` " "environment variable when the :option:`-E` or :option:`-I` command line " "options are being used." msgstr "" -#: ../../whatsnew/3.9.rst:1089 +#: ../../whatsnew/3.9.rst:918 msgid "" "The *encoding* parameter has been added to the classes :class:`ftplib.FTP` " "and :class:`ftplib.FTP_TLS` as a keyword-only parameter, and the default " "encoding is changed from Latin-1 to UTF-8 to follow :rfc:`2640`." msgstr "" -#: ../../whatsnew/3.9.rst:1093 +#: ../../whatsnew/3.9.rst:922 msgid "" ":meth:`asyncio.loop.shutdown_default_executor` has been added to :class:" "`~asyncio.AbstractEventLoop`, meaning alternative event loops that inherit " @@ -1593,7 +1284,7 @@ msgid "" "issue:`34037`.)" msgstr "" -#: ../../whatsnew/3.9.rst:1098 +#: ../../whatsnew/3.9.rst:927 msgid "" "The constant values of future flags in the :mod:`__future__` module is " "updated in order to prevent collision with compiler flags. Previously " @@ -1601,7 +1292,7 @@ msgid "" "(Contributed by Batuhan Taskaya in :issue:`39562`)" msgstr "" -#: ../../whatsnew/3.9.rst:1103 +#: ../../whatsnew/3.9.rst:932 msgid "" "``array('u')`` now uses ``wchar_t`` as C type instead of ``Py_UNICODE``. " "This change doesn't affect to its behavior because ``Py_UNICODE`` is alias " @@ -1609,49 +1300,11 @@ msgid "" "`34538`.)" msgstr "" -#: ../../whatsnew/3.9.rst:1108 -msgid "" -"The :func:`logging.getLogger` API now returns the root logger when passed " -"the name ``'root'``, whereas previously it returned a non-root logger named " -"``'root'``. This could affect cases where user code explicitly wants a non-" -"root logger named ``'root'``, or instantiates a logger using ``logging." -"getLogger(__name__)`` in some top-level module called ``'root.py'``. " -"(Contributed by Vinay Sajip in :issue:`37742`.)" -msgstr "" - -#: ../../whatsnew/3.9.rst:1115 -msgid "" -"Division handling of :class:`~pathlib.PurePath` now returns " -"``NotImplemented`` instead of raising a :exc:`TypeError` when passed " -"something other than an instance of ``str`` or :class:`~pathlib.PurePath`. " -"This allows creating compatible classes that don't inherit from those " -"mentioned types. (Contributed by Roger Aiudi in :issue:`34775`)." -msgstr "" - -#: ../../whatsnew/3.9.rst:1121 -msgid "" -"Starting with Python 3.9.5 the :mod:`ipaddress` module no longer accepts any " -"leading zeros in IPv4 address strings. Leading zeros are ambiguous and " -"interpreted as octal notation by some libraries. For example the legacy " -"function :func:`socket.inet_aton` treats leading zeros as octal notatation. " -"glibc implementation of modern :func:`~socket.inet_pton` does not accept any " -"leading zeros. (Contributed by Christian Heimes in :issue:`36384`)." -msgstr "" - -#: ../../whatsnew/3.9.rst:1129 -msgid "" -":func:`codecs.lookup` now normalizes the encoding name the same way as :func:" -"`encodings.normalize_encoding`, except that :func:`codecs.lookup` also " -"converts the name to lower case. For example, ``\"latex+latin1\"`` encoding " -"name is now normalized to ``\"latex_latin1\"``. (Contributed by Jordon Xu " -"in :issue:`37751`.)" -msgstr "" - -#: ../../whatsnew/3.9.rst:1137 +#: ../../whatsnew/3.9.rst:939 msgid "Changes in the C API" msgstr "" -#: ../../whatsnew/3.9.rst:1139 +#: ../../whatsnew/3.9.rst:941 msgid "" "Instances of heap-allocated types (such as those created with :c:func:" "`PyType_FromSpec` and similar APIs) hold a reference to their type object " @@ -1662,38 +1315,30 @@ msgid "" "visit the object's type." msgstr "" -#: ../../whatsnew/3.9.rst:1160 +#: ../../whatsnew/3.9.rst:962 msgid "" "If your traverse function delegates to ``tp_traverse`` of its base class (or " "another type), ensure that ``Py_TYPE(self)`` is visited only once. Note that " "only heap types are expected to visit the type in ``tp_traverse``." msgstr "" -#: ../../whatsnew/3.9.rst:1164 +#: ../../whatsnew/3.9.rst:966 msgid "For example, if your ``tp_traverse`` function includes:" msgstr "" -#: ../../whatsnew/3.9.rst:1170 +#: ../../whatsnew/3.9.rst:972 msgid "then add:" msgstr "" -#: ../../whatsnew/3.9.rst:1183 +#: ../../whatsnew/3.9.rst:985 msgid "(See :issue:`35810` and :issue:`40217` for more information.)" msgstr "" -#: ../../whatsnew/3.9.rst:1185 -msgid "" -"The functions ``PyEval_CallObject``, ``PyEval_CallFunction``, " -"``PyEval_CallMethod`` and ``PyEval_CallObjectWithKeywords`` are deprecated. " -"Use :c:func:`PyObject_Call` and its variants instead. (See more details in :" -"issue:`29548`.)" -msgstr "" - -#: ../../whatsnew/3.9.rst:1191 +#: ../../whatsnew/3.9.rst:988 msgid "CPython bytecode changes" msgstr "" -#: ../../whatsnew/3.9.rst:1193 +#: ../../whatsnew/3.9.rst:990 msgid "" "The :opcode:`LOAD_ASSERTION_ERROR` opcode was added for handling the :" "keyword:`assert` statement. Previously, the assert statement would not work " @@ -1701,146 +1346,72 @@ msgid "" "(Contributed by Zackery Spytz in :issue:`34880`.)" msgstr "" -#: ../../whatsnew/3.9.rst:1198 -msgid "" -"The :opcode:`COMPARE_OP` opcode was split into four distinct instructions:" -msgstr "" - -#: ../../whatsnew/3.9.rst:1200 -msgid "``COMPARE_OP`` for rich comparisons" -msgstr "" - -#: ../../whatsnew/3.9.rst:1201 -msgid "``IS_OP`` for 'is' and 'is not' tests" -msgstr "" - -#: ../../whatsnew/3.9.rst:1202 -msgid "``CONTAINS_OP`` for 'in' and 'not in' tests" -msgstr "" - -#: ../../whatsnew/3.9.rst:1203 -msgid "" -"``JUMP_IF_NOT_EXC_MATCH`` for checking exceptions in 'try-except' statements." -msgstr "" - -#: ../../whatsnew/3.9.rst:1206 -msgid "(Contributed by Mark Shannon in :issue:`39156`.)" -msgstr "" - -#: ../../whatsnew/3.9.rst:1210 +#: ../../whatsnew/3.9.rst:997 msgid "Build Changes" msgstr "" -#: ../../whatsnew/3.9.rst:1212 +#: ../../whatsnew/3.9.rst:999 msgid "" -"Added ``--with-platlibdir`` option to the ``configure`` script: name of the " +"Add ``--with-platlibdir`` option to the ``configure`` script: name of the " "platform-specific library directory, stored in the new :attr:`sys." "platlibdir` attribute. See :attr:`sys.platlibdir` attribute for more " "information. (Contributed by Jan Matějek, Matěj Cepl, Charalampos Stratakis " "and Victor Stinner in :issue:`1294959`.)" msgstr "" -#: ../../whatsnew/3.9.rst:1218 +#: ../../whatsnew/3.9.rst:1005 msgid "" "The ``COUNT_ALLOCS`` special build macro has been removed. (Contributed by " "Victor Stinner in :issue:`39489`.)" msgstr "" -#: ../../whatsnew/3.9.rst:1221 +#: ../../whatsnew/3.9.rst:1008 msgid "" "On non-Windows platforms, the :c:func:`setenv` and :c:func:`unsetenv` " "functions are now required to build Python. (Contributed by Victor Stinner " "in :issue:`39395`.)" msgstr "" -#: ../../whatsnew/3.9.rst:1225 -msgid "" -"On non-Windows platforms, creating ``bdist_wininst`` installers is now " -"officially unsupported. (See :issue:`10945` for more details.)" -msgstr "" - -#: ../../whatsnew/3.9.rst:1228 -msgid "" -"When building Python on macOS from source, ``_tkinter`` now links with non-" -"system Tcl and Tk frameworks if they are installed in ``/Library/" -"Frameworks``, as had been the case on older releases of macOS. If a macOS " -"SDK is explicitly configured, by using ``--enable-universalsdk=`` or ``-" -"isysroot``, only the SDK itself is searched. The default behavior can still " -"be overridden with ``--with-tcltk-includes`` and ``--with-tcltk-libs``. " -"(Contributed by Ned Deily in :issue:`34956`.)" -msgstr "" - -#: ../../whatsnew/3.9.rst:1237 -msgid "" -"Python can now be built for Windows 10 ARM64. (Contributed by Steve Dower " -"in :issue:`33125`.)" -msgstr "" - -#: ../../whatsnew/3.9.rst:1240 -msgid "" -"Some individual tests are now skipped when ``--pgo`` is used. The tests in " -"question increased the PGO task time significantly and likely didn't help " -"improve optimization of the final executable. This speeds up the task by a " -"factor of about 15x. Running the full unit test suite is slow. This change " -"may result in a slightly less optimized build since not as many code " -"branches will be executed. If you are willing to wait for the much slower " -"build, the old behavior can be restored using ``./configure [..] " -"PROFILE_TASK=\"-m test --pgo-extended\"``. We make no guarantees as to " -"which PGO task set produces a faster build. Users who care should run their " -"own relevant benchmarks as results can depend on the environment, workload, " -"and compiler tool chain. (See :issue:`36044` and :issue:`37707` for more " -"details.)" -msgstr "" - -#: ../../whatsnew/3.9.rst:1255 +#: ../../whatsnew/3.9.rst:1014 msgid "C API Changes" msgstr "" -#: ../../whatsnew/3.9.rst:1260 +#: ../../whatsnew/3.9.rst:1019 msgid "" -":pep:`573`: Added :c:func:`PyType_FromModuleAndSpec` to associate a module " -"with a class; :c:func:`PyType_GetModule` and :c:func:`PyType_GetModuleState` " -"to retrieve the module and its state; and :c:data:`PyCMethod` and :c:data:" -"`METH_METHOD` to allow a method to access the class it was defined in. " -"(Contributed by Marcel Plch and Petr Viktorin in :issue:`38787`.)" -msgstr "" - -#: ../../whatsnew/3.9.rst:1267 -msgid "" -"Added :c:func:`PyFrame_GetCode` function: get a frame code. Added :c:func:" +"Add :c:func:`PyFrame_GetCode` function: get a frame code. Add :c:func:" "`PyFrame_GetBack` function: get the frame next outer frame. (Contributed by " "Victor Stinner in :issue:`40421`.)" msgstr "" -#: ../../whatsnew/3.9.rst:1271 +#: ../../whatsnew/3.9.rst:1023 msgid "" -"Added :c:func:`PyFrame_GetLineNumber` to the limited C API. (Contributed by " +"Add :c:func:`PyFrame_GetLineNumber` to the limited C API. (Contributed by " "Victor Stinner in :issue:`40421`.)" msgstr "" -#: ../../whatsnew/3.9.rst:1274 +#: ../../whatsnew/3.9.rst:1026 msgid "" -"Added :c:func:`PyThreadState_GetInterpreter` and :c:func:" -"`PyInterpreterState_Get` functions to get the interpreter. Added :c:func:" +"Add :c:func:`PyThreadState_GetInterpreter` and :c:func:" +"`PyInterpreterState_Get` functions to get the interpreter. Add :c:func:" "`PyThreadState_GetFrame` function to get the current frame of a Python " -"thread state. Added :c:func:`PyThreadState_GetID` function: get the unique " +"thread state. Add :c:func:`PyThreadState_GetID` function: get the unique " "identifier of a Python thread state. (Contributed by Victor Stinner in :" "issue:`39947`.)" msgstr "" -#: ../../whatsnew/3.9.rst:1282 +#: ../../whatsnew/3.9.rst:1034 msgid "" -"Added a new public :c:func:`PyObject_CallNoArgs` function to the C API, " -"which calls a callable Python object without any arguments. It is the most " +"Add a new public :c:func:`PyObject_CallNoArgs` function to the C API, which " +"calls a callable Python object without any arguments. It is the most " "efficient way to call a callable Python object without any argument. " "(Contributed by Victor Stinner in :issue:`37194`.)" msgstr "" -#: ../../whatsnew/3.9.rst:1287 ../../whatsnew/3.9.rst:1409 +#: ../../whatsnew/3.9.rst:1039 ../../whatsnew/3.9.rst:1119 msgid "Changes in the limited C API (if ``Py_LIMITED_API`` macro is defined):" msgstr "" -#: ../../whatsnew/3.9.rst:1289 +#: ../../whatsnew/3.9.rst:1041 msgid "" "Provide :c:func:`Py_EnterRecursiveCall` and :c:func:`Py_LeaveRecursiveCall` " "as regular functions for the limited API. Previously, there were defined as " @@ -1849,52 +1420,39 @@ msgid "" "the limited C API)." msgstr "" -#: ../../whatsnew/3.9.rst:1295 +#: ../../whatsnew/3.9.rst:1047 msgid "" "``PyObject_INIT()`` and ``PyObject_INIT_VAR()`` become regular \"opaque\" " "function to hide implementation details." msgstr "" -#: ../../whatsnew/3.9.rst:1298 ../../whatsnew/3.9.rst:1436 +#: ../../whatsnew/3.9.rst:1050 ../../whatsnew/3.9.rst:1146 msgid "(Contributed by Victor Stinner in :issue:`38644` and :issue:`39542`.)" msgstr "" -#: ../../whatsnew/3.9.rst:1300 +#: ../../whatsnew/3.9.rst:1052 msgid "" "The :c:func:`PyModule_AddType` function is added to help adding a type to a " "module. (Contributed by Dong-hee Na in :issue:`40024`.)" msgstr "" -#: ../../whatsnew/3.9.rst:1304 +#: ../../whatsnew/3.9.rst:1056 msgid "" -"Added the functions :c:func:`PyObject_GC_IsTracked` and :c:func:" +"Add the functions :c:func:`PyObject_GC_IsTracked` and :c:func:" "`PyObject_GC_IsFinalized` to the public API to allow to query if Python " "objects are being currently tracked or have been already finalized by the " -"garbage collector respectively. (Contributed by Pablo Galindo Salgado in :" -"issue:`40241`.)" -msgstr "" - -#: ../../whatsnew/3.9.rst:1310 -msgid "" -"Added :c:func:`_PyObject_FunctionStr` to get a user-friendly string " -"representation of a function-like object. (Patch by Jeroen Demeyer in :issue:" -"`37645`.)" -msgstr "" - -#: ../../whatsnew/3.9.rst:1314 -msgid "" -"Added :c:func:`PyObject_CallOneArg` for calling an object with one " -"positional argument (Patch by Jeroen Demeyer in :issue:`37483`.)" +"garbage collector respectively. (Contributed by Pablo Galindo in :issue:" +"`40241`.)" msgstr "" -#: ../../whatsnew/3.9.rst:1322 +#: ../../whatsnew/3.9.rst:1066 msgid "" "``PyInterpreterState.eval_frame`` (:pep:`523`) now requires a new mandatory " "*tstate* parameter (``PyThreadState*``). (Contributed by Victor Stinner in :" "issue:`38500`.)" msgstr "" -#: ../../whatsnew/3.9.rst:1326 +#: ../../whatsnew/3.9.rst:1070 msgid "" "Extension modules: :c:member:`~PyModuleDef.m_traverse`, :c:member:" "`~PyModuleDef.m_clear` and :c:member:`~PyModuleDef.m_free` functions of :c:" @@ -1906,12 +1464,12 @@ msgid "" "`PyModule_GetState`) is ``NULL``." msgstr "" -#: ../../whatsnew/3.9.rst:1335 +#: ../../whatsnew/3.9.rst:1079 msgid "" "Extension modules without module state (``m_size <= 0``) are not affected." msgstr "" -#: ../../whatsnew/3.9.rst:1337 +#: ../../whatsnew/3.9.rst:1081 msgid "" "If :c:func:`Py_AddPendingCall` is called in a subinterpreter, the function " "is now scheduled to be called from the subinterpreter, rather than being " @@ -1919,7 +1477,7 @@ msgid "" "of scheduled calls. (Contributed by Victor Stinner in :issue:`39984`.)" msgstr "" -#: ../../whatsnew/3.9.rst:1343 +#: ../../whatsnew/3.9.rst:1087 msgid "" "The Windows registry is no longer used to initialize :data:`sys.path` when " "the ``-E`` option is used (if :c:member:`PyConfig.use_environment` is set to " @@ -1927,21 +1485,21 @@ msgid "" "by Zackery Spytz in :issue:`8901`.)" msgstr "" -#: ../../whatsnew/3.9.rst:1348 +#: ../../whatsnew/3.9.rst:1092 msgid "" "The global variable :c:data:`PyStructSequence_UnnamedField` is now a " "constant and refers to a constant string. (Contributed by Serhiy Storchaka " "in :issue:`38650`.)" msgstr "" -#: ../../whatsnew/3.9.rst:1352 +#: ../../whatsnew/3.9.rst:1096 msgid "" "The :c:type:`PyGC_Head` structure is now opaque. It is only defined in the " "internal C API (``pycore_gc.h``). (Contributed by Victor Stinner in :issue:" "`40241`.)" msgstr "" -#: ../../whatsnew/3.9.rst:1356 +#: ../../whatsnew/3.9.rst:1100 msgid "" "The ``Py_UNICODE_COPY``, ``Py_UNICODE_FILL``, ``PyUnicode_WSTR_LENGTH``, :c:" "func:`PyUnicode_FromUnicode`, :c:func:`PyUnicode_AsUnicode`, " @@ -1950,76 +1508,14 @@ msgid "" "Python 3.3. (Contributed by Inada Naoki in :issue:`36346`.)" msgstr "" -#: ../../whatsnew/3.9.rst:1363 -msgid "" -"The :c:func:`Py_FatalError` function is replaced with a macro which logs " -"automatically the name of the current function, unless the " -"``Py_LIMITED_API`` macro is defined. (Contributed by Victor Stinner in :" -"issue:`39882`.)" -msgstr "" - -#: ../../whatsnew/3.9.rst:1368 +#: ../../whatsnew/3.9.rst:1110 msgid "" -"The vectorcall protocol now requires that the caller passes only strings as " -"keyword names. (See :issue:`37540` for more information.)" -msgstr "" - -#: ../../whatsnew/3.9.rst:1371 -msgid "" -"Implementation details of a number of macros and functions are now hidden:" -msgstr "" - -#: ../../whatsnew/3.9.rst:1373 -msgid ":c:func:`PyObject_IS_GC` macro was converted to a function." -msgstr "" - -#: ../../whatsnew/3.9.rst:1375 -msgid "" -"The :c:func:`PyObject_NEW` macro becomes an alias to the :c:func:" -"`PyObject_New` macro, and the :c:func:`PyObject_NEW_VAR` macro becomes an " -"alias to the :c:func:`PyObject_NewVar` macro. They no longer access directly " -"the :c:member:`PyTypeObject.tp_basicsize` member." -msgstr "" - -#: ../../whatsnew/3.9.rst:1380 -msgid "" -":c:func:`PyType_HasFeature` now always calls :c:func:`PyType_GetFlags`. " -"Previously, it accessed directly the :c:member:`PyTypeObject.tp_flags` " -"member when the limited C API was not used." -msgstr "" - -#: ../../whatsnew/3.9.rst:1384 -msgid "" -":c:func:`PyObject_GET_WEAKREFS_LISTPTR` macro was converted to a function: " -"the macro accessed directly the :c:member:`PyTypeObject.tp_weaklistoffset` " -"member." -msgstr "" - -#: ../../whatsnew/3.9.rst:1388 -msgid "" -":c:func:`PyObject_CheckBuffer` macro was converted to a function: the macro " -"accessed directly the :c:member:`PyTypeObject.tp_as_buffer` member." -msgstr "" - -#: ../../whatsnew/3.9.rst:1391 -msgid "" -":c:func:`PyIndex_Check` is now always declared as an opaque function to hide " -"implementation details: removed the ``PyIndex_Check()`` macro. The macro " -"accessed directly the :c:member:`PyTypeObject.tp_as_number` member." -msgstr "" - -#: ../../whatsnew/3.9.rst:1395 -msgid "(See :issue:`40170` for more details.)" -msgstr "" - -#: ../../whatsnew/3.9.rst:1400 -msgid "" -"Excluded ``PyFPE_START_PROTECT()`` and ``PyFPE_END_PROTECT()`` macros of " +"Exclude ``PyFPE_START_PROTECT()`` and ``PyFPE_END_PROTECT()`` macros of " "``pyfpe.h`` from the limited C API. (Contributed by Victor Stinner in :issue:" "`38835`.)" msgstr "" -#: ../../whatsnew/3.9.rst:1404 +#: ../../whatsnew/3.9.rst:1114 msgid "" "The ``tp_print`` slot of :ref:`PyTypeObject ` has been " "removed. It was used for printing objects to files in Python 2.7 and before. " @@ -2027,296 +1523,157 @@ msgid "" "Demeyer in :issue:`36974`.)" msgstr "" -#: ../../whatsnew/3.9.rst:1411 -msgid "Excluded the following functions from the limited C API:" +#: ../../whatsnew/3.9.rst:1121 +msgid "Exclude the following functions from the limited C API:" msgstr "" -#: ../../whatsnew/3.9.rst:1413 +#: ../../whatsnew/3.9.rst:1123 msgid "" "``PyThreadState_DeleteCurrent()`` (Contributed by Joannah Nanjekye in :issue:" "`37878`.)" msgstr "" -#: ../../whatsnew/3.9.rst:1415 +#: ../../whatsnew/3.9.rst:1125 msgid "``_Py_CheckRecursionLimit``" msgstr "" -#: ../../whatsnew/3.9.rst:1416 +#: ../../whatsnew/3.9.rst:1126 msgid "``_Py_NewReference()``" msgstr "" -#: ../../whatsnew/3.9.rst:1417 +#: ../../whatsnew/3.9.rst:1127 msgid "``_Py_ForgetReference()``" msgstr "" -#: ../../whatsnew/3.9.rst:1418 +#: ../../whatsnew/3.9.rst:1128 msgid "``_PyTraceMalloc_NewReference()``" msgstr "" -#: ../../whatsnew/3.9.rst:1419 +#: ../../whatsnew/3.9.rst:1129 msgid "``_Py_GetRefTotal()``" msgstr "" -#: ../../whatsnew/3.9.rst:1420 +#: ../../whatsnew/3.9.rst:1130 msgid "The trashcan mechanism which never worked in the limited C API." msgstr "" -#: ../../whatsnew/3.9.rst:1421 +#: ../../whatsnew/3.9.rst:1131 msgid "``PyTrash_UNWIND_LEVEL``" msgstr "" -#: ../../whatsnew/3.9.rst:1422 +#: ../../whatsnew/3.9.rst:1132 msgid "``Py_TRASHCAN_BEGIN_CONDITION``" msgstr "" -#: ../../whatsnew/3.9.rst:1423 +#: ../../whatsnew/3.9.rst:1133 msgid "``Py_TRASHCAN_BEGIN``" msgstr "" -#: ../../whatsnew/3.9.rst:1424 +#: ../../whatsnew/3.9.rst:1134 msgid "``Py_TRASHCAN_END``" msgstr "" -#: ../../whatsnew/3.9.rst:1425 +#: ../../whatsnew/3.9.rst:1135 msgid "``Py_TRASHCAN_SAFE_BEGIN``" msgstr "" -#: ../../whatsnew/3.9.rst:1426 +#: ../../whatsnew/3.9.rst:1136 msgid "``Py_TRASHCAN_SAFE_END``" msgstr "" -#: ../../whatsnew/3.9.rst:1428 -msgid "Moved following functions and definitions to the internal C API:" +#: ../../whatsnew/3.9.rst:1138 +msgid "Move following functions and definitions to the internal C API:" msgstr "" -#: ../../whatsnew/3.9.rst:1430 +#: ../../whatsnew/3.9.rst:1140 msgid "``_PyDebug_PrintTotalRefs()``" msgstr "" -#: ../../whatsnew/3.9.rst:1431 +#: ../../whatsnew/3.9.rst:1141 msgid "``_Py_PrintReferences()``" msgstr "" -#: ../../whatsnew/3.9.rst:1432 +#: ../../whatsnew/3.9.rst:1142 msgid "``_Py_PrintReferenceAddresses()``" msgstr "" -#: ../../whatsnew/3.9.rst:1433 +#: ../../whatsnew/3.9.rst:1143 msgid "``_Py_tracemalloc_config``" msgstr "" -#: ../../whatsnew/3.9.rst:1434 +#: ../../whatsnew/3.9.rst:1144 msgid "``_Py_AddToAllObjects()`` (specific to ``Py_TRACE_REFS`` build)" msgstr "" -#: ../../whatsnew/3.9.rst:1438 +#: ../../whatsnew/3.9.rst:1148 msgid "" -"Removed ``_PyRuntime.getframe`` hook and removed ``_PyThreadState_GetFrame`` " +"Remove ``_PyRuntime.getframe`` hook and remove ``_PyThreadState_GetFrame`` " "macro which was an alias to ``_PyRuntime.getframe``. They were only exposed " -"by the internal C API. Removed also ``PyThreadFrameGetter`` type. " +"by the internal C API. Remove also ``PyThreadFrameGetter`` type. " "(Contributed by Victor Stinner in :issue:`39946`.)" msgstr "" -#: ../../whatsnew/3.9.rst:1443 +#: ../../whatsnew/3.9.rst:1153 msgid "" -"Removed the following functions from the C API. Call :c:func:`PyGC_Collect` " +"Remove the following functions from the C API. Call :c:func:`PyGC_Collect` " "explicitly to clear all free lists. (Contributed by Inada Naoki and Victor " "Stinner in :issue:`37340`, :issue:`38896` and :issue:`40428`.)" msgstr "" -#: ../../whatsnew/3.9.rst:1448 +#: ../../whatsnew/3.9.rst:1158 msgid "``PyAsyncGen_ClearFreeLists()``" msgstr "" -#: ../../whatsnew/3.9.rst:1449 +#: ../../whatsnew/3.9.rst:1159 msgid "``PyContext_ClearFreeList()``" msgstr "" -#: ../../whatsnew/3.9.rst:1450 +#: ../../whatsnew/3.9.rst:1160 msgid "``PyDict_ClearFreeList()``" msgstr "" -#: ../../whatsnew/3.9.rst:1451 +#: ../../whatsnew/3.9.rst:1161 msgid "``PyFloat_ClearFreeList()``" msgstr "" -#: ../../whatsnew/3.9.rst:1452 +#: ../../whatsnew/3.9.rst:1162 msgid "``PyFrame_ClearFreeList()``" msgstr "" -#: ../../whatsnew/3.9.rst:1453 +#: ../../whatsnew/3.9.rst:1163 msgid "``PyList_ClearFreeList()``" msgstr "" -#: ../../whatsnew/3.9.rst:1454 +#: ../../whatsnew/3.9.rst:1164 msgid "" "``PyMethod_ClearFreeList()`` and ``PyCFunction_ClearFreeList()``: the free " "lists of bound method objects have been removed." msgstr "" -#: ../../whatsnew/3.9.rst:1456 +#: ../../whatsnew/3.9.rst:1166 msgid "" "``PySet_ClearFreeList()``: the set free list has been removed in Python 3.4." msgstr "" -#: ../../whatsnew/3.9.rst:1458 +#: ../../whatsnew/3.9.rst:1168 msgid "``PyTuple_ClearFreeList()``" msgstr "" -#: ../../whatsnew/3.9.rst:1459 +#: ../../whatsnew/3.9.rst:1169 msgid "" "``PyUnicode_ClearFreeList()``: the Unicode free list has been removed in " "Python 3.3." msgstr "" -#: ../../whatsnew/3.9.rst:1462 +#: ../../whatsnew/3.9.rst:1172 msgid "" -"Removed ``_PyUnicode_ClearStaticStrings()`` function. (Contributed by Victor " +"Remove ``_PyUnicode_ClearStaticStrings()`` function. (Contributed by Victor " "Stinner in :issue:`39465`.)" msgstr "" -#: ../../whatsnew/3.9.rst:1465 +#: ../../whatsnew/3.9.rst:1175 msgid "" -"Removed ``Py_UNICODE_MATCH``. It has been deprecated by :pep:`393`, and " +"Remove ``Py_UNICODE_MATCH``. It has been deprecated by :pep:`393`, and " "broken since Python 3.3. The :c:func:`PyUnicode_Tailmatch` function can be " "used instead. (Contributed by Inada Naoki in :issue:`36346`.)" msgstr "" - -#: ../../whatsnew/3.9.rst:1470 -msgid "" -"Cleaned header files of interfaces defined but with no implementation. The " -"public API symbols being removed are: " -"``_PyBytes_InsertThousandsGroupingLocale``, " -"``_PyBytes_InsertThousandsGrouping``, ``_Py_InitializeFromArgs``, " -"``_Py_InitializeFromWideArgs``, ``_PyFloat_Repr``, ``_PyFloat_Digits``, " -"``_PyFloat_DigitsInit``, ``PyFrame_ExtendStack``, ``_PyAIterWrapper_Type``, " -"``PyNullImporter_Type``, ``PyCmpWrapper_Type``, ``PySortWrapper_Type``, " -"``PyNoArgsFunction``. (Contributed by Pablo Galindo Salgado in :issue:" -"`39372`.)" -msgstr "" - -#: ../../whatsnew/3.9.rst:1481 -msgid "Notable changes in Python 3.9.1" -msgstr "" - -#: ../../whatsnew/3.9.rst:1486 -msgid "" -"The behavior of :class:`typing.Literal` was changed to conform with :pep:" -"`586` and to match the behavior of static type checkers specified in the PEP." -msgstr "" - -#: ../../whatsnew/3.9.rst:1489 -msgid "``Literal`` now de-duplicates parameters." -msgstr "" - -#: ../../whatsnew/3.9.rst:1490 -msgid "" -"Equality comparisons between ``Literal`` objects are now order independent." -msgstr "" - -#: ../../whatsnew/3.9.rst:1491 -msgid "" -"``Literal`` comparisons now respect types. For example, ``Literal[0] == " -"Literal[False]`` previously evaluated to ``True``. It is now ``False``. To " -"support this change, the internally used type cache now supports " -"differentiating types." -msgstr "" - -#: ../../whatsnew/3.9.rst:1495 -msgid "" -"``Literal`` objects will now raise a :exc:`TypeError` exception during " -"equality comparisons if any of their parameters are not :term:`hashable`. " -"Note that declaring ``Literal`` with mutable parameters will not throw an " -"error::" -msgstr "" - -#: ../../whatsnew/3.9.rst:1507 -msgid "(Contributed by Yurii Karabas in :issue:`42345`.)" -msgstr "" - -#: ../../whatsnew/3.9.rst:1510 -msgid "macOS 11.0 (Big Sur) and Apple Silicon Mac support" -msgstr "" - -#: ../../whatsnew/3.9.rst:1512 -msgid "" -"As of 3.9.1, Python now fully supports building and running on macOS 11.0 " -"(Big Sur) and on Apple Silicon Macs (based on the ``ARM64`` architecture). A " -"new universal build variant, ``universal2``, is now available to natively " -"support both ``ARM64`` and ``Intel 64`` in one set of executables. Binaries " -"can also now be built on current versions of macOS to be deployed on a range " -"of older macOS versions (tested to 10.9) while making some newer OS " -"functions and options conditionally available based on the operating system " -"version in use at runtime (\"weaklinking\")." -msgstr "" - -#: ../../whatsnew/3.9.rst:1521 -msgid "(Contributed by Ronald Oussoren and Lawrence D'Anna in :issue:`41100`.)" -msgstr "" - -#: ../../whatsnew/3.9.rst:1524 -msgid "Notable changes in Python 3.9.2" -msgstr "" - -#: ../../whatsnew/3.9.rst:1527 -msgid "collections.abc" -msgstr "" - -#: ../../whatsnew/3.9.rst:1529 -msgid "" -":class:`collections.abc.Callable` generic now flattens type parameters, " -"similar to what :data:`typing.Callable` currently does. This means that " -"``collections.abc.Callable[[int, str], str]`` will have ``__args__`` of " -"``(int, str, str)``; previously this was ``([int, str], str)``. To allow " -"this change, :class:`types.GenericAlias` can now be subclassed, and a " -"subclass will be returned when subscripting the :class:`collections.abc." -"Callable` type. Code which accesses the arguments via :func:`typing." -"get_args` or ``__args__`` need to account for this change. A :exc:" -"`DeprecationWarning` may be emitted for invalid forms of parameterizing :" -"class:`collections.abc.Callable` which may have passed silently in Python " -"3.9.1. This :exc:`DeprecationWarning` will become a :exc:`TypeError` in " -"Python 3.10. (Contributed by Ken Jin in :issue:`42195`.)" -msgstr "" - -#: ../../whatsnew/3.9.rst:1543 ../../whatsnew/3.9.rst:1568 -msgid "urllib.parse" -msgstr "" - -#: ../../whatsnew/3.9.rst:1545 -msgid "" -"Earlier Python versions allowed using both ``;`` and ``&`` as query " -"parameter separators in :func:`urllib.parse.parse_qs` and :func:`urllib." -"parse.parse_qsl`. Due to security concerns, and to conform with newer W3C " -"recommendations, this has been changed to allow only a single separator key, " -"with ``&`` as the default. This change also affects :func:`cgi.parse` and :" -"func:`cgi.parse_multipart` as they use the affected functions internally. " -"For more details, please see their respective documentation. (Contributed by " -"Adam Goldschmidt, Senthil Kumaran and Ken Jin in :issue:`42967`.)" -msgstr "" - -#: ../../whatsnew/3.9.rst:1556 -msgid "Notable changes in Python 3.9.3" -msgstr "" - -#: ../../whatsnew/3.9.rst:1558 -msgid "" -"A security fix alters the :class:`ftplib.FTP` behavior to not trust the IPv4 " -"address sent from the remote server when setting up a passive data channel. " -"We reuse the ftp server IP address instead. For unusual code requiring the " -"old behavior, set a ``trust_server_pasv_ipv4_address`` attribute on your FTP " -"instance to ``True``. (See :issue:`43285`)" -msgstr "" - -#: ../../whatsnew/3.9.rst:1565 -msgid "Notable changes in Python 3.9.5" -msgstr "" - -#: ../../whatsnew/3.9.rst:1570 -msgid "" -"The presence of newline or tab characters in parts of a URL allows for some " -"forms of attacks. Following the WHATWG specification that updates :rfc:" -"`3986`, ASCII newline ``\\n``, ``\\r`` and tab ``\\t`` characters are " -"stripped from the URL by the parser in :mod:`urllib.parse` preventing such " -"attacks. The removal characters are controlled by a new module level " -"variable ``urllib.parse._UNSAFE_URL_BYTES_TO_REMOVE``. (See :issue:`43882`)" -msgstr ""