diff --git a/about.po b/about.po index f2dc716645..f69f9b8a87 100644 --- a/about.po +++ b/about.po @@ -14,8 +14,8 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.10\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2018-06-26 18:54+0800\n" -"PO-Revision-Date: 2017-09-22 18:26+0000\n" +"POT-Creation-Date: 2022-05-21 17:35+0000\n" +"PO-Revision-Date: 2022-05-12 00:11+0800\n" "Last-Translator: hsiao yi \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" "tw)\n" @@ -24,6 +24,7 @@ msgstr "" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" "Plural-Forms: nplurals=1; plural=0;\n" +"X-Generator: Poedit 3.0.1\n" #: ../../about.rst:3 msgid "About these documents" @@ -57,7 +58,7 @@ msgid "" "Fred L. Drake, Jr., the creator of the original Python documentation toolset " "and writer of much of the content;" msgstr "" -"Fred L. Drake, Jr.,原始 Python 文件工具集的創造者以及一大部份內容的作者。" +"Fred L. Drake, Jr.,原始 Python 文件工具集的創造者以及一大部份內容的作者;" #: ../../about.rst:24 msgid "" @@ -69,17 +70,17 @@ msgstr "" #: ../../about.rst:26 msgid "" -"Fredrik Lundh for his `Alternative Python Reference `_ project from which Sphinx got many good ideas." +"Fredrik Lundh for his Alternative Python Reference project from which Sphinx " +"got many good ideas." msgstr "" -"Fredrik Lundh 先生,Sphinx 從他的 `Alternative Python Reference `_ 計劃中獲得許多的好主意。" +"Fredrik Lundh 先生,Sphinx 從他的 Alternative Python Reference 計劃中獲得許多" +"的好主意。" -#: ../../about.rst:32 +#: ../../about.rst:31 msgid "Contributors to the Python Documentation" msgstr "Python 文件的貢獻者們" -#: ../../about.rst:34 +#: ../../about.rst:33 msgid "" "Many people have contributed to the Python language, the Python standard " "library, and the Python documentation. See :source:`Misc/ACKS` in the " @@ -88,7 +89,7 @@ msgstr "" "許多人都曾為 Python 這門語言、Python 標準函式庫和 Python 說明文件貢獻過。" "Python 所發佈的原始碼中含有部份貢獻者的清單,請見 :source:`Misc/ACKS` 。" -#: ../../about.rst:38 +#: ../../about.rst:37 msgid "" "It is only with the input and contributions of the Python community that " "Python has such wonderful documentation -- Thank You!" diff --git a/c-api/arg.po b/c-api/arg.po index 666e6786c6..263eece943 100644 --- a/c-api/arg.po +++ b/c-api/arg.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.10\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2021-10-26 16:47+0000\n" +"POT-Creation-Date: 2022-05-21 17:35+0000\n" "PO-Revision-Date: 2021-11-22 16:44+0800\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -540,8 +540,8 @@ msgid "" msgstr "" #: ../../c-api/arg.rst:290 ../../c-api/arg.rst:617 -msgid "``n`` (:class:`int`) [Py_ssize_t]" -msgstr "``n`` (:class:`int`) [Py_ssize_t]" +msgid "``n`` (:class:`int`) [:c:type:`Py_ssize_t`]" +msgstr "``n`` (:class:`int`) [:c:type:`Py_ssize_t`]" #: ../../c-api/arg.rst:290 msgid "Convert a Python integer to a C :c:type:`Py_ssize_t`." diff --git a/c-api/bytes.po b/c-api/bytes.po index 3ea22cdce6..daa36ccef1 100644 --- a/c-api/bytes.po +++ b/c-api/bytes.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.10\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2022-04-03 00:14+0000\n" +"POT-Creation-Date: 2022-05-21 17:35+0000\n" "PO-Revision-Date: 2018-05-23 14:04+0000\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -160,8 +160,8 @@ msgid ":attr:`%zd`" msgstr ":attr:`%zd`" #: ../../c-api/bytes.rst:87 -msgid "Py_ssize_t" -msgstr "Py_ssize_t" +msgid ":c:type:`\\ Py_ssize_t`" +msgstr ":c:type:`\\ Py_ssize_t`" #: ../../c-api/bytes.rst:87 msgid "Equivalent to ``printf(\"%zd\")``. [1]_" diff --git a/c-api/exceptions.po b/c-api/exceptions.po index 3807ff49e0..933bc92efc 100644 --- a/c-api/exceptions.po +++ b/c-api/exceptions.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.10\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2022-04-03 00:14+0000\n" +"POT-Creation-Date: 2022-05-21 17:35+0000\n" "PO-Revision-Date: 2018-05-23 14:05+0000\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -912,9 +912,9 @@ msgstr ":exc:`BaseException`" #: ../../c-api/exceptions.rst:892 ../../c-api/exceptions.rst:894 #: ../../c-api/exceptions.rst:896 ../../c-api/exceptions.rst:942 -#: ../../c-api/exceptions.rst:954 ../../c-api/exceptions.rst:1070 -msgid "\\(1)" -msgstr "\\(1)" +#: ../../c-api/exceptions.rst:954 +msgid "[1]_" +msgstr "[1]_" #: ../../c-api/exceptions.rst:894 msgid ":c:data:`PyExc_Exception`" @@ -1204,10 +1204,6 @@ msgstr ":c:data:`PyExc_ReferenceError`" msgid ":exc:`ReferenceError`" msgstr ":exc:`ReferenceError`" -#: ../../c-api/exceptions.rst:964 -msgid "\\(2)" -msgstr "\\(2)" - #: ../../c-api/exceptions.rst:966 msgid ":c:data:`PyExc_RuntimeError`" msgstr ":c:data:`PyExc_RuntimeError`" @@ -1382,8 +1378,8 @@ msgid ":c:data:`PyExc_WindowsError`" msgstr ":c:data:`PyExc_WindowsError`" #: ../../c-api/exceptions.rst:1029 -msgid "\\(3)" -msgstr "\\(3)" +msgid "[2]_" +msgstr "[2]_" #: ../../c-api/exceptions.rst:1032 msgid "These aliases used to be separate exception types." @@ -1423,6 +1419,10 @@ msgstr ":c:data:`PyExc_Warning`" msgid ":exc:`Warning`" msgstr ":exc:`Warning`" +#: ../../c-api/exceptions.rst:1070 +msgid "[3]_" +msgstr "[3]_" + #: ../../c-api/exceptions.rst:1072 msgid ":c:data:`PyExc_BytesWarning`" msgstr ":c:data:`PyExc_BytesWarning`" diff --git a/c-api/init.po b/c-api/init.po index bff10a2385..fef342d69a 100644 --- a/c-api/init.po +++ b/c-api/init.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.10\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2022-04-03 00:14+0000\n" +"POT-Creation-Date: 2022-05-21 17:35+0000\n" "PO-Revision-Date: 2018-05-23 14:06+0000\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -678,10 +678,10 @@ msgstr "" #: ../../c-api/init.rst:531 msgid "" "The first word (up to the first space character) is the current Python " -"version; the first three characters are the major and minor version " -"separated by a period. The returned string points into static storage; the " -"caller should not modify its value. The value is available to Python code " -"as :data:`sys.version`." +"version; the first characters are the major and minor version separated by a " +"period. The returned string points into static storage; the caller should " +"not modify its value. The value is available to Python code as :data:`sys." +"version`." msgstr "" #: ../../c-api/init.rst:541 diff --git a/c-api/intro.po b/c-api/intro.po index 0333e5a4f1..11a04e6088 100644 --- a/c-api/intro.po +++ b/c-api/intro.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.10\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2021-10-26 16:47+0000\n" +"POT-Creation-Date: 2022-05-21 17:35+0000\n" "PO-Revision-Date: 2018-05-23 14:06+0000\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -499,11 +499,19 @@ msgid "" "that use them." msgstr "" -#: ../../c-api/intro.rst:509 +#: ../../c-api/intro.rst:507 +msgid "" +"A signed integral type such that ``sizeof(Py_ssize_t) == sizeof(size_t)``. " +"C99 doesn't define such a thing directly (size_t is an unsigned integral " +"type). See :pep:`353` for details. ``PY_SSIZE_T_MAX`` is the largest " +"positive value of type :c:type:`Py_ssize_t`." +msgstr "" + +#: ../../c-api/intro.rst:516 msgid "Exceptions" msgstr "例外" -#: ../../c-api/intro.rst:511 +#: ../../c-api/intro.rst:518 msgid "" "The Python programmer only needs to deal with exceptions if specific error " "handling is required; unhandled exceptions are automatically propagated to " @@ -512,7 +520,7 @@ msgid "" "stack traceback." msgstr "" -#: ../../c-api/intro.rst:519 +#: ../../c-api/intro.rst:526 msgid "" "For C programmers, however, error checking always has to be explicit. All " "functions in the Python/C API can raise exceptions, unless an explicit claim " @@ -527,7 +535,7 @@ msgid "" "explicitly documented." msgstr "" -#: ../../c-api/intro.rst:534 +#: ../../c-api/intro.rst:541 msgid "" "Exception state is maintained in per-thread storage (this is equivalent to " "using global storage in an unthreaded application). A thread can be in one " @@ -540,7 +548,7 @@ msgid "" "clears the exception state." msgstr "" -#: ../../c-api/intro.rst:544 +#: ../../c-api/intro.rst:551 msgid "" "The full exception state consists of three objects (all of which can be " "``NULL``): the exception type, the corresponding exception value, and the " @@ -553,7 +561,7 @@ msgid "" "``sys.exc_info()`` and friends." msgstr "" -#: ../../c-api/intro.rst:556 +#: ../../c-api/intro.rst:563 msgid "" "Note that starting with Python 1.5, the preferred, thread-safe way to access " "the exception state from Python code is to call the function :func:`sys." @@ -567,7 +575,7 @@ msgid "" "referenced by the stack frames in the traceback." msgstr "" -#: ../../c-api/intro.rst:567 +#: ../../c-api/intro.rst:574 msgid "" "As a general principle, a function that calls another function to perform " "some task should check whether the called function raised an exception, and " @@ -578,7 +586,7 @@ msgid "" "of the error." msgstr "" -#: ../../c-api/intro.rst:576 +#: ../../c-api/intro.rst:583 msgid "" "A simple example of detecting exceptions and passing them on is shown in " "the :c:func:`sum_sequence` example above. It so happens that this example " @@ -587,11 +595,11 @@ msgid "" "why you like Python, we show the equivalent Python code::" msgstr "" -#: ../../c-api/intro.rst:591 +#: ../../c-api/intro.rst:598 msgid "Here is the corresponding C code, in all its glory::" msgstr "" -#: ../../c-api/intro.rst:643 +#: ../../c-api/intro.rst:650 msgid "" "This example represents an endorsed use of the ``goto`` statement in C! It " "illustrates the use of :c:func:`PyErr_ExceptionMatches` and :c:func:" @@ -604,11 +612,11 @@ msgid "" "success after the final call made is successful." msgstr "" -#: ../../c-api/intro.rst:657 +#: ../../c-api/intro.rst:664 msgid "Embedding Python" msgstr "嵌入式Python" -#: ../../c-api/intro.rst:659 +#: ../../c-api/intro.rst:666 msgid "" "The one important task that only embedders (as opposed to extension writers) " "of the Python interpreter have to worry about is the initialization, and " @@ -616,7 +624,7 @@ msgid "" "the interpreter can only be used after the interpreter has been initialized." msgstr "" -#: ../../c-api/intro.rst:672 +#: ../../c-api/intro.rst:679 msgid "" "The basic initialization function is :c:func:`Py_Initialize`. This " "initializes the table of loaded modules, and creates the fundamental " @@ -624,7 +632,7 @@ msgid "" "initializes the module search path (``sys.path``)." msgstr "" -#: ../../c-api/intro.rst:679 +#: ../../c-api/intro.rst:686 msgid "" ":c:func:`Py_Initialize` does not set the \"script argument list\" (``sys." "argv``). If this variable is needed by Python code that will be executed " @@ -632,7 +640,7 @@ msgid "" "argv, updatepath)`` after the call to :c:func:`Py_Initialize`." msgstr "" -#: ../../c-api/intro.rst:684 +#: ../../c-api/intro.rst:691 msgid "" "On most systems (in particular, on Unix and Windows, although the details " "are slightly different), :c:func:`Py_Initialize` calculates the module " @@ -644,7 +652,7 @@ msgid "" "on the shell command search path (the environment variable :envvar:`PATH`)." msgstr "" -#: ../../c-api/intro.rst:693 +#: ../../c-api/intro.rst:700 msgid "" "For instance, if the Python executable is found in :file:`/usr/local/bin/" "python`, it will assume that the libraries are in :file:`/usr/local/lib/" @@ -655,7 +663,7 @@ msgid "" "in front of the standard path by setting :envvar:`PYTHONPATH`." msgstr "" -#: ../../c-api/intro.rst:708 +#: ../../c-api/intro.rst:715 msgid "" "The embedding application can steer the search by calling " "``Py_SetProgramName(file)`` *before* calling :c:func:`Py_Initialize`. Note " @@ -666,7 +674,7 @@ msgid "" "func:`Py_GetProgramFullPath` (all defined in :file:`Modules/getpath.c`)." msgstr "" -#: ../../c-api/intro.rst:718 +#: ../../c-api/intro.rst:725 msgid "" "Sometimes, it is desirable to \"uninitialize\" Python. For instance, the " "application may want to start over (make another call to :c:func:" @@ -680,18 +688,18 @@ msgid "" "released." msgstr "" -#: ../../c-api/intro.rst:732 +#: ../../c-api/intro.rst:739 msgid "Debugging Builds" msgstr "" -#: ../../c-api/intro.rst:734 +#: ../../c-api/intro.rst:741 msgid "" "Python can be built with several macros to enable extra checks of the " "interpreter and extension modules. These checks tend to add a large amount " "of overhead to the runtime so they are not enabled by default." msgstr "" -#: ../../c-api/intro.rst:738 +#: ../../c-api/intro.rst:745 msgid "" "A full list of the various types of debugging builds is in the file :file:" "`Misc/SpecialBuilds.txt` in the Python source distribution. Builds are " @@ -701,7 +709,7 @@ msgid "" "section." msgstr "" -#: ../../c-api/intro.rst:744 +#: ../../c-api/intro.rst:751 msgid "" "Compiling the interpreter with the :c:macro:`Py_DEBUG` macro defined " "produces what is generally meant by :ref:`a debug build of Python `." msgstr "" -#: ../../c-api/intro.rst:755 +#: ../../c-api/intro.rst:762 msgid "" "Defining :c:macro:`Py_TRACE_REFS` enables reference tracing (see the :option:" "`configure --with-trace-refs option <--with-trace-refs>`). When defined, a " @@ -728,7 +736,7 @@ msgid "" "this happens after every statement run by the interpreter.)" msgstr "" -#: ../../c-api/intro.rst:762 +#: ../../c-api/intro.rst:769 msgid "" "Please refer to :file:`Misc/SpecialBuilds.txt` in the Python source " "distribution for more detailed information." diff --git a/c-api/number.po b/c-api/number.po index ab624803bb..8b98c29083 100644 --- a/c-api/number.po +++ b/c-api/number.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.10\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2022-04-03 00:14+0000\n" +"POT-Creation-Date: 2022-05-21 17:35+0000\n" "PO-Revision-Date: 2018-05-23 14:07+0000\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -279,14 +279,15 @@ msgstr "" #: ../../c-api/number.rst:276 msgid "" -"Returns *o* converted to a Py_ssize_t value if *o* can be interpreted as an " -"integer. If the call fails, an exception is raised and ``-1`` is returned." +"Returns *o* converted to a :c:type:`Py_ssize_t` value if *o* can be " +"interpreted as an integer. If the call fails, an exception is raised and " +"``-1`` is returned." msgstr "" #: ../../c-api/number.rst:279 msgid "" -"If *o* can be converted to a Python int but the attempt to convert to a " -"Py_ssize_t value would raise an :exc:`OverflowError`, then the *exc* " +"If *o* can be converted to a Python int but the attempt to convert to a :c:" +"type:`Py_ssize_t` value would raise an :exc:`OverflowError`, then the *exc* " "argument is the type of exception that will be raised (usually :exc:" "`IndexError` or :exc:`OverflowError`). If *exc* is ``NULL``, then the " "exception is cleared and the value is clipped to ``PY_SSIZE_T_MIN`` for a " diff --git a/c-api/object.po b/c-api/object.po index 970b6185fa..a25868164f 100644 --- a/c-api/object.po +++ b/c-api/object.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.10\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2022-04-03 00:14+0000\n" +"POT-Creation-Date: 2022-05-21 17:35+0000\n" "PO-Revision-Date: 2018-05-23 14:32+0000\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -269,8 +269,8 @@ msgstr "" #: ../../c-api/object.rst:259 msgid "" -"The return type is now Py_hash_t. This is a signed integer the same size as " -"Py_ssize_t." +"The return type is now Py_hash_t. This is a signed integer the same size " +"as :c:type:`Py_ssize_t`." msgstr "" #: ../../c-api/object.rst:266 diff --git a/c-api/refcounting.po b/c-api/refcounting.po index 82ed14c54d..3f456a4851 100644 --- a/c-api/refcounting.po +++ b/c-api/refcounting.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.10\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2021-10-26 16:47+0000\n" +"POT-Creation-Date: 2022-05-21 17:35+0000\n" "PO-Revision-Date: 2017-09-22 18:26+0000\n" "Last-Translator: Leon H.\n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -158,15 +158,19 @@ msgid "" "count of an object that might be traversed during garbage collection." msgstr "" -#: ../../c-api/refcounting.rst:113 +#: ../../c-api/refcounting.rst:114 msgid "" -"The following functions are for runtime dynamic embedding of Python: " -"``Py_IncRef(PyObject *o)``, ``Py_DecRef(PyObject *o)``. They are simply " -"exported function versions of :c:func:`Py_XINCREF` and :c:func:`Py_XDECREF`, " -"respectively." +"Increment the reference count for object *o*. A function version of :c:func:" +"`Py_XINCREF`. It can be used for runtime dynamic embedding of Python." msgstr "" -#: ../../c-api/refcounting.rst:118 +#: ../../c-api/refcounting.rst:120 +msgid "" +"Decrement the reference count for object *o*. A function version of :c:func:" +"`Py_XDECREF`. It can be used for runtime dynamic embedding of Python." +msgstr "" + +#: ../../c-api/refcounting.rst:124 msgid "" "The following functions or macros are only for use within the interpreter " "core: :c:func:`_Py_Dealloc`, :c:func:`_Py_ForgetReference`, :c:func:" diff --git a/c-api/sys.po b/c-api/sys.po index f82741b2cc..7fcc3aae56 100644 --- a/c-api/sys.po +++ b/c-api/sys.po @@ -10,7 +10,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.10\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2022-04-03 00:14+0000\n" +"POT-Creation-Date: 2022-05-21 17:35+0000\n" "PO-Revision-Date: 2018-05-23 14:07+0000\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -380,8 +380,8 @@ msgstr "" #: ../../c-api/sys.rst:325 msgid "" -"Note that ``#`` format characters should always be treated as " -"``Py_ssize_t``, regardless of whether ``PY_SSIZE_T_CLEAN`` was defined." +"Note that ``#`` format characters should always be treated as :c:type:" +"`Py_ssize_t`, regardless of whether ``PY_SSIZE_T_CLEAN`` was defined." msgstr "" #: ../../c-api/sys.rst:328 @@ -390,7 +390,7 @@ msgstr "" #: ../../c-api/sys.rst:334 msgid "" -"Require ``Py_ssize_t`` for ``#`` format characters. Previously, an " +"Require :c:type:`Py_ssize_t` for ``#`` format characters. Previously, an " "unavoidable deprecation warning was raised." msgstr "" diff --git a/c-api/typeobj.po b/c-api/typeobj.po index 6e17d34ee9..924f76c036 100644 --- a/c-api/typeobj.po +++ b/c-api/typeobj.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.10\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2022-03-02 00:17+0000\n" +"POT-Creation-Date: 2022-05-21 17:35+0000\n" "PO-Revision-Date: 2018-05-23 14:33+0000\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -130,8 +130,8 @@ msgstr ":c:member:`~PyTypeObject.tp_basicsize`" #: ../../c-api/typeobj.rst:52 ../../c-api/typeobj.rst:99 #: ../../c-api/typeobj.rst:120 ../../c-api/typeobj.rst:0 #: ../../c-api/typeobj.rst:408 -msgid "Py_ssize_t" -msgstr "Py_ssize_t" +msgid ":c:type:`Py_ssize_t`" +msgstr ":c:type:`Py_ssize_t`" #: ../../c-api/typeobj.rst:48 msgid ":c:member:`~PyTypeObject.tp_itemsize`" diff --git a/c-api/unicode.po b/c-api/unicode.po index f1cdea95e6..85a060358e 100644 --- a/c-api/unicode.po +++ b/c-api/unicode.po @@ -9,7 +9,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.10\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2022-02-24 00:12+0000\n" +"POT-Creation-Date: 2022-05-21 17:35+0000\n" "PO-Revision-Date: 2018-05-23 14:08+0000\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -591,8 +591,8 @@ msgid ":attr:`%zd`" msgstr ":attr:`%zd`" #: ../../c-api/unicode.rst:493 ../../c-api/unicode.rst:496 -msgid "Py_ssize_t" -msgstr "Py_ssize_t" +msgid ":c:type:`\\ Py_ssize_t`" +msgstr ":c:type:`\\ Py_ssize_t`" #: ../../c-api/unicode.rst:493 msgid "Equivalent to ``printf(\"%zd\")``. [1]_" @@ -1247,7 +1247,7 @@ msgid "" "``NULL`` if an exception was raised by the codec." msgstr "" -#: ../../c-api/unicode.rst:1052 ../../c-api/unicode.rst:1312 +#: ../../c-api/unicode.rst:1052 ../../c-api/unicode.rst:1313 msgid "" "Part of the old-style :c:type:`Py_UNICODE` API; please migrate to using :c:" "func:`PyUnicode_AsEncodedString`." @@ -1301,57 +1301,59 @@ msgstr "" 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." +"is not responsible for deallocating the buffer. The buffer is deallocated " +"and pointers to it become invalid when the Unicode object is garbage " +"collected." msgstr "" -#: ../../c-api/unicode.rst:1100 ../../c-api/unicode.rst:1113 +#: ../../c-api/unicode.rst:1101 ../../c-api/unicode.rst:1114 msgid "The return type is now ``const char *`` rather of ``char *``." msgstr "" -#: ../../c-api/unicode.rst:1103 +#: ../../c-api/unicode.rst:1104 msgid "This function is a part of the :ref:`limited API `." msgstr "" -#: ../../c-api/unicode.rst:1109 +#: ../../c-api/unicode.rst:1110 msgid "As :c:func:`PyUnicode_AsUTF8AndSize`, but does not store the size." msgstr "" -#: ../../c-api/unicode.rst:1119 +#: ../../c-api/unicode.rst:1120 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:1126 +#: ../../c-api/unicode.rst:1127 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:1130 +#: ../../c-api/unicode.rst:1131 msgid "UTF-32 Codecs" msgstr "" -#: ../../c-api/unicode.rst:1132 +#: ../../c-api/unicode.rst:1133 msgid "These are the UTF-32 codec APIs:" msgstr "" -#: ../../c-api/unicode.rst:1138 +#: ../../c-api/unicode.rst:1139 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:1142 ../../c-api/unicode.rst:1215 +#: ../../c-api/unicode.rst:1143 ../../c-api/unicode.rst:1216 msgid "" "If *byteorder* is non-``NULL``, the decoder starts decoding using the given " "byte order::" msgstr "" -#: ../../c-api/unicode.rst:1149 +#: ../../c-api/unicode.rst:1150 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 " @@ -1359,22 +1361,22 @@ msgid "" "``-1`` or ``1``, any byte order mark is copied to the output." msgstr "" -#: ../../c-api/unicode.rst:1154 +#: ../../c-api/unicode.rst:1155 msgid "" "After completion, *\\*byteorder* is set to the current byte order at the end " "of input data." msgstr "" -#: ../../c-api/unicode.rst:1157 ../../c-api/unicode.rst:1231 +#: ../../c-api/unicode.rst:1158 ../../c-api/unicode.rst:1232 msgid "If *byteorder* is ``NULL``, the codec starts in native order mode." msgstr "" -#: ../../c-api/unicode.rst:1159 ../../c-api/unicode.rst:1195 -#: ../../c-api/unicode.rst:1233 ../../c-api/unicode.rst:1270 +#: ../../c-api/unicode.rst:1160 ../../c-api/unicode.rst:1196 +#: ../../c-api/unicode.rst:1234 ../../c-api/unicode.rst:1271 msgid "Return ``NULL`` if an exception was raised by the codec." msgstr "" -#: ../../c-api/unicode.rst:1165 +#: ../../c-api/unicode.rst:1166 msgid "" "If *consumed* is ``NULL``, behave like :c:func:`PyUnicode_DecodeUTF32`. If " "*consumed* is not ``NULL``, :c:func:`PyUnicode_DecodeUTF32Stateful` will not " @@ -1383,53 +1385,53 @@ msgid "" "number of bytes that have been decoded will be stored in *consumed*." msgstr "" -#: ../../c-api/unicode.rst:1174 +#: ../../c-api/unicode.rst:1175 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:1182 +#: ../../c-api/unicode.rst:1183 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:1189 ../../c-api/unicode.rst:1263 +#: ../../c-api/unicode.rst:1190 ../../c-api/unicode.rst:1264 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:1192 +#: ../../c-api/unicode.rst:1193 msgid "" "If ``Py_UNICODE_WIDE`` is not defined, surrogate pairs will be output as a " "single code point." msgstr "" -#: ../../c-api/unicode.rst:1199 +#: ../../c-api/unicode.rst:1200 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:1203 +#: ../../c-api/unicode.rst:1204 msgid "UTF-16 Codecs" msgstr "" -#: ../../c-api/unicode.rst:1205 +#: ../../c-api/unicode.rst:1206 msgid "These are the UTF-16 codec APIs:" msgstr "" -#: ../../c-api/unicode.rst:1211 +#: ../../c-api/unicode.rst:1212 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:1222 +#: ../../c-api/unicode.rst:1223 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 " @@ -1438,13 +1440,13 @@ msgid "" "result in either a ``\\ufeff`` or a ``\\ufffe`` character)." msgstr "" -#: ../../c-api/unicode.rst:1228 +#: ../../c-api/unicode.rst:1229 msgid "" "After completion, ``*byteorder`` is set to the current byte order at the end " "of input data." msgstr "" -#: ../../c-api/unicode.rst:1239 +#: ../../c-api/unicode.rst:1240 msgid "" "If *consumed* is ``NULL``, behave like :c:func:`PyUnicode_DecodeUTF16`. If " "*consumed* is not ``NULL``, :c:func:`PyUnicode_DecodeUTF16Stateful` will not " @@ -1454,47 +1456,47 @@ msgid "" "*consumed*." msgstr "" -#: ../../c-api/unicode.rst:1248 +#: ../../c-api/unicode.rst:1249 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:1256 +#: ../../c-api/unicode.rst:1257 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:1266 +#: ../../c-api/unicode.rst:1267 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:1274 +#: ../../c-api/unicode.rst:1275 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:1278 +#: ../../c-api/unicode.rst:1279 msgid "UTF-7 Codecs" msgstr "" -#: ../../c-api/unicode.rst:1280 +#: ../../c-api/unicode.rst:1281 msgid "These are the UTF-7 codec APIs:" msgstr "" -#: ../../c-api/unicode.rst:1285 +#: ../../c-api/unicode.rst:1286 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:1292 +#: ../../c-api/unicode.rst:1293 msgid "" "If *consumed* is ``NULL``, behave like :c:func:`PyUnicode_DecodeUTF7`. If " "*consumed* is not ``NULL``, trailing incomplete UTF-7 base-64 sections will " @@ -1502,14 +1504,14 @@ msgid "" "of bytes that have been decoded will be stored in *consumed*." msgstr "" -#: ../../c-api/unicode.rst:1301 +#: ../../c-api/unicode.rst:1302 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:1305 +#: ../../c-api/unicode.rst:1306 msgid "" "If *base64SetO* is nonzero, \"Set O\" (punctuation that has no otherwise " "special meaning) will be encoded in base-64. If *base64WhiteSpace* is " @@ -1517,152 +1519,152 @@ msgid "" "the Python \"utf-7\" codec." msgstr "" -#: ../../c-api/unicode.rst:1316 +#: ../../c-api/unicode.rst:1317 msgid "Unicode-Escape Codecs" msgstr "" -#: ../../c-api/unicode.rst:1318 +#: ../../c-api/unicode.rst:1319 msgid "These are the \"Unicode Escape\" codec APIs:" msgstr "" -#: ../../c-api/unicode.rst:1324 +#: ../../c-api/unicode.rst:1325 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:1330 +#: ../../c-api/unicode.rst:1331 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:1337 +#: ../../c-api/unicode.rst:1338 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:1342 +#: ../../c-api/unicode.rst:1343 msgid "" "Part of the old-style :c:type:`Py_UNICODE` API; please migrate to using :c:" "func:`PyUnicode_AsUnicodeEscapeString`." msgstr "" -#: ../../c-api/unicode.rst:1346 +#: ../../c-api/unicode.rst:1347 msgid "Raw-Unicode-Escape Codecs" msgstr "" -#: ../../c-api/unicode.rst:1348 +#: ../../c-api/unicode.rst:1349 msgid "These are the \"Raw Unicode Escape\" codec APIs:" msgstr "" -#: ../../c-api/unicode.rst:1354 +#: ../../c-api/unicode.rst:1355 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:1360 +#: ../../c-api/unicode.rst:1361 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:1368 +#: ../../c-api/unicode.rst:1369 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:1374 +#: ../../c-api/unicode.rst:1375 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:1378 +#: ../../c-api/unicode.rst:1379 msgid "Latin-1 Codecs" msgstr "" -#: ../../c-api/unicode.rst:1380 +#: ../../c-api/unicode.rst:1381 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:1386 +#: ../../c-api/unicode.rst:1387 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:1392 +#: ../../c-api/unicode.rst:1393 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:1399 +#: ../../c-api/unicode.rst:1400 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:1406 +#: ../../c-api/unicode.rst:1407 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:1410 +#: ../../c-api/unicode.rst:1411 msgid "ASCII Codecs" msgstr "" -#: ../../c-api/unicode.rst:1412 +#: ../../c-api/unicode.rst:1413 msgid "" "These are the ASCII codec APIs. Only 7-bit ASCII data is accepted. All " "other codes generate errors." msgstr "" -#: ../../c-api/unicode.rst:1418 +#: ../../c-api/unicode.rst:1419 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:1424 +#: ../../c-api/unicode.rst:1425 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:1431 +#: ../../c-api/unicode.rst:1432 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:1438 +#: ../../c-api/unicode.rst:1439 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:1442 +#: ../../c-api/unicode.rst:1443 msgid "Character Map Codecs" msgstr "" -#: ../../c-api/unicode.rst:1444 +#: ../../c-api/unicode.rst:1445 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 " @@ -1672,18 +1674,18 @@ msgid "" "well." msgstr "" -#: ../../c-api/unicode.rst:1450 +#: ../../c-api/unicode.rst:1451 msgid "These are the mapping codec APIs:" msgstr "" -#: ../../c-api/unicode.rst:1455 +#: ../../c-api/unicode.rst:1456 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:1459 +#: ../../c-api/unicode.rst:1460 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 " @@ -1693,14 +1695,14 @@ msgid "" "treated as undefined mappings and cause an error." msgstr "" -#: ../../c-api/unicode.rst:1470 +#: ../../c-api/unicode.rst:1471 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:1474 +#: ../../c-api/unicode.rst:1475 msgid "" "The *mapping* object must map Unicode ordinal integers to bytes objects, " "integers in the range from 0 to 255 or ``None``. Unmapped character " @@ -1708,68 +1710,68 @@ msgid "" "``None`` are treated as \"undefined mapping\" and cause an error." msgstr "" -#: ../../c-api/unicode.rst:1483 +#: ../../c-api/unicode.rst:1484 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:1490 +#: ../../c-api/unicode.rst:1491 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:1493 +#: ../../c-api/unicode.rst:1494 msgid "The following codec API is special in that maps Unicode to Unicode." msgstr "" -#: ../../c-api/unicode.rst:1497 +#: ../../c-api/unicode.rst:1498 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:1501 +#: ../../c-api/unicode.rst:1502 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:1504 +#: ../../c-api/unicode.rst:1505 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:1508 +#: ../../c-api/unicode.rst:1509 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:1515 +#: ../../c-api/unicode.rst:1516 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:1522 +#: ../../c-api/unicode.rst:1523 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:1526 +#: ../../c-api/unicode.rst:1527 msgid "MBCS codecs for Windows" msgstr "" -#: ../../c-api/unicode.rst:1528 +#: ../../c-api/unicode.rst:1529 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 " @@ -1777,13 +1779,13 @@ msgid "" "is defined by the user settings on the machine running the codec." msgstr "" -#: ../../c-api/unicode.rst:1535 +#: ../../c-api/unicode.rst:1536 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:1542 +#: ../../c-api/unicode.rst:1543 msgid "" "If *consumed* is ``NULL``, behave like :c:func:`PyUnicode_DecodeMBCS`. If " "*consumed* is not ``NULL``, :c:func:`PyUnicode_DecodeMBCSStateful` will not " @@ -1791,58 +1793,58 @@ msgid "" "will be stored in *consumed*." msgstr "" -#: ../../c-api/unicode.rst:1550 +#: ../../c-api/unicode.rst:1551 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:1557 +#: ../../c-api/unicode.rst:1558 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:1566 +#: ../../c-api/unicode.rst:1567 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:1573 +#: ../../c-api/unicode.rst:1574 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:1577 +#: ../../c-api/unicode.rst:1578 msgid "Methods & Slots" msgstr "" -#: ../../c-api/unicode.rst:1583 +#: ../../c-api/unicode.rst:1584 msgid "Methods and Slot Functions" msgstr "" -#: ../../c-api/unicode.rst:1585 +#: ../../c-api/unicode.rst:1586 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:1589 +#: ../../c-api/unicode.rst:1590 msgid "They all return ``NULL`` or ``-1`` if an exception occurs." msgstr "" -#: ../../c-api/unicode.rst:1594 +#: ../../c-api/unicode.rst:1595 msgid "Concat two strings giving a new Unicode string." msgstr "" -#: ../../c-api/unicode.rst:1599 +#: ../../c-api/unicode.rst:1600 msgid "" "Split a string giving a list of Unicode strings. If *sep* is ``NULL``, " "splitting will be done at all whitespace substrings. Otherwise, splits " @@ -1851,27 +1853,27 @@ msgid "" "list." msgstr "" -#: ../../c-api/unicode.rst:1607 +#: ../../c-api/unicode.rst:1608 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:1614 +#: ../../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:1621 +#: ../../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:1629 +#: ../../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* " @@ -1880,7 +1882,7 @@ msgid "" "indicates that an error occurred and an exception has been set." msgstr "" -#: ../../c-api/unicode.rst:1639 +#: ../../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, " @@ -1889,36 +1891,36 @@ msgid "" "``-2`` indicates that an error occurred and an exception has been set." msgstr "" -#: ../../c-api/unicode.rst:1647 +#: ../../c-api/unicode.rst:1648 msgid "*start* and *end* are now adjusted to behave like ``str[start:end]``." msgstr "" -#: ../../c-api/unicode.rst:1654 +#: ../../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:1661 +#: ../../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:1668 +#: ../../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:1671 +#: ../../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:1677 +#: ../../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 " @@ -1926,51 +1928,51 @@ msgid "" "string as ISO-8859-1 if it contains non-ASCII characters." msgstr "" -#: ../../c-api/unicode.rst:1682 +#: ../../c-api/unicode.rst:1683 msgid "This function does not raise exceptions." msgstr "" -#: ../../c-api/unicode.rst:1687 +#: ../../c-api/unicode.rst:1688 msgid "Rich compare two Unicode strings and return one of the following:" msgstr "" -#: ../../c-api/unicode.rst:1689 +#: ../../c-api/unicode.rst:1690 msgid "``NULL`` in case an exception was raised" msgstr "" -#: ../../c-api/unicode.rst:1690 +#: ../../c-api/unicode.rst:1691 msgid ":const:`Py_True` or :const:`Py_False` for successful comparisons" msgstr "" -#: ../../c-api/unicode.rst:1691 +#: ../../c-api/unicode.rst:1692 msgid ":const:`Py_NotImplemented` in case the type combination is unknown" msgstr "" -#: ../../c-api/unicode.rst:1693 +#: ../../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:1699 +#: ../../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:1705 +#: ../../c-api/unicode.rst:1706 msgid "" "Check whether *element* is contained in *container* and return true or false " "accordingly." msgstr "" -#: ../../c-api/unicode.rst:1708 +#: ../../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:1714 +#: ../../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 " @@ -1983,7 +1985,7 @@ msgid "" "the object after the call if and only if you owned it before the call.)" msgstr "" -#: ../../c-api/unicode.rst:1727 +#: ../../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/extending/windows.po b/extending/windows.po index d945978576..fdbe8edba2 100644 --- a/extending/windows.po +++ b/extending/windows.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.10\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2018-06-26 18:54+0800\n" +"POT-Creation-Date: 2022-05-21 17:35+0000\n" "PO-Revision-Date: 2015-12-09 17:51+0000\n" "Last-Translator: Liang-Bo Wang \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -147,18 +147,17 @@ msgstr "" #: ../../extending/windows.rst:108 msgid "" "Windows Python is built in Microsoft Visual C++; using other compilers may " -"or may not work (though Borland seems to). The rest of this section is MSVC+" -"+ specific." +"or may not work. The rest of this section is MSVC++ specific." msgstr "" -#: ../../extending/windows.rst:112 +#: ../../extending/windows.rst:111 msgid "" "When creating DLLs in Windows, you must pass :file:`pythonXY.lib` to the " "linker. To build two DLLs, spam and ni (which uses C functions found in " "spam), you could use these commands::" msgstr "" -#: ../../extending/windows.rst:119 +#: ../../extending/windows.rst:118 msgid "" "The first command created three files: :file:`spam.obj`, :file:`spam.dll` " "and :file:`spam.lib`. :file:`Spam.dll` does not contain any Python " @@ -166,14 +165,14 @@ msgid "" "the Python code thanks to :file:`pythonXY.lib`." msgstr "" -#: ../../extending/windows.rst:124 +#: ../../extending/windows.rst:123 msgid "" "The second command created :file:`ni.dll` (and :file:`.obj` and :file:`." "lib`), which knows how to find the necessary functions from spam, and also " "from the Python executable." msgstr "" -#: ../../extending/windows.rst:128 +#: ../../extending/windows.rst:127 msgid "" "Not every identifier is exported to the lookup table. If you want any other " "modules (including Python) to be able to see your identifiers, you have to " @@ -181,7 +180,7 @@ msgid "" "initspam(void)`` or ``PyObject _declspec(dllexport) *NiGetSpamData(void)``." msgstr "" -#: ../../extending/windows.rst:133 +#: ../../extending/windows.rst:132 msgid "" "Developer Studio will throw in a lot of import libraries that you do not " "really need, adding about 100K to your executable. To get rid of them, use " diff --git a/faq/library.po b/faq/library.po index ed03e883e8..fd23a0ff16 100644 --- a/faq/library.po +++ b/faq/library.po @@ -9,7 +9,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.10\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2021-11-21 00:09+0000\n" +"POT-Creation-Date: 2022-05-21 17:35+0000\n" "PO-Revision-Date: 2018-05-23 14:35+0000\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -93,8 +93,8 @@ msgid "" "first line must begin with ``#!`` followed by the path of the Python " "interpreter." msgstr "" -"你需要作兩件事:腳本程式必須可以被執行而且第一行必須\"#!\"開頭後面接上 Python " -"直譯器的路徑" +"你需要作兩件事:腳本程式必須可以被執行而且第一行必須\"#!\"開頭後面接上 " +"Python 直譯器的路徑" #: ../../faq/library.rst:53 msgid "" @@ -164,58 +164,52 @@ msgid "" "category." msgstr "" -#: ../../faq/library.rst:109 -msgid "" -"For Windows: use `the consolelib module `_." -msgstr "" - -#: ../../faq/library.rst:114 +#: ../../faq/library.rst:111 msgid "Is there an equivalent to C's onexit() in Python?" msgstr "" -#: ../../faq/library.rst:116 +#: ../../faq/library.rst:113 msgid "" "The :mod:`atexit` module provides a register function that is similar to " "C's :c:func:`onexit`." msgstr "" -#: ../../faq/library.rst:121 +#: ../../faq/library.rst:118 msgid "Why don't my signal handlers work?" msgstr "" -#: ../../faq/library.rst:123 +#: ../../faq/library.rst:120 msgid "" "The most common problem is that the signal handler is declared with the " "wrong argument list. It is called as ::" msgstr "" -#: ../../faq/library.rst:128 +#: ../../faq/library.rst:125 msgid "so it should be declared with two parameters::" msgstr "" -#: ../../faq/library.rst:135 +#: ../../faq/library.rst:132 msgid "Common tasks" msgstr "一般性的工作" -#: ../../faq/library.rst:138 +#: ../../faq/library.rst:135 msgid "How do I test a Python program or component?" msgstr "我如何測試Python程式" -#: ../../faq/library.rst:140 +#: ../../faq/library.rst:137 msgid "" "Python comes with two testing frameworks. The :mod:`doctest` module finds " "examples in the docstrings for a module and runs them, comparing the output " "with the expected output given in the docstring." msgstr "" -#: ../../faq/library.rst:144 +#: ../../faq/library.rst:141 msgid "" "The :mod:`unittest` module is a fancier testing framework modelled on Java " "and Smalltalk testing frameworks." msgstr "" -#: ../../faq/library.rst:147 +#: ../../faq/library.rst:144 msgid "" "To make testing easier, you should use good modular design in your program. " "Your program should have almost all functionality encapsulated in either " @@ -226,15 +220,15 @@ msgid "" "more difficult to do." msgstr "" -#: ../../faq/library.rst:155 +#: ../../faq/library.rst:152 msgid "The \"global main logic\" of your program may be as simple as ::" msgstr "" -#: ../../faq/library.rst:160 +#: ../../faq/library.rst:157 msgid "at the bottom of the main module of your program." msgstr "在你的程式主模組的底端" -#: ../../faq/library.rst:162 +#: ../../faq/library.rst:159 msgid "" "Once your program is organized as a tractable collection of function and " "class behaviours, you should write test functions that exercise the " @@ -246,24 +240,24 @@ msgid "" "design flaws earlier." msgstr "" -#: ../../faq/library.rst:170 +#: ../../faq/library.rst:167 msgid "" "\"Support modules\" that are not intended to be the main module of a program " "may include a self-test of the module. ::" msgstr "" -#: ../../faq/library.rst:176 +#: ../../faq/library.rst:173 msgid "" "Even programs that interact with complex external interfaces may be tested " "when the external interfaces are unavailable by using \"fake\" interfaces " "implemented in Python." msgstr "" -#: ../../faq/library.rst:182 +#: ../../faq/library.rst:179 msgid "How do I create documentation from doc strings?" msgstr "" -#: ../../faq/library.rst:184 +#: ../../faq/library.rst:181 msgid "" "The :mod:`pydoc` module can create HTML from the doc strings in your Python " "source code. An alternative for creating API documentation purely from " @@ -271,59 +265,59 @@ msgid "" "sphinx-doc.org>`_ can also include docstring content." msgstr "" -#: ../../faq/library.rst:191 +#: ../../faq/library.rst:188 msgid "How do I get a single keypress at a time?" msgstr "" -#: ../../faq/library.rst:193 +#: ../../faq/library.rst:190 msgid "" "For Unix variants there are several solutions. It's straightforward to do " "this using curses, but curses is a fairly large module to learn." msgstr "" -#: ../../faq/library.rst:237 +#: ../../faq/library.rst:234 msgid "Threads" msgstr "" -#: ../../faq/library.rst:240 +#: ../../faq/library.rst:237 msgid "How do I program using threads?" msgstr "" -#: ../../faq/library.rst:242 +#: ../../faq/library.rst:239 msgid "" "Be sure to use the :mod:`threading` module and not the :mod:`_thread` " "module. The :mod:`threading` module builds convenient abstractions on top of " "the low-level primitives provided by the :mod:`_thread` module." msgstr "" -#: ../../faq/library.rst:248 +#: ../../faq/library.rst:245 msgid "None of my threads seem to run: why?" msgstr "" -#: ../../faq/library.rst:250 +#: ../../faq/library.rst:247 msgid "" "As soon as the main thread exits, all threads are killed. Your main thread " "is running too quickly, giving the threads no time to do any work." msgstr "" -#: ../../faq/library.rst:253 +#: ../../faq/library.rst:250 msgid "" "A simple fix is to add a sleep to the end of the program that's long enough " "for all the threads to finish::" msgstr "" -#: ../../faq/library.rst:268 +#: ../../faq/library.rst:265 msgid "" "But now (on many platforms) the threads don't run in parallel, but appear to " "run sequentially, one at a time! The reason is that the OS thread scheduler " "doesn't start a new thread until the previous thread is blocked." msgstr "" -#: ../../faq/library.rst:272 +#: ../../faq/library.rst:269 msgid "A simple fix is to add a tiny sleep to the start of the run function::" msgstr "" -#: ../../faq/library.rst:285 +#: ../../faq/library.rst:282 msgid "" "Instead of trying to guess a good delay value for :func:`time.sleep`, it's " "better to use some kind of semaphore mechanism. One idea is to use the :mod:" @@ -332,17 +326,17 @@ msgid "" "the queue as there are threads." msgstr "" -#: ../../faq/library.rst:293 +#: ../../faq/library.rst:290 msgid "How do I parcel out work among a bunch of worker threads?" msgstr "" -#: ../../faq/library.rst:295 +#: ../../faq/library.rst:292 msgid "" "The easiest way is to use the :mod:`concurrent.futures` module, especially " "the :mod:`~concurrent.futures.ThreadPoolExecutor` class." msgstr "" -#: ../../faq/library.rst:298 +#: ../../faq/library.rst:295 msgid "" "Or, if you want fine control over the dispatching algorithm, you can write " "your own logic manually. Use the :mod:`queue` module to create a queue " @@ -352,25 +346,25 @@ msgid "" "necessary to ensure that each job is handed out exactly once." msgstr "" -#: ../../faq/library.rst:305 +#: ../../faq/library.rst:302 msgid "Here's a trivial example::" msgstr "" -#: ../../faq/library.rst:343 +#: ../../faq/library.rst:340 msgid "When run, this will produce the following output:" msgstr "" -#: ../../faq/library.rst:361 +#: ../../faq/library.rst:358 msgid "" "Consult the module's documentation for more details; the :class:`~queue." "Queue` class provides a featureful interface." msgstr "" -#: ../../faq/library.rst:366 +#: ../../faq/library.rst:363 msgid "What kinds of global value mutation are thread-safe?" msgstr "" -#: ../../faq/library.rst:368 +#: ../../faq/library.rst:365 msgid "" "A :term:`global interpreter lock` (GIL) is used internally to ensure that " "only one thread runs in the Python VM at a time. In general, Python offers " @@ -380,7 +374,7 @@ msgid "" "instruction is therefore atomic from the point of view of a Python program." msgstr "" -#: ../../faq/library.rst:375 +#: ../../faq/library.rst:372 msgid "" "In theory, this means an exact accounting requires an exact understanding of " "the PVM bytecode implementation. In practice, it means that operations on " @@ -388,17 +382,17 @@ msgid "" "\"look atomic\" really are." msgstr "" -#: ../../faq/library.rst:380 +#: ../../faq/library.rst:377 msgid "" "For example, the following operations are all atomic (L, L1, L2 are lists, " "D, D1, D2 are dicts, x, y are objects, i, j are ints)::" msgstr "" -#: ../../faq/library.rst:395 +#: ../../faq/library.rst:392 msgid "These aren't::" msgstr "" -#: ../../faq/library.rst:402 +#: ../../faq/library.rst:399 msgid "" "Operations that replace other objects may invoke those other objects' :meth:" "`__del__` method when their reference count reaches zero, and that can " @@ -406,11 +400,11 @@ msgid "" "and lists. When in doubt, use a mutex!" msgstr "" -#: ../../faq/library.rst:409 +#: ../../faq/library.rst:406 msgid "Can't we get rid of the Global Interpreter Lock?" msgstr "" -#: ../../faq/library.rst:413 +#: ../../faq/library.rst:410 msgid "" "The :term:`global interpreter lock` (GIL) is often seen as a hindrance to " "Python's deployment on high-end multiprocessor server machines, because a " @@ -418,7 +412,7 @@ msgid "" "insistence that (almost) all Python code can only run while the GIL is held." msgstr "" -#: ../../faq/library.rst:418 +#: ../../faq/library.rst:415 msgid "" "Back in the days of Python 1.5, Greg Stein actually implemented a " "comprehensive patch set (the \"free threading\" patches) that removed the " @@ -430,7 +424,7 @@ msgid "" "removal of the GIL." msgstr "" -#: ../../faq/library.rst:426 +#: ../../faq/library.rst:423 msgid "" "This doesn't mean that you can't make good use of Python on multi-CPU " "machines! You just have to be creative with dividing the work up between " @@ -441,7 +435,7 @@ msgid "" "dispatching of tasks." msgstr "" -#: ../../faq/library.rst:434 +#: ../../faq/library.rst:431 msgid "" "Judicious use of C extensions will also help; if you use a C extension to " "perform a time-consuming task, the extension can release the GIL while the " @@ -450,7 +444,7 @@ msgid "" "`hashlib` already do this." msgstr "" -#: ../../faq/library.rst:440 +#: ../../faq/library.rst:437 msgid "" "It has been suggested that the GIL should be a per-interpreter-state lock " "rather than truly global; interpreters then wouldn't be able to share " @@ -462,7 +456,7 @@ msgid "" "the interpreter state. And so on." msgstr "" -#: ../../faq/library.rst:449 +#: ../../faq/library.rst:446 msgid "" "And I doubt that it can even be done in finite time, because the same " "problem exists for 3rd party extensions. It is likely that 3rd party " @@ -470,28 +464,28 @@ msgid "" "store all their global state in the interpreter state." msgstr "" -#: ../../faq/library.rst:454 +#: ../../faq/library.rst:451 msgid "" "And finally, once you have multiple interpreters not sharing any state, what " "have you gained over running each interpreter in a separate process?" msgstr "" -#: ../../faq/library.rst:459 +#: ../../faq/library.rst:456 msgid "Input and Output" msgstr "" -#: ../../faq/library.rst:462 +#: ../../faq/library.rst:459 msgid "How do I delete a file? (And other file questions...)" msgstr "" -#: ../../faq/library.rst:464 +#: ../../faq/library.rst:461 msgid "" "Use ``os.remove(filename)`` or ``os.unlink(filename)``; for documentation, " "see the :mod:`os` module. The two functions are identical; :func:`~os." "unlink` is simply the name of the Unix system call for this function." msgstr "" -#: ../../faq/library.rst:468 +#: ../../faq/library.rst:465 msgid "" "To remove a directory, use :func:`os.rmdir`; use :func:`os.mkdir` to create " "one. ``os.makedirs(path)`` will create any intermediate directories in " @@ -500,11 +494,11 @@ msgid "" "directory tree and its contents, use :func:`shutil.rmtree`." msgstr "" -#: ../../faq/library.rst:474 +#: ../../faq/library.rst:471 msgid "To rename a file, use ``os.rename(old_path, new_path)``." msgstr "" -#: ../../faq/library.rst:476 +#: ../../faq/library.rst:473 msgid "" "To truncate a file, open it using ``f = open(filename, \"rb+\")``, and use " "``f.truncate(offset)``; offset defaults to the current seek position. " @@ -512,54 +506,54 @@ msgid "" "open`, where *fd* is the file descriptor (a small integer)." msgstr "" -#: ../../faq/library.rst:481 +#: ../../faq/library.rst:478 msgid "" "The :mod:`shutil` module also contains a number of functions to work on " "files including :func:`~shutil.copyfile`, :func:`~shutil.copytree`, and :" "func:`~shutil.rmtree`." msgstr "" -#: ../../faq/library.rst:487 +#: ../../faq/library.rst:484 msgid "How do I copy a file?" msgstr "" -#: ../../faq/library.rst:489 +#: ../../faq/library.rst:486 msgid "" "The :mod:`shutil` module contains a :func:`~shutil.copyfile` function. Note " "that on MacOS 9 it doesn't copy the resource fork and Finder info." msgstr "" -#: ../../faq/library.rst:494 +#: ../../faq/library.rst:491 msgid "How do I read (or write) binary data?" msgstr "" -#: ../../faq/library.rst:496 +#: ../../faq/library.rst:493 msgid "" "To read or write complex binary data formats, it's best to use the :mod:" "`struct` module. It allows you to take a string containing binary data " "(usually numbers) and convert it to Python objects; and vice versa." msgstr "" -#: ../../faq/library.rst:500 +#: ../../faq/library.rst:497 msgid "" "For example, the following code reads two 2-byte integers and one 4-byte " "integer in big-endian format from a file::" msgstr "" -#: ../../faq/library.rst:509 +#: ../../faq/library.rst:506 msgid "" "The '>' in the format string forces big-endian data; the letter 'h' reads " "one \"short integer\" (2 bytes), and 'l' reads one \"long integer\" (4 " "bytes) from the string." msgstr "" -#: ../../faq/library.rst:513 +#: ../../faq/library.rst:510 msgid "" "For data that is more regular (e.g. a homogeneous list of ints or floats), " "you can also use the :mod:`array` module." msgstr "" -#: ../../faq/library.rst:518 +#: ../../faq/library.rst:515 msgid "" "To read and write binary data, it is mandatory to open the file in binary " "mode (here, passing ``\"rb\"`` to :func:`open`). If you use ``\"r\"`` " @@ -567,11 +561,11 @@ msgid "" "will return :class:`str` objects rather than :class:`bytes` objects." msgstr "" -#: ../../faq/library.rst:526 +#: ../../faq/library.rst:523 msgid "I can't seem to use os.read() on a pipe created with os.popen(); why?" msgstr "" -#: ../../faq/library.rst:528 +#: ../../faq/library.rst:525 msgid "" ":func:`os.read` is a low-level function which takes a file descriptor, a " "small integer representing the opened file. :func:`os.popen` creates a high-" @@ -580,37 +574,37 @@ msgid "" "popen`, you need to use ``p.read(n)``." msgstr "" -#: ../../faq/library.rst:615 +#: ../../faq/library.rst:612 msgid "How do I access the serial (RS232) port?" msgstr "" -#: ../../faq/library.rst:617 +#: ../../faq/library.rst:614 msgid "For Win32, OSX, Linux, BSD, Jython, IronPython:" msgstr "" -#: ../../faq/library.rst:619 +#: ../../faq/library.rst:616 msgid "https://pypi.org/project/pyserial/" msgstr "https://pypi.org/project/pyserial/" -#: ../../faq/library.rst:621 +#: ../../faq/library.rst:618 msgid "For Unix, see a Usenet post by Mitch Chapman:" msgstr "" -#: ../../faq/library.rst:623 +#: ../../faq/library.rst:620 msgid "https://groups.google.com/groups?selm=34A04430.CF9@ohioee.com" msgstr "https://groups.google.com/groups?selm=34A04430.CF9@ohioee.com" -#: ../../faq/library.rst:627 +#: ../../faq/library.rst:624 msgid "Why doesn't closing sys.stdout (stdin, stderr) really close it?" msgstr "" -#: ../../faq/library.rst:629 +#: ../../faq/library.rst:626 msgid "" "Python :term:`file objects ` are a high-level layer of " "abstraction on low-level C file descriptors." msgstr "" -#: ../../faq/library.rst:632 +#: ../../faq/library.rst:629 msgid "" "For most file objects you create in Python via the built-in :func:`open` " "function, ``f.close()`` marks the Python file object as being closed from " @@ -619,7 +613,7 @@ msgid "" "``f`` becomes garbage." msgstr "" -#: ../../faq/library.rst:638 +#: ../../faq/library.rst:635 msgid "" "But stdin, stdout and stderr are treated specially by Python, because of the " "special status also given to them by C. Running ``sys.stdout.close()`` " @@ -627,94 +621,94 @@ msgid "" "associated C file descriptor." msgstr "" -#: ../../faq/library.rst:643 +#: ../../faq/library.rst:640 msgid "" "To close the underlying C file descriptor for one of these three, you should " "first be sure that's what you really want to do (e.g., you may confuse " "extension modules trying to do I/O). If it is, use :func:`os.close`::" msgstr "" -#: ../../faq/library.rst:651 +#: ../../faq/library.rst:648 msgid "Or you can use the numeric constants 0, 1 and 2, respectively." msgstr "" -#: ../../faq/library.rst:655 +#: ../../faq/library.rst:652 msgid "Network/Internet Programming" msgstr "" -#: ../../faq/library.rst:658 +#: ../../faq/library.rst:655 msgid "What WWW tools are there for Python?" msgstr "" -#: ../../faq/library.rst:660 +#: ../../faq/library.rst:657 msgid "" "See the chapters titled :ref:`internet` and :ref:`netdata` in the Library " "Reference Manual. Python has many modules that will help you build server-" "side and client-side web systems." msgstr "" -#: ../../faq/library.rst:666 +#: ../../faq/library.rst:663 msgid "" "A summary of available frameworks is maintained by Paul Boddie at https://" "wiki.python.org/moin/WebProgramming\\ ." msgstr "" -#: ../../faq/library.rst:669 +#: ../../faq/library.rst:666 msgid "" "Cameron Laird maintains a useful set of pages about Python web technologies " "at http://phaseit.net/claird/comp.lang.python/web_python." msgstr "" -#: ../../faq/library.rst:674 +#: ../../faq/library.rst:671 msgid "How can I mimic CGI form submission (METHOD=POST)?" msgstr "" -#: ../../faq/library.rst:676 +#: ../../faq/library.rst:673 msgid "" "I would like to retrieve web pages that are the result of POSTing a form. Is " "there existing code that would let me do this easily?" msgstr "" -#: ../../faq/library.rst:679 +#: ../../faq/library.rst:676 msgid "Yes. Here's a simple example that uses :mod:`urllib.request`::" msgstr "" -#: ../../faq/library.rst:694 +#: ../../faq/library.rst:691 msgid "" "Note that in general for percent-encoded POST operations, query strings must " "be quoted using :func:`urllib.parse.urlencode`. For example, to send " "``name=Guy Steele, Jr.``::" msgstr "" -#: ../../faq/library.rst:702 +#: ../../faq/library.rst:699 msgid ":ref:`urllib-howto` for extensive examples." msgstr "" -#: ../../faq/library.rst:706 +#: ../../faq/library.rst:703 msgid "What module should I use to help with generating HTML?" msgstr "" -#: ../../faq/library.rst:710 +#: ../../faq/library.rst:707 msgid "" "You can find a collection of useful links on the `Web Programming wiki page " "`_." msgstr "" -#: ../../faq/library.rst:715 +#: ../../faq/library.rst:712 msgid "How do I send mail from a Python script?" msgstr "" -#: ../../faq/library.rst:717 +#: ../../faq/library.rst:714 msgid "Use the standard library module :mod:`smtplib`." msgstr "" -#: ../../faq/library.rst:719 +#: ../../faq/library.rst:716 msgid "" "Here's a very simple interactive mail sender that uses it. This method will " "work on any host that supports an SMTP listener. ::" msgstr "" -#: ../../faq/library.rst:739 +#: ../../faq/library.rst:736 msgid "" "A Unix-only alternative uses sendmail. The location of the sendmail program " "varies between systems; sometimes it is ``/usr/lib/sendmail``, sometimes ``/" @@ -722,17 +716,17 @@ msgid "" "some sample code::" msgstr "" -#: ../../faq/library.rst:759 +#: ../../faq/library.rst:756 msgid "How do I avoid blocking in the connect() method of a socket?" msgstr "" -#: ../../faq/library.rst:761 +#: ../../faq/library.rst:758 msgid "" "The :mod:`select` module is commonly used to help with asynchronous I/O on " "sockets." msgstr "" -#: ../../faq/library.rst:764 +#: ../../faq/library.rst:761 msgid "" "To prevent the TCP connect from blocking, you can set the socket to non-" "blocking mode. Then when you do the :meth:`socket.connect`, you will either " @@ -742,7 +736,7 @@ msgid "" "values, so you're going to have to check what's returned on your system." msgstr "" -#: ../../faq/library.rst:771 +#: ../../faq/library.rst:768 msgid "" "You can use the :meth:`socket.connect_ex` method to avoid creating an " "exception. It will just return the errno value. To poll, you can call :" @@ -751,7 +745,7 @@ msgid "" "select` to check if it's writable." msgstr "" -#: ../../faq/library.rst:777 +#: ../../faq/library.rst:774 msgid "" "The :mod:`asyncio` module provides a general purpose single-threaded and " "concurrent asynchronous library, which can be used for writing non-blocking " @@ -759,19 +753,19 @@ msgid "" "library is a popular and feature-rich alternative." msgstr "" -#: ../../faq/library.rst:785 +#: ../../faq/library.rst:782 msgid "Databases" msgstr "" -#: ../../faq/library.rst:788 +#: ../../faq/library.rst:785 msgid "Are there any interfaces to database packages in Python?" msgstr "" -#: ../../faq/library.rst:790 +#: ../../faq/library.rst:787 msgid "Yes." msgstr "有的" -#: ../../faq/library.rst:792 +#: ../../faq/library.rst:789 msgid "" "Interfaces to disk-based hashes such as :mod:`DBM ` and :mod:`GDBM " "` are also included with standard Python. There is also the :mod:" @@ -779,18 +773,18 @@ msgid "" "database." msgstr "" -#: ../../faq/library.rst:797 +#: ../../faq/library.rst:794 msgid "" "Support for most relational databases is available. See the " "`DatabaseProgramming wiki page `_ for details." msgstr "" -#: ../../faq/library.rst:803 +#: ../../faq/library.rst:800 msgid "How do you implement persistent objects in Python?" msgstr "" -#: ../../faq/library.rst:805 +#: ../../faq/library.rst:802 msgid "" "The :mod:`pickle` library module solves this in a very general way (though " "you still can't store things like open files, sockets or windows), and the :" @@ -798,55 +792,55 @@ msgid "" "mappings containing arbitrary Python objects." msgstr "" -#: ../../faq/library.rst:812 +#: ../../faq/library.rst:809 msgid "Mathematics and Numerics" msgstr "" -#: ../../faq/library.rst:815 +#: ../../faq/library.rst:812 msgid "How do I generate random numbers in Python?" msgstr "" -#: ../../faq/library.rst:817 +#: ../../faq/library.rst:814 msgid "" "The standard module :mod:`random` implements a random number generator. " "Usage is simple::" msgstr "" -#: ../../faq/library.rst:823 +#: ../../faq/library.rst:820 msgid "This returns a random floating point number in the range [0, 1)." msgstr "" -#: ../../faq/library.rst:825 +#: ../../faq/library.rst:822 msgid "" "There are also many other specialized generators in this module, such as:" msgstr "" -#: ../../faq/library.rst:827 +#: ../../faq/library.rst:824 msgid "``randrange(a, b)`` chooses an integer in the range [a, b)." msgstr "" -#: ../../faq/library.rst:828 +#: ../../faq/library.rst:825 msgid "``uniform(a, b)`` chooses a floating point number in the range [a, b)." msgstr "" -#: ../../faq/library.rst:829 +#: ../../faq/library.rst:826 msgid "" "``normalvariate(mean, sdev)`` samples the normal (Gaussian) distribution." msgstr "" -#: ../../faq/library.rst:831 +#: ../../faq/library.rst:828 msgid "Some higher-level functions operate on sequences directly, such as:" msgstr "" -#: ../../faq/library.rst:833 +#: ../../faq/library.rst:830 msgid "``choice(S)`` chooses a random element from a given sequence." msgstr "" -#: ../../faq/library.rst:834 +#: ../../faq/library.rst:831 msgid "``shuffle(L)`` shuffles a list in-place, i.e. permutes it randomly." msgstr "" -#: ../../faq/library.rst:836 +#: ../../faq/library.rst:833 msgid "" "There's also a ``Random`` class you can instantiate to create independent " "multiple random number generators." diff --git a/faq/programming.po b/faq/programming.po index 57d97128f1..c8ad748795 100644 --- a/faq/programming.po +++ b/faq/programming.po @@ -10,7 +10,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.10\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2022-02-15 00:10+0000\n" +"POT-Creation-Date: 2022-05-21 17:35+0000\n" "PO-Revision-Date: 2018-05-23 14:35+0000\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -143,9 +143,9 @@ msgstr "" #: ../../faq/programming.rst:80 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 " -"you can embed all your modules into a new program, which is then linked with " -"the standard Python modules." +"as ``Tools/freeze``. It converts Python byte code to C arrays; with a C " +"compiler you can embed all your modules into a new program, which is then " +"linked with the standard Python modules." msgstr "" #: ../../faq/programming.rst:85 diff --git a/faq/windows.po b/faq/windows.po index 74ed06ffbd..681ae0acbc 100644 --- a/faq/windows.po +++ b/faq/windows.po @@ -9,7 +9,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.10\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2021-09-13 00:11+0000\n" +"POT-Creation-Date: 2022-05-21 17:35+0000\n" "PO-Revision-Date: 2018-05-23 14:35+0000\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -44,11 +44,11 @@ msgstr "" #: ../../faq/windows.rst:28 msgid "" "Unless you use some sort of integrated development environment, you will end " -"up *typing* Windows commands into what is variously referred to as a \"DOS " -"window\" or \"Command prompt window\". Usually you can create such a window " -"from your search bar by searching for ``cmd``. You should be able to " -"recognize when you have started such a window because you will see a Windows " -"\"command prompt\", which usually looks like this:" +"up *typing* Windows commands into what is referred to as a \"Command prompt " +"window\". Usually you can create such a window from your search bar by " +"searching for ``cmd``. You should be able to recognize when you have " +"started such a window because you will see a Windows \"command prompt\", " +"which usually looks like this:" msgstr "" #: ../../faq/windows.rst:39 @@ -238,13 +238,7 @@ msgid "" "API." msgstr "" -#: ../../faq/windows.rst:189 -msgid "" -"Borland note: convert :file:`python{NN}.lib` to OMF format using Coff2Omf." -"exe first." -msgstr "" - -#: ../../faq/windows.rst:194 +#: ../../faq/windows.rst:191 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 +247,7 @@ msgid "" "this also simplifies linking." msgstr "" -#: ../../faq/windows.rst:200 +#: ../../faq/windows.rst:197 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 +256,26 @@ msgid "" "initializes a mostly hidden helper class used by the shadow class." msgstr "" -#: ../../faq/windows.rst:206 +#: ../../faq/windows.rst:203 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:207 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:218 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:221 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 +283,27 @@ msgid "" "implementation standpoint these are very _low_ level functions." msgstr "" -#: ../../faq/windows.rst:229 +#: ../../faq/windows.rst:226 msgid "" "Problem 2: SWIG generates the following code when generating wrappers to " "void functions:" msgstr "" -#: ../../faq/windows.rst:238 +#: ../../faq/windows.rst:235 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:243 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:247 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 +315,18 @@ msgid "" "and write() methods." msgstr "" -#: ../../faq/windows.rst:259 +#: ../../faq/windows.rst:256 msgid "How do I keep editors from inserting tabs into my Python source?" msgstr "" -#: ../../faq/windows.rst:261 +#: ../../faq/windows.rst:258 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:262 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,18 +335,18 @@ msgid "" "radio button." msgstr "" -#: ../../faq/windows.rst:270 +#: ../../faq/windows.rst:267 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:274 msgid "How do I check for a keypress without blocking?" msgstr "" -#: ../../faq/windows.rst:279 +#: ../../faq/windows.rst:276 msgid "" "Use the :mod:`msvcrt` module. This is a standard Windows-specific extension " "module. It defines a function ``kbhit()`` which checks whether a keyboard " diff --git a/glossary.po b/glossary.po index edc79977ec..ca3e9cdbed 100644 --- a/glossary.po +++ b/glossary.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.10\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2021-11-23 00:09+0000\n" +"POT-Creation-Date: 2022-05-21 17:35+0000\n" "PO-Revision-Date: 2021-11-15 11:05+0800\n" "Last-Translator: Matt Wang \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -2429,9 +2429,9 @@ msgid "" "(subscript) notation uses :class:`slice` objects internally." msgstr "" "一個物件,它通常包含一段 :term:`sequence`\\ (序列)的某一部分。建立一段切片" -"的方法是使用下標符號 (subscript notation) ``[]``\\ ,若要給出多個數字,則在" -"數字之間使用冒號,例如 ``variable_name[1:3:5]``。在括號(下標)符號的內部," -"會使用 :class:`slice` 物件。" +"的方法是使用下標符號 (subscript notation) ``[]``\\ ,若要給出多個數字,則在數" +"字之間使用冒號,例如 ``variable_name[1:3:5]``。在括號(下標)符號的內部,會使" +"用 :class:`slice` 物件。" #: ../../glossary.rst:1112 msgid "special method" @@ -2490,14 +2490,29 @@ msgid "text encoding" msgstr "text encoding(文字編碼)" #: ../../glossary.rst:1139 -msgid "A codec which encodes Unicode strings to bytes." -msgstr "將 Unicode 字串編碼為位元組的一個編解碼器 (codec)。" +msgid "" +"A string in Python is a sequence of Unicode code points (in range ``U" +"+0000``--``U+10FFFF``). To store or transfer a string, it needs to be " +"serialized as a sequence of bytes." +msgstr "" + +#: ../../glossary.rst:1143 +msgid "" +"Serializing a string into a sequence of bytes is known as \"encoding\", and " +"recreating the string from the sequence of bytes is known as \"decoding\"." +msgstr "" + +#: ../../glossary.rst:1146 +msgid "" +"There are a variety of different text serialization :ref:`codecs `, which are collectively referred to as \"text encodings\"." +msgstr "" -#: ../../glossary.rst:1140 +#: ../../glossary.rst:1149 msgid "text file" msgstr "text file(文字檔案)" -#: ../../glossary.rst:1142 +#: ../../glossary.rst:1151 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:" @@ -2511,7 +2526,7 @@ msgstr "" "有:以文字模式(``'r'`` 或 ``'w'``)開啟的檔案、\\ :data:`sys.stdin`\\ 、\\ :" "data:`sys.stdout` 以及 :class:`io.StringIO` 的實例。" -#: ../../glossary.rst:1149 +#: ../../glossary.rst:1158 msgid "" "See also :term:`binary file` for a file object able to read and write :term:" "`bytes-like objects `." @@ -2519,11 +2534,11 @@ msgstr "" "另請參閱 :term:`binary file`\\ (二進制檔案),它是一個能夠讀取和寫入\\ :" "term:`類位元組串物件 (bytes-like object) ` 的檔案物件。" -#: ../../glossary.rst:1151 +#: ../../glossary.rst:1160 msgid "triple-quoted string" msgstr "triple-quoted string(三引號內字串)" -#: ../../glossary.rst:1153 +#: ../../glossary.rst:1162 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 " @@ -2538,11 +2553,11 @@ msgstr "" "中包含未跳脫 (unescaped) 的單引號和雙引號,而且它們不需使用連續字元 " "(continuation character) 就可以跨越多行,這使得它們在編寫說明字串時特別有用。" -#: ../../glossary.rst:1160 +#: ../../glossary.rst:1169 msgid "type" msgstr "type(型別)" -#: ../../glossary.rst:1162 +#: ../../glossary.rst:1171 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." @@ -2552,15 +2567,15 @@ msgstr "" "件的型別可以用它的 :attr:`~instance.__class__` 屬性來存取,或以 " "``type(obj)`` 來檢索。" -#: ../../glossary.rst:1166 +#: ../../glossary.rst:1175 msgid "type alias" msgstr "type alias(型別別名)" -#: ../../glossary.rst:1168 +#: ../../glossary.rst:1177 msgid "A synonym for a type, created by assigning the type to an identifier." msgstr "一個型別的同義詞,透過將型別指定給一個識別符 (identifier) 來建立。" -#: ../../glossary.rst:1170 +#: ../../glossary.rst:1179 msgid "" "Type aliases are useful for simplifying :term:`type hints `. For " "example::" @@ -2569,22 +2584,22 @@ msgstr "" "\n" "::" -#: ../../glossary.rst:1177 +#: ../../glossary.rst:1186 msgid "could be made more readable like this::" msgstr "" "可以寫成這樣,更具有可讀性:\n" "\n" "::" -#: ../../glossary.rst:1184 ../../glossary.rst:1198 +#: ../../glossary.rst:1193 ../../glossary.rst:1207 msgid "See :mod:`typing` and :pep:`484`, which describe this functionality." msgstr "請參閱 :mod:`typing` 和 :pep:`484`\\ ,有此功能的描述。" -#: ../../glossary.rst:1185 +#: ../../glossary.rst:1194 msgid "type hint" msgstr "type hint(型別提示)" -#: ../../glossary.rst:1187 +#: ../../glossary.rst:1196 msgid "" "An :term:`annotation` that specifies the expected type for a variable, a " "class attribute, or a function parameter or return value." @@ -2592,7 +2607,7 @@ msgstr "" "一種 :term:`annotation`\\ (註釋),它指定一個變數、一個 class 屬性或一個函式" "的參數或回傳值的預期型別。" -#: ../../glossary.rst:1190 +#: ../../glossary.rst:1199 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 " @@ -2601,7 +2616,7 @@ msgstr "" "型別提示是選擇性的,而不是被 Python 強制的,但它們對靜態型別分析工具很有用," "並能協助 IDE 完成程式碼的補全 (completion) 和重構 (refactoring)。" -#: ../../glossary.rst:1194 +#: ../../glossary.rst:1203 msgid "" "Type hints of global variables, class attributes, and functions, but not " "local variables, can be accessed using :func:`typing.get_type_hints`." @@ -2609,11 +2624,11 @@ msgstr "" "全域變數、class 屬性和函式(不含區域變數)的型別提示,都可以使用 :func:" "`typing.get_type_hints` 來存取。" -#: ../../glossary.rst:1199 +#: ../../glossary.rst:1208 msgid "universal newlines" msgstr "universal newlines(通用換行字元)" -#: ../../glossary.rst:1201 +#: ../../glossary.rst:1210 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 " @@ -2626,15 +2641,15 @@ msgstr "" "``'\\r'``。請參閱 :pep:`278` 和 :pep:`3116`\\ ,以及用於 :func:`bytes." "splitlines` 的附加用途。" -#: ../../glossary.rst:1206 +#: ../../glossary.rst:1215 msgid "variable annotation" msgstr "variable annotation(變數註釋)" -#: ../../glossary.rst:1208 +#: ../../glossary.rst:1217 msgid "An :term:`annotation` of a variable or a class attribute." msgstr "一個變數或 class 屬性的 :term:`annotation`\\ (註釋)。" -#: ../../glossary.rst:1210 +#: ../../glossary.rst:1219 msgid "" "When annotating a variable or a class attribute, assignment is optional::" msgstr "" @@ -2642,7 +2657,7 @@ msgstr "" "\n" "::" -#: ../../glossary.rst:1215 +#: ../../glossary.rst:1224 msgid "" "Variable annotations are usually used for :term:`type hints `: " "for example this variable is expected to take :class:`int` values::" @@ -2652,11 +2667,11 @@ msgstr "" "\n" "::" -#: ../../glossary.rst:1221 +#: ../../glossary.rst:1230 msgid "Variable annotation syntax is explained in section :ref:`annassign`." msgstr "變數註釋的語法在\\ :ref:`annassign`\\ 章節有詳細的解釋。" -#: ../../glossary.rst:1223 +#: ../../glossary.rst:1232 msgid "" "See :term:`function annotation`, :pep:`484` and :pep:`526`, which describe " "this functionality. Also see :ref:`annotations-howto` for best practices on " @@ -2666,11 +2681,11 @@ msgstr "" "`526`\\ ,皆有此功能的描述。關於註釋的最佳實踐方法,另請參閱 :ref:" "`annotations-howto`\\ 。" -#: ../../glossary.rst:1227 +#: ../../glossary.rst:1236 msgid "virtual environment" msgstr "virtual environment(虛擬環境)" -#: ../../glossary.rst:1229 +#: ../../glossary.rst:1238 msgid "" "A cooperatively isolated runtime environment that allows Python users and " "applications to install and upgrade Python distribution packages without " @@ -2681,15 +2696,15 @@ msgstr "" "程式得以安裝和升級 Python 發佈套件,而不會對同一個系統上運行的其他 Python 應" "用程式的行為產生干擾。" -#: ../../glossary.rst:1234 +#: ../../glossary.rst:1243 msgid "See also :mod:`venv`." msgstr "另請參閱 :mod:`venv`\\ 。" -#: ../../glossary.rst:1235 +#: ../../glossary.rst:1244 msgid "virtual machine" msgstr "virtual machine(虛擬機器)" -#: ../../glossary.rst:1237 +#: ../../glossary.rst:1246 msgid "" "A computer defined entirely in software. Python's virtual machine executes " "the :term:`bytecode` emitted by the bytecode compiler." @@ -2697,11 +2712,11 @@ msgstr "" "一部完全由軟體所定義的電腦 (computer)。Python 的虛擬機器會執行由 :term:" "`bytecode`\\ (位元組碼)編譯器所發出的位元組碼。" -#: ../../glossary.rst:1239 +#: ../../glossary.rst:1248 msgid "Zen of Python" msgstr "Zen of Python(Python 之禪)" -#: ../../glossary.rst:1241 +#: ../../glossary.rst:1250 msgid "" "Listing of Python design principles and philosophies that are helpful in " "understanding and using the language. The listing can be found by typing " @@ -2709,3 +2724,6 @@ msgid "" msgstr "" "Python 設計原則與哲學的列表,其內容有助於理解和使用此語言。此列表可以透過在互" "動式提式字元後輸入「``import this``」來找到它。" + +#~ msgid "A codec which encodes Unicode strings to bytes." +#~ msgstr "將 Unicode 字串編碼為位元組的一個編解碼器 (codec)。" diff --git a/howto/clinic.po b/howto/clinic.po index 88a8862ec2..95ec880a2e 100644 --- a/howto/clinic.po +++ b/howto/clinic.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.10\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2021-10-26 16:47+0000\n" +"POT-Creation-Date: 2022-05-21 17:35+0000\n" "PO-Revision-Date: 2018-05-23 14:36+0000\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -1890,9 +1890,9 @@ msgstr "" #: ../../howto/clinic.rst:1352 msgid "" "This block adds a converter to Argument Clinic named ``ssize_t``. " -"Parameters declared as ``ssize_t`` will be declared as type ``Py_ssize_t``, " -"and will be parsed by the ``'O&'`` format unit, which will call the " -"``ssize_t_converter`` converter function. ``ssize_t`` variables " +"Parameters declared as ``ssize_t`` will be declared as type :c:type:" +"`Py_ssize_t`, and will be parsed by the ``'O&'`` format unit, which will " +"call the ``ssize_t_converter`` converter function. ``ssize_t`` variables " "automatically support default values." msgstr "" diff --git a/howto/curses.po b/howto/curses.po index d90099a2c4..8128b77bc9 100644 --- a/howto/curses.po +++ b/howto/curses.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.10\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2018-06-26 18:54+0800\n" +"POT-Creation-Date: 2022-05-21 17:35+0000\n" "PO-Revision-Date: 2018-05-23 14:36+0000\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -103,17 +103,14 @@ msgstr "" msgid "" "The Windows version of Python doesn't include the :mod:`curses` module. A " "ported version called `UniCurses `_ is " -"available. You could also try `the Console module `_ written by Fredrik Lundh, which doesn't use the same " -"API as curses but provides cursor-addressable text output and full support " -"for mouse and keyboard input." +"available." msgstr "" -#: ../../howto/curses.rst:66 +#: ../../howto/curses.rst:62 msgid "The Python curses module" msgstr "" -#: ../../howto/curses.rst:68 +#: ../../howto/curses.rst:64 msgid "" "The Python module is a fairly simple wrapper over the C functions provided " "by curses; if you're already familiar with curses programming in C, it's " @@ -124,7 +121,7 @@ msgid "" "this covered in more detail later." msgstr "" -#: ../../howto/curses.rst:76 +#: ../../howto/curses.rst:72 msgid "" "This HOWTO is an introduction to writing text-mode programs with curses and " "Python. It doesn't attempt to be a complete guide to the curses API; for " @@ -132,11 +129,11 @@ msgid "" "pages for ncurses. It will, however, give you the basic ideas." msgstr "" -#: ../../howto/curses.rst:83 +#: ../../howto/curses.rst:79 msgid "Starting and ending a curses application" msgstr "" -#: ../../howto/curses.rst:85 +#: ../../howto/curses.rst:81 msgid "" "Before doing anything, curses must be initialized. This is done by calling " "the :func:`~curses.initscr` function, which will determine the terminal " @@ -146,21 +143,21 @@ msgid "" "after the name of the corresponding C variable. ::" msgstr "" -#: ../../howto/curses.rst:96 +#: ../../howto/curses.rst:92 msgid "" "Usually curses applications turn off automatic echoing of keys to the " "screen, in order to be able to read keys and only display them under certain " "circumstances. This requires calling the :func:`~curses.noecho` function. ::" msgstr "" -#: ../../howto/curses.rst:103 +#: ../../howto/curses.rst:99 msgid "" "Applications will also commonly need to react to keys instantly, without " "requiring the Enter key to be pressed; this is called cbreak mode, as " "opposed to the usual buffered input mode. ::" msgstr "" -#: ../../howto/curses.rst:109 +#: ../../howto/curses.rst:105 msgid "" "Terminals usually return special keys, such as the cursor keys or navigation " "keys such as Page Up and Home, as a multibyte escape sequence. While you " @@ -170,20 +167,20 @@ msgid "" "keypad mode. ::" msgstr "" -#: ../../howto/curses.rst:118 +#: ../../howto/curses.rst:114 msgid "" "Terminating a curses application is much easier than starting one. You'll " "need to call::" msgstr "" -#: ../../howto/curses.rst:125 +#: ../../howto/curses.rst:121 msgid "" "to reverse the curses-friendly terminal settings. Then call the :func:" "`~curses.endwin` function to restore the terminal to its original operating " "mode. ::" msgstr "" -#: ../../howto/curses.rst:131 +#: ../../howto/curses.rst:127 msgid "" "A common problem when debugging a curses application is to get your terminal " "messed up when the application dies without restoring the terminal to its " @@ -192,13 +189,13 @@ msgid "" "you type them, for example, which makes using the shell difficult." msgstr "" -#: ../../howto/curses.rst:137 +#: ../../howto/curses.rst:133 msgid "" "In Python you can avoid these complications and make debugging much easier " "by importing the :func:`curses.wrapper` function and using it like this::" msgstr "" -#: ../../howto/curses.rst:156 +#: ../../howto/curses.rst:152 msgid "" "The :func:`~curses.wrapper` function takes a callable object and does the " "initializations described above, also initializing colors if color support " @@ -211,18 +208,18 @@ msgid "" "and traceback." msgstr "" -#: ../../howto/curses.rst:168 +#: ../../howto/curses.rst:164 msgid "Windows and Pads" msgstr "" -#: ../../howto/curses.rst:170 +#: ../../howto/curses.rst:166 msgid "" "Windows are the basic abstraction in curses. A window object represents a " "rectangular area of the screen, and supports methods to display text, erase " "it, allow the user to input strings, and so forth." msgstr "" -#: ../../howto/curses.rst:174 +#: ../../howto/curses.rst:170 msgid "" "The ``stdscr`` object returned by the :func:`~curses.initscr` function is a " "window object that covers the entire screen. Many programs may need only " @@ -232,7 +229,7 @@ msgid "" "window object. ::" msgstr "" -#: ../../howto/curses.rst:185 +#: ../../howto/curses.rst:181 msgid "" "Note that the coordinate system used in curses is unusual. Coordinates are " "always passed in the order *y,x*, and the top-left corner of a window is " @@ -242,7 +239,7 @@ msgid "" "curses since it was first written, and it's too late to change things now." msgstr "" -#: ../../howto/curses.rst:193 +#: ../../howto/curses.rst:189 msgid "" "Your application can determine the size of the screen by using the :data:" "`curses.LINES` and :data:`curses.COLS` variables to obtain the *y* and *x* " @@ -250,14 +247,14 @@ msgid "" "- 1, curses.COLS - 1)``." msgstr "" -#: ../../howto/curses.rst:198 +#: ../../howto/curses.rst:194 msgid "" "When you call a method to display or erase text, the effect doesn't " "immediately show up on the display. Instead you must call the :meth:" "`~curses.window.refresh` method of window objects to update the screen." msgstr "" -#: ../../howto/curses.rst:203 +#: ../../howto/curses.rst:199 msgid "" "This is because curses was originally written with slow 300-baud terminal " "connections in mind; with these terminals, minimizing the time required to " @@ -268,7 +265,7 @@ msgid "" "because they're never visible." msgstr "" -#: ../../howto/curses.rst:212 +#: ../../howto/curses.rst:208 msgid "" "In practice, explicitly telling curses to redraw a window doesn't really " "complicate programming with curses much. Most programs go into a flurry of " @@ -278,7 +275,7 @@ msgid "" "refresh()`` or the :meth:`refresh` method of some other relevant window." msgstr "" -#: ../../howto/curses.rst:220 +#: ../../howto/curses.rst:216 msgid "" "A pad is a special case of a window; it can be larger than the actual " "display screen, and only a portion of the pad displayed at a time. Creating " @@ -287,7 +284,7 @@ msgid "" "will be displayed. ::" msgstr "" -#: ../../howto/curses.rst:241 +#: ../../howto/curses.rst:237 msgid "" "The :meth:`refresh` call displays a section of the pad in the rectangle " "extending from coordinate (5,5) to coordinate (20,75) on the screen; the " @@ -296,36 +293,36 @@ msgid "" "the same methods." msgstr "" -#: ../../howto/curses.rst:247 +#: ../../howto/curses.rst:243 msgid "" "If you have multiple windows and pads on screen there is a more efficient " "way to update the screen and prevent annoying screen flicker as each part of " "the screen gets updated. :meth:`refresh` actually does two things:" msgstr "" -#: ../../howto/curses.rst:252 +#: ../../howto/curses.rst:248 msgid "" "Calls the :meth:`~curses.window.noutrefresh` method of each window to update " "an underlying data structure representing the desired state of the screen." msgstr "" -#: ../../howto/curses.rst:255 +#: ../../howto/curses.rst:251 msgid "" "Calls the function :func:`~curses.doupdate` function to change the physical " "screen to match the desired state recorded in the data structure." msgstr "" -#: ../../howto/curses.rst:258 +#: ../../howto/curses.rst:254 msgid "" "Instead you can call :meth:`noutrefresh` on a number of windows to update " "the data structure, and then call :func:`doupdate` to update the screen." msgstr "" -#: ../../howto/curses.rst:264 +#: ../../howto/curses.rst:260 msgid "Displaying Text" msgstr "" -#: ../../howto/curses.rst:266 +#: ../../howto/curses.rst:262 msgid "" "From a C programmer's point of view, curses may sometimes look like a twisty " "maze of functions, all subtly different. For example, :c:func:`addstr` " @@ -336,7 +333,7 @@ msgid "" "func:`mvwaddstr` allows specifying both a window and a coordinate." msgstr "" -#: ../../howto/curses.rst:275 +#: ../../howto/curses.rst:271 msgid "" "Fortunately the Python interface hides all these details. ``stdscr`` is a " "window object like any other, and methods such as :meth:`~curses.window." @@ -344,58 +341,58 @@ msgid "" "forms." msgstr "" -#: ../../howto/curses.rst:281 +#: ../../howto/curses.rst:277 msgid "Form" msgstr "" -#: ../../howto/curses.rst:281 ../../howto/curses.rst:350 +#: ../../howto/curses.rst:277 ../../howto/curses.rst:346 msgid "Description" msgstr "描述" -#: ../../howto/curses.rst:283 +#: ../../howto/curses.rst:279 msgid "*str* or *ch*" msgstr "" -#: ../../howto/curses.rst:283 +#: ../../howto/curses.rst:279 msgid "Display the string *str* or character *ch* at the current position" msgstr "" -#: ../../howto/curses.rst:286 +#: ../../howto/curses.rst:282 msgid "*str* or *ch*, *attr*" msgstr "" -#: ../../howto/curses.rst:286 +#: ../../howto/curses.rst:282 msgid "" "Display the string *str* or character *ch*, using attribute *attr* at the " "current position" msgstr "" -#: ../../howto/curses.rst:290 +#: ../../howto/curses.rst:286 msgid "*y*, *x*, *str* or *ch*" msgstr "*y*\\ 、\\ *x*\\ 、\\ *str* 或 *ch*" -#: ../../howto/curses.rst:290 +#: ../../howto/curses.rst:286 msgid "Move to position *y,x* within the window, and display *str* or *ch*" msgstr "" -#: ../../howto/curses.rst:293 +#: ../../howto/curses.rst:289 msgid "*y*, *x*, *str* or *ch*, *attr*" msgstr "*y*\\ 、\\ *x*\\ 、\\ *str* 或 *ch*\\ 、\\ *attr*" -#: ../../howto/curses.rst:293 +#: ../../howto/curses.rst:289 msgid "" "Move to position *y,x* within the window, and display *str* or *ch*, using " "attribute *attr*" msgstr "" -#: ../../howto/curses.rst:297 +#: ../../howto/curses.rst:293 msgid "" "Attributes allow displaying text in highlighted forms such as boldface, " "underline, reverse code, or in color. They'll be explained in more detail " "in the next subsection." msgstr "" -#: ../../howto/curses.rst:302 +#: ../../howto/curses.rst:298 msgid "" "The :meth:`~curses.window.addstr` method takes a Python string or bytestring " "as the value to be displayed. The contents of bytestrings are sent to the " @@ -404,13 +401,13 @@ msgid "" "encoding as returned by :func:`locale.getpreferredencoding`." msgstr "" -#: ../../howto/curses.rst:309 +#: ../../howto/curses.rst:305 msgid "" "The :meth:`~curses.window.addch` methods take a character, which can be " "either a string of length 1, a bytestring of length 1, or an integer." msgstr "" -#: ../../howto/curses.rst:312 +#: ../../howto/curses.rst:308 msgid "" "Constants are provided for extension characters; these constants are " "integers greater than 255. For example, :const:`ACS_PLMINUS` is a +/- " @@ -418,7 +415,7 @@ msgid "" "for drawing borders). You can also use the appropriate Unicode character." msgstr "" -#: ../../howto/curses.rst:318 +#: ../../howto/curses.rst:314 msgid "" "Windows remember where the cursor was left after the last operation, so if " "you leave out the *y,x* coordinates, the string or character will be " @@ -429,7 +426,7 @@ msgid "" "cursor blinking at some apparently random location." msgstr "" -#: ../../howto/curses.rst:326 +#: ../../howto/curses.rst:322 msgid "" "If your application doesn't need a blinking cursor at all, you can call " "``curs_set(False)`` to make it invisible. For compatibility with older " @@ -439,11 +436,11 @@ msgid "" "leaving it in odd locations." msgstr "" -#: ../../howto/curses.rst:335 +#: ../../howto/curses.rst:331 msgid "Attributes and Color" msgstr "" -#: ../../howto/curses.rst:337 +#: ../../howto/curses.rst:333 msgid "" "Characters can be displayed in different ways. Status lines in a text-based " "application are commonly shown in reverse video, or a text viewer may need " @@ -451,7 +448,7 @@ msgid "" "an attribute for each cell on the screen." msgstr "" -#: ../../howto/curses.rst:342 +#: ../../howto/curses.rst:338 msgid "" "An attribute is an integer, each bit representing a different attribute. " "You can try to display text with multiple attribute bits set, but curses " @@ -461,72 +458,72 @@ msgid "" "attributes, listed here." msgstr "" -#: ../../howto/curses.rst:350 +#: ../../howto/curses.rst:346 msgid "Attribute" msgstr "屬性" -#: ../../howto/curses.rst:352 +#: ../../howto/curses.rst:348 msgid ":const:`A_BLINK`" msgstr ":const:`A_BLINK`" -#: ../../howto/curses.rst:352 +#: ../../howto/curses.rst:348 msgid "Blinking text" msgstr "" -#: ../../howto/curses.rst:354 +#: ../../howto/curses.rst:350 msgid ":const:`A_BOLD`" msgstr ":const:`A_BOLD`" -#: ../../howto/curses.rst:354 +#: ../../howto/curses.rst:350 msgid "Extra bright or bold text" msgstr "" -#: ../../howto/curses.rst:356 +#: ../../howto/curses.rst:352 msgid ":const:`A_DIM`" msgstr ":const:`A_DIM`" -#: ../../howto/curses.rst:356 +#: ../../howto/curses.rst:352 msgid "Half bright text" msgstr "" -#: ../../howto/curses.rst:358 +#: ../../howto/curses.rst:354 msgid ":const:`A_REVERSE`" msgstr ":const:`A_REVERSE`" -#: ../../howto/curses.rst:358 +#: ../../howto/curses.rst:354 msgid "Reverse-video text" msgstr "" -#: ../../howto/curses.rst:360 +#: ../../howto/curses.rst:356 msgid ":const:`A_STANDOUT`" msgstr ":const:`A_STANDOUT`" -#: ../../howto/curses.rst:360 +#: ../../howto/curses.rst:356 msgid "The best highlighting mode available" msgstr "" -#: ../../howto/curses.rst:362 +#: ../../howto/curses.rst:358 msgid ":const:`A_UNDERLINE`" msgstr ":const:`A_UNDERLINE`" -#: ../../howto/curses.rst:362 +#: ../../howto/curses.rst:358 msgid "Underlined text" msgstr "" -#: ../../howto/curses.rst:365 +#: ../../howto/curses.rst:361 msgid "" "So, to display a reverse-video status line on the top line of the screen, " "you could code::" msgstr "" -#: ../../howto/curses.rst:372 +#: ../../howto/curses.rst:368 msgid "" "The curses library also supports color on those terminals that provide it. " "The most common such terminal is probably the Linux console, followed by " "color xterms." msgstr "" -#: ../../howto/curses.rst:376 +#: ../../howto/curses.rst:372 msgid "" "To use color, you must call the :func:`~curses.start_color` function soon " "after calling :func:`~curses.initscr`, to initialize the default color set " @@ -538,7 +535,7 @@ msgid "" "for the sake of these functions.)" msgstr "" -#: ../../howto/curses.rst:386 +#: ../../howto/curses.rst:382 msgid "" "The curses library maintains a finite number of color pairs, containing a " "foreground (or text) color and a background color. You can get the " @@ -548,11 +545,11 @@ msgid "" "work on all terminals." msgstr "" -#: ../../howto/curses.rst:393 +#: ../../howto/curses.rst:389 msgid "An example, which displays a line of text using color pair 1::" msgstr "" -#: ../../howto/curses.rst:398 +#: ../../howto/curses.rst:394 msgid "" "As I said before, a color pair consists of a foreground and background " "color. The ``init_pair(n, f, b)`` function changes the definition of color " @@ -560,7 +557,7 @@ msgid "" "hard-wired to white on black, and cannot be changed." msgstr "" -#: ../../howto/curses.rst:403 +#: ../../howto/curses.rst:399 msgid "" "Colors are numbered, and :func:`start_color` initializes 8 basic colors when " "it activates color mode. They are: 0:black, 1:red, 2:green, 3:yellow, 4:" @@ -569,20 +566,20 @@ msgid "" "const:`curses.COLOR_RED`, and so forth." msgstr "" -#: ../../howto/curses.rst:409 +#: ../../howto/curses.rst:405 msgid "" "Let's put all this together. To change color 1 to red text on a white " "background, you would call::" msgstr "" -#: ../../howto/curses.rst:414 +#: ../../howto/curses.rst:410 msgid "" "When you change a color pair, any text already displayed using that color " "pair will change to the new colors. You can also display new text in this " "color with::" msgstr "" -#: ../../howto/curses.rst:420 +#: ../../howto/curses.rst:416 msgid "" "Very fancy terminals can change the definitions of the actual colors to a " "given RGB value. This lets you change color 1, which is usually red, to " @@ -594,11 +591,11 @@ msgid "" "your system's man pages for more information." msgstr "" -#: ../../howto/curses.rst:431 +#: ../../howto/curses.rst:427 msgid "User Input" msgstr "" -#: ../../howto/curses.rst:433 +#: ../../howto/curses.rst:429 msgid "" "The C curses library offers only very simple input mechanisms. Python's :mod:" "`curses` module adds a basic text-input widget. (Other libraries such as " @@ -606,11 +603,11 @@ msgid "" "of widgets.)" msgstr "" -#: ../../howto/curses.rst:438 +#: ../../howto/curses.rst:434 msgid "There are two methods for getting input from a window:" msgstr "" -#: ../../howto/curses.rst:440 +#: ../../howto/curses.rst:436 msgid "" ":meth:`~curses.window.getch` refreshes the screen and then waits for the " "user to hit a key, displaying the key if :func:`~curses.echo` has been " @@ -618,7 +615,7 @@ msgid "" "should be moved before pausing." msgstr "" -#: ../../howto/curses.rst:445 +#: ../../howto/curses.rst:441 msgid "" ":meth:`~curses.window.getkey` does the same thing but converts the integer " "to a string. Individual characters are returned as 1-character strings, and " @@ -626,7 +623,7 @@ msgid "" "name such as ``KEY_UP`` or ``^G``." msgstr "" -#: ../../howto/curses.rst:450 +#: ../../howto/curses.rst:446 msgid "" "It's possible to not wait for the user using the :meth:`~curses.window." "nodelay` window method. After ``nodelay(True)``, :meth:`getch` and :meth:" @@ -638,7 +635,7 @@ msgid "" "tenths of a second), curses raises an exception." msgstr "" -#: ../../howto/curses.rst:460 +#: ../../howto/curses.rst:456 msgid "" "The :meth:`getch` method returns an integer; if it's between 0 and 255, it " "represents the ASCII code of the key pressed. Values greater than 255 are " @@ -648,7 +645,7 @@ msgid "" "program may look something like this::" msgstr "" -#: ../../howto/curses.rst:476 +#: ../../howto/curses.rst:472 msgid "" "The :mod:`curses.ascii` module supplies ASCII class membership functions " "that take either integer or 1-character string arguments; these may be " @@ -658,7 +655,7 @@ msgid "" "returns the control character corresponding to its argument." msgstr "" -#: ../../howto/curses.rst:483 +#: ../../howto/curses.rst:479 msgid "" "There's also a method to retrieve an entire string, :meth:`~curses.window." "getstr`. It isn't used very often, because its functionality is quite " @@ -667,7 +664,7 @@ msgid "" "number of characters. ::" msgstr "" -#: ../../howto/curses.rst:494 +#: ../../howto/curses.rst:490 msgid "" "The :mod:`curses.textpad` module supplies a text box that supports an Emacs-" "like set of keybindings. Various methods of the :class:`~curses.textpad." @@ -675,16 +672,16 @@ msgid "" "results either with or without trailing spaces. Here's an example::" msgstr "" -#: ../../howto/curses.rst:518 +#: ../../howto/curses.rst:514 msgid "" "See the library documentation on :mod:`curses.textpad` for more details." msgstr "" -#: ../../howto/curses.rst:522 +#: ../../howto/curses.rst:518 msgid "For More Information" msgstr "" -#: ../../howto/curses.rst:524 +#: ../../howto/curses.rst:520 msgid "" "This HOWTO doesn't cover some advanced topics, such as reading the contents " "of the screen or capturing mouse events from an xterm instance, but the " @@ -692,7 +689,7 @@ msgid "" "complete. You should browse it next." msgstr "" -#: ../../howto/curses.rst:529 +#: ../../howto/curses.rst:525 msgid "" "If you're in doubt about the detailed behavior of the curses functions, " "consult the manual pages for your curses implementation, whether it's " @@ -701,7 +698,7 @@ msgid "" "const:`ACS_\\*` characters available to you." msgstr "" -#: ../../howto/curses.rst:536 +#: ../../howto/curses.rst:532 msgid "" "Because the curses API is so large, some functions aren't supported in the " "Python interface. Often this isn't because they're difficult to implement, " @@ -711,30 +708,30 @@ msgid "" "org/>`_ to learn more about submitting patches to Python." msgstr "" -#: ../../howto/curses.rst:544 +#: ../../howto/curses.rst:540 msgid "" "`Writing Programs with NCURSES `_: a lengthy tutorial for C programmers." msgstr "" -#: ../../howto/curses.rst:546 +#: ../../howto/curses.rst:542 msgid "`The ncurses man page `_" msgstr "`ncurses 使用者手冊 `_" -#: ../../howto/curses.rst:547 +#: ../../howto/curses.rst:543 msgid "" "`The ncurses FAQ `_" msgstr "" "`ncurses 問答集 `_" -#: ../../howto/curses.rst:548 +#: ../../howto/curses.rst:544 msgid "" "`\"Use curses... don't swear\" `_: video of a PyCon 2013 talk on controlling terminals using " "curses or Urwid." msgstr "" -#: ../../howto/curses.rst:550 +#: ../../howto/curses.rst:546 msgid "" "`\"Console Applications with Urwid\" `_: video of a PyCon CA 2012 talk " diff --git a/howto/sorting.po b/howto/sorting.po index 8f0e68fef1..fb8a916d72 100644 --- a/howto/sorting.po +++ b/howto/sorting.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.10\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2021-10-26 16:47+0000\n" +"POT-Creation-Date: 2022-05-21 17:35+0000\n" "PO-Revision-Date: 2018-05-23 14:37+0000\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -317,13 +317,19 @@ msgstr "" #: ../../howto/sorting.rst:328 msgid "" -"The sort routines are guaranteed to use :meth:`__lt__` when making " -"comparisons between two objects. So, it is easy to add a standard sort order " -"to a class by defining an :meth:`__lt__` method:" +"The sort routines use ``<`` when making comparisons between two objects. So, " +"it is easy to add a standard sort order to a class by defining an :meth:" +"`__lt__` method:" msgstr "" #: ../../howto/sorting.rst:338 msgid "" +"However, note that ``<`` can fall back to using :meth:`__gt__` if :meth:" +"`__lt__` is not implemented (see :func:`object.__lt__`)." +msgstr "" + +#: ../../howto/sorting.rst:341 +msgid "" "Key functions need not depend directly on the objects being sorted. A key " "function can also access external resources. For instance, if the student " "grades are stored in a dictionary, they can be used to sort a separate list " diff --git a/library/__future__.po b/library/__future__.po index 2f2b8ec0a3..37a2c2a02e 100644 --- a/library/__future__.po +++ b/library/__future__.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.10\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2021-10-26 16:47+0000\n" +"POT-Creation-Date: 2022-05-21 17:35+0000\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,17 +243,28 @@ msgid "3.7.0b1" msgstr "3.7.0b1" #: ../../library/__future__.rst:93 -msgid "3.11" -msgstr "3.11" +msgid "TBD [1]_" +msgstr "TBD [1]_" #: ../../library/__future__.rst:93 msgid ":pep:`563`: *Postponed evaluation of annotations*" msgstr "" -#: ../../library/__future__.rst:102 +#: ../../library/__future__.rst:100 +msgid "" +"``from __future__ import annotations`` was previously scheduled to become " +"mandatory in Python 3.10, but the Python Steering Council twice decided to " +"delay the change (`announcement for Python 3.10 `__; `announcement for Python 3.11 `__). No " +"final decision has been made yet. See also :pep:`563` and :pep:`649`." +msgstr "" + +#: ../../library/__future__.rst:110 msgid ":ref:`future`" msgstr ":ref:`future`" -#: ../../library/__future__.rst:103 +#: ../../library/__future__.rst:111 msgid "How the compiler treats future imports." msgstr "" diff --git a/library/aifc.po b/library/aifc.po index fcf2d97821..e2f445daf3 100644 --- a/library/aifc.po +++ b/library/aifc.po @@ -7,8 +7,8 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.10\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2022-03-23 00:14+0000\n" -"PO-Revision-Date: 2018-05-23 14:38+0000\n" +"POT-Creation-Date: 2022-05-21 17:35+0000\n" +"PO-Revision-Date: 2022-05-22 01:57+0800\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" "tw)\n" @@ -17,6 +17,7 @@ msgstr "" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" "Plural-Forms: nplurals=1; plural=0;\n" +"X-Generator: Poedit 3.0.1\n" #: ../../library/aifc.rst:2 msgid ":mod:`aifc` --- Read and write AIFF and AIFC files" @@ -27,10 +28,13 @@ msgid "**Source code:** :source:`Lib/aifc.py`" msgstr "**原始碼:**\\ :source:`Lib/aifc.py`" #: ../../library/aifc.rst:16 -msgid "The :mod:`aifc` module is deprecated (see :pep:`594` for details)." -msgstr ":mod:`aifc` 模組 (module) 即將被棄用(詳見 :pep:`594`\\ )。" +msgid "" +"The :mod:`aifc` module is deprecated (see :pep:`PEP 594 <594#aifc>` for " +"details)." +msgstr "" +":mod:`aifc` 模組 (module) 即將被棄用(詳見 :pep:`PEP 594 <594#aifc>`\\ )。" -#: ../../library/aifc.rst:21 +#: ../../library/aifc.rst:22 msgid "" "This module provides support for reading and writing AIFF and AIFF-C files. " "AIFF is Audio Interchange File Format, a format for storing digital audio " @@ -38,7 +42,7 @@ msgid "" "the ability to compress the audio data." msgstr "" -#: ../../library/aifc.rst:26 +#: ../../library/aifc.rst:27 msgid "" "Audio files have a number of parameters that describe the audio data. The " "sampling rate or frame rate is the number of times per second the sound is " @@ -49,7 +53,7 @@ msgid "" "samplesize * framerate`` bytes." msgstr "" -#: ../../library/aifc.rst:34 +#: ../../library/aifc.rst:35 msgid "" "For example, CD quality audio has a sample size of two bytes (16 bits), uses " "two channels (stereo) and has a frame rate of 44,100 frames/second. This " @@ -57,11 +61,11 @@ msgid "" "2\\*2\\*44100 bytes (176,400 bytes)." msgstr "" -#: ../../library/aifc.rst:39 +#: ../../library/aifc.rst:40 msgid "Module :mod:`aifc` defines the following function:" msgstr ":mod:`aifc` 模組定義了以下函式:" -#: ../../library/aifc.rst:44 +#: ../../library/aifc.rst:45 msgid "" "Open an AIFF or AIFF-C file and return an object instance with methods that " "are described below. The argument *file* is either a string naming a file " @@ -75,53 +79,53 @@ msgid "" "keyword:`!with` block completes, the :meth:`~aifc.close` method is called." msgstr "" -#: ../../library/aifc.rst:55 +#: ../../library/aifc.rst:56 msgid "Support for the :keyword:`with` statement was added." msgstr "" -#: ../../library/aifc.rst:58 +#: ../../library/aifc.rst:59 msgid "" "Objects returned by :func:`.open` when a file is opened for reading have the " "following methods:" msgstr "" -#: ../../library/aifc.rst:64 +#: ../../library/aifc.rst:65 msgid "Return the number of audio channels (1 for mono, 2 for stereo)." msgstr "" -#: ../../library/aifc.rst:69 +#: ../../library/aifc.rst:70 msgid "Return the size in bytes of individual samples." msgstr "" -#: ../../library/aifc.rst:74 +#: ../../library/aifc.rst:75 msgid "Return the sampling rate (number of audio frames per second)." msgstr "" -#: ../../library/aifc.rst:79 +#: ../../library/aifc.rst:80 msgid "Return the number of audio frames in the file." msgstr "" -#: ../../library/aifc.rst:84 +#: ../../library/aifc.rst:85 msgid "" "Return a bytes array of length 4 describing the type of compression used in " "the audio file. For AIFF files, the returned value is ``b'NONE'``." msgstr "" -#: ../../library/aifc.rst:91 +#: ../../library/aifc.rst:92 msgid "" "Return a bytes array convertible to a human-readable description of the type " "of compression used in the audio file. For AIFF files, the returned value " "is ``b'not compressed'``." msgstr "" -#: ../../library/aifc.rst:98 +#: ../../library/aifc.rst:99 msgid "" "Returns a :func:`~collections.namedtuple` ``(nchannels, sampwidth, " "framerate, nframes, comptype, compname)``, equivalent to output of the :meth:" "`get\\*` methods." msgstr "" -#: ../../library/aifc.rst:105 +#: ../../library/aifc.rst:106 msgid "" "Return a list of markers in the audio file. A marker consists of a tuple of " "three elements. The first is the mark ID (an integer), the second is the " @@ -129,40 +133,40 @@ msgid "" "third is the name of the mark (a string)." msgstr "" -#: ../../library/aifc.rst:113 +#: ../../library/aifc.rst:114 msgid "" "Return the tuple as described in :meth:`getmarkers` for the mark with the " "given *id*." msgstr "" -#: ../../library/aifc.rst:119 +#: ../../library/aifc.rst:120 msgid "" "Read and return the next *nframes* frames from the audio file. The returned " "data is a string containing for each frame the uncompressed samples of all " "channels." msgstr "" -#: ../../library/aifc.rst:126 +#: ../../library/aifc.rst:127 msgid "" "Rewind the read pointer. The next :meth:`readframes` will start from the " "beginning." msgstr "" -#: ../../library/aifc.rst:132 +#: ../../library/aifc.rst:133 msgid "Seek to the specified frame number." msgstr "" -#: ../../library/aifc.rst:137 +#: ../../library/aifc.rst:138 msgid "Return the current frame number." msgstr "" -#: ../../library/aifc.rst:142 +#: ../../library/aifc.rst:143 msgid "" "Close the AIFF file. After calling this method, the object can no longer be " "used." msgstr "" -#: ../../library/aifc.rst:145 +#: ../../library/aifc.rst:146 msgid "" "Objects returned by :func:`.open` when a file is opened for writing have all " "the above methods, except for :meth:`readframes` and :meth:`setpos`. In " @@ -172,40 +176,40 @@ msgid "" "parameters except for the number of frames must be filled in." msgstr "" -#: ../../library/aifc.rst:155 +#: ../../library/aifc.rst:156 msgid "" "Create an AIFF file. The default is that an AIFF-C file is created, unless " "the name of the file ends in ``'.aiff'`` in which case the default is an " "AIFF file." msgstr "" -#: ../../library/aifc.rst:161 +#: ../../library/aifc.rst:162 msgid "" "Create an AIFF-C file. The default is that an AIFF-C file is created, " "unless the name of the file ends in ``'.aiff'`` in which case the default is " "an AIFF file." msgstr "" -#: ../../library/aifc.rst:168 +#: ../../library/aifc.rst:169 msgid "Specify the number of channels in the audio file." msgstr "" -#: ../../library/aifc.rst:173 +#: ../../library/aifc.rst:174 msgid "Specify the size in bytes of audio samples." msgstr "" -#: ../../library/aifc.rst:178 +#: ../../library/aifc.rst:179 msgid "Specify the sampling frequency in frames per second." msgstr "" -#: ../../library/aifc.rst:183 +#: ../../library/aifc.rst:184 msgid "" "Specify the number of frames that are to be written to the audio file. If " "this parameter is not set, or not set correctly, the file needs to support " "seeking." msgstr "" -#: ../../library/aifc.rst:194 +#: ../../library/aifc.rst:195 msgid "" "Specify the compression type. If not specified, the audio data will not be " "compressed. In AIFF files, compression is not possible. The name parameter " @@ -215,42 +219,42 @@ msgid "" "``b'ALAW'``, ``b'G722'``." msgstr "" -#: ../../library/aifc.rst:204 +#: ../../library/aifc.rst:205 msgid "" "Set all the above parameters at once. The argument is a tuple consisting of " "the various parameters. This means that it is possible to use the result of " "a :meth:`getparams` call as argument to :meth:`setparams`." msgstr "" -#: ../../library/aifc.rst:211 +#: ../../library/aifc.rst:212 msgid "" "Add a mark with the given id (larger than 0), and the given name at the " "given position. This method can be called at any time before :meth:`close`." msgstr "" -#: ../../library/aifc.rst:218 +#: ../../library/aifc.rst:219 msgid "" "Return the current write position in the output file. Useful in combination " "with :meth:`setmark`." msgstr "" -#: ../../library/aifc.rst:224 +#: ../../library/aifc.rst:225 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:227 ../../library/aifc.rst:236 +#: ../../library/aifc.rst:228 ../../library/aifc.rst:237 msgid "Any :term:`bytes-like object` is now accepted." msgstr "" -#: ../../library/aifc.rst:233 +#: ../../library/aifc.rst:234 msgid "" "Like :meth:`writeframes`, except that the header of the audio file is not " "updated." msgstr "" -#: ../../library/aifc.rst:243 +#: ../../library/aifc.rst:244 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 00f9ec4851..210a71b23c 100644 --- a/library/argparse.po +++ b/library/argparse.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.10\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2022-01-03 00:10+0000\n" +"POT-Creation-Date: 2022-05-21 17:35+0000\n" "PO-Revision-Date: 2018-05-23 14:38+0000\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -427,7 +427,7 @@ msgstr "fromfile_prefix_chars" #: ../../library/argparse.rst:505 msgid "" -"Sometimes, for example when dealing with a particularly long argument lists, " +"Sometimes, for example when dealing with a particularly long argument list, " "it may make sense to keep the list of arguments in a file rather than typing " "it out at the command line. If the ``fromfile_prefix_chars=`` argument is " "given to the :class:`ArgumentParser` constructor, then arguments that start " diff --git a/library/asynchat.po b/library/asynchat.po index a0306e42e2..efea479904 100644 --- a/library/asynchat.po +++ b/library/asynchat.po @@ -7,8 +7,8 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.10\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2022-03-21 00:13+0000\n" -"PO-Revision-Date: 2022-03-23 15:50+0800\n" +"POT-Creation-Date: 2022-05-21 17:35+0000\n" +"PO-Revision-Date: 2022-05-22 01:58+0800\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" "tw)\n" @@ -29,19 +29,19 @@ msgstr "**原始碼:**\\ :source:`Lib/asynchat.py`" #: ../../library/asynchat.rst:13 msgid "" -":mod:`asynchat` will be removed in Python 3.12 (:pep:`594`). Please use :mod:" -"`asyncio` instead." +":mod:`asynchat` will be removed in Python 3.12 (see :pep:`PEP 594 " +"<594#asynchat>` for details). Please use :mod:`asyncio` instead." msgstr "" -":mod:`asynchat` 將於 Python 3.12 中移除(\\ :pep:`594`\\ )。請改用 :mod:" -"`asyncio`\\ 。" +":mod:`asynchat` 將於 Python 3.12 中移除(詳情請見:pep:`PEP 594 " +"<594#asynchat>`\\ )。請改用 :mod:`asyncio`\\ 。" -#: ../../library/asynchat.rst:21 +#: ../../library/asynchat.rst:22 msgid "" "This module exists for backwards compatibility only. For new code we " "recommend using :mod:`asyncio`." msgstr "" -#: ../../library/asynchat.rst:24 +#: ../../library/asynchat.rst:25 msgid "" "This module builds on the :mod:`asyncore` infrastructure, simplifying " "asynchronous clients and servers and making it easier to handle protocols " @@ -56,7 +56,7 @@ msgid "" "connection requests." msgstr "" -#: ../../library/asynchat.rst:39 +#: ../../library/asynchat.rst:40 msgid "" "This class is an abstract subclass of :class:`asyncore.dispatcher`. To make " "practical use of the code you must subclass :class:`async_chat`, providing " @@ -65,7 +65,7 @@ msgid "" "all make sense in a message/response context." msgstr "" -#: ../../library/asynchat.rst:46 +#: ../../library/asynchat.rst:47 msgid "" "Like :class:`asyncore.dispatcher`, :class:`async_chat` defines a set of " "events that are generated by an analysis of socket conditions after a :c:" @@ -74,21 +74,21 @@ msgid "" "with no action on the part of the programmer." msgstr "" -#: ../../library/asynchat.rst:52 +#: ../../library/asynchat.rst:53 msgid "" "Two class attributes can be modified, to improve performance, or possibly " "even to conserve memory." msgstr "" -#: ../../library/asynchat.rst:58 +#: ../../library/asynchat.rst:59 msgid "The asynchronous input buffer size (default ``4096``)." msgstr "" -#: ../../library/asynchat.rst:63 +#: ../../library/asynchat.rst:64 msgid "The asynchronous output buffer size (default ``4096``)." msgstr "" -#: ../../library/asynchat.rst:65 +#: ../../library/asynchat.rst:66 msgid "" "Unlike :class:`asyncore.dispatcher`, :class:`async_chat` allows you to " "define a :abbr:`FIFO (first-in, first-out)` queue of *producers*. A producer " @@ -103,7 +103,7 @@ msgid "" "transmission from the remote endpoint." msgstr "" -#: ../../library/asynchat.rst:78 +#: ../../library/asynchat.rst:79 msgid "" "To build a functioning :class:`async_chat` subclass your input methods :" "meth:`collect_incoming_data` and :meth:`found_terminator` must handle the " @@ -111,26 +111,26 @@ msgid "" "below." msgstr "" -#: ../../library/asynchat.rst:86 +#: ../../library/asynchat.rst:87 msgid "" "Pushes a ``None`` on to the producer queue. When this producer is popped off " "the queue it causes the channel to be closed." msgstr "" -#: ../../library/asynchat.rst:92 +#: ../../library/asynchat.rst:93 msgid "" "Called with *data* holding an arbitrary amount of received data. The " "default method, which must be overridden, raises a :exc:" "`NotImplementedError` exception." msgstr "" -#: ../../library/asynchat.rst:99 +#: ../../library/asynchat.rst:100 msgid "" "In emergencies this method will discard any data held in the input and/or " "output buffers and the producer queue." msgstr "" -#: ../../library/asynchat.rst:105 +#: ../../library/asynchat.rst:106 msgid "" "Called when the incoming data stream matches the termination condition set " "by :meth:`set_terminator`. The default method, which must be overridden, " @@ -138,11 +138,11 @@ msgid "" "should be available via an instance attribute." msgstr "" -#: ../../library/asynchat.rst:113 +#: ../../library/asynchat.rst:114 msgid "Returns the current terminator for the channel." msgstr "" -#: ../../library/asynchat.rst:118 +#: ../../library/asynchat.rst:119 msgid "" "Pushes data on to the channel's queue to ensure its transmission. This is " "all you need to do to have the channel write the data out to the network, " @@ -150,7 +150,7 @@ msgid "" "implement encryption and chunking, for example." msgstr "" -#: ../../library/asynchat.rst:126 +#: ../../library/asynchat.rst:127 msgid "" "Takes a producer object and adds it to the producer queue associated with " "the channel. When all currently-pushed producers have been exhausted the " @@ -158,60 +158,60 @@ msgid "" "and send the data to the remote endpoint." msgstr "" -#: ../../library/asynchat.rst:134 +#: ../../library/asynchat.rst:135 msgid "" "Sets the terminating condition to be recognized on the channel. ``term`` " "may be any of three types of value, corresponding to three different ways to " "handle incoming protocol data." msgstr "" -#: ../../library/asynchat.rst:139 +#: ../../library/asynchat.rst:140 msgid "term" msgstr "" -#: ../../library/asynchat.rst:139 +#: ../../library/asynchat.rst:140 msgid "Description" msgstr "描述" -#: ../../library/asynchat.rst:141 +#: ../../library/asynchat.rst:142 msgid "*string*" msgstr "" -#: ../../library/asynchat.rst:141 +#: ../../library/asynchat.rst:142 msgid "" "Will call :meth:`found_terminator` when the string is found in the input " "stream" msgstr "" -#: ../../library/asynchat.rst:144 +#: ../../library/asynchat.rst:145 msgid "*integer*" msgstr "" -#: ../../library/asynchat.rst:144 +#: ../../library/asynchat.rst:145 msgid "" "Will call :meth:`found_terminator` when the indicated number of characters " "have been received" msgstr "" -#: ../../library/asynchat.rst:148 +#: ../../library/asynchat.rst:149 msgid "``None``" msgstr "``None``" -#: ../../library/asynchat.rst:148 +#: ../../library/asynchat.rst:149 msgid "The channel continues to collect data forever" msgstr "" -#: ../../library/asynchat.rst:152 +#: ../../library/asynchat.rst:153 msgid "" "Note that any data following the terminator will be available for reading by " "the channel after :meth:`found_terminator` is called." msgstr "" -#: ../../library/asynchat.rst:159 +#: ../../library/asynchat.rst:160 msgid "asynchat Example" msgstr "" -#: ../../library/asynchat.rst:161 +#: ../../library/asynchat.rst:162 msgid "" "The following partial example shows how HTTP requests can be read with :" "class:`async_chat`. A web server might create an :class:" @@ -221,7 +221,7 @@ msgid "" "read." msgstr "" -#: ../../library/asynchat.rst:168 +#: ../../library/asynchat.rst:169 msgid "" "Once the headers have been read, if the request is of type POST (indicating " "that further data are present in the input stream) then the ``Content-Length:" @@ -229,7 +229,7 @@ msgid "" "data from the channel." msgstr "" -#: ../../library/asynchat.rst:173 +#: ../../library/asynchat.rst:174 msgid "" "The :meth:`handle_request` method is called once all relevant input has been " "marshalled, after setting the channel terminator to ``None`` to ensure that " diff --git a/library/asyncio-subprocess.po b/library/asyncio-subprocess.po index 5b09831ff4..2a78ec2bbd 100644 --- a/library/asyncio-subprocess.po +++ b/library/asyncio-subprocess.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.10\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2022-02-19 00:13+0000\n" +"POT-Creation-Date: 2022-05-21 17:35+0000\n" "PO-Revision-Date: 2018-05-23 14:39+0000\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -129,18 +129,18 @@ msgstr "" msgid "Constants" msgstr "常數" -#: ../../library/asyncio-subprocess.rst:128 +#: ../../library/asyncio-subprocess.rst:129 msgid "Can be passed to the *stdin*, *stdout* or *stderr* parameters." msgstr "" -#: ../../library/asyncio-subprocess.rst:130 +#: ../../library/asyncio-subprocess.rst:131 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:134 +#: ../../library/asyncio-subprocess.rst:135 msgid "" "If *PIPE* is passed to *stdout* or *stderr* arguments, the :attr:`Process." "stdout ` and :attr:`Process.stderr " @@ -148,24 +148,24 @@ msgid "" "`StreamReader` instances." msgstr "" -#: ../../library/asyncio-subprocess.rst:141 +#: ../../library/asyncio-subprocess.rst:143 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:146 +#: ../../library/asyncio-subprocess.rst:149 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:152 +#: ../../library/asyncio-subprocess.rst:155 msgid "Interacting with Subprocesses" msgstr "" -#: ../../library/asyncio-subprocess.rst:154 +#: ../../library/asyncio-subprocess.rst:157 msgid "" "Both :func:`create_subprocess_exec` and :func:`create_subprocess_shell` " "functions return instances of the *Process* class. *Process* is a high-" @@ -173,61 +173,61 @@ msgid "" "their completion." msgstr "" -#: ../../library/asyncio-subprocess.rst:161 +#: ../../library/asyncio-subprocess.rst:165 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:165 +#: ../../library/asyncio-subprocess.rst:169 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:169 +#: ../../library/asyncio-subprocess.rst:173 msgid "" "unlike Popen, Process instances do not have an equivalent to the :meth:" "`~subprocess.Popen.poll` method;" msgstr "" -#: ../../library/asyncio-subprocess.rst:172 +#: ../../library/asyncio-subprocess.rst:176 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:176 +#: ../../library/asyncio-subprocess.rst:180 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:180 +#: ../../library/asyncio-subprocess.rst:184 msgid "the *universal_newlines* parameter is not supported." msgstr "" -#: ../../library/asyncio-subprocess.rst:182 +#: ../../library/asyncio-subprocess.rst:186 msgid "This class is :ref:`not thread safe `." msgstr "" -#: ../../library/asyncio-subprocess.rst:184 +#: ../../library/asyncio-subprocess.rst:188 msgid "" "See also the :ref:`Subprocess and Threads ` " "section." msgstr "" -#: ../../library/asyncio-subprocess.rst:189 +#: ../../library/asyncio-subprocess.rst:193 msgid "Wait for the child process to terminate." msgstr "" -#: ../../library/asyncio-subprocess.rst:191 +#: ../../library/asyncio-subprocess.rst:195 msgid "Set and return the :attr:`returncode` attribute." msgstr "" -#: ../../library/asyncio-subprocess.rst:195 +#: ../../library/asyncio-subprocess.rst:199 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 +235,33 @@ msgid "" "using pipes to avoid this condition." msgstr "" -#: ../../library/asyncio-subprocess.rst:203 +#: ../../library/asyncio-subprocess.rst:207 msgid "Interact with process:" msgstr "" -#: ../../library/asyncio-subprocess.rst:205 +#: ../../library/asyncio-subprocess.rst:209 msgid "send data to *stdin* (if *input* is not ``None``);" msgstr "" -#: ../../library/asyncio-subprocess.rst:206 +#: ../../library/asyncio-subprocess.rst:210 msgid "read data from *stdout* and *stderr*, until EOF is reached;" msgstr "" -#: ../../library/asyncio-subprocess.rst:207 +#: ../../library/asyncio-subprocess.rst:211 msgid "wait for process to terminate." msgstr "" -#: ../../library/asyncio-subprocess.rst:209 +#: ../../library/asyncio-subprocess.rst:213 msgid "" "The optional *input* argument is the data (:class:`bytes` object) that will " "be sent to the child process." msgstr "" -#: ../../library/asyncio-subprocess.rst:212 +#: ../../library/asyncio-subprocess.rst:216 msgid "Return a tuple ``(stdout_data, stderr_data)``." msgstr "" -#: ../../library/asyncio-subprocess.rst:214 +#: ../../library/asyncio-subprocess.rst:218 msgid "" "If either :exc:`BrokenPipeError` or :exc:`ConnectionResetError` exception is " "raised when writing *input* into *stdin*, the exception is ignored. This " @@ -269,7 +269,7 @@ msgid "" "*stdin*." msgstr "" -#: ../../library/asyncio-subprocess.rst:219 +#: ../../library/asyncio-subprocess.rst:223 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,165 +277,165 @@ msgid "" "``stdout=PIPE`` and/or ``stderr=PIPE`` arguments." msgstr "" -#: ../../library/asyncio-subprocess.rst:225 +#: ../../library/asyncio-subprocess.rst:229 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:230 +#: ../../library/asyncio-subprocess.rst:234 msgid "Sends the signal *signal* to the child process." msgstr "" -#: ../../library/asyncio-subprocess.rst:234 +#: ../../library/asyncio-subprocess.rst:238 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:241 +#: ../../library/asyncio-subprocess.rst:245 msgid "Stop the child process." msgstr "" -#: ../../library/asyncio-subprocess.rst:243 +#: ../../library/asyncio-subprocess.rst:247 msgid "" "On POSIX systems this method sends :py:data:`signal.SIGTERM` to the child " "process." msgstr "" -#: ../../library/asyncio-subprocess.rst:246 +#: ../../library/asyncio-subprocess.rst:250 msgid "" "On Windows the Win32 API function :c:func:`TerminateProcess` is called to " "stop the child process." msgstr "" -#: ../../library/asyncio-subprocess.rst:251 +#: ../../library/asyncio-subprocess.rst:255 msgid "Kill the child process." msgstr "" -#: ../../library/asyncio-subprocess.rst:253 +#: ../../library/asyncio-subprocess.rst:257 msgid "" "On POSIX systems this method sends :py:data:`SIGKILL` to the child process." msgstr "" -#: ../../library/asyncio-subprocess.rst:256 +#: ../../library/asyncio-subprocess.rst:260 msgid "On Windows this method is an alias for :meth:`terminate`." msgstr "" -#: ../../library/asyncio-subprocess.rst:260 +#: ../../library/asyncio-subprocess.rst:264 msgid "" "Standard input stream (:class:`StreamWriter`) or ``None`` if the process was " "created with ``stdin=None``." msgstr "" -#: ../../library/asyncio-subprocess.rst:265 +#: ../../library/asyncio-subprocess.rst:269 msgid "" "Standard output stream (:class:`StreamReader`) or ``None`` if the process " "was created with ``stdout=None``." msgstr "" -#: ../../library/asyncio-subprocess.rst:270 +#: ../../library/asyncio-subprocess.rst:274 msgid "" "Standard error stream (:class:`StreamReader`) or ``None`` if the process was " "created with ``stderr=None``." msgstr "" -#: ../../library/asyncio-subprocess.rst:275 +#: ../../library/asyncio-subprocess.rst:279 msgid "" "Use the :meth:`communicate` method rather than :attr:`process.stdin.write() " "`, :attr:`await process.stdout.read() ` or :attr:`await " -"process.stderr.read `. This avoids deadlocks due to streams pausing " -"reading or writing and blocking the child process." +"process.stderr.read() `. This avoids deadlocks due to streams " +"pausing reading or writing and blocking the child process." msgstr "" -#: ../../library/asyncio-subprocess.rst:284 +#: ../../library/asyncio-subprocess.rst:288 msgid "Process identification number (PID)." msgstr "" -#: ../../library/asyncio-subprocess.rst:286 +#: ../../library/asyncio-subprocess.rst:290 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:291 +#: ../../library/asyncio-subprocess.rst:295 msgid "Return code of the process when it exits." msgstr "" -#: ../../library/asyncio-subprocess.rst:293 +#: ../../library/asyncio-subprocess.rst:297 msgid "A ``None`` value indicates that the process has not terminated yet." msgstr "" -#: ../../library/asyncio-subprocess.rst:295 +#: ../../library/asyncio-subprocess.rst:299 msgid "" "A negative value ``-N`` indicates that the child was terminated by signal " "``N`` (POSIX only)." msgstr "" -#: ../../library/asyncio-subprocess.rst:302 +#: ../../library/asyncio-subprocess.rst:306 msgid "Subprocess and Threads" msgstr "子行程與線程" -#: ../../library/asyncio-subprocess.rst:304 +#: ../../library/asyncio-subprocess.rst:308 msgid "" "Standard asyncio event loop supports running subprocesses from different " "threads by default." msgstr "" -#: ../../library/asyncio-subprocess.rst:307 +#: ../../library/asyncio-subprocess.rst:311 msgid "" "On Windows subprocesses are provided by :class:`ProactorEventLoop` only " "(default), :class:`SelectorEventLoop` has no subprocess support." msgstr "" -#: ../../library/asyncio-subprocess.rst:310 +#: ../../library/asyncio-subprocess.rst:314 msgid "" "On UNIX *child watchers* are used for subprocess finish waiting, see :ref:" "`asyncio-watchers` for more info." msgstr "" -#: ../../library/asyncio-subprocess.rst:316 +#: ../../library/asyncio-subprocess.rst:320 msgid "" "UNIX switched to use :class:`ThreadedChildWatcher` for spawning subprocesses " "from different threads without any limitation." msgstr "" -#: ../../library/asyncio-subprocess.rst:319 +#: ../../library/asyncio-subprocess.rst:323 msgid "" "Spawning a subprocess with *inactive* current child watcher raises :exc:" "`RuntimeError`." msgstr "" -#: ../../library/asyncio-subprocess.rst:322 +#: ../../library/asyncio-subprocess.rst:326 msgid "" "Note that alternative event loop implementations might have own limitations; " "please refer to their documentation." msgstr "" -#: ../../library/asyncio-subprocess.rst:327 +#: ../../library/asyncio-subprocess.rst:331 msgid "" "The :ref:`Concurrency and multithreading in asyncio ` section." msgstr "" -#: ../../library/asyncio-subprocess.rst:332 +#: ../../library/asyncio-subprocess.rst:336 msgid "Examples" msgstr "範例" -#: ../../library/asyncio-subprocess.rst:334 +#: ../../library/asyncio-subprocess.rst:338 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:340 +#: ../../library/asyncio-subprocess.rst:344 msgid "" "The subprocess is created by the :func:`create_subprocess_exec` function::" msgstr "" -#: ../../library/asyncio-subprocess.rst:367 +#: ../../library/asyncio-subprocess.rst:371 msgid "" "See also the :ref:`same example ` written " "using low-level APIs." diff --git a/library/asyncio-task.po b/library/asyncio-task.po index feb6edf424..c9dfd59440 100644 --- a/library/asyncio-task.po +++ b/library/asyncio-task.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.10\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2022-02-19 00:13+0000\n" +"POT-Creation-Date: 2022-05-21 17:35+0000\n" "PO-Revision-Date: 2018-05-23 14:39+0000\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -36,8 +36,7 @@ msgstr "協程" msgid "" ":term:`Coroutines ` declared with the async/await syntax is the " "preferred way of writing asyncio applications. For example, the following " -"snippet of code (requires Python 3.7+) prints \"hello\", waits 1 second, and " -"then prints \"world\"::" +"snippet of code prints \"hello\", waits 1 second, and then prints \"world\"::" msgstr "" #: ../../library/asyncio-task.rst:37 @@ -213,8 +212,8 @@ msgid "" "ideally only be called once." msgstr "" -#: ../../library/asyncio-task.rst:230 ../../library/asyncio-task.rst:372 -#: ../../library/asyncio-task.rst:505 ../../library/asyncio-task.rst:641 +#: ../../library/asyncio-task.rst:230 ../../library/asyncio-task.rst:357 +#: ../../library/asyncio-task.rst:490 ../../library/asyncio-task.rst:626 msgid "Example::" msgstr "" "範例:\n" @@ -253,92 +252,86 @@ msgid "" "`RuntimeError` is raised if there is no running loop in current thread." msgstr "" -#: ../../library/asyncio-task.rst:262 -msgid "" -"This function has been **added in Python 3.7**. Prior to Python 3.7, the " -"low-level :func:`asyncio.ensure_future` function can be used instead::" -msgstr "" - -#: ../../library/asyncio-task.rst:279 +#: ../../library/asyncio-task.rst:264 msgid "" "Save a reference to the result of this function, to avoid a task " "disappearing mid execution." msgstr "" -#: ../../library/asyncio-task.rst:284 ../../library/asyncio-task.rst:830 +#: ../../library/asyncio-task.rst:269 ../../library/asyncio-task.rst:815 msgid "Added the *name* parameter." msgstr "新增 *name* 參數。" -#: ../../library/asyncio-task.rst:289 +#: ../../library/asyncio-task.rst:274 msgid "Sleeping" msgstr "" -#: ../../library/asyncio-task.rst:293 +#: ../../library/asyncio-task.rst:278 msgid "Block for *delay* seconds." msgstr "" -#: ../../library/asyncio-task.rst:295 +#: ../../library/asyncio-task.rst:280 msgid "" "If *result* is provided, it is returned to the caller when the coroutine " "completes." msgstr "" -#: ../../library/asyncio-task.rst:298 +#: ../../library/asyncio-task.rst:283 msgid "" "``sleep()`` always suspends the current task, allowing other tasks to run." msgstr "" -#: ../../library/asyncio-task.rst:301 +#: ../../library/asyncio-task.rst:286 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:310 +#: ../../library/asyncio-task.rst:295 msgid "" "The ``loop`` parameter. This function has been implicitly getting the " "current running loop since 3.7. See :ref:`What's New in 3.10's Removed " "section ` for more information." msgstr "" -#: ../../library/asyncio-task.rst:313 +#: ../../library/asyncio-task.rst:298 msgid "" "Example of coroutine displaying the current date every second for 5 seconds::" msgstr "" -#: ../../library/asyncio-task.rst:331 ../../library/asyncio-task.rst:367 -#: ../../library/asyncio-task.rst:421 ../../library/asyncio-task.rst:466 -#: ../../library/asyncio-task.rst:500 ../../library/asyncio-task.rst:530 -#: ../../library/asyncio-task.rst:589 ../../library/asyncio-task.rst:624 -#: ../../library/asyncio-task.rst:638 ../../library/asyncio-task.rst:647 +#: ../../library/asyncio-task.rst:316 ../../library/asyncio-task.rst:352 +#: ../../library/asyncio-task.rst:406 ../../library/asyncio-task.rst:451 +#: ../../library/asyncio-task.rst:485 ../../library/asyncio-task.rst:515 +#: ../../library/asyncio-task.rst:574 ../../library/asyncio-task.rst:609 +#: ../../library/asyncio-task.rst:623 ../../library/asyncio-task.rst:632 msgid "Removed the *loop* parameter." msgstr "移除 *loop* 參數。" -#: ../../library/asyncio-task.rst:336 +#: ../../library/asyncio-task.rst:321 msgid "Running Tasks Concurrently" msgstr "" -#: ../../library/asyncio-task.rst:340 +#: ../../library/asyncio-task.rst:325 msgid "" "Run :ref:`awaitable objects ` in the *aws* sequence " "*concurrently*." msgstr "" -#: ../../library/asyncio-task.rst:343 +#: ../../library/asyncio-task.rst:328 msgid "" "If any awaitable in *aws* is a coroutine, it is automatically scheduled as a " "Task." msgstr "" -#: ../../library/asyncio-task.rst:346 +#: ../../library/asyncio-task.rst:331 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:350 +#: ../../library/asyncio-task.rst:335 msgid "" "If *return_exceptions* is ``False`` (default), the first raised exception is " "immediately propagated to the task that awaits on ``gather()``. Other " @@ -346,19 +339,19 @@ msgid "" "run." msgstr "" -#: ../../library/asyncio-task.rst:355 +#: ../../library/asyncio-task.rst:340 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:358 +#: ../../library/asyncio-task.rst:343 msgid "" "If ``gather()`` is *cancelled*, all submitted awaitables (that have not " "completed yet) are also *cancelled*." msgstr "" -#: ../../library/asyncio-task.rst:361 +#: ../../library/asyncio-task.rst:346 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** " @@ -366,7 +359,7 @@ msgid "" "submitted Task/Future to cause other Tasks/Futures to be cancelled." msgstr "" -#: ../../library/asyncio-task.rst:410 +#: ../../library/asyncio-task.rst:395 msgid "" "If *return_exceptions* is False, cancelling gather() after it has been " "marked done won't cancel any submitted awaitables. For instance, gather can " @@ -375,42 +368,42 @@ msgid "" "the awaitables) from gather won't cancel any other awaitables." msgstr "" -#: ../../library/asyncio-task.rst:417 +#: ../../library/asyncio-task.rst:402 msgid "" "If the *gather* itself is cancelled, the cancellation is propagated " "regardless of *return_exceptions*." msgstr "" -#: ../../library/asyncio-task.rst:424 +#: ../../library/asyncio-task.rst:409 msgid "" "Deprecation warning is emitted if no positional arguments are provided or " "not all positional arguments are Future-like objects and there is no running " "event loop." msgstr "" -#: ../../library/asyncio-task.rst:431 +#: ../../library/asyncio-task.rst:416 msgid "Shielding From Cancellation" msgstr "" -#: ../../library/asyncio-task.rst:435 +#: ../../library/asyncio-task.rst:420 msgid "" "Protect an :ref:`awaitable object ` from being :meth:" "`cancelled `." msgstr "" -#: ../../library/asyncio-task.rst:438 ../../library/asyncio-task.rst:482 +#: ../../library/asyncio-task.rst:423 ../../library/asyncio-task.rst:467 msgid "If *aw* is a coroutine it is automatically scheduled as a Task." msgstr "" -#: ../../library/asyncio-task.rst:440 +#: ../../library/asyncio-task.rst:425 msgid "The statement::" msgstr "" -#: ../../library/asyncio-task.rst:444 +#: ../../library/asyncio-task.rst:429 msgid "is equivalent to::" msgstr "" -#: ../../library/asyncio-task.rst:448 +#: ../../library/asyncio-task.rst:433 msgid "" "*except* that if the coroutine containing it is cancelled, the Task running " "in ``something()`` is not cancelled. From the point of view of " @@ -419,178 +412,178 @@ msgid "" "`CancelledError`." msgstr "" -#: ../../library/asyncio-task.rst:454 +#: ../../library/asyncio-task.rst:439 msgid "" "If ``something()`` is cancelled by other means (i.e. from within itself) " "that would also cancel ``shield()``." msgstr "" -#: ../../library/asyncio-task.rst:457 +#: ../../library/asyncio-task.rst:442 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:469 +#: ../../library/asyncio-task.rst:454 msgid "" "Deprecation warning is emitted if *aw* is not Future-like object and there " "is no running event loop." msgstr "" -#: ../../library/asyncio-task.rst:475 +#: ../../library/asyncio-task.rst:460 msgid "Timeouts" msgstr "" -#: ../../library/asyncio-task.rst:479 +#: ../../library/asyncio-task.rst:464 msgid "" "Wait for the *aw* :ref:`awaitable ` to complete with a " "timeout." msgstr "" -#: ../../library/asyncio-task.rst:484 +#: ../../library/asyncio-task.rst:469 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:488 +#: ../../library/asyncio-task.rst:473 msgid "" "If a timeout occurs, it cancels the task and raises :exc:`asyncio." "TimeoutError`." msgstr "" -#: ../../library/asyncio-task.rst:491 +#: ../../library/asyncio-task.rst:476 msgid "" "To avoid the task :meth:`cancellation `, wrap it in :func:" "`shield`." msgstr "" -#: ../../library/asyncio-task.rst:494 +#: ../../library/asyncio-task.rst:479 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:498 +#: ../../library/asyncio-task.rst:483 msgid "If the wait is cancelled, the future *aw* is also cancelled." msgstr "" -#: ../../library/asyncio-task.rst:525 +#: ../../library/asyncio-task.rst:510 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:535 +#: ../../library/asyncio-task.rst:520 msgid "Waiting Primitives" msgstr "" -#: ../../library/asyncio-task.rst:539 +#: ../../library/asyncio-task.rst:524 msgid "" "Run :ref:`awaitable objects ` in the *aws* iterable " "concurrently and block until the condition specified by *return_when*." msgstr "" -#: ../../library/asyncio-task.rst:543 +#: ../../library/asyncio-task.rst:528 msgid "The *aws* iterable must not be empty." msgstr "" -#: ../../library/asyncio-task.rst:545 +#: ../../library/asyncio-task.rst:530 msgid "Returns two sets of Tasks/Futures: ``(done, pending)``." msgstr "" -#: ../../library/asyncio-task.rst:547 +#: ../../library/asyncio-task.rst:532 msgid "Usage::" msgstr "" "用法:\n" "\n" "::" -#: ../../library/asyncio-task.rst:551 +#: ../../library/asyncio-task.rst:536 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:554 +#: ../../library/asyncio-task.rst:539 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:558 +#: ../../library/asyncio-task.rst:543 msgid "" "*return_when* indicates when this function should return. It must be one of " "the following constants:" msgstr "" -#: ../../library/asyncio-task.rst:564 +#: ../../library/asyncio-task.rst:549 msgid "Constant" msgstr "常數" -#: ../../library/asyncio-task.rst:564 +#: ../../library/asyncio-task.rst:549 msgid "Description" msgstr "描述" -#: ../../library/asyncio-task.rst:566 +#: ../../library/asyncio-task.rst:551 msgid ":const:`FIRST_COMPLETED`" msgstr ":const:`FIRST_COMPLETED`" -#: ../../library/asyncio-task.rst:566 +#: ../../library/asyncio-task.rst:551 msgid "The function will return when any future finishes or is cancelled." msgstr "" -#: ../../library/asyncio-task.rst:569 +#: ../../library/asyncio-task.rst:554 msgid ":const:`FIRST_EXCEPTION`" msgstr ":const:`FIRST_EXCEPTION`" -#: ../../library/asyncio-task.rst:569 +#: ../../library/asyncio-task.rst:554 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:575 +#: ../../library/asyncio-task.rst:560 msgid ":const:`ALL_COMPLETED`" msgstr ":const:`ALL_COMPLETED`" -#: ../../library/asyncio-task.rst:575 +#: ../../library/asyncio-task.rst:560 msgid "The function will return when all futures finish or are cancelled." msgstr "" -#: ../../library/asyncio-task.rst:579 +#: ../../library/asyncio-task.rst:564 msgid "" "Unlike :func:`~asyncio.wait_for`, ``wait()`` does not cancel the futures " "when a timeout occurs." msgstr "" -#: ../../library/asyncio-task.rst:584 +#: ../../library/asyncio-task.rst:569 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:595 +#: ../../library/asyncio-task.rst:580 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:608 +#: ../../library/asyncio-task.rst:593 msgid "Here is how the above snippet can be fixed::" msgstr "" -#: ../../library/asyncio-task.rst:621 +#: ../../library/asyncio-task.rst:606 msgid "Passing coroutine objects to ``wait()`` directly is deprecated." msgstr "" -#: ../../library/asyncio-task.rst:630 +#: ../../library/asyncio-task.rst:615 msgid "" "Run :ref:`awaitable objects ` in the *aws* iterable " "concurrently. Return an iterator of coroutines. Each coroutine returned can " @@ -598,27 +591,27 @@ msgid "" "remaining awaitables." msgstr "" -#: ../../library/asyncio-task.rst:635 +#: ../../library/asyncio-task.rst:620 msgid "" "Raises :exc:`asyncio.TimeoutError` if the timeout occurs before all Futures " "are done." msgstr "" -#: ../../library/asyncio-task.rst:650 +#: ../../library/asyncio-task.rst:635 msgid "" "Deprecation warning is emitted if not all awaitable objects in the *aws* " "iterable are Future-like objects and there is no running event loop." msgstr "" -#: ../../library/asyncio-task.rst:656 +#: ../../library/asyncio-task.rst:641 msgid "Running in Threads" msgstr "" -#: ../../library/asyncio-task.rst:660 +#: ../../library/asyncio-task.rst:645 msgid "Asynchronously run function *func* in a separate thread." msgstr "" -#: ../../library/asyncio-task.rst:662 +#: ../../library/asyncio-task.rst:647 msgid "" "Any \\*args and \\*\\*kwargs supplied for this function are directly passed " "to *func*. Also, the current :class:`contextvars.Context` is propagated, " @@ -626,19 +619,19 @@ msgid "" "separate thread." msgstr "" -#: ../../library/asyncio-task.rst:667 +#: ../../library/asyncio-task.rst:652 msgid "" "Return a coroutine that can be awaited to get the eventual result of *func*." msgstr "" -#: ../../library/asyncio-task.rst:669 +#: ../../library/asyncio-task.rst:654 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:699 +#: ../../library/asyncio-task.rst:684 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, " @@ -646,7 +639,7 @@ msgid "" "blocking the event loop." msgstr "" -#: ../../library/asyncio-task.rst:706 +#: ../../library/asyncio-task.rst:691 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 " @@ -654,81 +647,81 @@ msgid "" "`asyncio.to_thread()` can also be used for CPU-bound functions." msgstr "" -#: ../../library/asyncio-task.rst:715 +#: ../../library/asyncio-task.rst:700 msgid "Scheduling From Other Threads" msgstr "" -#: ../../library/asyncio-task.rst:719 +#: ../../library/asyncio-task.rst:704 msgid "Submit a coroutine to the given event loop. Thread-safe." msgstr "" -#: ../../library/asyncio-task.rst:721 +#: ../../library/asyncio-task.rst:706 msgid "" "Return a :class:`concurrent.futures.Future` to wait for the result from " "another OS thread." msgstr "" -#: ../../library/asyncio-task.rst:724 +#: ../../library/asyncio-task.rst:709 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:736 +#: ../../library/asyncio-task.rst:721 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:750 +#: ../../library/asyncio-task.rst:735 msgid "" "See the :ref:`concurrency and multithreading ` " "section of the documentation." msgstr "" -#: ../../library/asyncio-task.rst:753 +#: ../../library/asyncio-task.rst:738 msgid "" "Unlike other asyncio functions this function requires the *loop* argument to " "be passed explicitly." msgstr "" -#: ../../library/asyncio-task.rst:760 +#: ../../library/asyncio-task.rst:745 msgid "Introspection" msgstr "" -#: ../../library/asyncio-task.rst:765 +#: ../../library/asyncio-task.rst:750 msgid "" "Return the currently running :class:`Task` instance, or ``None`` if no task " "is running." msgstr "" -#: ../../library/asyncio-task.rst:768 +#: ../../library/asyncio-task.rst:753 msgid "" "If *loop* is ``None`` :func:`get_running_loop` is used to get the current " "loop." msgstr "" -#: ../../library/asyncio-task.rst:776 +#: ../../library/asyncio-task.rst:761 msgid "Return a set of not yet finished :class:`Task` objects run by the loop." msgstr "" -#: ../../library/asyncio-task.rst:779 +#: ../../library/asyncio-task.rst:764 msgid "" "If *loop* is ``None``, :func:`get_running_loop` is used for getting current " "loop." msgstr "" -#: ../../library/asyncio-task.rst:786 +#: ../../library/asyncio-task.rst:771 msgid "Task Object" msgstr "" -#: ../../library/asyncio-task.rst:790 +#: ../../library/asyncio-task.rst:775 msgid "" "A :class:`Future-like ` object that runs a Python :ref:`coroutine " "`. Not thread-safe." msgstr "" -#: ../../library/asyncio-task.rst:793 +#: ../../library/asyncio-task.rst:778 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 " @@ -736,21 +729,21 @@ msgid "" "wrapped coroutine resumes." msgstr "" -#: ../../library/asyncio-task.rst:799 +#: ../../library/asyncio-task.rst:784 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:804 +#: ../../library/asyncio-task.rst:789 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:809 +#: ../../library/asyncio-task.rst:794 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 " @@ -758,47 +751,47 @@ msgid "" "cancellation, the Future object will be cancelled." msgstr "" -#: ../../library/asyncio-task.rst:814 +#: ../../library/asyncio-task.rst:799 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:819 +#: ../../library/asyncio-task.rst:804 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:823 +#: ../../library/asyncio-task.rst:808 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:827 +#: ../../library/asyncio-task.rst:812 msgid "Added support for the :mod:`contextvars` module." msgstr "" -#: ../../library/asyncio-task.rst:833 +#: ../../library/asyncio-task.rst:818 msgid "" "Deprecation warning is emitted if *loop* is not specified and there is no " "running event loop." msgstr "" -#: ../../library/asyncio-task.rst:839 +#: ../../library/asyncio-task.rst:824 msgid "Request the Task to be cancelled." msgstr "" -#: ../../library/asyncio-task.rst:841 +#: ../../library/asyncio-task.rst:826 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:844 +#: ../../library/asyncio-task.rst:829 msgid "" "The coroutine then has a chance to clean up or even deny the request by " "suppressing the exception with a :keyword:`try` ... ... ``except " @@ -808,103 +801,103 @@ msgid "" "is actively discouraged." msgstr "" -#: ../../library/asyncio-task.rst:852 +#: ../../library/asyncio-task.rst:837 msgid "Added the *msg* parameter." msgstr "新增 *msg* 參數。" -#: ../../library/asyncio-task.rst:857 +#: ../../library/asyncio-task.rst:842 msgid "" "The following example illustrates how coroutines can intercept the " "cancellation request::" msgstr "" -#: ../../library/asyncio-task.rst:896 +#: ../../library/asyncio-task.rst:881 msgid "Return ``True`` if the Task is *cancelled*." msgstr "" -#: ../../library/asyncio-task.rst:898 +#: ../../library/asyncio-task.rst:883 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:904 +#: ../../library/asyncio-task.rst:889 msgid "Return ``True`` if the Task is *done*." msgstr "" -#: ../../library/asyncio-task.rst:906 +#: ../../library/asyncio-task.rst:891 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:911 +#: ../../library/asyncio-task.rst:896 msgid "Return the result of the Task." msgstr "" -#: ../../library/asyncio-task.rst:913 +#: ../../library/asyncio-task.rst:898 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:917 ../../library/asyncio-task.rst:931 +#: ../../library/asyncio-task.rst:902 ../../library/asyncio-task.rst:916 msgid "" "If the Task has been *cancelled*, this method raises a :exc:`CancelledError` " "exception." msgstr "" -#: ../../library/asyncio-task.rst:920 +#: ../../library/asyncio-task.rst:905 msgid "" "If the Task's result isn't yet available, this method raises a :exc:" "`InvalidStateError` exception." msgstr "" -#: ../../library/asyncio-task.rst:925 +#: ../../library/asyncio-task.rst:910 msgid "Return the exception of the Task." msgstr "" -#: ../../library/asyncio-task.rst:927 +#: ../../library/asyncio-task.rst:912 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:934 +#: ../../library/asyncio-task.rst:919 msgid "" "If the Task isn't *done* yet, this method raises an :exc:`InvalidStateError` " "exception." msgstr "" -#: ../../library/asyncio-task.rst:939 +#: ../../library/asyncio-task.rst:924 msgid "Add a callback to be run when the Task is *done*." msgstr "" -#: ../../library/asyncio-task.rst:941 ../../library/asyncio-task.rst:950 +#: ../../library/asyncio-task.rst:926 ../../library/asyncio-task.rst:935 msgid "This method should only be used in low-level callback-based code." msgstr "" -#: ../../library/asyncio-task.rst:943 +#: ../../library/asyncio-task.rst:928 msgid "" "See the documentation of :meth:`Future.add_done_callback` for more details." msgstr "" -#: ../../library/asyncio-task.rst:948 +#: ../../library/asyncio-task.rst:933 msgid "Remove *callback* from the callbacks list." msgstr "" -#: ../../library/asyncio-task.rst:952 +#: ../../library/asyncio-task.rst:937 msgid "" "See the documentation of :meth:`Future.remove_done_callback` for more " "details." msgstr "" -#: ../../library/asyncio-task.rst:957 +#: ../../library/asyncio-task.rst:942 msgid "Return the list of stack frames for this Task." msgstr "" -#: ../../library/asyncio-task.rst:959 +#: ../../library/asyncio-task.rst:944 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, " @@ -912,15 +905,15 @@ msgid "" "this returns the list of traceback frames." msgstr "" -#: ../../library/asyncio-task.rst:965 +#: ../../library/asyncio-task.rst:950 msgid "The frames are always ordered from oldest to newest." msgstr "" -#: ../../library/asyncio-task.rst:967 +#: ../../library/asyncio-task.rst:952 msgid "Only one stack frame is returned for a suspended coroutine." msgstr "" -#: ../../library/asyncio-task.rst:969 +#: ../../library/asyncio-task.rst:954 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 " @@ -929,111 +922,111 @@ msgid "" "are returned. (This matches the behavior of the traceback module.)" msgstr "" -#: ../../library/asyncio-task.rst:978 +#: ../../library/asyncio-task.rst:963 msgid "Print the stack or traceback for this Task." msgstr "" -#: ../../library/asyncio-task.rst:980 +#: ../../library/asyncio-task.rst:965 msgid "" "This produces output similar to that of the traceback module for the frames " "retrieved by :meth:`get_stack`." msgstr "" -#: ../../library/asyncio-task.rst:983 +#: ../../library/asyncio-task.rst:968 msgid "The *limit* argument is passed to :meth:`get_stack` directly." msgstr "" -#: ../../library/asyncio-task.rst:985 +#: ../../library/asyncio-task.rst:970 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:990 +#: ../../library/asyncio-task.rst:975 msgid "Return the coroutine object wrapped by the :class:`Task`." msgstr "" -#: ../../library/asyncio-task.rst:996 +#: ../../library/asyncio-task.rst:981 msgid "Return the name of the Task." msgstr "" -#: ../../library/asyncio-task.rst:998 +#: ../../library/asyncio-task.rst:983 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:1006 +#: ../../library/asyncio-task.rst:991 msgid "Set the name of the Task." msgstr "" -#: ../../library/asyncio-task.rst:1008 +#: ../../library/asyncio-task.rst:993 msgid "" "The *value* argument can be any object, which is then converted to a string." msgstr "" -#: ../../library/asyncio-task.rst:1011 +#: ../../library/asyncio-task.rst:996 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:1020 +#: ../../library/asyncio-task.rst:1005 msgid "Generator-based Coroutines" msgstr "" -#: ../../library/asyncio-task.rst:1024 +#: ../../library/asyncio-task.rst:1009 msgid "" "Support for generator-based coroutines is **deprecated** and is removed in " "Python 3.11." msgstr "" -#: ../../library/asyncio-task.rst:1027 +#: ../../library/asyncio-task.rst:1012 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:1031 +#: ../../library/asyncio-task.rst:1016 msgid "" "Generator-based coroutines should be decorated with :func:`@asyncio." "coroutine `, although this is not enforced." msgstr "" -#: ../../library/asyncio-task.rst:1038 +#: ../../library/asyncio-task.rst:1023 msgid "Decorator to mark generator-based coroutines." msgstr "" -#: ../../library/asyncio-task.rst:1040 +#: ../../library/asyncio-task.rst:1025 msgid "" "This decorator enables legacy generator-based coroutines to be compatible " "with async/await code::" msgstr "" -#: ../../library/asyncio-task.rst:1050 +#: ../../library/asyncio-task.rst:1035 msgid "This decorator should not be used for :keyword:`async def` coroutines." msgstr "" -#: ../../library/asyncio-task.rst:1055 +#: ../../library/asyncio-task.rst:1040 msgid "Use :keyword:`async def` instead." msgstr "" -#: ../../library/asyncio-task.rst:1059 +#: ../../library/asyncio-task.rst:1044 msgid "Return ``True`` if *obj* is a :ref:`coroutine object `." msgstr "" -#: ../../library/asyncio-task.rst:1061 +#: ../../library/asyncio-task.rst:1046 msgid "" "This method is different from :func:`inspect.iscoroutine` because it returns " "``True`` for generator-based coroutines." msgstr "" -#: ../../library/asyncio-task.rst:1066 +#: ../../library/asyncio-task.rst:1051 msgid "Return ``True`` if *func* is a :ref:`coroutine function `." msgstr "" -#: ../../library/asyncio-task.rst:1069 +#: ../../library/asyncio-task.rst:1054 msgid "" "This method is different from :func:`inspect.iscoroutinefunction` because it " "returns ``True`` for generator-based coroutine functions decorated with :" diff --git a/library/asyncio.po b/library/asyncio.po index 54b62e2f4b..d085d6d888 100644 --- a/library/asyncio.po +++ b/library/asyncio.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.10\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2021-12-16 19:33+0000\n" +"POT-Creation-Date: 2022-05-21 17:35+0000\n" "PO-Revision-Date: 2021-11-23 12:40+0800\n" "Last-Translator: Matt Wang \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -20,15 +20,15 @@ msgstr "" "Plural-Forms: nplurals=1; plural=0;\n" "X-Generator: Poedit 3.0\n" -#: ../../library/asyncio.rst:66 +#: ../../library/asyncio.rst:65 msgid "High-level APIs" msgstr "高階 API" -#: ../../library/asyncio.rst:77 +#: ../../library/asyncio.rst:76 msgid "Low-level APIs" msgstr "低階 API" -#: ../../library/asyncio.rst:87 +#: ../../library/asyncio.rst:86 msgid "Guides and Tutorials" msgstr "指南與教學" @@ -40,7 +40,7 @@ msgstr ":mod:`asyncio` --- 非同步 I/O" msgid "Hello World!" msgstr "Hello World!" -#: ../../library/asyncio.rst:23 +#: ../../library/asyncio.rst:22 msgid "" "asyncio is a library to write **concurrent** code using the **async/await** " "syntax." @@ -48,7 +48,7 @@ msgstr "" "asyncio 是讓使用者以 **async/await** 語法來編寫\\ *並行 (concurrent)* 程式碼" "的函式庫 (library)。" -#: ../../library/asyncio.rst:26 +#: ../../library/asyncio.rst:25 msgid "" "asyncio is used as a foundation for multiple Python asynchronous frameworks " "that provide high-performance network and web-servers, database connection " @@ -57,48 +57,48 @@ msgstr "" "asyncio 作為多個 Python 非同步框架的基礎,在高效能網路與網頁伺服器、資料庫連" "線函式庫、分散式任務佇列等服務都可以看得到它。" -#: ../../library/asyncio.rst:30 +#: ../../library/asyncio.rst:29 msgid "" "asyncio is often a perfect fit for IO-bound and high-level **structured** " "network code." msgstr "" "asyncio 往往是個建構 IO 密集型與高階層\\ **結構化**\\ 網路程式碼的完美選擇。" -#: ../../library/asyncio.rst:33 +#: ../../library/asyncio.rst:32 msgid "asyncio provides a set of **high-level** APIs to:" msgstr "asyncio 提供了一系列\\ **高階** API:" -#: ../../library/asyncio.rst:35 +#: ../../library/asyncio.rst:34 msgid "" ":ref:`run Python coroutines ` concurrently and have full control " "over their execution;" msgstr "" "並行地\\ :ref:`運行 Python 協程 (coroutine) ` 並擁有完整控制權;" -#: ../../library/asyncio.rst:38 +#: ../../library/asyncio.rst:37 msgid "perform :ref:`network IO and IPC `;" msgstr "執行\\ :ref:`網路 IO 與 IPC `;" -#: ../../library/asyncio.rst:40 +#: ../../library/asyncio.rst:39 msgid "control :ref:`subprocesses `;" msgstr "控制\\ :ref:`子行程 (subprocess) `;" -#: ../../library/asyncio.rst:42 +#: ../../library/asyncio.rst:41 msgid "distribute tasks via :ref:`queues `;" msgstr "透過\\ :ref:`佇列 (queue) ` 分配任務;" -#: ../../library/asyncio.rst:44 +#: ../../library/asyncio.rst:43 msgid ":ref:`synchronize ` concurrent code;" msgstr ":ref:`同步 `\\ 並行程式碼;" -#: ../../library/asyncio.rst:46 +#: ../../library/asyncio.rst:45 msgid "" "Additionally, there are **low-level** APIs for *library and framework " "developers* to:" msgstr "" "此外,還有一些給\\ *函式庫與框架 (framework) 開發者*\\ 的\\ **低階** API:" -#: ../../library/asyncio.rst:49 +#: ../../library/asyncio.rst:48 msgid "" "create and manage :ref:`event loops `, which provide " "asynchronous APIs for :meth:`networking `, running :meth:" @@ -110,7 +110,7 @@ msgstr "" "subprocess_exec>`、處理\\ :meth:`作業系統訊號 `\\ 等" "任務的非同步 API;" -#: ../../library/asyncio.rst:54 +#: ../../library/asyncio.rst:53 msgid "" "implement efficient protocols using :ref:`transports `;" @@ -118,7 +118,7 @@ msgstr "" "使用 :ref:`transports(asyncio 底層傳輸相關類別) `\\ 來實作高效能協定;" -#: ../../library/asyncio.rst:57 +#: ../../library/asyncio.rst:56 msgid "" ":ref:`bridge ` callback-based libraries and code with async/" "await syntax." @@ -126,10 +126,10 @@ msgstr "" "透過 async/await 語法來\\ :ref:`橋接 `\\ 基於回呼 (callback-" "based) 的函式庫與程式碼。" -#: ../../library/asyncio.rst:65 +#: ../../library/asyncio.rst:64 msgid "Reference" msgstr "參閱" -#: ../../library/asyncio.rst:96 +#: ../../library/asyncio.rst:95 msgid "The source code for asyncio can be found in :source:`Lib/asyncio/`." msgstr "asyncio 的原始碼可以在 :source:`Lib/asyncio/` 中找到。" diff --git a/library/asyncore.po b/library/asyncore.po index 715d1a725b..39f980df22 100644 --- a/library/asyncore.po +++ b/library/asyncore.po @@ -7,8 +7,8 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.10\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2022-03-21 00:13+0000\n" -"PO-Revision-Date: 2022-03-23 15:51+0800\n" +"POT-Creation-Date: 2022-05-21 17:35+0000\n" +"PO-Revision-Date: 2022-05-22 02:00+0800\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" "tw)\n" @@ -29,25 +29,25 @@ msgstr "**原始碼:**\\ :source:`Lib/asyncore.py`" #: ../../library/asyncore.rst:16 msgid "" -":mod:`asyncore` will be removed in Python 3.12 (:pep:`594`). Please use :mod:" -"`asyncio` instead." +":mod:`asyncore` will be removed in Python 3.12 (see :pep:`PEP 594 " +"<594#asyncore>` for details). Please use :mod:`asyncio` instead." msgstr "" -":mod:`asyncore` 將於 Python 3.12 中移除(\\ :pep:`594`\\ )。請改用 :mod:" -"`asyncio`\\ 。" +":mod:`asyncore` 將於 Python 3.12 中移除(詳情請見:pep:`PEP 594 " +"<594#asyncore>`\\ )。請改用 :mod:`asyncio`\\ 。" -#: ../../library/asyncore.rst:24 +#: ../../library/asyncore.rst:25 msgid "" "This module exists for backwards compatibility only. For new code we " "recommend using :mod:`asyncio`." msgstr "" -#: ../../library/asyncore.rst:27 +#: ../../library/asyncore.rst:28 msgid "" "This module provides the basic infrastructure for writing asynchronous " "socket service clients and servers." msgstr "" -#: ../../library/asyncore.rst:30 +#: ../../library/asyncore.rst:31 msgid "" "There are only two ways to have a program on a single processor do \"more " "than one thing at a time.\" Multi-threaded programming is the simplest and " @@ -59,7 +59,7 @@ msgid "" "servers are rarely processor bound, however." msgstr "" -#: ../../library/asyncore.rst:39 +#: ../../library/asyncore.rst:40 msgid "" "If your operating system supports the :c:func:`select` system call in its I/" "O library (and nearly all do), then you can use it to juggle multiple " @@ -73,7 +73,7 @@ msgid "" "module is invaluable." msgstr "" -#: ../../library/asyncore.rst:50 +#: ../../library/asyncore.rst:51 msgid "" "The basic idea behind both modules is to create one or more network " "*channels*, instances of class :class:`asyncore.dispatcher` and :class:" @@ -82,7 +82,7 @@ msgid "" "*map*." msgstr "" -#: ../../library/asyncore.rst:56 +#: ../../library/asyncore.rst:57 msgid "" "Once the initial channel(s) is(are) created, calling the :func:`loop` " "function activates channel service, which continues until the last channel " @@ -90,7 +90,7 @@ msgid "" "is closed." msgstr "" -#: ../../library/asyncore.rst:63 +#: ../../library/asyncore.rst:64 msgid "" "Enter a polling loop that terminates after count passes or all open channels " "have been closed. All arguments are optional. The *count* parameter " @@ -102,7 +102,7 @@ msgid "" "preference to :func:`~select.select` (the default is ``False``)." msgstr "" -#: ../../library/asyncore.rst:72 +#: ../../library/asyncore.rst:73 msgid "" "The *map* parameter is a dictionary whose items are the channels to watch. " "As channels are closed they are deleted from their map. If *map* is " @@ -111,7 +111,7 @@ msgid "" "be mixed in the map." msgstr "" -#: ../../library/asyncore.rst:81 +#: ../../library/asyncore.rst:82 msgid "" "The :class:`dispatcher` class is a thin wrapper around a low-level socket " "object. To make it more useful, it has a few methods for event-handling " @@ -119,7 +119,7 @@ msgid "" "as a normal non-blocking socket object." msgstr "" -#: ../../library/asyncore.rst:86 +#: ../../library/asyncore.rst:87 msgid "" "The firing of low-level events at certain times or in certain connection " "states tells the asynchronous loop that certain higher-level events have " @@ -130,39 +130,39 @@ msgid "" "events are:" msgstr "" -#: ../../library/asyncore.rst:95 +#: ../../library/asyncore.rst:96 msgid "Event" msgstr "" -#: ../../library/asyncore.rst:95 +#: ../../library/asyncore.rst:96 msgid "Description" msgstr "描述" -#: ../../library/asyncore.rst:97 +#: ../../library/asyncore.rst:98 msgid "``handle_connect()``" msgstr "``handle_connect()``" -#: ../../library/asyncore.rst:97 +#: ../../library/asyncore.rst:98 msgid "Implied by the first read or write event" msgstr "" -#: ../../library/asyncore.rst:100 +#: ../../library/asyncore.rst:101 msgid "``handle_close()``" msgstr "``handle_close()``" -#: ../../library/asyncore.rst:100 +#: ../../library/asyncore.rst:101 msgid "Implied by a read event with no data available" msgstr "" -#: ../../library/asyncore.rst:103 +#: ../../library/asyncore.rst:104 msgid "``handle_accepted()``" msgstr "``handle_accepted()``" -#: ../../library/asyncore.rst:103 +#: ../../library/asyncore.rst:104 msgid "Implied by a read event on a listening socket" msgstr "" -#: ../../library/asyncore.rst:107 +#: ../../library/asyncore.rst:108 msgid "" "During asynchronous processing, each mapped channel's :meth:`readable` and :" "meth:`writable` methods are used to determine whether the channel's socket " @@ -170,49 +170,49 @@ msgid "" "`poll`\\ ed for read and write events." msgstr "" -#: ../../library/asyncore.rst:112 +#: ../../library/asyncore.rst:113 msgid "" "Thus, the set of channel events is larger than the basic socket events. The " "full set of methods that can be overridden in your subclass follows:" msgstr "" -#: ../../library/asyncore.rst:118 +#: ../../library/asyncore.rst:119 msgid "" "Called when the asynchronous loop detects that a :meth:`read` call on the " "channel's socket will succeed." msgstr "" -#: ../../library/asyncore.rst:124 +#: ../../library/asyncore.rst:125 msgid "" "Called when the asynchronous loop detects that a writable socket can be " "written. Often this method will implement the necessary buffering for " "performance. For example::" msgstr "" -#: ../../library/asyncore.rst:135 +#: ../../library/asyncore.rst:136 msgid "" "Called when there is out of band (OOB) data for a socket connection. This " "will almost never happen, as OOB is tenuously supported and rarely used." msgstr "" -#: ../../library/asyncore.rst:141 +#: ../../library/asyncore.rst:142 msgid "" "Called when the active opener's socket actually makes a connection. Might " "send a \"welcome\" banner, or initiate a protocol negotiation with the " "remote endpoint, for example." msgstr "" -#: ../../library/asyncore.rst:148 +#: ../../library/asyncore.rst:149 msgid "Called when the socket is closed." msgstr "" -#: ../../library/asyncore.rst:153 +#: ../../library/asyncore.rst:154 msgid "" "Called when an exception is raised and not otherwise handled. The default " "version prints a condensed traceback." msgstr "" -#: ../../library/asyncore.rst:159 +#: ../../library/asyncore.rst:160 msgid "" "Called on listening channels (passive openers) when a connection can be " "established with a new remote endpoint that has issued a :meth:`connect` " @@ -220,7 +220,7 @@ msgid "" "`handle_accepted` instead." msgstr "" -#: ../../library/asyncore.rst:169 +#: ../../library/asyncore.rst:170 msgid "" "Called on listening channels (passive openers) when a connection has been " "established with a new remote endpoint that has issued a :meth:`connect` " @@ -229,7 +229,7 @@ msgid "" "socket on the other end of the connection." msgstr "" -#: ../../library/asyncore.rst:180 +#: ../../library/asyncore.rst:181 msgid "" "Called each time around the asynchronous loop to determine whether a " "channel's socket should be added to the list on which read events can " @@ -237,7 +237,7 @@ msgid "" "default, all channels will be interested in read events." msgstr "" -#: ../../library/asyncore.rst:188 +#: ../../library/asyncore.rst:189 msgid "" "Called each time around the asynchronous loop to determine whether a " "channel's socket should be added to the list on which write events can " @@ -245,55 +245,55 @@ msgid "" "default, all channels will be interested in write events." msgstr "" -#: ../../library/asyncore.rst:194 +#: ../../library/asyncore.rst:195 msgid "" "In addition, each channel delegates or extends many of the socket methods. " "Most of these are nearly identical to their socket partners." msgstr "" -#: ../../library/asyncore.rst:200 +#: ../../library/asyncore.rst:201 msgid "" "This is identical to the creation of a normal socket, and will use the same " "options for creation. Refer to the :mod:`socket` documentation for " "information on creating sockets." msgstr "" -#: ../../library/asyncore.rst:204 +#: ../../library/asyncore.rst:205 msgid "*family* and *type* arguments can be omitted." msgstr "" -#: ../../library/asyncore.rst:210 +#: ../../library/asyncore.rst:211 msgid "" "As with the normal socket object, *address* is a tuple with the first " "element the host to connect to, and the second the port number." msgstr "" -#: ../../library/asyncore.rst:216 +#: ../../library/asyncore.rst:217 msgid "Send *data* to the remote end-point of the socket." msgstr "" -#: ../../library/asyncore.rst:221 +#: ../../library/asyncore.rst:222 msgid "" "Read at most *buffer_size* bytes from the socket's remote end-point. An " "empty bytes object implies that the channel has been closed from the other " "end." msgstr "" -#: ../../library/asyncore.rst:225 +#: ../../library/asyncore.rst:226 msgid "" "Note that :meth:`recv` may raise :exc:`BlockingIOError` , even though :func:" "`select.select` or :func:`select.poll` has reported the socket ready for " "reading." msgstr "" -#: ../../library/asyncore.rst:232 +#: ../../library/asyncore.rst:233 msgid "" "Listen for connections made to the socket. The *backlog* argument specifies " "the maximum number of queued connections and should be at least 1; the " "maximum value is system-dependent (usually 5)." msgstr "" -#: ../../library/asyncore.rst:239 +#: ../../library/asyncore.rst:240 msgid "" "Bind the socket to *address*. The socket must not already be bound. (The " "format of *address* depends on the address family --- refer to the :mod:" @@ -302,7 +302,7 @@ msgid "" "`dispatcher` object's :meth:`set_reuse_addr` method." msgstr "" -#: ../../library/asyncore.rst:248 +#: ../../library/asyncore.rst:249 msgid "" "Accept a connection. The socket must be bound to an address and listening " "for connections. The return value can be either ``None`` or a pair ``(conn, " @@ -313,21 +313,21 @@ msgid "" "this event and keep listening for further incoming connections." msgstr "" -#: ../../library/asyncore.rst:260 +#: ../../library/asyncore.rst:261 msgid "" "Close the socket. All future operations on the socket object will fail. The " "remote end-point will receive no more data (after queued data is flushed). " "Sockets are automatically closed when they are garbage-collected." msgstr "" -#: ../../library/asyncore.rst:268 +#: ../../library/asyncore.rst:269 msgid "" "A :class:`dispatcher` subclass which adds simple buffered output capability, " "useful for simple clients. For more sophisticated usage use :class:`asynchat." "async_chat`." msgstr "" -#: ../../library/asyncore.rst:274 +#: ../../library/asyncore.rst:275 msgid "" "A file_dispatcher takes a file descriptor or :term:`file object` along with " "an optional map argument and wraps it for use with the :c:func:`poll` or :c:" @@ -336,11 +336,11 @@ msgid "" "`file_wrapper` constructor." msgstr "" -#: ../../library/asyncore.rst:280 ../../library/asyncore.rst:289 +#: ../../library/asyncore.rst:281 ../../library/asyncore.rst:290 msgid ":ref:`Availability `: Unix." msgstr ":ref:`適用 `:Unix。" -#: ../../library/asyncore.rst:284 +#: ../../library/asyncore.rst:285 msgid "" "A file_wrapper takes an integer file descriptor and calls :func:`os.dup` to " "duplicate the handle so that the original handle may be closed independently " @@ -348,21 +348,21 @@ msgid "" "socket for use by the :class:`file_dispatcher` class." msgstr "" -#: ../../library/asyncore.rst:295 +#: ../../library/asyncore.rst:296 msgid "asyncore Example basic HTTP client" msgstr "" -#: ../../library/asyncore.rst:297 +#: ../../library/asyncore.rst:298 msgid "" "Here is a very basic HTTP client that uses the :class:`dispatcher` class to " "implement its socket handling::" msgstr "" -#: ../../library/asyncore.rst:334 +#: ../../library/asyncore.rst:335 msgid "asyncore Example basic echo server" msgstr "" -#: ../../library/asyncore.rst:336 +#: ../../library/asyncore.rst:337 msgid "" "Here is a basic echo server that uses the :class:`dispatcher` class to " "accept connections and dispatches the incoming connections to a handler::" diff --git a/library/audioop.po b/library/audioop.po index 64b455dc4d..8e2199f058 100644 --- a/library/audioop.po +++ b/library/audioop.po @@ -7,8 +7,8 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.10\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2022-03-23 00:14+0000\n" -"PO-Revision-Date: 2016-11-19 00:28+0000\n" +"POT-Creation-Date: 2022-05-21 17:35+0000\n" +"PO-Revision-Date: 2022-05-22 02:00+0800\n" "Last-Translator: Liang-Bo Wang \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" "tw)\n" @@ -17,16 +17,21 @@ msgstr "" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" "Plural-Forms: nplurals=1; plural=0;\n" +"X-Generator: Poedit 3.0.1\n" #: ../../library/audioop.rst:2 msgid ":mod:`audioop` --- Manipulate raw audio data" msgstr ":mod:`audioop` --- 操作原始聲音檔案" #: ../../library/audioop.rst:8 -msgid "The :mod:`audioop` module is deprecated (see :pep:`594` for details)." -msgstr ":mod:`audioop` 模組 (module) 即將被棄用(詳見 :pep:`594`\\ )。" +msgid "" +"The :mod:`audioop` module is deprecated (see :pep:`PEP 594 <594#audioop>` " +"for details)." +msgstr "" +":mod:`audioop` 模組 (module) 即將被棄用(詳見 :pep:`PEP 594 <594#audioop>`" +"\\ )。" -#: ../../library/audioop.rst:13 +#: ../../library/audioop.rst:14 msgid "" "The :mod:`audioop` module contains some useful operations on sound " "fragments. It operates on sound fragments consisting of signed integer " @@ -35,34 +40,34 @@ msgid "" "otherwise." msgstr "" -#: ../../library/audioop.rst:18 +#: ../../library/audioop.rst:19 msgid "" "Support for 24-bit samples was added. All functions now accept any :term:" "`bytes-like object`. String input now results in an immediate error." msgstr "" -#: ../../library/audioop.rst:29 +#: ../../library/audioop.rst:30 msgid "" "This module provides support for a-LAW, u-LAW and Intel/DVI ADPCM encodings." msgstr "" -#: ../../library/audioop.rst:33 +#: ../../library/audioop.rst:34 msgid "" "A few of the more complicated operations only take 16-bit samples, otherwise " "the sample size (in bytes) is always a parameter of the operation." msgstr "" -#: ../../library/audioop.rst:36 +#: ../../library/audioop.rst:37 msgid "The module defines the following variables and functions:" msgstr "" -#: ../../library/audioop.rst:41 +#: ../../library/audioop.rst:42 msgid "" "This exception is raised on all errors, such as unknown number of bytes per " "sample, etc." msgstr "" -#: ../../library/audioop.rst:47 +#: ../../library/audioop.rst:48 msgid "" "Return a fragment which is the addition of the two samples passed as " "parameters. *width* is the sample width in bytes, either ``1``, ``2``, ``3`` " @@ -70,48 +75,48 @@ msgid "" "truncated in case of overflow." msgstr "" -#: ../../library/audioop.rst:54 +#: ../../library/audioop.rst:55 msgid "" "Decode an Intel/DVI ADPCM coded fragment to a linear fragment. See the " "description of :func:`lin2adpcm` for details on ADPCM coding. Return a tuple " "``(sample, newstate)`` where the sample has the width specified in *width*." msgstr "" -#: ../../library/audioop.rst:61 +#: ../../library/audioop.rst:62 msgid "" "Convert sound fragments in a-LAW encoding to linearly encoded sound " "fragments. a-LAW encoding always uses 8 bits samples, so *width* refers only " "to the sample width of the output fragment here." msgstr "" -#: ../../library/audioop.rst:68 +#: ../../library/audioop.rst:69 msgid "Return the average over all samples in the fragment." msgstr "" -#: ../../library/audioop.rst:73 +#: ../../library/audioop.rst:74 msgid "" "Return the average peak-peak value over all samples in the fragment. No " "filtering is done, so the usefulness of this routine is questionable." msgstr "" -#: ../../library/audioop.rst:79 +#: ../../library/audioop.rst:80 msgid "" "Return a fragment that is the original fragment with a bias added to each " "sample. Samples wrap around in case of overflow." msgstr "" -#: ../../library/audioop.rst:85 +#: ../../library/audioop.rst:86 msgid "" "\"Byteswap\" all samples in a fragment and returns the modified fragment. " "Converts big-endian samples to little-endian and vice versa." msgstr "" -#: ../../library/audioop.rst:93 +#: ../../library/audioop.rst:94 msgid "" "Return the number of zero crossings in the fragment passed as an argument." msgstr "" -#: ../../library/audioop.rst:98 +#: ../../library/audioop.rst:99 msgid "" "Return a factor *F* such that ``rms(add(fragment, mul(reference, -F)))`` is " "minimal, i.e., return the factor with which you should multiply *reference* " @@ -119,11 +124,11 @@ msgid "" "both contain 2-byte samples." msgstr "" -#: ../../library/audioop.rst:103 +#: ../../library/audioop.rst:104 msgid "The time taken by this routine is proportional to ``len(fragment)``." msgstr "" -#: ../../library/audioop.rst:108 +#: ../../library/audioop.rst:109 msgid "" "Try to match *reference* as well as possible to a portion of *fragment* " "(which should be the longer fragment). This is (conceptually) done by " @@ -134,22 +139,22 @@ msgid "" "*factor* is the (floating-point) factor as per :func:`findfactor`." msgstr "" -#: ../../library/audioop.rst:119 +#: ../../library/audioop.rst:120 msgid "" "Search *fragment* for a slice of length *length* samples (not bytes!) with " "maximum energy, i.e., return *i* for which ``rms(fragment[i*2:(i" "+length)*2])`` is maximal. The fragments should both contain 2-byte samples." msgstr "" -#: ../../library/audioop.rst:123 +#: ../../library/audioop.rst:124 msgid "The routine takes time proportional to ``len(fragment)``." msgstr "" -#: ../../library/audioop.rst:128 +#: ../../library/audioop.rst:129 msgid "Return the value of sample *index* from the fragment." msgstr "" -#: ../../library/audioop.rst:133 +#: ../../library/audioop.rst:134 msgid "" "Convert samples to 4 bit Intel/DVI ADPCM encoding. ADPCM coding is an " "adaptive coding scheme, whereby each 4 bit number is the difference between " @@ -158,7 +163,7 @@ msgid "" "standard." msgstr "" -#: ../../library/audioop.rst:138 +#: ../../library/audioop.rst:139 msgid "" "*state* is a tuple containing the state of the coder. The coder returns a " "tuple ``(adpcmfrag, newstate)``, and the *newstate* should be passed to the " @@ -167,7 +172,7 @@ msgid "" "per byte." msgstr "" -#: ../../library/audioop.rst:146 +#: ../../library/audioop.rst:147 msgid "" "Convert samples in the audio fragment to a-LAW encoding and return this as a " "bytes object. a-LAW is an audio encoding format whereby you get a dynamic " @@ -175,24 +180,24 @@ msgid "" "audio hardware, among others." msgstr "" -#: ../../library/audioop.rst:154 +#: ../../library/audioop.rst:155 msgid "Convert samples between 1-, 2-, 3- and 4-byte formats." msgstr "" -#: ../../library/audioop.rst:158 +#: ../../library/audioop.rst:159 msgid "" "In some audio formats, such as .WAV files, 16, 24 and 32 bit samples are " "signed, but 8 bit samples are unsigned. So when converting to 8 bit wide " "samples for these formats, you need to also add 128 to the result::" msgstr "" -#: ../../library/audioop.rst:165 +#: ../../library/audioop.rst:166 msgid "" "The same, in reverse, has to be applied when converting from 8 to 16, 24 or " "32 bit width samples." msgstr "" -#: ../../library/audioop.rst:171 +#: ../../library/audioop.rst:172 msgid "" "Convert samples in the audio fragment to u-LAW encoding and return this as a " "bytes object. u-LAW is an audio encoding format whereby you get a dynamic " @@ -200,33 +205,33 @@ msgid "" "audio hardware, among others." msgstr "" -#: ../../library/audioop.rst:179 +#: ../../library/audioop.rst:180 msgid "" "Return the maximum of the *absolute value* of all samples in a fragment." msgstr "" -#: ../../library/audioop.rst:184 +#: ../../library/audioop.rst:185 msgid "Return the maximum peak-peak value in the sound fragment." msgstr "" -#: ../../library/audioop.rst:189 +#: ../../library/audioop.rst:190 msgid "" "Return a tuple consisting of the minimum and maximum values of all samples " "in the sound fragment." msgstr "" -#: ../../library/audioop.rst:195 +#: ../../library/audioop.rst:196 msgid "" "Return a fragment that has all samples in the original fragment multiplied " "by the floating-point value *factor*. Samples are truncated in case of " "overflow." msgstr "" -#: ../../library/audioop.rst:201 +#: ../../library/audioop.rst:202 msgid "Convert the frame rate of the input fragment." msgstr "" -#: ../../library/audioop.rst:203 +#: ../../library/audioop.rst:204 msgid "" "*state* is a tuple containing the state of the converter. The converter " "returns a tuple ``(newfragment, newstate)``, and *newstate* should be passed " @@ -234,47 +239,47 @@ msgid "" "as the state." msgstr "" -#: ../../library/audioop.rst:207 +#: ../../library/audioop.rst:208 msgid "" "The *weightA* and *weightB* arguments are parameters for a simple digital " "filter and default to ``1`` and ``0`` respectively." msgstr "" -#: ../../library/audioop.rst:213 +#: ../../library/audioop.rst:214 msgid "Reverse the samples in a fragment and returns the modified fragment." msgstr "" -#: ../../library/audioop.rst:218 +#: ../../library/audioop.rst:219 msgid "" "Return the root-mean-square of the fragment, i.e. ``sqrt(sum(S_i^2)/n)``." msgstr "" -#: ../../library/audioop.rst:220 +#: ../../library/audioop.rst:221 msgid "This is a measure of the power in an audio signal." msgstr "" -#: ../../library/audioop.rst:225 +#: ../../library/audioop.rst:226 msgid "" "Convert a stereo fragment to a mono fragment. The left channel is " "multiplied by *lfactor* and the right channel by *rfactor* before adding the " "two channels to give a mono signal." msgstr "" -#: ../../library/audioop.rst:232 +#: ../../library/audioop.rst:233 msgid "" "Generate a stereo fragment from a mono fragment. Each pair of samples in " "the stereo fragment are computed from the mono sample, whereby left channel " "samples are multiplied by *lfactor* and right channel samples by *rfactor*." msgstr "" -#: ../../library/audioop.rst:239 +#: ../../library/audioop.rst:240 msgid "" "Convert sound fragments in u-LAW encoding to linearly encoded sound " "fragments. u-LAW encoding always uses 8 bits samples, so *width* refers only " "to the sample width of the output fragment here." msgstr "" -#: ../../library/audioop.rst:243 +#: ../../library/audioop.rst:244 msgid "" "Note that operations such as :func:`.mul` or :func:`.max` make no " "distinction between mono and stereo fragments, i.e. all samples are treated " @@ -283,7 +288,7 @@ msgid "" "that::" msgstr "" -#: ../../library/audioop.rst:257 +#: ../../library/audioop.rst:258 msgid "" "If you use the ADPCM coder to build network packets and you want your " "protocol to be stateless (i.e. to be able to tolerate packet loss) you " @@ -295,14 +300,14 @@ msgid "" "index) in 8." msgstr "" -#: ../../library/audioop.rst:265 +#: ../../library/audioop.rst:266 msgid "" "The ADPCM coders have never been tried against other ADPCM coders, only " "against themselves. It could well be that I misinterpreted the standards in " "which case they will not be interoperable with the respective standards." msgstr "" -#: ../../library/audioop.rst:269 +#: ../../library/audioop.rst:270 msgid "" "The :func:`find\\*` routines might look a bit funny at first sight. They are " "primarily meant to do echo cancellation. A reasonably fast way to do this " diff --git a/library/bisect.po b/library/bisect.po index d18c1b08d1..800a4c972a 100644 --- a/library/bisect.po +++ b/library/bisect.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.10\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2021-10-26 16:47+0000\n" +"POT-Creation-Date: 2022-05-21 17:35+0000\n" "PO-Revision-Date: 2017-09-22 18:26+0000\n" "Last-Translator: Liang-Bo Wang \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -70,20 +70,25 @@ msgstr "" "回傳的插入位置 *i* 將陣列 *a* 分為兩半,使得 ``all(val < x for val in a[lo : " "i])`` 都在左側且 ``all(val >= x for val in a[i : hi])`` 都在右側。" -#: ../../library/bisect.rst:37 ../../library/bisect.rst:55 -#: ../../library/bisect.rst:67 ../../library/bisect.rst:88 +#: ../../library/bisect.rst:37 ../../library/bisect.rst:58 msgid "" "*key* specifies a :term:`key function` of one argument that is used to " -"extract a comparison key from each input element. The default value is " -"``None`` (compare the elements directly)." +"extract a comparison key from each element in the array. To support " +"searching complex records, the key function is not applied to the *x* value." msgstr "" -#: ../../library/bisect.rst:41 ../../library/bisect.rst:59 -#: ../../library/bisect.rst:78 ../../library/bisect.rst:99 +#: ../../library/bisect.rst:41 ../../library/bisect.rst:62 +msgid "" +"If *key* is ``None``, the elements are compared directly with no intervening " +"function call." +msgstr "" + +#: ../../library/bisect.rst:44 ../../library/bisect.rst:65 +#: ../../library/bisect.rst:83 ../../library/bisect.rst:103 msgid "Added the *key* parameter." msgstr "新增 *key* 參數。" -#: ../../library/bisect.rst:48 +#: ../../library/bisect.rst:51 msgid "" "Similar to :func:`bisect_left`, but returns an insertion point which comes " "after (to the right of) any existing entries of *x* in *a*." @@ -91,33 +96,39 @@ msgstr "" "類似 :func:`bisect_left` ,但回傳的插入位置會在所有 *a* 當中的 *x* 的後面(右" "邊)。" -#: ../../library/bisect.rst:51 +#: ../../library/bisect.rst:54 msgid "" "The returned insertion point *i* partitions the array *a* into two halves so " "that ``all(val <= x for val in a[lo : i])`` for the left side and ``all(val " "> x for val in a[i : hi])`` for the right side." msgstr "" -"回傳的插入位置 *i* 將陣列 *a* 分為兩半,使得 ``all(val <= x for val in a[lo : " -"i])`` 都在左側且 ``all(val > x for val in a[i : hi])`` 都在右側。" +"回傳的插入位置 *i* 將陣列 *a* 分為兩半,使得 ``all(val <= x for val in " +"a[lo : i])`` 都在左側且 ``all(val > x for val in a[i : hi])`` 都在右側。" -#: ../../library/bisect.rst:65 +#: ../../library/bisect.rst:71 msgid "Insert *x* in *a* in sorted order." msgstr "" -#: ../../library/bisect.rst:71 +#: ../../library/bisect.rst:73 msgid "" "This function first runs :func:`bisect_left` to locate an insertion point. " "Next, it runs the :meth:`insert` method on *a* to insert *x* at the " "appropriate position to maintain sort order." msgstr "" -#: ../../library/bisect.rst:75 ../../library/bisect.rst:96 +#: ../../library/bisect.rst:77 ../../library/bisect.rst:97 +msgid "" +"To support inserting records in a table, the *key* function (if any) is " +"applied to *x* for the search step but not for the insertion step." +msgstr "" + +#: ../../library/bisect.rst:80 ../../library/bisect.rst:100 msgid "" "Keep in mind that the ``O(log n)`` search is dominated by the slow O(n) " "insertion step." msgstr "" -#: ../../library/bisect.rst:85 +#: ../../library/bisect.rst:90 msgid "" "Similar to :func:`insort_left`, but inserting *x* in *a* after any existing " "entries of *x*." @@ -125,36 +136,36 @@ msgstr "" "類似 :func:`insort_left` ,但插入的位置會在所有 *a* 當中的 *x* 的後面(右" "邊)。" -#: ../../library/bisect.rst:92 +#: ../../library/bisect.rst:93 msgid "" "This function first runs :func:`bisect_right` to locate an insertion point. " "Next, it runs the :meth:`insert` method on *a* to insert *x* at the " "appropriate position to maintain sort order." msgstr "" -#: ../../library/bisect.rst:104 +#: ../../library/bisect.rst:108 msgid "Performance Notes" msgstr "" -#: ../../library/bisect.rst:106 +#: ../../library/bisect.rst:110 msgid "" "When writing time sensitive code using *bisect()* and *insort()*, keep these " "thoughts in mind:" msgstr "" -#: ../../library/bisect.rst:109 +#: ../../library/bisect.rst:113 msgid "" "Bisection is effective for searching ranges of values. For locating specific " "values, dictionaries are more performant." msgstr "" -#: ../../library/bisect.rst:112 +#: ../../library/bisect.rst:116 msgid "" "The *insort()* functions are ``O(n)`` because the logarithmic search step is " "dominated by the linear time insertion step." msgstr "" -#: ../../library/bisect.rst:115 +#: ../../library/bisect.rst:119 msgid "" "The search functions are stateless and discard key function results after " "they are used. Consequently, if the search functions are used in a loop, " @@ -165,14 +176,14 @@ msgid "" "examples section below)." msgstr "" -#: ../../library/bisect.rst:125 +#: ../../library/bisect.rst:129 msgid "" "`Sorted Collections `_ is " "a high performance module that uses *bisect* to managed sorted collections " "of data." msgstr "" -#: ../../library/bisect.rst:129 +#: ../../library/bisect.rst:133 msgid "" "The `SortedCollection recipe `_ uses bisect to build a full-featured collection class " @@ -181,11 +192,11 @@ msgid "" "searches." msgstr "" -#: ../../library/bisect.rst:137 +#: ../../library/bisect.rst:141 msgid "Searching Sorted Lists" msgstr "" -#: ../../library/bisect.rst:139 +#: ../../library/bisect.rst:143 msgid "" "The above :func:`bisect` functions are useful for finding insertion points " "but can be tricky or awkward to use for common searching tasks. The " @@ -193,11 +204,11 @@ msgid "" "lookups for sorted lists::" msgstr "" -#: ../../library/bisect.rst:181 +#: ../../library/bisect.rst:185 msgid "Examples" msgstr "範例" -#: ../../library/bisect.rst:185 +#: ../../library/bisect.rst:189 msgid "" "The :func:`bisect` function can be useful for numeric table lookups. This " "example uses :func:`bisect` to look up a letter grade for an exam score " @@ -205,19 +216,15 @@ msgid "" "to 89 is a 'B', and so on::" msgstr "" -#: ../../library/bisect.rst:197 +#: ../../library/bisect.rst:201 msgid "" -"One technique to avoid repeated calls to a key function is to search a list " -"of precomputed keys to find the index of a record::" +"The :func:`bisect` and :func:`insort` functions also work with lists of " +"tuples. The *key* argument can serve to extract the field used for ordering " +"records in a table::" msgstr "" -#~ msgid "" -#~ "Insert *x* in *a* in sorted order. This is equivalent to ``a." -#~ "insert(bisect.bisect_left(a, x, lo, hi), x)`` assuming that *a* is " -#~ "already sorted. Keep in mind that the O(log n) search is dominated by " -#~ "the slow O(n) insertion step." -#~ msgstr "" -#~ "不破壞 *a* 的排序下插入 *x* ,這等價於 ``a.insert(bisect.bisect_left(a, " -#~ "x, lo, hi), x)`` ,注意 *a* 必須是已經排序過的 list 。注意搜尋只需要 " -#~ "O(log n) 時間而插入需要很慢的 O(n) 時間,這使得插入操作主導了需要的花費時" -#~ "間。" +#: ../../library/bisect.rst:235 +msgid "" +"If the key function is expensive, it is possible to avoid repeated function " +"calls by searching a list of precomputed keys to find the index of a record::" +msgstr "" diff --git a/library/cgi.po b/library/cgi.po index 765738fa61..6be509a622 100644 --- a/library/cgi.po +++ b/library/cgi.po @@ -7,8 +7,8 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.10\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2022-03-23 00:14+0000\n" -"PO-Revision-Date: 2018-05-23 14:40+0000\n" +"POT-Creation-Date: 2022-05-21 17:35+0000\n" +"PO-Revision-Date: 2022-05-22 02:01+0800\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" "tw)\n" @@ -17,6 +17,7 @@ msgstr "" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" "Plural-Forms: nplurals=1; plural=0;\n" +"X-Generator: Poedit 3.0.1\n" #: ../../library/cgi.rst:2 msgid ":mod:`cgi` --- Common Gateway Interface support" @@ -27,30 +28,34 @@ msgid "**Source code:** :source:`Lib/cgi.py`" msgstr "**原始碼:**\\ :source:`Lib/cgi.py`" #: ../../library/cgi.rst:18 -msgid "The :mod:`cgi` module is deprecated (see :pep:`594` for details)." -msgstr ":mod:`cgi` 模組 (module) 即將被棄用(詳見 :pep:`594`\\ )。" +msgid "" +"The :mod:`cgi` module is deprecated (see :pep:`PEP 594 <594#cgi>` for " +"details and alternatives)." +msgstr "" +":mod:`cgi` 模組 (module) 即將被棄用(詳情與替代方案請見 :pep:`PEP 594 " +"<594#cgi>`\\ )。" -#: ../../library/cgi.rst:23 +#: ../../library/cgi.rst:24 msgid "Support module for Common Gateway Interface (CGI) scripts." msgstr "" -#: ../../library/cgi.rst:25 +#: ../../library/cgi.rst:26 msgid "" "This module defines a number of utilities for use by CGI scripts written in " "Python." msgstr "" -#: ../../library/cgi.rst:30 +#: ../../library/cgi.rst:31 msgid "Introduction" msgstr "簡介" -#: ../../library/cgi.rst:34 +#: ../../library/cgi.rst:35 msgid "" "A CGI script is invoked by an HTTP server, usually to process user input " "submitted through an HTML ``
`` or ```` element." msgstr "" -#: ../../library/cgi.rst:37 +#: ../../library/cgi.rst:38 msgid "" "Most often, CGI scripts live in the server's special :file:`cgi-bin` " "directory. The HTTP server places all sorts of information about the request " @@ -59,7 +64,7 @@ msgid "" "script, and sends the script's output back to the client." msgstr "" -#: ../../library/cgi.rst:43 +#: ../../library/cgi.rst:44 msgid "" "The script's input is connected to the client too, and sometimes the form " "data is read this way; at other times the form data is passed via the " @@ -70,7 +75,7 @@ msgid "" "supports it)." msgstr "" -#: ../../library/cgi.rst:50 +#: ../../library/cgi.rst:51 msgid "" "The output of a CGI script should consist of two sections, separated by a " "blank line. The first section contains a number of headers, telling the " @@ -78,26 +83,26 @@ msgid "" "header section looks like this::" msgstr "" -#: ../../library/cgi.rst:58 +#: ../../library/cgi.rst:59 msgid "" "The second section is usually HTML, which allows the client software to " "display nicely formatted text with header, in-line images, etc. Here's " "Python code that prints a simple piece of HTML::" msgstr "" -#: ../../library/cgi.rst:70 +#: ../../library/cgi.rst:71 msgid "Using the cgi module" msgstr "" -#: ../../library/cgi.rst:72 +#: ../../library/cgi.rst:73 msgid "Begin by writing ``import cgi``." msgstr "" -#: ../../library/cgi.rst:74 +#: ../../library/cgi.rst:75 msgid "When you write a new script, consider adding these lines::" msgstr "" -#: ../../library/cgi.rst:79 +#: ../../library/cgi.rst:80 msgid "" "This activates a special exception handler that will display detailed " "reports in the web browser if any errors occur. If you'd rather not show " @@ -105,7 +110,7 @@ msgid "" "saved to files instead, with code like this::" msgstr "" -#: ../../library/cgi.rst:87 +#: ../../library/cgi.rst:88 msgid "" "It's very helpful to use this feature during script development. The reports " "produced by :mod:`cgitb` provide information that can save you a lot of time " @@ -113,7 +118,7 @@ msgid "" "you have tested your script and are confident that it works correctly." msgstr "" -#: ../../library/cgi.rst:92 +#: ../../library/cgi.rst:93 msgid "" "To get at submitted form data, use the :class:`FieldStorage` class. If the " "form contains non-ASCII characters, use the *encoding* keyword parameter set " @@ -125,7 +130,7 @@ msgid "" "consume standard input, it should be instantiated only once." msgstr "" -#: ../../library/cgi.rst:101 +#: ../../library/cgi.rst:102 msgid "" "The :class:`FieldStorage` instance can be indexed like a Python dictionary. " "It allows membership testing with the :keyword:`in` operator, and also " @@ -136,14 +141,14 @@ msgid "" "class:`FieldStorage` instance." msgstr "" -#: ../../library/cgi.rst:109 +#: ../../library/cgi.rst:110 msgid "" "For instance, the following code (which assumes that the :mailheader:" "`Content-Type` header and blank line have already been printed) checks that " "the fields ``name`` and ``addr`` are both set to a non-empty string::" msgstr "" -#: ../../library/cgi.rst:123 +#: ../../library/cgi.rst:124 msgid "" "Here the fields, accessed through ``form[key]``, are themselves instances " "of :class:`FieldStorage` (or :class:`MiniFieldStorage`, depending on the " @@ -153,7 +158,7 @@ msgid "" "second argument as a default to return if the requested key is not present." msgstr "" -#: ../../library/cgi.rst:130 +#: ../../library/cgi.rst:131 msgid "" "If the submitted form data contains more than one field with the same name, " "the object retrieved by ``form[key]`` is not a :class:`FieldStorage` or :" @@ -166,7 +171,7 @@ msgid "" "username fields, separated by commas::" msgstr "" -#: ../../library/cgi.rst:143 +#: ../../library/cgi.rst:144 msgid "" "If a field represents an uploaded file, accessing the value via the :attr:" "`~FieldStorage.value` attribute or the :meth:`~FieldStorage.getvalue` method " @@ -179,13 +184,13 @@ msgid "" "IOBase.readline` methods will return bytes)::" msgstr "" -#: ../../library/cgi.rst:163 +#: ../../library/cgi.rst:164 msgid "" ":class:`FieldStorage` objects also support being used in a :keyword:`with` " "statement, which will automatically close them when done." msgstr "" -#: ../../library/cgi.rst:166 +#: ../../library/cgi.rst:167 msgid "" "If an error is encountered when obtaining the contents of an uploaded file " "(for example, when the user interrupts the form submission by clicking on a " @@ -193,7 +198,7 @@ msgid "" "object for the field will be set to the value -1." msgstr "" -#: ../../library/cgi.rst:171 +#: ../../library/cgi.rst:172 msgid "" "The file upload draft standard entertains the possibility of uploading " "multiple files from one field (using a recursive :mimetype:`multipart/\\*` " @@ -204,7 +209,7 @@ msgid "" "be iterated over recursively just like the top-level form object." msgstr "" -#: ../../library/cgi.rst:179 +#: ../../library/cgi.rst:180 msgid "" "When a form is submitted in the \"old\" format (as the query string or as a " "single data part of type :mimetype:`application/x-www-form-urlencoded`), the " @@ -213,29 +218,29 @@ msgid "" "are always ``None``." msgstr "" -#: ../../library/cgi.rst:184 +#: ../../library/cgi.rst:185 msgid "" "A form submitted via POST that also has a query string will contain both :" "class:`FieldStorage` and :class:`MiniFieldStorage` items." msgstr "" -#: ../../library/cgi.rst:187 +#: ../../library/cgi.rst:188 msgid "" "The :attr:`~FieldStorage.file` attribute is automatically closed upon the " "garbage collection of the creating :class:`FieldStorage` instance." msgstr "" -#: ../../library/cgi.rst:191 +#: ../../library/cgi.rst:192 msgid "" "Added support for the context management protocol to the :class:" "`FieldStorage` class." msgstr "" -#: ../../library/cgi.rst:197 +#: ../../library/cgi.rst:198 msgid "Higher Level Interface" msgstr "" -#: ../../library/cgi.rst:199 +#: ../../library/cgi.rst:200 msgid "" "The previous section explains how to read CGI form data using the :class:" "`FieldStorage` class. This section describes a higher level interface which " @@ -245,33 +250,33 @@ msgid "" "efficiently, for example." msgstr "" -#: ../../library/cgi.rst:208 +#: ../../library/cgi.rst:209 msgid "" "The interface consists of two simple methods. Using the methods you can " "process form data in a generic way, without the need to worry whether only " "one or more values were posted under one name." msgstr "" -#: ../../library/cgi.rst:212 +#: ../../library/cgi.rst:213 msgid "" "In the previous section, you learned to write following code anytime you " "expected a user to post more than one value under one name::" msgstr "" -#: ../../library/cgi.rst:221 +#: ../../library/cgi.rst:222 msgid "" "This situation is common for example when a form contains a group of " "multiple checkboxes with the same name::" msgstr "" -#: ../../library/cgi.rst:227 +#: ../../library/cgi.rst:228 msgid "" "In most situations, however, there's only one form control with a particular " "name in a form and then you expect and need only one value associated with " "this name. So you write a script containing for example this code::" msgstr "" -#: ../../library/cgi.rst:233 +#: ../../library/cgi.rst:234 msgid "" "The problem with the code is that you should never expect that a client will " "provide valid input to your scripts. For example, if a curious user appends " @@ -282,21 +287,21 @@ msgid "" "an :exc:`AttributeError` exception." msgstr "" -#: ../../library/cgi.rst:241 +#: ../../library/cgi.rst:242 msgid "" "Therefore, the appropriate way to read form data values was to always use " "the code which checks whether the obtained value is a single value or a list " "of values. That's annoying and leads to less readable scripts." msgstr "" -#: ../../library/cgi.rst:245 +#: ../../library/cgi.rst:246 msgid "" "A more convenient approach is to use the methods :meth:`~FieldStorage." "getfirst` and :meth:`~FieldStorage.getlist` provided by this higher level " "interface." msgstr "" -#: ../../library/cgi.rst:251 +#: ../../library/cgi.rst:252 msgid "" "This method always returns only one value associated with form field *name*. " "The method returns only the first value in case that more values were posted " @@ -307,7 +312,7 @@ msgid "" "defaults to ``None`` if not specified." msgstr "" -#: ../../library/cgi.rst:262 +#: ../../library/cgi.rst:263 msgid "" "This method always returns a list of values associated with form field " "*name*. The method returns an empty list if no such form field or value " @@ -315,28 +320,28 @@ msgid "" "such value exists." msgstr "" -#: ../../library/cgi.rst:266 +#: ../../library/cgi.rst:267 msgid "Using these methods you can write nice compact code::" msgstr "" -#: ../../library/cgi.rst:278 +#: ../../library/cgi.rst:279 msgid "Functions" msgstr "函式" -#: ../../library/cgi.rst:280 +#: ../../library/cgi.rst:281 msgid "" "These are useful if you want more control, or if you want to employ some of " "the algorithms implemented in this module in other circumstances." msgstr "" -#: ../../library/cgi.rst:286 +#: ../../library/cgi.rst:287 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." msgstr "" -#: ../../library/cgi.rst:293 +#: ../../library/cgi.rst:294 msgid "" "Parse input of type :mimetype:`multipart/form-data` (for file uploads). " "Arguments are *fp* for the input file, *pdict* for a dictionary containing " @@ -344,63 +349,63 @@ msgid "" "the request encoding." msgstr "" -#: ../../library/cgi.rst:298 +#: ../../library/cgi.rst:299 msgid "" "Returns a dictionary just like :func:`urllib.parse.parse_qs`: keys are the " "field names, each value is a list of values for that field. For non-file " "fields, the value is a list of strings." msgstr "" -#: ../../library/cgi.rst:302 +#: ../../library/cgi.rst:303 msgid "" "This is easy to use but not much good if you are expecting megabytes to be " "uploaded --- in that case, use the :class:`FieldStorage` class instead which " "is much more flexible." msgstr "" -#: ../../library/cgi.rst:306 +#: ../../library/cgi.rst:307 msgid "" "Added the *encoding* and *errors* parameters. For non-file fields, the " "value is now a list of strings, not bytes." msgstr "" -#: ../../library/cgi.rst:310 +#: ../../library/cgi.rst:311 msgid "Added the *separator* parameter." msgstr "新增 *separator* 參數。" -#: ../../library/cgi.rst:316 +#: ../../library/cgi.rst:317 msgid "" "Parse a MIME header (such as :mailheader:`Content-Type`) into a main value " "and a dictionary of parameters." msgstr "" -#: ../../library/cgi.rst:322 +#: ../../library/cgi.rst:323 msgid "" "Robust test CGI script, usable as main program. Writes minimal HTTP headers " "and formats all information provided to the script in HTML format." msgstr "" -#: ../../library/cgi.rst:328 +#: ../../library/cgi.rst:329 msgid "Format the shell environment in HTML." msgstr "" -#: ../../library/cgi.rst:333 +#: ../../library/cgi.rst:334 msgid "Format a form in HTML." msgstr "" -#: ../../library/cgi.rst:338 +#: ../../library/cgi.rst:339 msgid "Format the current directory in HTML." msgstr "" -#: ../../library/cgi.rst:343 +#: ../../library/cgi.rst:344 msgid "Print a list of useful (used by CGI) environment variables in HTML." msgstr "" -#: ../../library/cgi.rst:349 +#: ../../library/cgi.rst:350 msgid "Caring about security" msgstr "" -#: ../../library/cgi.rst:353 +#: ../../library/cgi.rst:354 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), " @@ -411,25 +416,25 @@ msgid "" "since the request doesn't have to come from your form!" msgstr "" -#: ../../library/cgi.rst:361 +#: ../../library/cgi.rst:362 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:367 +#: ../../library/cgi.rst:368 msgid "Installing your CGI script on a Unix system" msgstr "" -#: ../../library/cgi.rst:369 +#: ../../library/cgi.rst:370 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:373 +#: ../../library/cgi.rst:374 msgid "" "Make sure that your script is readable and executable by \"others\"; the " "Unix file mode should be ``0o755`` octal (use ``chmod 0755 filename``). " @@ -437,12 +442,12 @@ msgid "" "column 1 followed by the pathname of the Python interpreter, for instance::" msgstr "" -#: ../../library/cgi.rst:380 +#: ../../library/cgi.rst:381 msgid "" "Make sure the Python interpreter exists and is executable by \"others\"." msgstr "" -#: ../../library/cgi.rst:382 +#: ../../library/cgi.rst:383 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 " @@ -457,28 +462,28 @@ msgid "" "anything interesting." msgstr "" -#: ../../library/cgi.rst:393 +#: ../../library/cgi.rst:394 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:401 +#: ../../library/cgi.rst:402 msgid "(This way, the directory inserted last will be searched first!)" msgstr "" -#: ../../library/cgi.rst:403 +#: ../../library/cgi.rst:404 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:408 +#: ../../library/cgi.rst:409 msgid "Testing your CGI script" msgstr "" -#: ../../library/cgi.rst:410 +#: ../../library/cgi.rst:411 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 " @@ -488,17 +493,17 @@ msgid "" "will most likely send a cryptic error to the client." msgstr "" -#: ../../library/cgi.rst:417 +#: ../../library/cgi.rst:418 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:422 +#: ../../library/cgi.rst:423 msgid "Debugging CGI scripts" msgstr "" -#: ../../library/cgi.rst:426 +#: ../../library/cgi.rst:427 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. " @@ -511,7 +516,7 @@ msgid "" "your browser of the form:" msgstr "" -#: ../../library/cgi.rst:439 +#: ../../library/cgi.rst:440 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 " @@ -523,19 +528,19 @@ msgid "" "same procedure for your own script, you should now be able to debug it." msgstr "" -#: ../../library/cgi.rst:448 +#: ../../library/cgi.rst:449 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:453 +#: ../../library/cgi.rst:454 msgid "" "This should produce the same results as those gotten from installing the :" "file:`cgi.py` file itself." msgstr "" -#: ../../library/cgi.rst:456 +#: ../../library/cgi.rst:457 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 " @@ -545,28 +550,28 @@ msgid "" "or be discarded altogether." msgstr "" -#: ../../library/cgi.rst:463 +#: ../../library/cgi.rst:464 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:470 +#: ../../library/cgi.rst:471 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:474 +#: ../../library/cgi.rst:475 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:483 +#: ../../library/cgi.rst:484 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 " @@ -576,47 +581,47 @@ msgid "" "interpretation is going on, the traceback will be readable." msgstr "" -#: ../../library/cgi.rst:492 +#: ../../library/cgi.rst:493 msgid "Common problems and solutions" msgstr "" -#: ../../library/cgi.rst:494 +#: ../../library/cgi.rst:495 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:498 +#: ../../library/cgi.rst:499 msgid "Check the installation instructions above." msgstr "" -#: ../../library/cgi.rst:500 +#: ../../library/cgi.rst:501 msgid "" "Check the HTTP server's log files. (``tail -f logfile`` in a separate " "window may be useful!)" msgstr "" -#: ../../library/cgi.rst:503 +#: ../../library/cgi.rst:504 msgid "" "Always check a script for syntax errors first, by doing something like " "``python script.py``." msgstr "" -#: ../../library/cgi.rst:506 +#: ../../library/cgi.rst:507 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:509 +#: ../../library/cgi.rst:510 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:513 +#: ../../library/cgi.rst:514 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 " @@ -624,17 +629,17 @@ msgid "" "explicitly specified userid for a web server's ``suexec`` feature." msgstr "" -#: ../../library/cgi.rst:518 +#: ../../library/cgi.rst:519 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:522 +#: ../../library/cgi.rst:523 msgid "Footnotes" msgstr "註解" -#: ../../library/cgi.rst:523 +#: ../../library/cgi.rst:524 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/cgitb.po b/library/cgitb.po index 7916d46c2d..49f9318983 100644 --- a/library/cgitb.po +++ b/library/cgitb.po @@ -7,8 +7,8 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.10\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2022-03-23 00:14+0000\n" -"PO-Revision-Date: 2016-11-19 00:28+0000\n" +"POT-Creation-Date: 2022-05-21 17:35+0000\n" +"PO-Revision-Date: 2022-05-22 02:02+0800\n" "Last-Translator: Liang-Bo Wang \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" "tw)\n" @@ -17,6 +17,7 @@ msgstr "" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" "Plural-Forms: nplurals=1; plural=0;\n" +"X-Generator: Poedit 3.0.1\n" #: ../../library/cgitb.rst:2 msgid ":mod:`cgitb` --- Traceback manager for CGI scripts" @@ -27,10 +28,13 @@ msgid "**Source code:** :source:`Lib/cgitb.py`" msgstr "**原始碼:**\\ :source:`Lib/cgitb.py`" #: ../../library/cgitb.rst:19 -msgid "The :mod:`cgitb` module is deprecated (see :pep:`594` for details)." -msgstr ":mod:`cgitb` 模組 (module) 即將被棄用(詳見 :pep:`594`\\ )。" +msgid "" +"The :mod:`cgitb` module is deprecated (see :pep:`PEP 594 <594#cgitb>` for " +"details)." +msgstr "" +":mod:`cgitb` 模組 (module) 即將被棄用(詳見 :pep:`PEP 594 <594#cgitb>`\\ )。" -#: ../../library/cgitb.rst:24 +#: ../../library/cgitb.rst:25 msgid "" "The :mod:`cgitb` module provides a special exception handler for Python " "scripts. (Its name is a bit misleading. It was originally designed to " @@ -44,25 +48,25 @@ msgid "" "instead of sending it to the browser." msgstr "" -#: ../../library/cgitb.rst:34 +#: ../../library/cgitb.rst:35 msgid "To enable this feature, simply add this to the top of your CGI script::" msgstr "" -#: ../../library/cgitb.rst:39 +#: ../../library/cgitb.rst:40 msgid "" "The options to the :func:`enable` function control whether the report is " "displayed in the browser and whether the report is logged to a file for " "later analysis." msgstr "" -#: ../../library/cgitb.rst:48 +#: ../../library/cgitb.rst:49 msgid "" "This function causes the :mod:`cgitb` module to take over the interpreter's " "default handling for exceptions by setting the value of :attr:`sys." "excepthook`." msgstr "" -#: ../../library/cgitb.rst:51 +#: ../../library/cgitb.rst:52 msgid "" "The optional argument *display* defaults to ``1`` and can be set to ``0`` to " "suppress sending the traceback to the browser. If the argument *logdir* is " @@ -75,7 +79,7 @@ msgid "" "\"html\"``." msgstr "" -#: ../../library/cgitb.rst:63 +#: ../../library/cgitb.rst:64 msgid "" "This function handles the exception described by *info* (a 3-tuple " "containing the result of :func:`sys.exc_info`), formatting its traceback as " @@ -84,7 +88,7 @@ msgid "" "source code in the traceback; this defaults to ``5``." msgstr "" -#: ../../library/cgitb.rst:72 +#: ../../library/cgitb.rst:73 msgid "" "This function handles the exception described by *info* (a 3-tuple " "containing the result of :func:`sys.exc_info`), formatting its traceback as " @@ -93,7 +97,7 @@ msgid "" "source code in the traceback; this defaults to ``5``." msgstr "" -#: ../../library/cgitb.rst:81 +#: ../../library/cgitb.rst:82 msgid "" "This function handles an exception using the default settings (that is, show " "a report in the browser, but don't log to a file). This can be used when " diff --git a/library/chunk.po b/library/chunk.po index ed37bcf9fa..b158598dd0 100644 --- a/library/chunk.po +++ b/library/chunk.po @@ -7,8 +7,8 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.10\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2022-03-23 00:14+0000\n" -"PO-Revision-Date: 2017-09-22 18:26+0000\n" +"POT-Creation-Date: 2022-05-21 17:35+0000\n" +"PO-Revision-Date: 2022-05-22 02:03+0800\n" "Last-Translator: Liang-Bo Wang \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" "tw)\n" @@ -17,6 +17,7 @@ msgstr "" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" "Plural-Forms: nplurals=1; plural=0;\n" +"X-Generator: Poedit 3.0.1\n" #: ../../library/chunk.rst:2 msgid ":mod:`chunk` --- Read IFF chunked data" @@ -27,10 +28,13 @@ msgid "**Source code:** :source:`Lib/chunk.py`" msgstr "**原始碼:**\\ :source:`Lib/chunk.py`" #: ../../library/chunk.rst:20 -msgid "The :mod:`chunk` module is deprecated (see :pep:`594` for details)." -msgstr ":mod:`chunk` 模組 (module) 即將被棄用(詳見 :pep:`594`\\ )。" +msgid "" +"The :mod:`chunk` module is deprecated (see :pep:`PEP 594 <594#chunk>` for " +"details)." +msgstr "" +":mod:`chunk` 模組 (module) 即將被棄用(詳見 :pep:`PEP 594 <594#chunk>`\\ )。" -#: ../../library/chunk.rst:25 +#: ../../library/chunk.rst:26 msgid "" "This module provides an interface for reading files that use EA IFF 85 " "chunks. [#]_ This format is used in at least the Audio Interchange File " @@ -38,73 +42,73 @@ msgid "" "file format is closely related and can also be read using this module." msgstr "" -#: ../../library/chunk.rst:30 +#: ../../library/chunk.rst:31 msgid "A chunk has the following structure:" msgstr "" -#: ../../library/chunk.rst:33 +#: ../../library/chunk.rst:34 msgid "Offset" msgstr "" -#: ../../library/chunk.rst:33 +#: ../../library/chunk.rst:34 msgid "Length" msgstr "長度" -#: ../../library/chunk.rst:33 +#: ../../library/chunk.rst:34 msgid "Contents" msgstr "內容" -#: ../../library/chunk.rst:35 +#: ../../library/chunk.rst:36 msgid "0" msgstr "0" -#: ../../library/chunk.rst:35 ../../library/chunk.rst:37 +#: ../../library/chunk.rst:36 ../../library/chunk.rst:38 msgid "4" msgstr "4" -#: ../../library/chunk.rst:35 +#: ../../library/chunk.rst:36 msgid "Chunk ID" msgstr "" -#: ../../library/chunk.rst:37 +#: ../../library/chunk.rst:38 msgid "Size of chunk in big-endian byte order, not including the header" msgstr "" -#: ../../library/chunk.rst:41 +#: ../../library/chunk.rst:42 msgid "8" msgstr "8" -#: ../../library/chunk.rst:41 +#: ../../library/chunk.rst:42 msgid "*n*" msgstr "*n*" -#: ../../library/chunk.rst:41 +#: ../../library/chunk.rst:42 msgid "Data bytes, where *n* is the size given in the preceding field" msgstr "" -#: ../../library/chunk.rst:45 +#: ../../library/chunk.rst:46 msgid "8 + *n*" msgstr "8 + *n*" -#: ../../library/chunk.rst:45 +#: ../../library/chunk.rst:46 msgid "0 or 1" msgstr "0 或 1" -#: ../../library/chunk.rst:45 +#: ../../library/chunk.rst:46 msgid "Pad byte needed if *n* is odd and chunk alignment is used" msgstr "" -#: ../../library/chunk.rst:49 +#: ../../library/chunk.rst:50 msgid "The ID is a 4-byte string which identifies the type of chunk." msgstr "" -#: ../../library/chunk.rst:51 +#: ../../library/chunk.rst:52 msgid "" "The size field (a 32-bit value, encoded using big-endian byte order) gives " "the size of the chunk data, not including the 8-byte header." msgstr "" -#: ../../library/chunk.rst:54 +#: ../../library/chunk.rst:55 msgid "" "Usually an IFF-type file consists of one or more chunks. The proposed usage " "of the :class:`Chunk` class defined here is to instantiate an instance at " @@ -113,7 +117,7 @@ msgid "" "creating a new instance will fail with an :exc:`EOFError` exception." msgstr "" -#: ../../library/chunk.rst:63 +#: ../../library/chunk.rst:64 msgid "" "Class which represents a chunk. The *file* argument is expected to be a " "file-like object. An instance of this class is specifically allowed. The " @@ -130,37 +134,37 @@ msgid "" "The default value is false." msgstr "" -#: ../../library/chunk.rst:77 +#: ../../library/chunk.rst:78 msgid "A :class:`Chunk` object supports the following methods:" msgstr "" -#: ../../library/chunk.rst:82 +#: ../../library/chunk.rst:83 msgid "" "Returns the name (ID) of the chunk. This is the first 4 bytes of the chunk." msgstr "" -#: ../../library/chunk.rst:88 +#: ../../library/chunk.rst:89 msgid "Returns the size of the chunk." msgstr "" -#: ../../library/chunk.rst:93 +#: ../../library/chunk.rst:94 msgid "" "Close and skip to the end of the chunk. This does not close the underlying " "file." msgstr "" -#: ../../library/chunk.rst:96 +#: ../../library/chunk.rst:97 msgid "" "The remaining methods will raise :exc:`OSError` if called after the :meth:" "`close` method has been called. Before Python 3.3, they used to raise :exc:" "`IOError`, now an alias of :exc:`OSError`." msgstr "" -#: ../../library/chunk.rst:103 +#: ../../library/chunk.rst:104 msgid "Returns ``False``." msgstr "" -#: ../../library/chunk.rst:108 +#: ../../library/chunk.rst:109 msgid "" "Set the chunk's current position. The *whence* argument is optional and " "defaults to ``0`` (absolute file positioning); other values are ``1`` (seek " @@ -169,11 +173,11 @@ msgid "" "only forward seeks are allowed." msgstr "" -#: ../../library/chunk.rst:117 +#: ../../library/chunk.rst:118 msgid "Return the current position into the chunk." msgstr "" -#: ../../library/chunk.rst:122 +#: ../../library/chunk.rst:123 msgid "" "Read at most *size* bytes from the chunk (less if the read hits the end of " "the chunk before obtaining *size* bytes). If the *size* argument is " @@ -182,7 +186,7 @@ msgid "" "immediately." msgstr "" -#: ../../library/chunk.rst:131 +#: ../../library/chunk.rst:132 msgid "" "Skip to the end of the chunk. All further calls to :meth:`read` for the " "chunk will return ``b''``. If you are not interested in the contents of the " @@ -190,11 +194,11 @@ msgid "" "the next chunk." msgstr "" -#: ../../library/chunk.rst:138 +#: ../../library/chunk.rst:139 msgid "Footnotes" msgstr "註解" -#: ../../library/chunk.rst:139 +#: ../../library/chunk.rst:140 msgid "" "\"EA IFF 85\" Standard for Interchange Format Files, Jerry Morrison, " "Electronic Arts, January 1985." diff --git a/library/codecs.po b/library/codecs.po index d1d8999e60..4268932313 100644 --- a/library/codecs.po +++ b/library/codecs.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.10\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2022-04-20 00:15+0000\n" +"POT-Creation-Date: 2022-05-21 17:35+0000\n" "PO-Revision-Date: 2018-05-23 14:40+0000\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -31,11 +31,12 @@ msgid "" "This module defines base classes for standard Python codecs (encoders and " "decoders) and provides access to the internal Python codec registry, which " "manages the codec and error handling lookup process. Most standard codecs " -"are :term:`text encodings `, which encode text to bytes, but " -"there are also codecs provided that encode text to text, and bytes to bytes. " -"Custom codecs may encode and decode between arbitrary types, but some module " -"features are restricted to use specifically with :term:`text encodings `, or with codecs that encode to :class:`bytes`." +"are :term:`text encodings `, which encode text to bytes (and " +"decode bytes to text), but there are also codecs provided that encode text " +"to text, and bytes to bytes. Custom codecs may encode and decode between " +"arbitrary types, but some module features are restricted to be used " +"specifically with :term:`text encodings ` or with codecs that " +"encode to :class:`bytes`." msgstr "" #: ../../library/codecs.rst:33 @@ -349,94 +350,74 @@ msgstr "" #: ../../library/codecs.rst:300 msgid "" "To simplify and standardize error handling, codecs may implement different " -"error handling schemes by accepting the *errors* string argument. The " -"following string values are defined and implemented by all standard Python " -"codecs:" +"error handling schemes by accepting the *errors* string argument:" msgstr "" -#: ../../library/codecs.rst:308 ../../library/codecs.rst:331 -#: ../../library/codecs.rst:364 +#: ../../library/codecs.rst:320 +msgid "" +"The following error handlers can be used with all Python :ref:`standard-" +"encodings` codecs:" +msgstr "" + +#: ../../library/codecs.rst:326 ../../library/codecs.rst:368 +#: ../../library/codecs.rst:387 msgid "Value" msgstr "" -#: ../../library/codecs.rst:308 ../../library/codecs.rst:331 -#: ../../library/codecs.rst:364 ../../library/codecs.rst:1277 -#: ../../library/codecs.rst:1344 ../../library/codecs.rst:1399 +#: ../../library/codecs.rst:326 ../../library/codecs.rst:368 +#: ../../library/codecs.rst:387 ../../library/codecs.rst:1320 +#: ../../library/codecs.rst:1387 ../../library/codecs.rst:1442 msgid "Meaning" msgstr "" -#: ../../library/codecs.rst:310 +#: ../../library/codecs.rst:328 msgid "``'strict'``" msgstr "``'strict'``" -#: ../../library/codecs.rst:310 +#: ../../library/codecs.rst:328 msgid "" -"Raise :exc:`UnicodeError` (or a subclass); this is the default. Implemented " +"Raise :exc:`UnicodeError` (or a subclass), this is the default. Implemented " "in :func:`strict_errors`." msgstr "" -#: ../../library/codecs.rst:314 +#: ../../library/codecs.rst:332 msgid "``'ignore'``" msgstr "``'ignore'``" -#: ../../library/codecs.rst:314 +#: ../../library/codecs.rst:332 msgid "" "Ignore the malformed data and continue without further notice. Implemented " "in :func:`ignore_errors`." msgstr "" -#: ../../library/codecs.rst:319 -msgid "" -"The following error handlers are only applicable to :term:`text encodings " -"`:" -msgstr "" - -#: ../../library/codecs.rst:333 +#: ../../library/codecs.rst:336 msgid "``'replace'``" msgstr "``'replace'``" -#: ../../library/codecs.rst:333 -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:340 -msgid "``'xmlcharrefreplace'``" -msgstr "``'xmlcharrefreplace'``" - -#: ../../library/codecs.rst:340 +#: ../../library/codecs.rst:336 msgid "" -"Replace with the appropriate XML character reference (only for encoding). " -"Implemented in :func:`xmlcharrefreplace_errors`." +"Replace with a replacement marker. On encoding, use ``?`` (ASCII character). " +"On decoding, use ``�`` (U+FFFD, the official REPLACEMENT CHARACTER). " +"Implemented in :func:`replace_errors`." msgstr "" -#: ../../library/codecs.rst:344 +#: ../../library/codecs.rst:342 msgid "``'backslashreplace'``" msgstr "``'backslashreplace'``" -#: ../../library/codecs.rst:344 -msgid "" -"Replace with backslashed escape sequences. Implemented in :func:" -"`backslashreplace_errors`." -msgstr "" - -#: ../../library/codecs.rst:348 -msgid "``'namereplace'``" -msgstr "``'namereplace'``" - -#: ../../library/codecs.rst:348 +#: ../../library/codecs.rst:342 msgid "" -"Replace with ``\\N{...}`` escape sequences (only for encoding). Implemented " -"in :func:`namereplace_errors`." +"Replace with backslashed escape sequences. On encoding, use hexadecimal form " +"of Unicode code point with formats ``\\xhh`` ``\\uxxxx`` ``\\Uxxxxxxxx``. On " +"decoding, use hexadecimal form of byte value with format ``\\xhh``. " +"Implemented in :func:`backslashreplace_errors`." msgstr "" -#: ../../library/codecs.rst:352 +#: ../../library/codecs.rst:350 msgid "``'surrogateescape'``" msgstr "``'surrogateescape'``" -#: ../../library/codecs.rst:352 +#: ../../library/codecs.rst:350 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 +425,92 @@ msgid "" "(See :pep:`383` for more.)" msgstr "" -#: ../../library/codecs.rst:361 +#: ../../library/codecs.rst:364 +msgid "" +"The following error handlers are only applicable to encoding (within :term:" +"`text encodings `):" +msgstr "" + +#: ../../library/codecs.rst:370 +msgid "``'xmlcharrefreplace'``" +msgstr "``'xmlcharrefreplace'``" + +#: ../../library/codecs.rst:370 +msgid "" +"Replace with XML/HTML numeric character reference, which is a decimal form " +"of Unicode code point with format ``&#num;`` Implemented in :func:" +"`xmlcharrefreplace_errors`." +msgstr "" + +#: ../../library/codecs.rst:375 +msgid "``'namereplace'``" +msgstr "``'namereplace'``" + +#: ../../library/codecs.rst:375 +msgid "" +"Replace with ``\\N{...}`` escape sequences, what appears in the braces is " +"the Name property from Unicode Character Database. Implemented in :func:" +"`namereplace_errors`." +msgstr "" + +#: ../../library/codecs.rst:384 msgid "" "In addition, the following error handler is specific to the given codecs:" msgstr "" -#: ../../library/codecs.rst:364 +#: ../../library/codecs.rst:387 msgid "Codecs" msgstr "" -#: ../../library/codecs.rst:366 +#: ../../library/codecs.rst:389 msgid "``'surrogatepass'``" msgstr "``'surrogatepass'``" -#: ../../library/codecs.rst:366 +#: ../../library/codecs.rst:389 msgid "utf-8, utf-16, utf-32, utf-16-be, utf-16-le, utf-32-be, utf-32-le" msgstr "utf-8, utf-16, utf-32, utf-16-be, utf-16-le, utf-32-be, utf-32-le" -#: ../../library/codecs.rst:366 +#: ../../library/codecs.rst:389 msgid "" -"Allow encoding and decoding of surrogate codes. These codecs normally treat " -"the presence of surrogates as an error." +"Allow encoding and decoding surrogate code point (``U+D800`` - ``U+DFFF``) " +"as normal code point. Otherwise these codecs treat the presence of surrogate " +"code point in :class:`str` as an error." msgstr "" -#: ../../library/codecs.rst:371 +#: ../../library/codecs.rst:396 msgid "The ``'surrogateescape'`` and ``'surrogatepass'`` error handlers." msgstr "" -#: ../../library/codecs.rst:374 +#: ../../library/codecs.rst:399 msgid "" -"The ``'surrogatepass'`` error handlers now works with utf-16\\* and " -"utf-32\\* codecs." +"The ``'surrogatepass'`` error handler now works with utf-16\\* and utf-32\\* " +"codecs." msgstr "" -#: ../../library/codecs.rst:377 +#: ../../library/codecs.rst:403 msgid "The ``'namereplace'`` error handler." msgstr "" -#: ../../library/codecs.rst:380 +#: ../../library/codecs.rst:406 msgid "" -"The ``'backslashreplace'`` error handlers now works with decoding and " +"The ``'backslashreplace'`` error handler now works with decoding and " "translating." msgstr "" -#: ../../library/codecs.rst:384 +#: ../../library/codecs.rst:410 msgid "" "The set of allowed values can be extended by registering a new named error " "handler:" msgstr "" -#: ../../library/codecs.rst:389 +#: ../../library/codecs.rst:415 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:393 +#: ../../library/codecs.rst:419 msgid "" "For encoding, *error_handler* will be called with a :exc:" "`UnicodeEncodeError` instance, which contains information about the location " @@ -515,85 +525,115 @@ msgid "" "position is out of bound an :exc:`IndexError` will be raised." msgstr "" -#: ../../library/codecs.rst:405 +#: ../../library/codecs.rst:431 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:410 +#: ../../library/codecs.rst:436 msgid "" "Previously registered error handlers (including the standard error handlers) " "can be looked up by name:" msgstr "" -#: ../../library/codecs.rst:415 +#: ../../library/codecs.rst:441 msgid "Return the error handler previously registered under the name *name*." msgstr "" -#: ../../library/codecs.rst:417 +#: ../../library/codecs.rst:443 msgid "Raises a :exc:`LookupError` in case the handler cannot be found." msgstr "" -#: ../../library/codecs.rst:419 +#: ../../library/codecs.rst:445 msgid "" "The following standard error handlers are also made available as module " "level functions:" msgstr "" -#: ../../library/codecs.rst:424 +#: ../../library/codecs.rst:450 +msgid "Implements the ``'strict'`` error handling." +msgstr "" + +#: ../../library/codecs.rst:452 +msgid "Each encoding or decoding error raises a :exc:`UnicodeError`." +msgstr "" + +#: ../../library/codecs.rst:457 +msgid "Implements the ``'ignore'`` error handling." +msgstr "" + +#: ../../library/codecs.rst:459 msgid "" -"Implements the ``'strict'`` error handling: each encoding or decoding error " -"raises a :exc:`UnicodeError`." +"Malformed data is ignored; encoding or decoding is continued without further " +"notice." +msgstr "" + +#: ../../library/codecs.rst:465 +msgid "Implements the ``'replace'`` error handling." msgstr "" -#: ../../library/codecs.rst:430 +#: ../../library/codecs.rst:467 msgid "" -"Implements the ``'replace'`` error handling (for :term:`text encodings ` only): substitutes ``'?'`` for encoding errors (to be encoded by " -"the codec), and ``'\\ufffd'`` (the Unicode replacement character) for " -"decoding errors." +"Substitutes ``?`` (ASCII character) for encoding errors or ``�`` (U+FFFD, " +"the official REPLACEMENT CHARACTER) for decoding errors." +msgstr "" + +#: ../../library/codecs.rst:473 +msgid "Implements the ``'backslashreplace'`` error handling." msgstr "" -#: ../../library/codecs.rst:438 +#: ../../library/codecs.rst:475 msgid "" -"Implements the ``'ignore'`` error handling: malformed data is ignored and " -"encoding or decoding is continued without further notice." +"Malformed data is replaced by a backslashed escape sequence. On encoding, " +"use the hexadecimal form of Unicode code point with formats ``\\xhh`` ``" +"\\uxxxx`` ``\\Uxxxxxxxx``. On decoding, use the hexadecimal form of byte " +"value with format ``\\xhh``." +msgstr "" + +#: ../../library/codecs.rst:480 +msgid "Works with decoding and translating." msgstr "" -#: ../../library/codecs.rst:444 +#: ../../library/codecs.rst:486 msgid "" -"Implements the ``'xmlcharrefreplace'`` error handling (for encoding with :" -"term:`text encodings ` only): the unencodable character is " -"replaced by an appropriate XML character reference." +"Implements the ``'xmlcharrefreplace'`` error handling (for encoding within :" +"term:`text encoding` only)." msgstr "" -#: ../../library/codecs.rst:451 +#: ../../library/codecs.rst:489 msgid "" -"Implements the ``'backslashreplace'`` error handling (for :term:`text " -"encodings ` only): malformed data is replaced by a " -"backslashed escape sequence." +"The unencodable character is replaced by an appropriate XML/HTML numeric " +"character reference, which is a decimal form of Unicode code point with " +"format ``&#num;`` ." msgstr "" -#: ../../library/codecs.rst:457 +#: ../../library/codecs.rst:496 msgid "" -"Implements the ``'namereplace'`` error handling (for encoding with :term:" -"`text encodings ` only): the unencodable character is " -"replaced by a ``\\N{...}`` escape sequence." +"Implements the ``'namereplace'`` error handling (for encoding within :term:" +"`text encoding` only)." msgstr "" -#: ../../library/codecs.rst:467 +#: ../../library/codecs.rst:499 +msgid "" +"The unencodable character is replaced by a ``\\N{...}`` escape sequence. The " +"set of characters that appear in the braces is the Name property from " +"Unicode Character Database. For example, the German lowercase letter ``'ß'`` " +"will be converted to byte sequence ``\\N{LATIN SMALL LETTER SHARP S}`` ." +msgstr "" + +#: ../../library/codecs.rst:510 msgid "Stateless Encoding and Decoding" msgstr "" -#: ../../library/codecs.rst:469 +#: ../../library/codecs.rst:512 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:475 +#: ../../library/codecs.rst:518 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 +641,26 @@ msgid "" "``iso-8859-1``)." msgstr "" -#: ../../library/codecs.rst:480 ../../library/codecs.rst:502 +#: ../../library/codecs.rst:523 ../../library/codecs.rst:545 msgid "" "The *errors* argument defines the error handling to apply. It defaults to " "``'strict'`` handling." msgstr "" -#: ../../library/codecs.rst:483 +#: ../../library/codecs.rst:526 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:487 +#: ../../library/codecs.rst:530 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:493 +#: ../../library/codecs.rst:536 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 +668,31 @@ msgid "" "object." msgstr "" -#: ../../library/codecs.rst:498 +#: ../../library/codecs.rst:541 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:505 +#: ../../library/codecs.rst:548 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:509 +#: ../../library/codecs.rst:552 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:514 +#: ../../library/codecs.rst:557 msgid "Incremental Encoding and Decoding" msgstr "" -#: ../../library/codecs.rst:516 +#: ../../library/codecs.rst:559 msgid "" "The :class:`IncrementalEncoder` and :class:`IncrementalDecoder` classes " "provide the basic interface for incremental encoding and decoding. Encoding/" @@ -663,7 +703,7 @@ msgid "" "during method calls." msgstr "" -#: ../../library/codecs.rst:524 +#: ../../library/codecs.rst:567 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 +711,36 @@ msgid "" "encoder/decoder." msgstr "" -#: ../../library/codecs.rst:533 +#: ../../library/codecs.rst:576 msgid "IncrementalEncoder Objects" msgstr "IncrementalEncoder 物件" -#: ../../library/codecs.rst:535 +#: ../../library/codecs.rst:578 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:542 +#: ../../library/codecs.rst:585 msgid "Constructor for an :class:`IncrementalEncoder` instance." msgstr "" -#: ../../library/codecs.rst:544 +#: ../../library/codecs.rst:587 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:548 +#: ../../library/codecs.rst:591 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:552 +#: ../../library/codecs.rst:595 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 +748,21 @@ msgid "" "`IncrementalEncoder` object." msgstr "" -#: ../../library/codecs.rst:560 +#: ../../library/codecs.rst:603 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:567 +#: ../../library/codecs.rst:610 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:574 +#: ../../library/codecs.rst:617 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 +771,42 @@ msgid "" "into an integer.)" msgstr "" -#: ../../library/codecs.rst:583 +#: ../../library/codecs.rst:626 msgid "" "Set the state of the encoder to *state*. *state* must be an encoder state " "returned by :meth:`getstate`." msgstr "" -#: ../../library/codecs.rst:590 +#: ../../library/codecs.rst:633 msgid "IncrementalDecoder Objects" msgstr "IncrementalDecoder 物件" -#: ../../library/codecs.rst:592 +#: ../../library/codecs.rst:635 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:599 +#: ../../library/codecs.rst:642 msgid "Constructor for an :class:`IncrementalDecoder` instance." msgstr "" -#: ../../library/codecs.rst:601 +#: ../../library/codecs.rst:644 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:605 +#: ../../library/codecs.rst:648 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:609 +#: ../../library/codecs.rst:652 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 +814,7 @@ msgid "" "`IncrementalDecoder` object." msgstr "" -#: ../../library/codecs.rst:617 +#: ../../library/codecs.rst:660 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 +825,11 @@ msgid "" "(which might raise an exception)." msgstr "" -#: ../../library/codecs.rst:628 +#: ../../library/codecs.rst:671 msgid "Reset the decoder to the initial state." msgstr "" -#: ../../library/codecs.rst:633 +#: ../../library/codecs.rst:676 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 +844,59 @@ msgid "" "bytes of the resulting string into an integer.)" msgstr "" -#: ../../library/codecs.rst:648 +#: ../../library/codecs.rst:691 msgid "" "Set the state of the decoder to *state*. *state* must be a decoder state " "returned by :meth:`getstate`." msgstr "" -#: ../../library/codecs.rst:653 +#: ../../library/codecs.rst:696 msgid "Stream Encoding and Decoding" msgstr "" -#: ../../library/codecs.rst:656 +#: ../../library/codecs.rst:699 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:664 +#: ../../library/codecs.rst:707 msgid "StreamWriter Objects" msgstr "StreamWriter 物件" -#: ../../library/codecs.rst:666 +#: ../../library/codecs.rst:709 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:673 +#: ../../library/codecs.rst:716 msgid "Constructor for a :class:`StreamWriter` instance." msgstr "" -#: ../../library/codecs.rst:675 +#: ../../library/codecs.rst:718 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:679 +#: ../../library/codecs.rst:722 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:682 +#: ../../library/codecs.rst:725 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:686 +#: ../../library/codecs.rst:729 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 +904,70 @@ msgid "" "object." msgstr "" -#: ../../library/codecs.rst:692 +#: ../../library/codecs.rst:735 msgid "Writes the object's contents encoded to the stream." msgstr "" -#: ../../library/codecs.rst:697 +#: ../../library/codecs.rst:740 msgid "" "Writes the concatenated iterable of strings to the stream (possibly by " "reusing the :meth:`write` method). Infinite or very large iterables are not " "supported. The standard bytes-to-bytes codecs do not support this method." msgstr "" -#: ../../library/codecs.rst:705 ../../library/codecs.rst:800 +#: ../../library/codecs.rst:748 ../../library/codecs.rst:843 msgid "Resets the codec buffers used for keeping internal state." msgstr "" -#: ../../library/codecs.rst:707 +#: ../../library/codecs.rst:750 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:712 +#: ../../library/codecs.rst:755 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:719 +#: ../../library/codecs.rst:762 msgid "StreamReader Objects" msgstr "StreamReader 物件" -#: ../../library/codecs.rst:721 +#: ../../library/codecs.rst:764 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:728 +#: ../../library/codecs.rst:771 msgid "Constructor for a :class:`StreamReader` instance." msgstr "" -#: ../../library/codecs.rst:730 +#: ../../library/codecs.rst:773 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:734 +#: ../../library/codecs.rst:777 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:737 +#: ../../library/codecs.rst:780 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:741 +#: ../../library/codecs.rst:784 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 +975,24 @@ msgid "" "object." msgstr "" -#: ../../library/codecs.rst:745 +#: ../../library/codecs.rst:788 msgid "" "The set of allowed values for the *errors* argument can be extended with :" "func:`register_error`." msgstr "" -#: ../../library/codecs.rst:751 +#: ../../library/codecs.rst:794 msgid "Decodes data from the stream and returns the resulting object." msgstr "" -#: ../../library/codecs.rst:753 +#: ../../library/codecs.rst:796 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:758 +#: ../../library/codecs.rst:801 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 +1001,13 @@ msgid "" "huge files in one step." msgstr "" -#: ../../library/codecs.rst:765 +#: ../../library/codecs.rst:808 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:769 +#: ../../library/codecs.rst:812 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 +1015,68 @@ msgid "" "the stream, these should be read too." msgstr "" -#: ../../library/codecs.rst:777 +#: ../../library/codecs.rst:820 msgid "Read one line from the input stream and return the decoded data." msgstr "" -#: ../../library/codecs.rst:779 +#: ../../library/codecs.rst:822 msgid "" "*size*, if given, is passed as size argument to the stream's :meth:`read` " "method." msgstr "" -#: ../../library/codecs.rst:782 +#: ../../library/codecs.rst:825 msgid "" "If *keepends* is false line-endings will be stripped from the lines returned." msgstr "" -#: ../../library/codecs.rst:788 +#: ../../library/codecs.rst:831 msgid "" "Read all lines available on the input stream and return them as a list of " "lines." msgstr "" -#: ../../library/codecs.rst:791 +#: ../../library/codecs.rst:834 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:794 +#: ../../library/codecs.rst:837 msgid "" "*sizehint*, if given, is passed as the *size* argument to the stream's :meth:" "`read` method." msgstr "" -#: ../../library/codecs.rst:802 +#: ../../library/codecs.rst:845 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:806 +#: ../../library/codecs.rst:849 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:812 +#: ../../library/codecs.rst:855 msgid "StreamReaderWriter Objects" msgstr "StreamReaderWriter 物件" -#: ../../library/codecs.rst:814 +#: ../../library/codecs.rst:857 msgid "" "The :class:`StreamReaderWriter` is a convenience class that allows wrapping " "streams which work in both read and write modes." msgstr "" -#: ../../library/codecs.rst:817 ../../library/codecs.rst:841 +#: ../../library/codecs.rst:860 ../../library/codecs.rst:884 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:823 +#: ../../library/codecs.rst:866 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 +1085,24 @@ msgid "" "writers." msgstr "" -#: ../../library/codecs.rst:828 +#: ../../library/codecs.rst:871 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:836 +#: ../../library/codecs.rst:879 msgid "StreamRecoder Objects" msgstr "StreamRecoder 物件" -#: ../../library/codecs.rst:838 +#: ../../library/codecs.rst:881 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:847 +#: ../../library/codecs.rst:890 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 +1110,17 @@ msgid "" "work on the backend — the data in *stream*." msgstr "" -#: ../../library/codecs.rst:852 +#: ../../library/codecs.rst:895 msgid "" "You can use these objects to do transparent transcodings, e.g., from Latin-1 " "to UTF-8 and back." msgstr "" -#: ../../library/codecs.rst:855 +#: ../../library/codecs.rst:898 msgid "The *stream* argument must be a file-like object." msgstr "" -#: ../../library/codecs.rst:857 +#: ../../library/codecs.rst:900 msgid "" "The *encode* and *decode* arguments must adhere to the :class:`Codec` " "interface. *Reader* and *Writer* must be factory functions or classes " @@ -1088,36 +1128,36 @@ msgid "" "interface respectively." msgstr "" -#: ../../library/codecs.rst:862 +#: ../../library/codecs.rst:905 msgid "" "Error handling is done in the same way as defined for the stream readers and " "writers." msgstr "" -#: ../../library/codecs.rst:866 +#: ../../library/codecs.rst:909 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:874 +#: ../../library/codecs.rst:917 msgid "Encodings and Unicode" msgstr "" -#: ../../library/codecs.rst:876 +#: ../../library/codecs.rst:919 msgid "" -"Strings are stored internally as sequences of code points in range ``0x0``--" -"``0x10FFFF``. (See :pep:`393` for more details about the implementation.) " -"Once a string object is used outside of CPU and memory, endianness and how " -"these arrays are stored as bytes become an issue. As with other codecs, " -"serialising a string into a sequence of bytes is known as *encoding*, and " -"recreating the string from the sequence of bytes is known as *decoding*. " -"There are a variety of different text serialisation codecs, which are " -"collectivity referred to as :term:`text encodings `." +"Strings are stored internally as sequences of code points in range ``U" +"+0000``--``U+10FFFF``. (See :pep:`393` for more details about the " +"implementation.) Once a string object is used outside of CPU and memory, " +"endianness and how these arrays are stored as bytes become an issue. As with " +"other codecs, serialising a string into a sequence of bytes is known as " +"*encoding*, and recreating the string from the sequence of bytes is known as " +"*decoding*. There are a variety of different text serialisation codecs, " +"which are collectivity referred to as :term:`text encodings `." msgstr "" -#: ../../library/codecs.rst:886 +#: ../../library/codecs.rst:929 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 +1168,7 @@ msgid "" "position 3: ordinal not in range(256)``." msgstr "" -#: ../../library/codecs.rst:894 +#: ../../library/codecs.rst:937 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 +1178,7 @@ msgid "" "that shows you which character is mapped to which byte value." msgstr "" -#: ../../library/codecs.rst:901 +#: ../../library/codecs.rst:944 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 +1208,7 @@ msgid "" "normal character that will be decoded like any other." msgstr "" -#: ../../library/codecs.rst:927 +#: ../../library/codecs.rst:970 msgid "" "There's another encoding that is able to encode the full range of Unicode " "characters: UTF-8. UTF-8 is an 8-bit encoding, which means there are no " @@ -1179,71 +1219,70 @@ msgid "" "which when concatenated give the Unicode character):" msgstr "" -#: ../../library/codecs.rst:936 +#: ../../library/codecs.rst:979 msgid "Range" msgstr "" -#: ../../library/codecs.rst:936 +#: ../../library/codecs.rst:979 msgid "Encoding" msgstr "" -#: ../../library/codecs.rst:938 +#: ../../library/codecs.rst:981 msgid "``U-00000000`` ... ``U-0000007F``" msgstr "``U-00000000`` ... ``U-0000007F``" -#: ../../library/codecs.rst:938 +#: ../../library/codecs.rst:981 msgid "0xxxxxxx" msgstr "0xxxxxxx" -#: ../../library/codecs.rst:940 +#: ../../library/codecs.rst:983 msgid "``U-00000080`` ... ``U-000007FF``" msgstr "``U-00000080`` ... ``U-000007FF``" -#: ../../library/codecs.rst:940 +#: ../../library/codecs.rst:983 msgid "110xxxxx 10xxxxxx" msgstr "110xxxxx 10xxxxxx" -#: ../../library/codecs.rst:942 +#: ../../library/codecs.rst:985 msgid "``U-00000800`` ... ``U-0000FFFF``" msgstr "``U-00000800`` ... ``U-0000FFFF``" -#: ../../library/codecs.rst:942 +#: ../../library/codecs.rst:985 msgid "1110xxxx 10xxxxxx 10xxxxxx" msgstr "1110xxxx 10xxxxxx 10xxxxxx" -#: ../../library/codecs.rst:944 +#: ../../library/codecs.rst:987 msgid "``U-00010000`` ... ``U-0010FFFF``" msgstr "``U-00010000`` ... ``U-0010FFFF``" -#: ../../library/codecs.rst:944 +#: ../../library/codecs.rst:987 msgid "11110xxx 10xxxxxx 10xxxxxx 10xxxxxx" msgstr "11110xxx 10xxxxxx 10xxxxxx 10xxxxxx" -#: ../../library/codecs.rst:947 +#: ../../library/codecs.rst:990 msgid "" "The least significant bit of the Unicode character is the rightmost x bit." msgstr "" -#: ../../library/codecs.rst:949 +#: ../../library/codecs.rst:992 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:953 +#: ../../library/codecs.rst:996 msgid "" "Without external information it's impossible to reliably determine which " "encoding was used for encoding a string. Each charmap encoding can decode " "any random byte sequence. However that's not possible with UTF-8, as UTF-8 " "byte sequences have a structure that doesn't allow arbitrary byte sequences. " "To increase the reliability with which a UTF-8 encoding can be detected, " -"Microsoft invented a variant of UTF-8 (that Python 2.5 calls ``\"utf-8-sig" -"\"``) for its Notepad program: Before any of the Unicode characters is " -"written to the file, a UTF-8 encoded BOM (which looks like this as a byte " -"sequence: ``0xef``, ``0xbb``, ``0xbf``) is written. As it's rather " -"improbable that any charmap encoded file starts with these byte values " -"(which would e.g. map to" +"Microsoft invented a variant of UTF-8 (that Python calls ``\"utf-8-sig\"``) " +"for its Notepad program: Before any of the Unicode characters is written to " +"the file, a UTF-8 encoded BOM (which looks like this as a byte sequence: " +"``0xef``, ``0xbb``, ``0xbf``) is written. As it's rather improbable that any " +"charmap encoded file starts with these byte values (which would e.g. map to" msgstr "" #: ../../library/codecs.rst:0 @@ -1258,7 +1297,7 @@ msgstr "" msgid "INVERTED QUESTION MARK" msgstr "" -#: ../../library/codecs.rst:969 +#: ../../library/codecs.rst:1012 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 +1309,11 @@ msgid "" "the use of the BOM is discouraged and should generally be avoided." msgstr "" -#: ../../library/codecs.rst:982 +#: ../../library/codecs.rst:1025 msgid "Standard Encodings" msgstr "" -#: ../../library/codecs.rst:984 +#: ../../library/codecs.rst:1027 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 +1325,7 @@ msgid "" "alias for the ``'utf_8'`` codec." msgstr "" -#: ../../library/codecs.rst:994 +#: ../../library/codecs.rst:1037 msgid "" "Some common encodings can bypass the codecs lookup machinery to improve " "performance. These optimization opportunities are only recognized by CPython " @@ -1296,11 +1335,11 @@ msgid "" "Using alternative aliases for these encodings may result in slower execution." msgstr "" -#: ../../library/codecs.rst:1002 +#: ../../library/codecs.rst:1045 msgid "Optimization opportunity recognized for us-ascii." msgstr "" -#: ../../library/codecs.rst:1005 +#: ../../library/codecs.rst:1048 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,504 +1347,504 @@ msgid "" "languages in particular, the following variants typically exist:" msgstr "" -#: ../../library/codecs.rst:1010 +#: ../../library/codecs.rst:1053 msgid "an ISO 8859 codeset" msgstr "" -#: ../../library/codecs.rst:1012 +#: ../../library/codecs.rst:1055 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:1015 +#: ../../library/codecs.rst:1058 msgid "an IBM EBCDIC code page" msgstr "" -#: ../../library/codecs.rst:1017 +#: ../../library/codecs.rst:1060 msgid "an IBM PC code page, which is ASCII compatible" msgstr "" -#: ../../library/codecs.rst:1022 ../../library/codecs.rst:1277 -#: ../../library/codecs.rst:1344 ../../library/codecs.rst:1399 +#: ../../library/codecs.rst:1065 ../../library/codecs.rst:1320 +#: ../../library/codecs.rst:1387 ../../library/codecs.rst:1442 msgid "Codec" msgstr "" -#: ../../library/codecs.rst:1022 ../../library/codecs.rst:1277 -#: ../../library/codecs.rst:1344 ../../library/codecs.rst:1399 +#: ../../library/codecs.rst:1065 ../../library/codecs.rst:1320 +#: ../../library/codecs.rst:1387 ../../library/codecs.rst:1442 msgid "Aliases" msgstr "" -#: ../../library/codecs.rst:1022 +#: ../../library/codecs.rst:1065 msgid "Languages" msgstr "語言" -#: ../../library/codecs.rst:1024 +#: ../../library/codecs.rst:1067 msgid "ascii" msgstr "ascii" -#: ../../library/codecs.rst:1024 +#: ../../library/codecs.rst:1067 msgid "646, us-ascii" msgstr "646, us-ascii" -#: ../../library/codecs.rst:1024 ../../library/codecs.rst:1030 -#: ../../library/codecs.rst:1038 +#: ../../library/codecs.rst:1067 ../../library/codecs.rst:1073 +#: ../../library/codecs.rst:1081 msgid "English" msgstr "英文" -#: ../../library/codecs.rst:1026 +#: ../../library/codecs.rst:1069 msgid "big5" msgstr "big5" -#: ../../library/codecs.rst:1026 +#: ../../library/codecs.rst:1069 msgid "big5-tw, csbig5" msgstr "big5-tw, csbig5" -#: ../../library/codecs.rst:1026 ../../library/codecs.rst:1028 -#: ../../library/codecs.rst:1086 +#: ../../library/codecs.rst:1069 ../../library/codecs.rst:1071 +#: ../../library/codecs.rst:1129 msgid "Traditional Chinese" msgstr "繁體中文" -#: ../../library/codecs.rst:1028 +#: ../../library/codecs.rst:1071 msgid "big5hkscs" msgstr "big5hkscs" -#: ../../library/codecs.rst:1028 +#: ../../library/codecs.rst:1071 msgid "big5-hkscs, hkscs" msgstr "big5-hkscs, hkscs" -#: ../../library/codecs.rst:1030 +#: ../../library/codecs.rst:1073 msgid "cp037" msgstr "cp037" -#: ../../library/codecs.rst:1030 +#: ../../library/codecs.rst:1073 msgid "IBM037, IBM039" msgstr "IBM037, IBM039" -#: ../../library/codecs.rst:1032 +#: ../../library/codecs.rst:1075 msgid "cp273" msgstr "cp273" -#: ../../library/codecs.rst:1032 +#: ../../library/codecs.rst:1075 msgid "273, IBM273, csIBM273" msgstr "273, IBM273, csIBM273" -#: ../../library/codecs.rst:1032 +#: ../../library/codecs.rst:1075 msgid "German" msgstr "德文" -#: ../../library/codecs.rst:1036 +#: ../../library/codecs.rst:1079 msgid "cp424" msgstr "cp424" -#: ../../library/codecs.rst:1036 +#: ../../library/codecs.rst:1079 msgid "EBCDIC-CP-HE, IBM424" msgstr "EBCDIC-CP-HE, IBM424" -#: ../../library/codecs.rst:1036 ../../library/codecs.rst:1056 -#: ../../library/codecs.rst:1066 ../../library/codecs.rst:1109 -#: ../../library/codecs.rst:1172 +#: ../../library/codecs.rst:1079 ../../library/codecs.rst:1099 +#: ../../library/codecs.rst:1109 ../../library/codecs.rst:1152 +#: ../../library/codecs.rst:1215 msgid "Hebrew" msgstr "希伯來文" -#: ../../library/codecs.rst:1038 +#: ../../library/codecs.rst:1081 msgid "cp437" msgstr "cp437" -#: ../../library/codecs.rst:1038 +#: ../../library/codecs.rst:1081 msgid "437, IBM437" msgstr "437, IBM437" -#: ../../library/codecs.rst:1040 +#: ../../library/codecs.rst:1083 msgid "cp500" msgstr "cp500" -#: ../../library/codecs.rst:1040 +#: ../../library/codecs.rst:1083 msgid "EBCDIC-CP-BE, EBCDIC-CP-CH, IBM500" msgstr "EBCDIC-CP-BE, EBCDIC-CP-CH, IBM500" -#: ../../library/codecs.rst:1040 ../../library/codecs.rst:1049 -#: ../../library/codecs.rst:1060 ../../library/codecs.rst:1096 -#: ../../library/codecs.rst:1103 ../../library/codecs.rst:1156 -#: ../../library/codecs.rst:1184 ../../library/codecs.rst:1212 +#: ../../library/codecs.rst:1083 ../../library/codecs.rst:1092 +#: ../../library/codecs.rst:1103 ../../library/codecs.rst:1139 +#: ../../library/codecs.rst:1146 ../../library/codecs.rst:1199 +#: ../../library/codecs.rst:1227 ../../library/codecs.rst:1255 msgid "Western Europe" msgstr "" -#: ../../library/codecs.rst:1043 +#: ../../library/codecs.rst:1086 msgid "cp720" msgstr "cp720" -#: ../../library/codecs.rst:1043 ../../library/codecs.rst:1070 -#: ../../library/codecs.rst:1111 ../../library/codecs.rst:1168 +#: ../../library/codecs.rst:1086 ../../library/codecs.rst:1113 +#: ../../library/codecs.rst:1154 ../../library/codecs.rst:1211 msgid "Arabic" msgstr "阿拉伯文" -#: ../../library/codecs.rst:1045 +#: ../../library/codecs.rst:1088 msgid "cp737" msgstr "cp737" -#: ../../library/codecs.rst:1045 ../../library/codecs.rst:1076 -#: ../../library/codecs.rst:1080 ../../library/codecs.rst:1105 -#: ../../library/codecs.rst:1170 ../../library/codecs.rst:1205 +#: ../../library/codecs.rst:1088 ../../library/codecs.rst:1119 +#: ../../library/codecs.rst:1123 ../../library/codecs.rst:1148 +#: ../../library/codecs.rst:1213 ../../library/codecs.rst:1248 msgid "Greek" msgstr "希臘文" -#: ../../library/codecs.rst:1047 +#: ../../library/codecs.rst:1090 msgid "cp775" msgstr "cp775" -#: ../../library/codecs.rst:1047 +#: ../../library/codecs.rst:1090 msgid "IBM775" msgstr "IBM775" -#: ../../library/codecs.rst:1047 ../../library/codecs.rst:1113 -#: ../../library/codecs.rst:1163 ../../library/codecs.rst:1180 +#: ../../library/codecs.rst:1090 ../../library/codecs.rst:1156 +#: ../../library/codecs.rst:1206 ../../library/codecs.rst:1223 msgid "Baltic languages" msgstr "" -#: ../../library/codecs.rst:1049 +#: ../../library/codecs.rst:1092 msgid "cp850" msgstr "cp850" -#: ../../library/codecs.rst:1049 +#: ../../library/codecs.rst:1092 msgid "850, IBM850" msgstr "850, IBM850" -#: ../../library/codecs.rst:1051 +#: ../../library/codecs.rst:1094 msgid "cp852" msgstr "cp852" -#: ../../library/codecs.rst:1051 +#: ../../library/codecs.rst:1094 msgid "852, IBM852" msgstr "852, IBM852" -#: ../../library/codecs.rst:1051 ../../library/codecs.rst:1098 -#: ../../library/codecs.rst:1159 ../../library/codecs.rst:1209 +#: ../../library/codecs.rst:1094 ../../library/codecs.rst:1141 +#: ../../library/codecs.rst:1202 ../../library/codecs.rst:1252 msgid "Central and Eastern Europe" msgstr "" -#: ../../library/codecs.rst:1053 +#: ../../library/codecs.rst:1096 msgid "cp855" msgstr "cp855" -#: ../../library/codecs.rst:1053 +#: ../../library/codecs.rst:1096 msgid "855, IBM855" msgstr "855, IBM855" -#: ../../library/codecs.rst:1053 ../../library/codecs.rst:1100 -#: ../../library/codecs.rst:1165 ../../library/codecs.rst:1202 +#: ../../library/codecs.rst:1096 ../../library/codecs.rst:1143 +#: ../../library/codecs.rst:1208 ../../library/codecs.rst:1245 msgid "Bulgarian, Byelorussian, Macedonian, Russian, Serbian" msgstr "" -#: ../../library/codecs.rst:1056 +#: ../../library/codecs.rst:1099 msgid "cp856" msgstr "cp856" -#: ../../library/codecs.rst:1058 +#: ../../library/codecs.rst:1101 msgid "cp857" msgstr "cp857" -#: ../../library/codecs.rst:1058 +#: ../../library/codecs.rst:1101 msgid "857, IBM857" msgstr "857, IBM857" -#: ../../library/codecs.rst:1058 ../../library/codecs.rst:1090 -#: ../../library/codecs.rst:1107 ../../library/codecs.rst:1174 -#: ../../library/codecs.rst:1214 +#: ../../library/codecs.rst:1101 ../../library/codecs.rst:1133 +#: ../../library/codecs.rst:1150 ../../library/codecs.rst:1217 +#: ../../library/codecs.rst:1257 msgid "Turkish" msgstr "土耳其文" -#: ../../library/codecs.rst:1060 +#: ../../library/codecs.rst:1103 msgid "cp858" msgstr "cp858" -#: ../../library/codecs.rst:1060 +#: ../../library/codecs.rst:1103 msgid "858, IBM858" msgstr "858, IBM858" -#: ../../library/codecs.rst:1062 +#: ../../library/codecs.rst:1105 msgid "cp860" msgstr "cp860" -#: ../../library/codecs.rst:1062 +#: ../../library/codecs.rst:1105 msgid "860, IBM860" msgstr "860, IBM860" -#: ../../library/codecs.rst:1062 +#: ../../library/codecs.rst:1105 msgid "Portuguese" msgstr "" -#: ../../library/codecs.rst:1064 +#: ../../library/codecs.rst:1107 msgid "cp861" msgstr "cp861" -#: ../../library/codecs.rst:1064 +#: ../../library/codecs.rst:1107 msgid "861, CP-IS, IBM861" msgstr "861, CP-IS, IBM861" -#: ../../library/codecs.rst:1064 ../../library/codecs.rst:1207 +#: ../../library/codecs.rst:1107 ../../library/codecs.rst:1250 msgid "Icelandic" msgstr "" -#: ../../library/codecs.rst:1066 +#: ../../library/codecs.rst:1109 msgid "cp862" msgstr "cp862" -#: ../../library/codecs.rst:1066 +#: ../../library/codecs.rst:1109 msgid "862, IBM862" msgstr "862, IBM862" -#: ../../library/codecs.rst:1068 +#: ../../library/codecs.rst:1111 msgid "cp863" msgstr "cp863" -#: ../../library/codecs.rst:1068 +#: ../../library/codecs.rst:1111 msgid "863, IBM863" msgstr "863, IBM863" -#: ../../library/codecs.rst:1068 +#: ../../library/codecs.rst:1111 msgid "Canadian" msgstr "" -#: ../../library/codecs.rst:1070 +#: ../../library/codecs.rst:1113 msgid "cp864" msgstr "cp864" -#: ../../library/codecs.rst:1070 +#: ../../library/codecs.rst:1113 msgid "IBM864" msgstr "IBM864" -#: ../../library/codecs.rst:1072 +#: ../../library/codecs.rst:1115 msgid "cp865" msgstr "cp865" -#: ../../library/codecs.rst:1072 +#: ../../library/codecs.rst:1115 msgid "865, IBM865" msgstr "865, IBM865" -#: ../../library/codecs.rst:1072 +#: ../../library/codecs.rst:1115 msgid "Danish, Norwegian" msgstr "" -#: ../../library/codecs.rst:1074 +#: ../../library/codecs.rst:1117 msgid "cp866" msgstr "cp866" -#: ../../library/codecs.rst:1074 +#: ../../library/codecs.rst:1117 msgid "866, IBM866" msgstr "866, IBM866" -#: ../../library/codecs.rst:1074 ../../library/codecs.rst:1190 +#: ../../library/codecs.rst:1117 ../../library/codecs.rst:1233 msgid "Russian" msgstr "俄羅斯文" -#: ../../library/codecs.rst:1076 +#: ../../library/codecs.rst:1119 msgid "cp869" msgstr "cp869" -#: ../../library/codecs.rst:1076 +#: ../../library/codecs.rst:1119 msgid "869, CP-GR, IBM869" msgstr "869, CP-GR, IBM869" -#: ../../library/codecs.rst:1078 +#: ../../library/codecs.rst:1121 msgid "cp874" msgstr "cp874" -#: ../../library/codecs.rst:1078 +#: ../../library/codecs.rst:1121 msgid "Thai" msgstr "泰文" -#: ../../library/codecs.rst:1080 +#: ../../library/codecs.rst:1123 msgid "cp875" msgstr "cp875" -#: ../../library/codecs.rst:1082 +#: ../../library/codecs.rst:1125 msgid "cp932" msgstr "cp932" -#: ../../library/codecs.rst:1082 +#: ../../library/codecs.rst:1125 msgid "932, ms932, mskanji, ms-kanji" msgstr "932, ms932, mskanji, ms-kanji" -#: ../../library/codecs.rst:1082 ../../library/codecs.rst:1117 -#: ../../library/codecs.rst:1119 ../../library/codecs.rst:1121 -#: ../../library/codecs.rst:1138 ../../library/codecs.rst:1141 -#: ../../library/codecs.rst:1146 ../../library/codecs.rst:1149 -#: ../../library/codecs.rst:1151 ../../library/codecs.rst:1219 -#: ../../library/codecs.rst:1222 ../../library/codecs.rst:1225 +#: ../../library/codecs.rst:1125 ../../library/codecs.rst:1160 +#: ../../library/codecs.rst:1162 ../../library/codecs.rst:1164 +#: ../../library/codecs.rst:1181 ../../library/codecs.rst:1184 +#: ../../library/codecs.rst:1189 ../../library/codecs.rst:1192 +#: ../../library/codecs.rst:1194 ../../library/codecs.rst:1262 +#: ../../library/codecs.rst:1265 ../../library/codecs.rst:1268 msgid "Japanese" msgstr "日文" -#: ../../library/codecs.rst:1084 +#: ../../library/codecs.rst:1127 msgid "cp949" msgstr "cp949" -#: ../../library/codecs.rst:1084 +#: ../../library/codecs.rst:1127 msgid "949, ms949, uhc" msgstr "949, ms949, uhc" -#: ../../library/codecs.rst:1084 ../../library/codecs.rst:1123 -#: ../../library/codecs.rst:1153 ../../library/codecs.rst:1188 +#: ../../library/codecs.rst:1127 ../../library/codecs.rst:1166 +#: ../../library/codecs.rst:1196 ../../library/codecs.rst:1231 msgid "Korean" msgstr "韓文" -#: ../../library/codecs.rst:1086 +#: ../../library/codecs.rst:1129 msgid "cp950" msgstr "cp950" -#: ../../library/codecs.rst:1086 +#: ../../library/codecs.rst:1129 msgid "950, ms950" msgstr "950, ms950" -#: ../../library/codecs.rst:1088 +#: ../../library/codecs.rst:1131 msgid "cp1006" msgstr "cp1006" -#: ../../library/codecs.rst:1088 +#: ../../library/codecs.rst:1131 msgid "Urdu" msgstr "" -#: ../../library/codecs.rst:1090 +#: ../../library/codecs.rst:1133 msgid "cp1026" msgstr "cp1026" -#: ../../library/codecs.rst:1090 +#: ../../library/codecs.rst:1133 msgid "ibm1026" msgstr "ibm1026" -#: ../../library/codecs.rst:1092 +#: ../../library/codecs.rst:1135 msgid "cp1125" msgstr "cp1125" -#: ../../library/codecs.rst:1092 +#: ../../library/codecs.rst:1135 msgid "1125, ibm1125, cp866u, ruscii" msgstr "1125, ibm1125, cp866u, ruscii" -#: ../../library/codecs.rst:1092 ../../library/codecs.rst:1196 +#: ../../library/codecs.rst:1135 ../../library/codecs.rst:1239 msgid "Ukrainian" msgstr "烏克蘭文" -#: ../../library/codecs.rst:1096 +#: ../../library/codecs.rst:1139 msgid "cp1140" msgstr "cp1140" -#: ../../library/codecs.rst:1096 +#: ../../library/codecs.rst:1139 msgid "ibm1140" msgstr "ibm1140" -#: ../../library/codecs.rst:1098 +#: ../../library/codecs.rst:1141 msgid "cp1250" msgstr "cp1250" -#: ../../library/codecs.rst:1098 +#: ../../library/codecs.rst:1141 msgid "windows-1250" msgstr "windows-1250" -#: ../../library/codecs.rst:1100 +#: ../../library/codecs.rst:1143 msgid "cp1251" msgstr "cp1251" -#: ../../library/codecs.rst:1100 +#: ../../library/codecs.rst:1143 msgid "windows-1251" msgstr "windows-1251" -#: ../../library/codecs.rst:1103 +#: ../../library/codecs.rst:1146 msgid "cp1252" msgstr "cp1252" -#: ../../library/codecs.rst:1103 +#: ../../library/codecs.rst:1146 msgid "windows-1252" msgstr "windows-1252" -#: ../../library/codecs.rst:1105 +#: ../../library/codecs.rst:1148 msgid "cp1253" msgstr "cp1253" -#: ../../library/codecs.rst:1105 +#: ../../library/codecs.rst:1148 msgid "windows-1253" msgstr "windows-1253" -#: ../../library/codecs.rst:1107 +#: ../../library/codecs.rst:1150 msgid "cp1254" msgstr "cp1254" -#: ../../library/codecs.rst:1107 +#: ../../library/codecs.rst:1150 msgid "windows-1254" msgstr "windows-1254" -#: ../../library/codecs.rst:1109 +#: ../../library/codecs.rst:1152 msgid "cp1255" msgstr "cp1255" -#: ../../library/codecs.rst:1109 +#: ../../library/codecs.rst:1152 msgid "windows-1255" msgstr "windows-1255" -#: ../../library/codecs.rst:1111 +#: ../../library/codecs.rst:1154 msgid "cp1256" msgstr "cp1256" -#: ../../library/codecs.rst:1111 +#: ../../library/codecs.rst:1154 msgid "windows-1256" msgstr "windows-1256" -#: ../../library/codecs.rst:1113 +#: ../../library/codecs.rst:1156 msgid "cp1257" msgstr "cp1257" -#: ../../library/codecs.rst:1113 +#: ../../library/codecs.rst:1156 msgid "windows-1257" msgstr "windows-1257" -#: ../../library/codecs.rst:1115 +#: ../../library/codecs.rst:1158 msgid "cp1258" msgstr "cp1258" -#: ../../library/codecs.rst:1115 +#: ../../library/codecs.rst:1158 msgid "windows-1258" msgstr "windows-1258" -#: ../../library/codecs.rst:1115 +#: ../../library/codecs.rst:1158 msgid "Vietnamese" msgstr "越南文" -#: ../../library/codecs.rst:1117 +#: ../../library/codecs.rst:1160 msgid "euc_jp" msgstr "euc_jp" -#: ../../library/codecs.rst:1117 +#: ../../library/codecs.rst:1160 msgid "eucjp, ujis, u-jis" msgstr "eucjp, ujis, u-jis" -#: ../../library/codecs.rst:1119 +#: ../../library/codecs.rst:1162 msgid "euc_jis_2004" msgstr "euc_jis_2004" -#: ../../library/codecs.rst:1119 +#: ../../library/codecs.rst:1162 msgid "jisx0213, eucjis2004" msgstr "jisx0213, eucjis2004" -#: ../../library/codecs.rst:1121 +#: ../../library/codecs.rst:1164 msgid "euc_jisx0213" msgstr "euc_jisx0213" -#: ../../library/codecs.rst:1121 +#: ../../library/codecs.rst:1164 msgid "eucjisx0213" msgstr "eucjisx0213" -#: ../../library/codecs.rst:1123 +#: ../../library/codecs.rst:1166 msgid "euc_kr" msgstr "euc_kr" -#: ../../library/codecs.rst:1123 +#: ../../library/codecs.rst:1166 msgid "euckr, korean, ksc5601, ks_c-5601, ks_c-5601-1987, ksx1001, ks_x-1001" msgstr "euckr, korean, ksc5601, ks_c-5601, ks_c-5601-1987, ksx1001, ks_x-1001" -#: ../../library/codecs.rst:1127 +#: ../../library/codecs.rst:1170 msgid "gb2312" msgstr "gb2312" -#: ../../library/codecs.rst:1127 +#: ../../library/codecs.rst:1170 msgid "" "chinese, csiso58gb231280, euc-cn, euccn, eucgb2312-cn, gb2312-1980, " "gb2312-80, iso-ir-58" @@ -1813,446 +1852,446 @@ msgstr "" "chinese, csiso58gb231280, euc-cn, euccn, eucgb2312-cn, gb2312-1980, " "gb2312-80, iso-ir-58" -#: ../../library/codecs.rst:1127 ../../library/codecs.rst:1136 +#: ../../library/codecs.rst:1170 ../../library/codecs.rst:1179 msgid "Simplified Chinese" msgstr "簡體中文" -#: ../../library/codecs.rst:1132 +#: ../../library/codecs.rst:1175 msgid "gbk" msgstr "gbk" -#: ../../library/codecs.rst:1132 +#: ../../library/codecs.rst:1175 msgid "936, cp936, ms936" msgstr "936, cp936, ms936" -#: ../../library/codecs.rst:1132 ../../library/codecs.rst:1134 +#: ../../library/codecs.rst:1175 ../../library/codecs.rst:1177 msgid "Unified Chinese" msgstr "" -#: ../../library/codecs.rst:1134 +#: ../../library/codecs.rst:1177 msgid "gb18030" msgstr "gb18030" -#: ../../library/codecs.rst:1134 +#: ../../library/codecs.rst:1177 msgid "gb18030-2000" msgstr "gb18030-2000" -#: ../../library/codecs.rst:1136 +#: ../../library/codecs.rst:1179 msgid "hz" msgstr "" -#: ../../library/codecs.rst:1136 +#: ../../library/codecs.rst:1179 msgid "hzgb, hz-gb, hz-gb-2312" msgstr "hzgb, hz-gb, hz-gb-2312" -#: ../../library/codecs.rst:1138 +#: ../../library/codecs.rst:1181 msgid "iso2022_jp" msgstr "iso2022_jp" -#: ../../library/codecs.rst:1138 +#: ../../library/codecs.rst:1181 msgid "csiso2022jp, iso2022jp, iso-2022-jp" msgstr "csiso2022jp, iso2022jp, iso-2022-jp" -#: ../../library/codecs.rst:1141 +#: ../../library/codecs.rst:1184 msgid "iso2022_jp_1" msgstr "iso2022_jp_1" -#: ../../library/codecs.rst:1141 +#: ../../library/codecs.rst:1184 msgid "iso2022jp-1, iso-2022-jp-1" msgstr "iso2022jp-1, iso-2022-jp-1" -#: ../../library/codecs.rst:1143 +#: ../../library/codecs.rst:1186 msgid "iso2022_jp_2" msgstr "iso2022_jp_2" -#: ../../library/codecs.rst:1143 +#: ../../library/codecs.rst:1186 msgid "iso2022jp-2, iso-2022-jp-2" msgstr "iso2022jp-2, iso-2022-jp-2" -#: ../../library/codecs.rst:1143 +#: ../../library/codecs.rst:1186 msgid "Japanese, Korean, Simplified Chinese, Western Europe, Greek" msgstr "" -#: ../../library/codecs.rst:1146 +#: ../../library/codecs.rst:1189 msgid "iso2022_jp_2004" msgstr "iso2022_jp_2004" -#: ../../library/codecs.rst:1146 +#: ../../library/codecs.rst:1189 msgid "iso2022jp-2004, iso-2022-jp-2004" msgstr "iso2022jp-2004, iso-2022-jp-2004" -#: ../../library/codecs.rst:1149 +#: ../../library/codecs.rst:1192 msgid "iso2022_jp_3" msgstr "iso2022_jp_3" -#: ../../library/codecs.rst:1149 +#: ../../library/codecs.rst:1192 msgid "iso2022jp-3, iso-2022-jp-3" msgstr "iso2022jp-3, iso-2022-jp-3" -#: ../../library/codecs.rst:1151 +#: ../../library/codecs.rst:1194 msgid "iso2022_jp_ext" msgstr "iso2022_jp_ext" -#: ../../library/codecs.rst:1151 +#: ../../library/codecs.rst:1194 msgid "iso2022jp-ext, iso-2022-jp-ext" msgstr "iso2022jp-ext, iso-2022-jp-ext" -#: ../../library/codecs.rst:1153 +#: ../../library/codecs.rst:1196 msgid "iso2022_kr" msgstr "iso2022_kr" -#: ../../library/codecs.rst:1153 +#: ../../library/codecs.rst:1196 msgid "csiso2022kr, iso2022kr, iso-2022-kr" msgstr "csiso2022kr, iso2022kr, iso-2022-kr" -#: ../../library/codecs.rst:1156 +#: ../../library/codecs.rst:1199 msgid "latin_1" msgstr "latin_1" -#: ../../library/codecs.rst:1156 +#: ../../library/codecs.rst:1199 msgid "iso-8859-1, iso8859-1, 8859, cp819, latin, latin1, L1" msgstr "iso-8859-1, iso8859-1, 8859, cp819, latin, latin1, L1" -#: ../../library/codecs.rst:1159 +#: ../../library/codecs.rst:1202 msgid "iso8859_2" msgstr "iso8859_2" -#: ../../library/codecs.rst:1159 +#: ../../library/codecs.rst:1202 msgid "iso-8859-2, latin2, L2" msgstr "iso-8859-2, latin2, L2" -#: ../../library/codecs.rst:1161 +#: ../../library/codecs.rst:1204 msgid "iso8859_3" msgstr "iso8859_3" -#: ../../library/codecs.rst:1161 +#: ../../library/codecs.rst:1204 msgid "iso-8859-3, latin3, L3" msgstr "iso-8859-3, latin3, L3" -#: ../../library/codecs.rst:1161 +#: ../../library/codecs.rst:1204 msgid "Esperanto, Maltese" msgstr "" -#: ../../library/codecs.rst:1163 +#: ../../library/codecs.rst:1206 msgid "iso8859_4" msgstr "iso8859_4" -#: ../../library/codecs.rst:1163 +#: ../../library/codecs.rst:1206 msgid "iso-8859-4, latin4, L4" msgstr "iso-8859-4, latin4, L4" -#: ../../library/codecs.rst:1165 +#: ../../library/codecs.rst:1208 msgid "iso8859_5" msgstr "iso8859_5" -#: ../../library/codecs.rst:1165 +#: ../../library/codecs.rst:1208 msgid "iso-8859-5, cyrillic" msgstr "iso-8859-5, cyrillic" -#: ../../library/codecs.rst:1168 +#: ../../library/codecs.rst:1211 msgid "iso8859_6" msgstr "iso8859_6" -#: ../../library/codecs.rst:1168 +#: ../../library/codecs.rst:1211 msgid "iso-8859-6, arabic" msgstr "iso-8859-6, arabic" -#: ../../library/codecs.rst:1170 +#: ../../library/codecs.rst:1213 msgid "iso8859_7" msgstr "iso8859_7" -#: ../../library/codecs.rst:1170 +#: ../../library/codecs.rst:1213 msgid "iso-8859-7, greek, greek8" msgstr "iso-8859-7, greek, greek8" -#: ../../library/codecs.rst:1172 +#: ../../library/codecs.rst:1215 msgid "iso8859_8" msgstr "iso8859_8" -#: ../../library/codecs.rst:1172 +#: ../../library/codecs.rst:1215 msgid "iso-8859-8, hebrew" msgstr "iso-8859-8, hebrew" -#: ../../library/codecs.rst:1174 +#: ../../library/codecs.rst:1217 msgid "iso8859_9" msgstr "iso8859_9" -#: ../../library/codecs.rst:1174 +#: ../../library/codecs.rst:1217 msgid "iso-8859-9, latin5, L5" msgstr "iso-8859-9, latin5, L5" -#: ../../library/codecs.rst:1176 +#: ../../library/codecs.rst:1219 msgid "iso8859_10" msgstr "iso8859_10" -#: ../../library/codecs.rst:1176 +#: ../../library/codecs.rst:1219 msgid "iso-8859-10, latin6, L6" msgstr "iso-8859-10, latin6, L6" -#: ../../library/codecs.rst:1176 +#: ../../library/codecs.rst:1219 msgid "Nordic languages" msgstr "" -#: ../../library/codecs.rst:1178 +#: ../../library/codecs.rst:1221 msgid "iso8859_11" msgstr "iso8859_11" -#: ../../library/codecs.rst:1178 +#: ../../library/codecs.rst:1221 msgid "iso-8859-11, thai" msgstr "iso-8859-11, thai" -#: ../../library/codecs.rst:1178 +#: ../../library/codecs.rst:1221 msgid "Thai languages" msgstr "" -#: ../../library/codecs.rst:1180 +#: ../../library/codecs.rst:1223 msgid "iso8859_13" msgstr "iso8859_13" -#: ../../library/codecs.rst:1180 +#: ../../library/codecs.rst:1223 msgid "iso-8859-13, latin7, L7" msgstr "iso-8859-13, latin7, L7" -#: ../../library/codecs.rst:1182 +#: ../../library/codecs.rst:1225 msgid "iso8859_14" msgstr "iso8859_14" -#: ../../library/codecs.rst:1182 +#: ../../library/codecs.rst:1225 msgid "iso-8859-14, latin8, L8" msgstr "iso-8859-14, latin8, L8" -#: ../../library/codecs.rst:1182 +#: ../../library/codecs.rst:1225 msgid "Celtic languages" msgstr "" -#: ../../library/codecs.rst:1184 +#: ../../library/codecs.rst:1227 msgid "iso8859_15" msgstr "iso8859_15" -#: ../../library/codecs.rst:1184 +#: ../../library/codecs.rst:1227 msgid "iso-8859-15, latin9, L9" msgstr "iso-8859-15, latin9, L9" -#: ../../library/codecs.rst:1186 +#: ../../library/codecs.rst:1229 msgid "iso8859_16" msgstr "iso8859_16" -#: ../../library/codecs.rst:1186 +#: ../../library/codecs.rst:1229 msgid "iso-8859-16, latin10, L10" msgstr "iso-8859-16, latin10, L10" -#: ../../library/codecs.rst:1186 +#: ../../library/codecs.rst:1229 msgid "South-Eastern Europe" msgstr "" -#: ../../library/codecs.rst:1188 +#: ../../library/codecs.rst:1231 msgid "johab" msgstr "" -#: ../../library/codecs.rst:1188 +#: ../../library/codecs.rst:1231 msgid "cp1361, ms1361" msgstr "cp1361, ms1361" -#: ../../library/codecs.rst:1190 +#: ../../library/codecs.rst:1233 msgid "koi8_r" msgstr "koi8_r" -#: ../../library/codecs.rst:1192 +#: ../../library/codecs.rst:1235 msgid "koi8_t" msgstr "koi8_t" -#: ../../library/codecs.rst:1192 +#: ../../library/codecs.rst:1235 msgid "Tajik" msgstr "" -#: ../../library/codecs.rst:1196 +#: ../../library/codecs.rst:1239 msgid "koi8_u" msgstr "koi8_u" -#: ../../library/codecs.rst:1198 +#: ../../library/codecs.rst:1241 msgid "kz1048" msgstr "kz1048" -#: ../../library/codecs.rst:1198 +#: ../../library/codecs.rst:1241 msgid "kz_1048, strk1048_2002, rk1048" msgstr "kz_1048, strk1048_2002, rk1048" -#: ../../library/codecs.rst:1198 ../../library/codecs.rst:1216 +#: ../../library/codecs.rst:1241 ../../library/codecs.rst:1259 msgid "Kazakh" msgstr "" -#: ../../library/codecs.rst:1202 +#: ../../library/codecs.rst:1245 msgid "mac_cyrillic" msgstr "mac_cyrillic" -#: ../../library/codecs.rst:1202 +#: ../../library/codecs.rst:1245 msgid "maccyrillic" msgstr "" -#: ../../library/codecs.rst:1205 +#: ../../library/codecs.rst:1248 msgid "mac_greek" msgstr "mac_greek" -#: ../../library/codecs.rst:1205 +#: ../../library/codecs.rst:1248 msgid "macgreek" msgstr "" -#: ../../library/codecs.rst:1207 +#: ../../library/codecs.rst:1250 msgid "mac_iceland" msgstr "mac_iceland" -#: ../../library/codecs.rst:1207 +#: ../../library/codecs.rst:1250 msgid "maciceland" msgstr "" -#: ../../library/codecs.rst:1209 +#: ../../library/codecs.rst:1252 msgid "mac_latin2" msgstr "mac_latin2" -#: ../../library/codecs.rst:1209 +#: ../../library/codecs.rst:1252 msgid "maclatin2, maccentraleurope, mac_centeuro" msgstr "maclatin2, maccentraleurope, mac_centeuro" -#: ../../library/codecs.rst:1212 +#: ../../library/codecs.rst:1255 msgid "mac_roman" msgstr "mac_roman" -#: ../../library/codecs.rst:1212 +#: ../../library/codecs.rst:1255 msgid "macroman, macintosh" msgstr "macroman, macintosh" -#: ../../library/codecs.rst:1214 +#: ../../library/codecs.rst:1257 msgid "mac_turkish" msgstr "mac_turkish" -#: ../../library/codecs.rst:1214 +#: ../../library/codecs.rst:1257 msgid "macturkish" msgstr "" -#: ../../library/codecs.rst:1216 +#: ../../library/codecs.rst:1259 msgid "ptcp154" msgstr "ptcp154" -#: ../../library/codecs.rst:1216 +#: ../../library/codecs.rst:1259 msgid "csptcp154, pt154, cp154, cyrillic-asian" msgstr "csptcp154, pt154, cp154, cyrillic-asian" -#: ../../library/codecs.rst:1219 +#: ../../library/codecs.rst:1262 msgid "shift_jis" msgstr "shift_jis" -#: ../../library/codecs.rst:1219 +#: ../../library/codecs.rst:1262 msgid "csshiftjis, shiftjis, sjis, s_jis" msgstr "csshiftjis, shiftjis, sjis, s_jis" -#: ../../library/codecs.rst:1222 +#: ../../library/codecs.rst:1265 msgid "shift_jis_2004" msgstr "shift_jis_2004" -#: ../../library/codecs.rst:1222 +#: ../../library/codecs.rst:1265 msgid "shiftjis2004, sjis_2004, sjis2004" msgstr "shiftjis2004, sjis_2004, sjis2004" -#: ../../library/codecs.rst:1225 +#: ../../library/codecs.rst:1268 msgid "shift_jisx0213" msgstr "shift_jisx0213" -#: ../../library/codecs.rst:1225 +#: ../../library/codecs.rst:1268 msgid "shiftjisx0213, sjisx0213, s_jisx0213" msgstr "shiftjisx0213, sjisx0213, s_jisx0213" -#: ../../library/codecs.rst:1228 +#: ../../library/codecs.rst:1271 msgid "utf_32" msgstr "utf_32" -#: ../../library/codecs.rst:1228 +#: ../../library/codecs.rst:1271 msgid "U32, utf32" msgstr "U32, utf32" -#: ../../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:1242 -#: ../../library/codecs.rst:1244 +#: ../../library/codecs.rst:1271 ../../library/codecs.rst:1273 +#: ../../library/codecs.rst:1275 ../../library/codecs.rst:1277 +#: ../../library/codecs.rst:1279 ../../library/codecs.rst:1281 +#: ../../library/codecs.rst:1283 ../../library/codecs.rst:1285 +#: ../../library/codecs.rst:1287 msgid "all languages" msgstr "" -#: ../../library/codecs.rst:1230 +#: ../../library/codecs.rst:1273 msgid "utf_32_be" msgstr "utf_32_be" -#: ../../library/codecs.rst:1230 +#: ../../library/codecs.rst:1273 msgid "UTF-32BE" msgstr "UTF-32BE" -#: ../../library/codecs.rst:1232 +#: ../../library/codecs.rst:1275 msgid "utf_32_le" msgstr "utf_32_le" -#: ../../library/codecs.rst:1232 +#: ../../library/codecs.rst:1275 msgid "UTF-32LE" msgstr "UTF-32LE" -#: ../../library/codecs.rst:1234 +#: ../../library/codecs.rst:1277 msgid "utf_16" msgstr "utf_16" -#: ../../library/codecs.rst:1234 +#: ../../library/codecs.rst:1277 msgid "U16, utf16" msgstr "U16, utf16" -#: ../../library/codecs.rst:1236 +#: ../../library/codecs.rst:1279 msgid "utf_16_be" msgstr "utf_16_be" -#: ../../library/codecs.rst:1236 +#: ../../library/codecs.rst:1279 msgid "UTF-16BE" msgstr "UTF-16BE" -#: ../../library/codecs.rst:1238 +#: ../../library/codecs.rst:1281 msgid "utf_16_le" msgstr "utf_16_le" -#: ../../library/codecs.rst:1238 +#: ../../library/codecs.rst:1281 msgid "UTF-16LE" msgstr "UTF-16LE" -#: ../../library/codecs.rst:1240 +#: ../../library/codecs.rst:1283 msgid "utf_7" msgstr "utf_7" -#: ../../library/codecs.rst:1240 +#: ../../library/codecs.rst:1283 msgid "U7, unicode-1-1-utf-7" msgstr "U7, unicode-1-1-utf-7" -#: ../../library/codecs.rst:1242 +#: ../../library/codecs.rst:1285 msgid "utf_8" msgstr "utf_8" -#: ../../library/codecs.rst:1242 +#: ../../library/codecs.rst:1285 msgid "U8, UTF, utf8, cp65001" msgstr "U8, UTF, utf8, cp65001" -#: ../../library/codecs.rst:1244 +#: ../../library/codecs.rst:1287 msgid "utf_8_sig" msgstr "utf_8_sig" -#: ../../library/codecs.rst:1247 +#: ../../library/codecs.rst:1290 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:1253 +#: ../../library/codecs.rst:1296 msgid "``cp65001`` is now an alias to ``utf_8``." msgstr "" -#: ../../library/codecs.rst:1258 +#: ../../library/codecs.rst:1301 msgid "Python Specific Encodings" msgstr "" -#: ../../library/codecs.rst:1260 +#: ../../library/codecs.rst:1303 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 " @@ -2262,272 +2301,272 @@ msgid "" "asymmetric codecs, the stated meaning describes the encoding direction." msgstr "" -#: ../../library/codecs.rst:1268 +#: ../../library/codecs.rst:1311 msgid "Text Encodings" msgstr "" -#: ../../library/codecs.rst:1270 +#: ../../library/codecs.rst:1313 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:1279 +#: ../../library/codecs.rst:1322 msgid "idna" msgstr "idna" -#: ../../library/codecs.rst:1279 +#: ../../library/codecs.rst:1322 msgid "" "Implement :rfc:`3490`, see also :mod:`encodings.idna`. Only " "``errors='strict'`` is supported." msgstr "" -#: ../../library/codecs.rst:1285 +#: ../../library/codecs.rst:1328 msgid "mbcs" msgstr "mbcs" -#: ../../library/codecs.rst:1285 +#: ../../library/codecs.rst:1328 msgid "ansi, dbcs" msgstr "ansi, dbcs" -#: ../../library/codecs.rst:1285 +#: ../../library/codecs.rst:1328 msgid "" "Windows only: Encode the operand according to the ANSI codepage (CP_ACP)." msgstr "" -#: ../../library/codecs.rst:1289 +#: ../../library/codecs.rst:1332 msgid "oem" msgstr "oem" -#: ../../library/codecs.rst:1289 +#: ../../library/codecs.rst:1332 msgid "" "Windows only: Encode the operand according to the OEM codepage (CP_OEMCP)." msgstr "" -#: ../../library/codecs.rst:1295 +#: ../../library/codecs.rst:1338 msgid "palmos" msgstr "" -#: ../../library/codecs.rst:1295 +#: ../../library/codecs.rst:1338 msgid "Encoding of PalmOS 3.5." msgstr "" -#: ../../library/codecs.rst:1297 +#: ../../library/codecs.rst:1340 msgid "punycode" msgstr "" -#: ../../library/codecs.rst:1297 +#: ../../library/codecs.rst:1340 msgid "Implement :rfc:`3492`. Stateful codecs are not supported." msgstr "" -#: ../../library/codecs.rst:1301 +#: ../../library/codecs.rst:1344 msgid "raw_unicode_escape" msgstr "raw_unicode_escape" -#: ../../library/codecs.rst:1301 +#: ../../library/codecs.rst:1344 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:1310 +#: ../../library/codecs.rst:1353 msgid "undefined" msgstr "" -#: ../../library/codecs.rst:1310 +#: ../../library/codecs.rst:1353 msgid "" "Raise an exception for all conversions, even empty strings. The error " "handler is ignored." msgstr "" -#: ../../library/codecs.rst:1315 +#: ../../library/codecs.rst:1358 msgid "unicode_escape" msgstr "unicode_escape" -#: ../../library/codecs.rst:1315 +#: ../../library/codecs.rst:1358 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:1327 +#: ../../library/codecs.rst:1370 msgid "\"unicode_internal\" codec is removed." msgstr "" -#: ../../library/codecs.rst:1334 +#: ../../library/codecs.rst:1377 msgid "Binary Transforms" msgstr "" -#: ../../library/codecs.rst:1336 +#: ../../library/codecs.rst:1379 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:1344 +#: ../../library/codecs.rst:1387 msgid "Encoder / decoder" msgstr "" -#: ../../library/codecs.rst:1346 +#: ../../library/codecs.rst:1389 msgid "base64_codec [#b64]_" msgstr "base64_codec [#b64]_" -#: ../../library/codecs.rst:1346 +#: ../../library/codecs.rst:1389 msgid "base64, base_64" msgstr "base64, base_64" -#: ../../library/codecs.rst:1346 +#: ../../library/codecs.rst:1389 msgid "" "Convert the operand to multiline MIME base64 (the result always includes a " "trailing ``'\\n'``)." msgstr "" -#: ../../library/codecs.rst:1351 +#: ../../library/codecs.rst:1394 msgid "" "accepts any :term:`bytes-like object` as input for encoding and decoding" msgstr "" -#: ../../library/codecs.rst:1346 +#: ../../library/codecs.rst:1389 msgid ":meth:`base64.encodebytes` / :meth:`base64.decodebytes`" msgstr ":meth:`base64.encodebytes` / :meth:`base64.decodebytes`" -#: ../../library/codecs.rst:1357 +#: ../../library/codecs.rst:1400 msgid "bz2_codec" msgstr "bz2_codec" -#: ../../library/codecs.rst:1357 +#: ../../library/codecs.rst:1400 msgid "bz2" msgstr "bz2" -#: ../../library/codecs.rst:1357 +#: ../../library/codecs.rst:1400 msgid "Compress the operand using bz2." msgstr "" -#: ../../library/codecs.rst:1357 +#: ../../library/codecs.rst:1400 msgid ":meth:`bz2.compress` / :meth:`bz2.decompress`" msgstr ":meth:`bz2.compress` / :meth:`bz2.decompress`" -#: ../../library/codecs.rst:1360 +#: ../../library/codecs.rst:1403 msgid "hex_codec" msgstr "hex_codec" -#: ../../library/codecs.rst:1360 +#: ../../library/codecs.rst:1403 msgid "hex" msgstr "hex" -#: ../../library/codecs.rst:1360 +#: ../../library/codecs.rst:1403 msgid "" "Convert the operand to hexadecimal representation, with two digits per byte." msgstr "" -#: ../../library/codecs.rst:1360 +#: ../../library/codecs.rst:1403 msgid ":meth:`binascii.b2a_hex` / :meth:`binascii.a2b_hex`" msgstr ":meth:`binascii.b2a_hex` / :meth:`binascii.a2b_hex`" -#: ../../library/codecs.rst:1365 +#: ../../library/codecs.rst:1408 msgid "quopri_codec" msgstr "quopri_codec" -#: ../../library/codecs.rst:1365 +#: ../../library/codecs.rst:1408 msgid "quopri, quotedprintable, quoted_printable" msgstr "quopri, quotedprintable, quoted_printable" -#: ../../library/codecs.rst:1365 +#: ../../library/codecs.rst:1408 msgid "Convert the operand to MIME quoted printable." msgstr "" -#: ../../library/codecs.rst:1365 +#: ../../library/codecs.rst:1408 msgid ":meth:`quopri.encode` with ``quotetabs=True`` / :meth:`quopri.decode`" msgstr ":meth:`quopri.encode` with ``quotetabs=True`` / :meth:`quopri.decode`" -#: ../../library/codecs.rst:1369 +#: ../../library/codecs.rst:1412 msgid "uu_codec" msgstr "uu_codec" -#: ../../library/codecs.rst:1369 +#: ../../library/codecs.rst:1412 msgid "uu" msgstr "uu" -#: ../../library/codecs.rst:1369 +#: ../../library/codecs.rst:1412 msgid "Convert the operand using uuencode." msgstr "" -#: ../../library/codecs.rst:1369 +#: ../../library/codecs.rst:1412 msgid ":meth:`uu.encode` / :meth:`uu.decode`" msgstr ":meth:`uu.encode` / :meth:`uu.decode`" -#: ../../library/codecs.rst:1372 +#: ../../library/codecs.rst:1415 msgid "zlib_codec" msgstr "zlib_codec" -#: ../../library/codecs.rst:1372 +#: ../../library/codecs.rst:1415 msgid "zip, zlib" msgstr "zip, zlib" -#: ../../library/codecs.rst:1372 +#: ../../library/codecs.rst:1415 msgid "Compress the operand using gzip." msgstr "" -#: ../../library/codecs.rst:1372 +#: ../../library/codecs.rst:1415 msgid ":meth:`zlib.compress` / :meth:`zlib.decompress`" msgstr ":meth:`zlib.compress` / :meth:`zlib.decompress`" -#: ../../library/codecs.rst:1376 +#: ../../library/codecs.rst:1419 msgid "" "In addition to :term:`bytes-like objects `, " "``'base64_codec'`` also accepts ASCII-only instances of :class:`str` for " "decoding" msgstr "" -#: ../../library/codecs.rst:1380 +#: ../../library/codecs.rst:1423 msgid "Restoration of the binary transforms." msgstr "" -#: ../../library/codecs.rst:1383 +#: ../../library/codecs.rst:1426 msgid "Restoration of the aliases for the binary transforms." msgstr "" -#: ../../library/codecs.rst:1390 +#: ../../library/codecs.rst:1433 msgid "Text Transforms" msgstr "" -#: ../../library/codecs.rst:1392 +#: ../../library/codecs.rst:1435 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:1401 +#: ../../library/codecs.rst:1444 msgid "rot_13" msgstr "rot_13" -#: ../../library/codecs.rst:1401 +#: ../../library/codecs.rst:1444 msgid "rot13" msgstr "" -#: ../../library/codecs.rst:1401 +#: ../../library/codecs.rst:1444 msgid "Return the Caesar-cypher encryption of the operand." msgstr "" -#: ../../library/codecs.rst:1406 +#: ../../library/codecs.rst:1449 msgid "Restoration of the ``rot_13`` text transform." msgstr "" -#: ../../library/codecs.rst:1409 +#: ../../library/codecs.rst:1452 msgid "Restoration of the ``rot13`` alias." msgstr "" -#: ../../library/codecs.rst:1414 +#: ../../library/codecs.rst:1457 msgid "" ":mod:`encodings.idna` --- Internationalized Domain Names in Applications" msgstr "" -#: ../../library/codecs.rst:1420 +#: ../../library/codecs.rst:1463 msgid "" "This module implements :rfc:`3490` (Internationalized Domain Names in " "Applications) and :rfc:`3492` (Nameprep: A Stringprep Profile for " @@ -2535,13 +2574,13 @@ msgid "" "encoding and :mod:`stringprep`." msgstr "" -#: ../../library/codecs.rst:1425 +#: ../../library/codecs.rst:1468 msgid "" "If you need the IDNA 2008 standard from :rfc:`5891` and :rfc:`5895`, use the " "third-party `idna module `_." msgstr "" -#: ../../library/codecs.rst:1428 +#: ../../library/codecs.rst:1471 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." @@ -2555,7 +2594,7 @@ msgid "" "presenting them to the user." msgstr "" -#: ../../library/codecs.rst:1439 +#: ../../library/codecs.rst:1482 msgid "" "Python supports this conversion in several ways: the ``idna`` codec " "performs conversion between Unicode and ACE, separating an input string into " @@ -2572,14 +2611,14 @@ msgid "" "sends that field at all)." msgstr "" -#: ../../library/codecs.rst:1452 +#: ../../library/codecs.rst:1495 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:1456 +#: ../../library/codecs.rst:1499 msgid "" "The module :mod:`encodings.idna` also implements the nameprep procedure, " "which performs certain normalizations on host names, to achieve case-" @@ -2587,49 +2626,49 @@ msgid "" "characters. The nameprep functions can be used directly if desired." msgstr "" -#: ../../library/codecs.rst:1464 +#: ../../library/codecs.rst:1507 msgid "" "Return the nameprepped version of *label*. The implementation currently " "assumes query strings, so ``AllowUnassigned`` is true." msgstr "" -#: ../../library/codecs.rst:1470 +#: ../../library/codecs.rst:1513 msgid "" "Convert a label to ASCII, as specified in :rfc:`3490`. ``UseSTD3ASCIIRules`` " "is assumed to be false." msgstr "" -#: ../../library/codecs.rst:1476 +#: ../../library/codecs.rst:1519 msgid "Convert a label to Unicode, as specified in :rfc:`3490`." msgstr "" -#: ../../library/codecs.rst:1480 +#: ../../library/codecs.rst:1523 msgid ":mod:`encodings.mbcs` --- Windows ANSI codepage" msgstr "" -#: ../../library/codecs.rst:1485 +#: ../../library/codecs.rst:1528 msgid "This module implements the ANSI codepage (CP_ACP)." msgstr "" -#: ../../library/codecs.rst:1488 +#: ../../library/codecs.rst:1531 msgid ":ref:`Availability `: Windows only." msgstr ":ref:`適用 `:只有 Windows。" -#: ../../library/codecs.rst:1489 +#: ../../library/codecs.rst:1532 msgid "Support any error handler." msgstr "" -#: ../../library/codecs.rst:1492 +#: ../../library/codecs.rst:1535 msgid "" "Before 3.2, the *errors* argument was ignored; ``'replace'`` was always used " "to encode, and ``'ignore'`` to decode." msgstr "" -#: ../../library/codecs.rst:1498 +#: ../../library/codecs.rst:1541 msgid ":mod:`encodings.utf_8_sig` --- UTF-8 codec with BOM signature" msgstr "" -#: ../../library/codecs.rst:1504 +#: ../../library/codecs.rst:1547 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/crypt.po b/library/crypt.po index 814138f265..0d429f2b7b 100644 --- a/library/crypt.po +++ b/library/crypt.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.10\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2022-04-06 00:13+0000\n" +"POT-Creation-Date: 2022-05-21 17:35+0000\n" "PO-Revision-Date: 2018-05-23 14:42+0000\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -27,10 +27,13 @@ msgid "**Source code:** :source:`Lib/crypt.py`" msgstr "**原始碼:**\\ :source:`Lib/crypt.py`" #: ../../library/crypt.rst:19 -msgid "The :mod:`crypt` module is deprecated (see :pep:`594` for details)." -msgstr ":mod:`crypt` 模組 (module) 即將被棄用(詳見 :pep:`594`\\ )。" +msgid "" +"The :mod:`crypt` module is deprecated (see :pep:`PEP 594 <594#crypt>` for " +"details and alternatives). The :mod:`hashlib` module is a potential " +"replacement for certain use cases." +msgstr "" -#: ../../library/crypt.rst:24 +#: ../../library/crypt.rst:26 msgid "" "This module implements an interface to the :manpage:`crypt(3)` routine, " "which is a one-way hash function based upon a modified DES algorithm; see " @@ -39,7 +42,7 @@ msgid "" "attempting to crack Unix passwords with a dictionary." msgstr "" -#: ../../library/crypt.rst:32 +#: ../../library/crypt.rst:34 msgid "" "Notice that the behavior of this module depends on the actual " "implementation of the :manpage:`crypt(3)` routine in the running system. " @@ -47,69 +50,69 @@ msgid "" "be available on this module." msgstr "" -#: ../../library/crypt.rst:38 +#: ../../library/crypt.rst:40 msgid ":ref:`Availability `: Unix. Not available on VxWorks." msgstr ":ref:`適用 `:Unix,在 VxWorks 上不支援。" -#: ../../library/crypt.rst:40 +#: ../../library/crypt.rst:42 msgid "Hashing Methods" msgstr "" -#: ../../library/crypt.rst:44 +#: ../../library/crypt.rst:46 msgid "" "The :mod:`crypt` module defines the list of hashing methods (not all methods " "are available on all platforms):" msgstr "" -#: ../../library/crypt.rst:49 +#: ../../library/crypt.rst:51 msgid "" "A Modular Crypt Format method with 16 character salt and 86 character hash " "based on the SHA-512 hash function. This is the strongest method." msgstr "" -#: ../../library/crypt.rst:54 +#: ../../library/crypt.rst:56 msgid "" "Another Modular Crypt Format method with 16 character salt and 43 character " "hash based on the SHA-256 hash function." msgstr "" -#: ../../library/crypt.rst:59 +#: ../../library/crypt.rst:61 msgid "" "Another Modular Crypt Format method with 22 character salt and 31 character " "hash based on the Blowfish cipher." msgstr "" -#: ../../library/crypt.rst:66 +#: ../../library/crypt.rst:68 msgid "" "Another Modular Crypt Format method with 8 character salt and 22 character " "hash based on the MD5 hash function." msgstr "" -#: ../../library/crypt.rst:71 +#: ../../library/crypt.rst:73 msgid "" "The traditional method with a 2 character salt and 13 characters of hash. " "This is the weakest method." msgstr "" -#: ../../library/crypt.rst:76 +#: ../../library/crypt.rst:78 msgid "Module Attributes" msgstr "模組屬性" -#: ../../library/crypt.rst:82 +#: ../../library/crypt.rst:84 msgid "" "A list of available password hashing algorithms, as ``crypt.METHOD_*`` " "objects. This list is sorted from strongest to weakest." msgstr "" -#: ../../library/crypt.rst:88 +#: ../../library/crypt.rst:90 msgid "Module Functions" msgstr "模組函式" -#: ../../library/crypt.rst:90 +#: ../../library/crypt.rst:92 msgid "The :mod:`crypt` module defines the following functions:" msgstr ":mod:`crypt` 模組定義了以下函式:" -#: ../../library/crypt.rst:94 +#: ../../library/crypt.rst:96 msgid "" "*word* will usually be a user's password as typed at a prompt or in a " "graphical interface. The optional *salt* is either a string as returned " @@ -119,14 +122,14 @@ msgid "" "strongest method available in :attr:`methods` will be used." msgstr "" -#: ../../library/crypt.rst:101 +#: ../../library/crypt.rst:103 msgid "" "Checking a password is usually done by passing the plain-text password as " "*word* and the full results of a previous :func:`crypt` call, which should " "be the same as the results of this call." msgstr "" -#: ../../library/crypt.rst:105 +#: ../../library/crypt.rst:107 msgid "" "*salt* (either a random 2 or 16 character string, possibly prefixed with ``" "$digit$`` to indicate the method) which will be used to perturb the " @@ -135,36 +138,36 @@ msgid "" "$``." msgstr "" -#: ../../library/crypt.rst:111 +#: ../../library/crypt.rst:113 msgid "" "Returns the hashed password as a string, which will be composed of " "characters from the same alphabet as the salt." msgstr "" -#: ../../library/crypt.rst:116 +#: ../../library/crypt.rst:118 msgid "" "Since a few :manpage:`crypt(3)` extensions allow different values, with " "different sizes in the *salt*, it is recommended to use the full crypted " "password as salt when checking for a password." msgstr "" -#: ../../library/crypt.rst:120 +#: ../../library/crypt.rst:122 msgid "Accept ``crypt.METHOD_*`` values in addition to strings for *salt*." msgstr "" -#: ../../library/crypt.rst:126 +#: ../../library/crypt.rst:128 msgid "" "Return a randomly generated salt of the specified method. If no *method* is " "given, the strongest method available in :attr:`methods` is used." msgstr "" -#: ../../library/crypt.rst:130 +#: ../../library/crypt.rst:132 msgid "" "The return value is a string suitable for passing as the *salt* argument to :" "func:`crypt`." msgstr "" -#: ../../library/crypt.rst:133 +#: ../../library/crypt.rst:135 msgid "" "*rounds* specifies the number of rounds for ``METHOD_SHA256``, " "``METHOD_SHA512`` and ``METHOD_BLOWFISH``. For ``METHOD_SHA256`` and " @@ -174,23 +177,26 @@ msgid "" "sup:`31`), the default is ``4096`` (2\\ :sup:`12`)." msgstr "" -#: ../../library/crypt.rst:143 +#: ../../library/crypt.rst:145 msgid "Added the *rounds* parameter." msgstr "新增 *rounds* 參數。" -#: ../../library/crypt.rst:148 +#: ../../library/crypt.rst:150 msgid "Examples" msgstr "範例" -#: ../../library/crypt.rst:150 +#: ../../library/crypt.rst:152 msgid "" "A simple example illustrating typical use (a constant-time comparison " "operation is needed to limit exposure to timing attacks. :func:`hmac." "compare_digest` is suitable for this purpose)::" msgstr "" -#: ../../library/crypt.rst:170 +#: ../../library/crypt.rst:172 msgid "" "To generate a hash of a password using the strongest available method and " "check it against the original::" msgstr "" + +#~ msgid "The :mod:`crypt` module is deprecated (see :pep:`594` for details)." +#~ msgstr ":mod:`crypt` 模組 (module) 即將被棄用(詳見 :pep:`594`\\ )。" diff --git a/library/ctypes.po b/library/ctypes.po index 5df037c7b0..8195ec6ae6 100644 --- a/library/ctypes.po +++ b/library/ctypes.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.10\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2022-03-30 00:13+0000\n" +"POT-Creation-Date: 2022-05-21 17:35+0000\n" "PO-Revision-Date: 2018-05-23 14:42+0000\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -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:2138 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:1913 msgid "The exact functionality is system dependent." msgstr "" @@ -1289,18 +1289,11 @@ msgstr "" #: ../../library/ctypes.rst:1364 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 -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:1370 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 " @@ -1308,11 +1301,11 @@ msgid "" "set, a Python exception is raised." msgstr "" -#: ../../library/ctypes.rst:1379 +#: ../../library/ctypes.rst:1375 msgid "Thus, this is only useful to call Python C api functions directly." msgstr "" -#: ../../library/ctypes.rst:1381 +#: ../../library/ctypes.rst:1377 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 " @@ -1322,7 +1315,7 @@ msgid "" "to get a handle to it." msgstr "" -#: ../../library/ctypes.rst:1388 +#: ../../library/ctypes.rst:1384 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 " @@ -1330,7 +1323,7 @@ msgid "" "configurable." msgstr "" -#: ../../library/ctypes.rst:1393 +#: ../../library/ctypes.rst:1389 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:" @@ -1340,14 +1333,14 @@ msgid "" "private copy, the same happens immediately after the function call." msgstr "" -#: ../../library/ctypes.rst:1400 +#: ../../library/ctypes.rst:1396 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:1400 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 :" @@ -1356,7 +1349,7 @@ msgid "" "private copy of the windows error code." msgstr "" -#: ../../library/ctypes.rst:1410 +#: ../../library/ctypes.rst:1406 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 " @@ -1366,29 +1359,29 @@ msgid "" "ensure the correct library and dependencies are loaded." msgstr "" -#: ../../library/ctypes.rst:1417 +#: ../../library/ctypes.rst:1413 msgid "Added *winmode* parameter." msgstr "新增 *winmode* 參數。" -#: ../../library/ctypes.rst:1424 +#: ../../library/ctypes.rst:1420 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:1427 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:1434 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:1437 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 " @@ -1397,21 +1390,21 @@ msgid "" "other hand, accessing it through an index returns a new object each time::" msgstr "" -#: ../../library/ctypes.rst:1454 +#: ../../library/ctypes.rst:1450 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:1456 msgid "The system handle used to access the library." msgstr "" -#: ../../library/ctypes.rst:1465 +#: ../../library/ctypes.rst:1461 msgid "The name of the library passed in the constructor." msgstr "" -#: ../../library/ctypes.rst:1467 +#: ../../library/ctypes.rst:1463 msgid "" "Shared libraries can also be loaded by using one of the prefabricated " "objects, which are instances of the :class:`LibraryLoader` class, either by " @@ -1419,52 +1412,52 @@ msgid "" "attribute of the loader instance." msgstr "" -#: ../../library/ctypes.rst:1475 +#: ../../library/ctypes.rst:1471 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:1474 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:1480 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:1484 msgid "These prefabricated library loaders are available:" msgstr "" -#: ../../library/ctypes.rst:1493 +#: ../../library/ctypes.rst:1489 msgid "Creates :class:`CDLL` instances." msgstr "" -#: ../../library/ctypes.rst:1499 +#: ../../library/ctypes.rst:1495 msgid "Windows only: Creates :class:`WinDLL` instances." msgstr "" -#: ../../library/ctypes.rst:1505 +#: ../../library/ctypes.rst:1501 msgid "Windows only: Creates :class:`OleDLL` instances." msgstr "" -#: ../../library/ctypes.rst:1511 +#: ../../library/ctypes.rst:1507 msgid "Creates :class:`PyDLL` instances." msgstr "" -#: ../../library/ctypes.rst:1514 +#: ../../library/ctypes.rst:1510 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:1516 msgid "" "An instance of :class:`PyDLL` that exposes Python C API functions as " "attributes. Note that all these functions are assumed to return C :c:type:" @@ -1472,50 +1465,50 @@ msgid "" "correct :attr:`restype` attribute to use these functions." msgstr "" -#: ../../library/ctypes.rst:1525 +#: ../../library/ctypes.rst:1521 msgid "" "Raises an :ref:`auditing event ` ``ctypes.dlopen`` with argument " "``name``." msgstr "" -#: ../../library/ctypes.rst:1527 +#: ../../library/ctypes.rst:1523 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:1527 msgid "" "Raises an :ref:`auditing event ` ``ctypes.dlsym`` with arguments " "``library``, ``name``." msgstr "" -#: ../../library/ctypes.rst:1533 +#: ../../library/ctypes.rst:1529 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:1533 msgid "" "Raises an :ref:`auditing event ` ``ctypes.dlsym/handle`` with " "arguments ``handle``, ``name``." msgstr "" -#: ../../library/ctypes.rst:1539 +#: ../../library/ctypes.rst:1535 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:1542 msgid "Foreign functions" msgstr "" -#: ../../library/ctypes.rst:1548 +#: ../../library/ctypes.rst:1544 msgid "" "As explained in the previous section, foreign functions can be accessed as " "attributes of loaded shared libraries. The function objects created in this " @@ -1524,29 +1517,29 @@ msgid "" "library loader. They are instances of a private class:" msgstr "" -#: ../../library/ctypes.rst:1557 +#: ../../library/ctypes.rst:1553 msgid "Base class for C callable foreign functions." msgstr "" -#: ../../library/ctypes.rst:1559 +#: ../../library/ctypes.rst:1555 msgid "" "Instances of foreign functions are also C compatible data types; they " "represent C function pointers." msgstr "" -#: ../../library/ctypes.rst:1562 +#: ../../library/ctypes.rst:1558 msgid "" "This behavior can be customized by assigning to special attributes of the " "foreign function object." msgstr "" -#: ../../library/ctypes.rst:1567 +#: ../../library/ctypes.rst:1563 msgid "" "Assign a ctypes type to specify the result type of the foreign function. Use " "``None`` for :c:type:`void`, a function not returning anything." msgstr "" -#: ../../library/ctypes.rst:1570 +#: ../../library/ctypes.rst:1566 msgid "" "It is possible to assign a callable Python object that is not a ctypes type, " "in this case the function is assumed to return a C :c:type:`int`, and the " @@ -1556,7 +1549,7 @@ msgid "" "callable to the :attr:`errcheck` attribute." msgstr "" -#: ../../library/ctypes.rst:1579 +#: ../../library/ctypes.rst:1575 msgid "" "Assign a tuple of ctypes types to specify the argument types that the " "function accepts. Functions using the ``stdcall`` calling convention can " @@ -1565,7 +1558,7 @@ msgid "" "unspecified arguments as well." msgstr "" -#: ../../library/ctypes.rst:1585 +#: ../../library/ctypes.rst:1581 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, " @@ -1575,7 +1568,7 @@ msgid "" "object using ctypes conversion rules." msgstr "" -#: ../../library/ctypes.rst:1592 +#: ../../library/ctypes.rst:1588 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 " @@ -1583,50 +1576,50 @@ msgid "" "adapters that can adapt custom objects as function parameters." msgstr "" -#: ../../library/ctypes.rst:1599 +#: ../../library/ctypes.rst:1595 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:1602 msgid "" "*result* is what the foreign function returns, as specified by the :attr:" "`restype` attribute." msgstr "" -#: ../../library/ctypes.rst:1609 +#: ../../library/ctypes.rst:1605 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:1609 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:1613 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:1620 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:1624 msgid "" "Raises an :ref:`auditing event ` ``ctypes.seh_exception`` with " "argument ``code``." msgstr "" -#: ../../library/ctypes.rst:1630 +#: ../../library/ctypes.rst:1626 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 " @@ -1635,24 +1628,24 @@ msgid "" "hook to replace the exception with its own." msgstr "" -#: ../../library/ctypes.rst:1636 +#: ../../library/ctypes.rst:1632 msgid "" "Raises an :ref:`auditing event ` ``ctypes.call_function`` with " "arguments ``func_pointer``, ``arguments``." msgstr "" -#: ../../library/ctypes.rst:1638 +#: ../../library/ctypes.rst:1634 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:1640 msgid "Function prototypes" msgstr "" -#: ../../library/ctypes.rst:1646 +#: ../../library/ctypes.rst:1642 msgid "" "Foreign functions can also be created by instantiating function prototypes. " "Function prototypes are similar to function prototypes in C; they describe a " @@ -1663,7 +1656,7 @@ msgid "" "``@wrapper`` syntax. See :ref:`ctypes-callback-functions` for examples." msgstr "" -#: ../../library/ctypes.rst:1657 +#: ../../library/ctypes.rst:1653 msgid "" "The returned function prototype creates functions that use the standard C " "calling convention. The function will release the GIL during the call. If " @@ -1672,39 +1665,37 @@ msgid "" "after the call; *use_last_error* does the same for the Windows error code." msgstr "" -#: ../../library/ctypes.rst:1667 +#: ../../library/ctypes.rst:1663 msgid "" "Windows only: The returned function prototype creates functions that use the " -"``stdcall`` calling convention, except on Windows CE where :func:" -"`WINFUNCTYPE` is the same as :func:`CFUNCTYPE`. The function will release " -"the GIL during the call. *use_errno* and *use_last_error* have the same " -"meaning as above." +"``stdcall`` calling convention. The function will release the GIL during " +"the call. *use_errno* and *use_last_error* have the same meaning as above." msgstr "" -#: ../../library/ctypes.rst:1676 +#: ../../library/ctypes.rst:1671 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:1674 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:1682 msgid "" "Returns a foreign function at the specified address which must be an integer." msgstr "" -#: ../../library/ctypes.rst:1694 +#: ../../library/ctypes.rst:1689 msgid "" "Create a C callable function (a callback function) from a Python *callable*." msgstr "" -#: ../../library/ctypes.rst:1701 +#: ../../library/ctypes.rst:1696 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 " @@ -1712,7 +1703,7 @@ msgid "" "small integer. The second item is the shared library instance." msgstr "" -#: ../../library/ctypes.rst:1711 +#: ../../library/ctypes.rst:1706 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* " @@ -1720,85 +1711,85 @@ msgid "" "identifier which is used in extended error reporting." msgstr "" -#: ../../library/ctypes.rst:1716 +#: ../../library/ctypes.rst:1711 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:1715 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:1718 msgid "*paramflags* must be a tuple of the same length as :attr:`argtypes`." msgstr "" -#: ../../library/ctypes.rst:1725 +#: ../../library/ctypes.rst:1720 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:1723 msgid "" "The first item is an integer containing a combination of direction flags for " "the parameter:" msgstr "" -#: ../../library/ctypes.rst:1732 +#: ../../library/ctypes.rst:1727 msgid "1" msgstr "1" -#: ../../library/ctypes.rst:1732 +#: ../../library/ctypes.rst:1727 msgid "Specifies an input parameter to the function." msgstr "" -#: ../../library/ctypes.rst:1735 +#: ../../library/ctypes.rst:1730 msgid "2" msgstr "2" -#: ../../library/ctypes.rst:1735 +#: ../../library/ctypes.rst:1730 msgid "Output parameter. The foreign function fills in a value." msgstr "" -#: ../../library/ctypes.rst:1738 +#: ../../library/ctypes.rst:1733 msgid "4" msgstr "4" -#: ../../library/ctypes.rst:1738 +#: ../../library/ctypes.rst:1733 msgid "Input parameter which defaults to the integer zero." msgstr "" -#: ../../library/ctypes.rst:1740 +#: ../../library/ctypes.rst:1735 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:1738 msgid "The optional third item is the default value for this parameter." msgstr "" -#: ../../library/ctypes.rst:1745 +#: ../../library/ctypes.rst:1740 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:1751 ../../library/ctypes.rst:1774 msgid "Here is the wrapping with :mod:`ctypes`::" msgstr "" -#: ../../library/ctypes.rst:1764 +#: ../../library/ctypes.rst:1759 msgid "The ``MessageBox`` foreign function can now be called in these ways::" msgstr "" -#: ../../library/ctypes.rst:1770 +#: ../../library/ctypes.rst:1765 msgid "" "A second example demonstrates output parameters. The win32 " "``GetWindowRect`` function retrieves the dimensions of a specified window by " @@ -1806,7 +1797,7 @@ msgid "" "the C declaration::" msgstr "" -#: ../../library/ctypes.rst:1788 +#: ../../library/ctypes.rst:1783 msgid "" "Functions with output parameters will automatically return the output " "parameter value if there is a single one, or a tuple containing the output " @@ -1814,7 +1805,7 @@ msgid "" "now returns a RECT instance, when called." msgstr "" -#: ../../library/ctypes.rst:1793 +#: ../../library/ctypes.rst:1788 msgid "" "Output parameters can be combined with the :attr:`errcheck` protocol to do " "further output processing and error checking. The win32 ``GetWindowRect`` " @@ -1823,7 +1814,7 @@ msgid "" "call failed::" msgstr "" -#: ../../library/ctypes.rst:1806 +#: ../../library/ctypes.rst:1801 msgid "" "If the :attr:`errcheck` function returns the argument tuple it receives " "unchanged, :mod:`ctypes` continues the normal processing it does on the " @@ -1832,46 +1823,46 @@ msgid "" "and return them instead, the normal processing will no longer take place::" msgstr "" -#: ../../library/ctypes.rst:1825 +#: ../../library/ctypes.rst:1820 msgid "Utility functions" msgstr "" -#: ../../library/ctypes.rst:1829 +#: ../../library/ctypes.rst:1824 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:1827 msgid "" "Raises an :ref:`auditing event ` ``ctypes.addressof`` with " "argument ``obj``." msgstr "" -#: ../../library/ctypes.rst:1837 +#: ../../library/ctypes.rst:1832 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:1838 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:1842 msgid "``byref(obj, offset)`` corresponds to this C code::" msgstr "" -#: ../../library/ctypes.rst:1851 +#: ../../library/ctypes.rst:1846 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:1852 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* " @@ -1879,19 +1870,19 @@ msgid "" "as a pointer." msgstr "" -#: ../../library/ctypes.rst:1865 +#: ../../library/ctypes.rst:1860 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:1863 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:1866 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 " @@ -1900,25 +1891,25 @@ msgid "" "not be used." msgstr "" -#: ../../library/ctypes.rst:1876 +#: ../../library/ctypes.rst:1871 msgid "" "Raises an :ref:`auditing event ` ``ctypes.create_string_buffer`` " "with arguments ``init``, ``size``." msgstr "" -#: ../../library/ctypes.rst:1881 +#: ../../library/ctypes.rst:1876 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:1879 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:1882 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 " @@ -1927,27 +1918,27 @@ msgid "" "should not be used." msgstr "" -#: ../../library/ctypes.rst:1893 +#: ../../library/ctypes.rst:1888 msgid "" "Raises an :ref:`auditing event ` ``ctypes.create_unicode_buffer`` " "with arguments ``init``, ``size``." msgstr "" -#: ../../library/ctypes.rst:1898 +#: ../../library/ctypes.rst:1893 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:1900 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:1908 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 " @@ -1955,92 +1946,92 @@ msgid "" "If no library can be found, returns ``None``." msgstr "" -#: ../../library/ctypes.rst:1924 +#: ../../library/ctypes.rst:1919 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:1923 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:1930 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:1937 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:1943 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:1946 msgid "" "Raises an :ref:`auditing event ` ``ctypes.get_errno`` with no " "arguments." msgstr "" -#: ../../library/ctypes.rst:1955 +#: ../../library/ctypes.rst:1950 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:1953 msgid "" "Raises an :ref:`auditing event ` ``ctypes.get_last_error`` with no " "arguments." msgstr "" -#: ../../library/ctypes.rst:1962 +#: ../../library/ctypes.rst:1957 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:1964 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:1971 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:1978 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:1981 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:1987 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 " @@ -2048,51 +2039,51 @@ msgid "" "but it is possible to enlarge the buffer." msgstr "" -#: ../../library/ctypes.rst:2000 +#: ../../library/ctypes.rst:1995 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:1998 msgid "" "Raises an :ref:`auditing event ` ``ctypes.set_errno`` with " "argument ``errno``." msgstr "" -#: ../../library/ctypes.rst:2008 +#: ../../library/ctypes.rst:2003 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:2007 msgid "" "Raises an :ref:`auditing event ` ``ctypes.set_last_error`` with " "argument ``error``." msgstr "" -#: ../../library/ctypes.rst:2017 +#: ../../library/ctypes.rst:2012 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:2018 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:2022 msgid "" "Raises an :ref:`auditing event ` ``ctypes.string_at`` with " "arguments ``address``, ``size``." msgstr "" -#: ../../library/ctypes.rst:2032 +#: ../../library/ctypes.rst:2027 msgid "" "Windows only: this function is probably the worst-named thing in ctypes. It " "creates an instance of OSError. If *code* is not specified, " @@ -2101,11 +2092,11 @@ msgid "" "error." msgstr "" -#: ../../library/ctypes.rst:2038 +#: ../../library/ctypes.rst:2033 msgid "An instance of :exc:`WindowsError` used to be created." msgstr "" -#: ../../library/ctypes.rst:2044 +#: ../../library/ctypes.rst:2039 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 " @@ -2113,17 +2104,17 @@ msgid "" "terminated." msgstr "" -#: ../../library/ctypes.rst:2049 +#: ../../library/ctypes.rst:2044 msgid "" "Raises an :ref:`auditing event ` ``ctypes.wstring_at`` with " "arguments ``address``, ``size``." msgstr "" -#: ../../library/ctypes.rst:2055 +#: ../../library/ctypes.rst:2050 msgid "Data types" msgstr "" -#: ../../library/ctypes.rst:2060 +#: ../../library/ctypes.rst:2055 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 " @@ -2133,13 +2124,13 @@ msgid "" "alive in case the memory block contains pointers." msgstr "" -#: ../../library/ctypes.rst:2067 +#: ../../library/ctypes.rst:2062 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:2067 msgid "" "This method returns a ctypes instance that shares the buffer of the *source* " "object. The *source* object must support the writeable buffer interface. " @@ -2148,13 +2139,13 @@ msgid "" "exc:`ValueError` is raised." msgstr "" -#: ../../library/ctypes.rst:2078 ../../library/ctypes.rst:2088 +#: ../../library/ctypes.rst:2073 ../../library/ctypes.rst:2083 msgid "" "Raises an :ref:`auditing event ` ``ctypes.cdata/buffer`` with " "arguments ``pointer``, ``size``, ``offset``." msgstr "" -#: ../../library/ctypes.rst:2082 +#: ../../library/ctypes.rst:2077 msgid "" "This method creates a ctypes instance, copying the buffer from the *source* " "object buffer which must be readable. The optional *offset* parameter " @@ -2162,25 +2153,25 @@ msgid "" "If the source buffer is not large enough a :exc:`ValueError` is raised." msgstr "" -#: ../../library/ctypes.rst:2092 +#: ../../library/ctypes.rst:2087 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:2090 msgid "" "Raises an :ref:`auditing event ` ``ctypes.cdata`` with argument " "``address``." msgstr "" -#: ../../library/ctypes.rst:2097 +#: ../../library/ctypes.rst:2092 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:2098 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 " @@ -2188,25 +2179,25 @@ msgid "" "be used as a function call parameter." msgstr "" -#: ../../library/ctypes.rst:2108 +#: ../../library/ctypes.rst:2103 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:2109 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:2113 msgid "Common instance variables of ctypes data types:" msgstr "" -#: ../../library/ctypes.rst:2122 +#: ../../library/ctypes.rst:2117 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:" @@ -2214,13 +2205,13 @@ msgid "" "block." msgstr "" -#: ../../library/ctypes.rst:2129 +#: ../../library/ctypes.rst:2124 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:2129 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. " @@ -2228,7 +2219,7 @@ msgid "" "dictionary." msgstr "" -#: ../../library/ctypes.rst:2147 +#: ../../library/ctypes.rst:2142 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 " @@ -2237,11 +2228,11 @@ msgid "" "types that are not and do not contain pointers can now be pickled." msgstr "" -#: ../../library/ctypes.rst:2153 +#: ../../library/ctypes.rst:2148 msgid "Instances have a single attribute:" msgstr "" -#: ../../library/ctypes.rst:2157 +#: ../../library/ctypes.rst:2152 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 " @@ -2249,7 +2240,7 @@ msgid "" "bytes object or string." msgstr "" -#: ../../library/ctypes.rst:2162 +#: ../../library/ctypes.rst:2157 msgid "" "When the ``value`` attribute is retrieved from a ctypes instance, usually a " "new object is returned each time. :mod:`ctypes` does *not* implement " @@ -2257,7 +2248,7 @@ msgid "" "true for all other ctypes object instances." msgstr "" -#: ../../library/ctypes.rst:2168 +#: ../../library/ctypes.rst:2163 msgid "" "Fundamental data types, when returned as foreign function call results, or, " "for example, by retrieving structure field members or array items, are " @@ -2266,7 +2257,7 @@ msgid "" "receive a Python bytes object, *not* a :class:`c_char_p` instance." msgstr "" -#: ../../library/ctypes.rst:2176 +#: ../../library/ctypes.rst:2171 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 " @@ -2274,25 +2265,25 @@ msgid "" "you can get the value of the pointer by accessing the ``value`` attribute." msgstr "" -#: ../../library/ctypes.rst:2181 +#: ../../library/ctypes.rst:2176 msgid "These are the fundamental ctypes data types:" msgstr "" -#: ../../library/ctypes.rst:2185 +#: ../../library/ctypes.rst:2180 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:2187 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:2194 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 " @@ -2300,178 +2291,178 @@ msgid "" "integer address, or a bytes object." msgstr "" -#: ../../library/ctypes.rst:2207 +#: ../../library/ctypes.rst:2202 msgid "" "Represents the C :c:type:`double` datatype. The constructor accepts an " "optional float initializer." msgstr "" -#: ../../library/ctypes.rst:2213 +#: ../../library/ctypes.rst:2208 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:2214 msgid "" "Represents the C :c:type:`float` datatype. The constructor accepts an " "optional float initializer." msgstr "" -#: ../../library/ctypes.rst:2225 +#: ../../library/ctypes.rst:2220 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:2227 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:2233 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:2239 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:2245 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:2251 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:2257 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:2263 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:2269 msgid "Represents the C :c:type:`size_t` datatype." msgstr "" -#: ../../library/ctypes.rst:2279 +#: ../../library/ctypes.rst:2274 msgid "Represents the C :c:type:`ssize_t` datatype." msgstr "" -#: ../../library/ctypes.rst:2286 +#: ../../library/ctypes.rst:2281 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:2288 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:2295 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:2301 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:2307 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:2313 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:2319 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:2325 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:2331 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:2337 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:2343 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:2350 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:2357 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:2364 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:2370 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:2373 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:" @@ -2479,33 +2470,33 @@ msgid "" "also defined." msgstr "" -#: ../../library/ctypes.rst:2386 +#: ../../library/ctypes.rst:2381 msgid "Structured data types" msgstr "" -#: ../../library/ctypes.rst:2391 +#: ../../library/ctypes.rst:2386 msgid "Abstract base class for unions in native byte order." msgstr "" -#: ../../library/ctypes.rst:2396 +#: ../../library/ctypes.rst:2391 msgid "Abstract base class for structures in *big endian* byte order." msgstr "" -#: ../../library/ctypes.rst:2401 +#: ../../library/ctypes.rst:2396 msgid "Abstract base class for structures in *little endian* byte order." msgstr "" -#: ../../library/ctypes.rst:2403 +#: ../../library/ctypes.rst:2398 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:2404 msgid "Abstract base class for structures in *native* byte order." msgstr "" -#: ../../library/ctypes.rst:2411 +#: ../../library/ctypes.rst:2406 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:" @@ -2513,34 +2504,34 @@ msgid "" "the fields by direct attribute accesses. These are the" msgstr "" -#: ../../library/ctypes.rst:2419 +#: ../../library/ctypes.rst:2414 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:2418 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:2422 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:2425 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:2435 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, " @@ -2548,28 +2539,28 @@ msgid "" "raise an AttributeError." msgstr "" -#: ../../library/ctypes.rst:2445 +#: ../../library/ctypes.rst:2440 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:2447 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:2454 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:2458 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 " @@ -2577,11 +2568,11 @@ msgid "" "structure or union field." msgstr "" -#: ../../library/ctypes.rst:2468 +#: ../../library/ctypes.rst:2463 msgid "Here is an example type (Windows)::" msgstr "" -#: ../../library/ctypes.rst:2481 +#: ../../library/ctypes.rst:2476 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 " @@ -2591,7 +2582,7 @@ msgid "" "temporary union instance::" msgstr "" -#: ../../library/ctypes.rst:2493 +#: ../../library/ctypes.rst:2488 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:" @@ -2599,7 +2590,7 @@ msgid "" "of the base class." msgstr "" -#: ../../library/ctypes.rst:2498 +#: ../../library/ctypes.rst:2493 msgid "" "Structure and union constructors accept both positional and keyword " "arguments. Positional arguments are used to initialize member fields in the " @@ -2609,15 +2600,15 @@ msgid "" "names not present in :attr:`_fields_`." msgstr "" -#: ../../library/ctypes.rst:2509 +#: ../../library/ctypes.rst:2504 msgid "Arrays and pointers" msgstr "" -#: ../../library/ctypes.rst:2513 +#: ../../library/ctypes.rst:2508 msgid "Abstract base class for arrays." msgstr "" -#: ../../library/ctypes.rst:2515 +#: ../../library/ctypes.rst:2510 msgid "" "The recommended way to create concrete array types is by multiplying any :" "mod:`ctypes` data type with a non-negative integer. Alternatively, you can " @@ -2627,34 +2618,34 @@ msgid "" "an :class:`Array`." msgstr "" -#: ../../library/ctypes.rst:2525 +#: ../../library/ctypes.rst:2520 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:2527 msgid "Specifies the type of each element in the array." msgstr "" -#: ../../library/ctypes.rst:2535 +#: ../../library/ctypes.rst:2530 msgid "" "Array subclass constructors accept positional arguments, used to initialize " "the elements in order." msgstr "" -#: ../../library/ctypes.rst:2541 +#: ../../library/ctypes.rst:2536 msgid "Private, abstract base class for pointers." msgstr "" -#: ../../library/ctypes.rst:2543 +#: ../../library/ctypes.rst:2538 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:2542 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 :" @@ -2663,11 +2654,11 @@ msgid "" "probably crash with an access violation (if you're lucky)." msgstr "" -#: ../../library/ctypes.rst:2557 +#: ../../library/ctypes.rst:2552 msgid "Specifies the type pointed to." msgstr "" -#: ../../library/ctypes.rst:2561 +#: ../../library/ctypes.rst:2556 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/decimal.po b/library/decimal.po index 3e8da26673..8a47afc358 100644 --- a/library/decimal.po +++ b/library/decimal.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.10\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2021-10-26 16:47+0000\n" +"POT-Creation-Date: 2022-05-21 17:35+0000\n" "PO-Revision-Date: 2018-05-23 14:43+0000\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -455,7 +455,7 @@ msgid "" msgstr "" #: ../../library/decimal.rst:520 ../../library/decimal.rst:531 -#: ../../library/decimal.rst:559 ../../library/decimal.rst:834 +#: ../../library/decimal.rst:559 ../../library/decimal.rst:835 msgid "" "This operation is unaffected by context and is quiet: no flags are changed " "and no rounding is performed. As an exception, the C version may raise " @@ -502,10 +502,12 @@ msgid "" msgstr "" #: ../../library/decimal.rst:576 -msgid "Classmethod that converts a float to a decimal number, exactly." +msgid "" +"Alternative constructor that only accepts instances of :class:`float` or :" +"class:`int`." msgstr "" -#: ../../library/decimal.rst:578 +#: ../../library/decimal.rst:579 msgid "" "Note `Decimal.from_float(0.1)` is not the same as `Decimal('0.1')`. Since " "0.1 is not exactly representable in binary floating point, the value is " @@ -514,92 +516,92 @@ msgid "" "`0.1000000000000000055511151231257827021181583404541015625`." msgstr "" -#: ../../library/decimal.rst:584 +#: ../../library/decimal.rst:585 msgid "" "From Python 3.2 onwards, a :class:`Decimal` instance can also be constructed " "directly from a :class:`float`." msgstr "" -#: ../../library/decimal.rst:602 +#: ../../library/decimal.rst:603 msgid "" "Fused multiply-add. Return self*other+third with no rounding of the " "intermediate product self*other." msgstr "" -#: ../../library/decimal.rst:610 +#: ../../library/decimal.rst:611 msgid "" "Return :const:`True` if the argument is canonical and :const:`False` " "otherwise. Currently, a :class:`Decimal` instance is always canonical, so " "this operation always returns :const:`True`." msgstr "" -#: ../../library/decimal.rst:616 +#: ../../library/decimal.rst:617 msgid "" "Return :const:`True` if the argument is a finite number, and :const:`False` " "if the argument is an infinity or a NaN." msgstr "" -#: ../../library/decimal.rst:621 +#: ../../library/decimal.rst:622 msgid "" "Return :const:`True` if the argument is either positive or negative infinity " "and :const:`False` otherwise." msgstr "" -#: ../../library/decimal.rst:626 +#: ../../library/decimal.rst:627 msgid "" "Return :const:`True` if the argument is a (quiet or signaling) NaN and :" "const:`False` otherwise." msgstr "" -#: ../../library/decimal.rst:631 +#: ../../library/decimal.rst:632 msgid "" "Return :const:`True` if the argument is a *normal* finite number. Return :" "const:`False` if the argument is zero, subnormal, infinite or a NaN." msgstr "" -#: ../../library/decimal.rst:636 +#: ../../library/decimal.rst:637 msgid "" "Return :const:`True` if the argument is a quiet NaN, and :const:`False` " "otherwise." msgstr "" -#: ../../library/decimal.rst:641 +#: ../../library/decimal.rst:642 msgid "" "Return :const:`True` if the argument has a negative sign and :const:`False` " "otherwise. Note that zeros and NaNs can both carry signs." msgstr "" -#: ../../library/decimal.rst:646 +#: ../../library/decimal.rst:647 msgid "" "Return :const:`True` if the argument is a signaling NaN and :const:`False` " "otherwise." msgstr "" -#: ../../library/decimal.rst:651 +#: ../../library/decimal.rst:652 msgid "" "Return :const:`True` if the argument is subnormal, and :const:`False` " "otherwise." msgstr "" -#: ../../library/decimal.rst:656 +#: ../../library/decimal.rst:657 msgid "" "Return :const:`True` if the argument is a (positive or negative) zero and :" "const:`False` otherwise." msgstr "" -#: ../../library/decimal.rst:661 +#: ../../library/decimal.rst:662 msgid "" "Return the natural (base e) logarithm of the operand. The result is " "correctly rounded using the :const:`ROUND_HALF_EVEN` rounding mode." msgstr "" -#: ../../library/decimal.rst:666 +#: ../../library/decimal.rst:667 msgid "" "Return the base ten logarithm of the operand. The result is correctly " "rounded using the :const:`ROUND_HALF_EVEN` rounding mode." msgstr "" -#: ../../library/decimal.rst:671 +#: ../../library/decimal.rst:672 msgid "" "For a nonzero number, return the adjusted exponent of its operand as a :" "class:`Decimal` instance. If the operand is a zero then ``Decimal('-" @@ -607,74 +609,74 @@ msgid "" "the operand is an infinity then ``Decimal('Infinity')`` is returned." msgstr "" -#: ../../library/decimal.rst:679 +#: ../../library/decimal.rst:680 msgid "" ":meth:`logical_and` is a logical operation which takes two *logical " "operands* (see :ref:`logical_operands_label`). The result is the digit-wise " "``and`` of the two operands." msgstr "" -#: ../../library/decimal.rst:685 +#: ../../library/decimal.rst:686 msgid "" ":meth:`logical_invert` is a logical operation. The result is the digit-wise " "inversion of the operand." msgstr "" -#: ../../library/decimal.rst:690 +#: ../../library/decimal.rst:691 msgid "" ":meth:`logical_or` is a logical operation which takes two *logical operands* " "(see :ref:`logical_operands_label`). The result is the digit-wise ``or`` of " "the two operands." msgstr "" -#: ../../library/decimal.rst:696 +#: ../../library/decimal.rst:697 msgid "" ":meth:`logical_xor` is a logical operation which takes two *logical " "operands* (see :ref:`logical_operands_label`). The result is the digit-wise " "exclusive or of the two operands." msgstr "" -#: ../../library/decimal.rst:702 +#: ../../library/decimal.rst:703 msgid "" "Like ``max(self, other)`` except that the context rounding rule is applied " "before returning and that :const:`NaN` values are either signaled or ignored " "(depending on the context and whether they are signaling or quiet)." msgstr "" -#: ../../library/decimal.rst:709 +#: ../../library/decimal.rst:710 msgid "" "Similar to the :meth:`.max` method, but the comparison is done using the " "absolute values of the operands." msgstr "" -#: ../../library/decimal.rst:714 +#: ../../library/decimal.rst:715 msgid "" "Like ``min(self, other)`` except that the context rounding rule is applied " "before returning and that :const:`NaN` values are either signaled or ignored " "(depending on the context and whether they are signaling or quiet)." msgstr "" -#: ../../library/decimal.rst:721 +#: ../../library/decimal.rst:722 msgid "" "Similar to the :meth:`.min` method, but the comparison is done using the " "absolute values of the operands." msgstr "" -#: ../../library/decimal.rst:726 +#: ../../library/decimal.rst:727 msgid "" "Return the largest number representable in the given context (or in the " "current thread's context if no context is given) that is smaller than the " "given operand." msgstr "" -#: ../../library/decimal.rst:732 +#: ../../library/decimal.rst:733 msgid "" "Return the smallest number representable in the given context (or in the " "current thread's context if no context is given) that is larger than the " "given operand." msgstr "" -#: ../../library/decimal.rst:738 +#: ../../library/decimal.rst:739 msgid "" "If the two operands are unequal, return the number closest to the first " "operand in the direction of the second operand. If both operands are " @@ -682,7 +684,7 @@ msgid "" "be the same as the sign of the second operand." msgstr "" -#: ../../library/decimal.rst:745 +#: ../../library/decimal.rst:746 msgid "" "Normalize the number by stripping the rightmost trailing zeros and " "converting any result equal to :const:`Decimal('0')` to :const:" @@ -692,63 +694,63 @@ msgid "" "``Decimal('32.1')``." msgstr "" -#: ../../library/decimal.rst:754 +#: ../../library/decimal.rst:755 msgid "" "Return a string describing the *class* of the operand. The returned value " "is one of the following ten strings." msgstr "" -#: ../../library/decimal.rst:757 +#: ../../library/decimal.rst:758 msgid "``\"-Infinity\"``, indicating that the operand is negative infinity." msgstr "" -#: ../../library/decimal.rst:758 +#: ../../library/decimal.rst:759 msgid "" "``\"-Normal\"``, indicating that the operand is a negative normal number." msgstr "" -#: ../../library/decimal.rst:759 +#: ../../library/decimal.rst:760 msgid "" "``\"-Subnormal\"``, indicating that the operand is negative and subnormal." msgstr "" -#: ../../library/decimal.rst:760 +#: ../../library/decimal.rst:761 msgid "``\"-Zero\"``, indicating that the operand is a negative zero." msgstr "" -#: ../../library/decimal.rst:761 +#: ../../library/decimal.rst:762 msgid "``\"+Zero\"``, indicating that the operand is a positive zero." msgstr "" -#: ../../library/decimal.rst:762 +#: ../../library/decimal.rst:763 msgid "" "``\"+Subnormal\"``, indicating that the operand is positive and subnormal." msgstr "" -#: ../../library/decimal.rst:763 +#: ../../library/decimal.rst:764 msgid "" "``\"+Normal\"``, indicating that the operand is a positive normal number." msgstr "" -#: ../../library/decimal.rst:764 +#: ../../library/decimal.rst:765 msgid "``\"+Infinity\"``, indicating that the operand is positive infinity." msgstr "" -#: ../../library/decimal.rst:765 +#: ../../library/decimal.rst:766 msgid "``\"NaN\"``, indicating that the operand is a quiet NaN (Not a Number)." msgstr "" -#: ../../library/decimal.rst:766 +#: ../../library/decimal.rst:767 msgid "``\"sNaN\"``, indicating that the operand is a signaling NaN." msgstr "" -#: ../../library/decimal.rst:770 +#: ../../library/decimal.rst:771 msgid "" "Return a value equal to the first operand after rounding and having the " "exponent of the second operand." msgstr "" -#: ../../library/decimal.rst:776 +#: ../../library/decimal.rst:777 msgid "" "Unlike other operations, if the length of the coefficient after the quantize " "operation would be greater than precision, then an :const:`InvalidOperation` " @@ -756,13 +758,13 @@ msgid "" "quantized exponent is always equal to that of the right-hand operand." msgstr "" -#: ../../library/decimal.rst:782 +#: ../../library/decimal.rst:783 msgid "" "Also unlike other operations, quantize never signals Underflow, even if the " "result is subnormal and inexact." msgstr "" -#: ../../library/decimal.rst:785 +#: ../../library/decimal.rst:786 msgid "" "If the exponent of the second operand is larger than that of the first then " "rounding may be necessary. In this case, the rounding mode is determined by " @@ -771,19 +773,19 @@ msgid "" "context is used." msgstr "" -#: ../../library/decimal.rst:791 +#: ../../library/decimal.rst:792 msgid "" "An error is returned whenever the resulting exponent is greater than :attr:" "`Emax` or less than :attr:`Etiny`." msgstr "" -#: ../../library/decimal.rst:796 +#: ../../library/decimal.rst:797 msgid "" "Return ``Decimal(10)``, the radix (base) in which the :class:`Decimal` class " "does all its arithmetic. Included for compatibility with the specification." msgstr "" -#: ../../library/decimal.rst:802 +#: ../../library/decimal.rst:803 msgid "" "Return the remainder from dividing *self* by *other*. This differs from " "``self % other`` in that the sign of the remainder is chosen so as to " @@ -792,11 +794,11 @@ msgid "" "other``, and if two integers are equally near then the even one is chosen." msgstr "" -#: ../../library/decimal.rst:809 +#: ../../library/decimal.rst:810 msgid "If the result is zero then its sign will be the sign of *self*." msgstr "" -#: ../../library/decimal.rst:820 +#: ../../library/decimal.rst:821 msgid "" "Return the result of rotating the digits of the first operand by an amount " "specified by the second operand. The second operand must be an integer in " @@ -808,20 +810,20 @@ msgid "" "are unchanged." msgstr "" -#: ../../library/decimal.rst:831 +#: ../../library/decimal.rst:832 msgid "" "Test whether self and other have the same exponent or whether both are :" "const:`NaN`." msgstr "" -#: ../../library/decimal.rst:840 +#: ../../library/decimal.rst:841 msgid "" "Return the first operand with exponent adjusted by the second. Equivalently, " "return the first operand multiplied by ``10**other``. The second operand " "must be an integer." msgstr "" -#: ../../library/decimal.rst:846 +#: ../../library/decimal.rst:847 msgid "" "Return the result of shifting the digits of the first operand by an amount " "specified by the second operand. The second operand must be an integer in " @@ -832,34 +834,34 @@ msgid "" "exponent of the first operand are unchanged." msgstr "" -#: ../../library/decimal.rst:856 +#: ../../library/decimal.rst:857 msgid "Return the square root of the argument to full precision." msgstr "" -#: ../../library/decimal.rst:861 ../../library/decimal.rst:1440 +#: ../../library/decimal.rst:862 ../../library/decimal.rst:1441 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:864 ../../library/decimal.rst:1443 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 " "addition of either one or two trailing zeros." msgstr "" -#: ../../library/decimal.rst:867 +#: ../../library/decimal.rst:868 msgid "" "For example, this converts ``Decimal('123E+1')`` to ``Decimal('1.23E+3')``." msgstr "" -#: ../../library/decimal.rst:871 +#: ../../library/decimal.rst:872 msgid "" "Identical to the :meth:`to_integral_value` method. The ``to_integral`` name " "has been kept for compatibility with older versions." msgstr "" -#: ../../library/decimal.rst:876 +#: ../../library/decimal.rst:877 msgid "" "Round to the nearest integer, signaling :const:`Inexact` or :const:`Rounded` " "as appropriate if rounding occurs. The rounding mode is determined by the " @@ -867,18 +869,18 @@ msgid "" "parameter is given then the rounding mode of the current context is used." msgstr "" -#: ../../library/decimal.rst:884 +#: ../../library/decimal.rst:885 msgid "" "Round to the nearest integer without signaling :const:`Inexact` or :const:" "`Rounded`. If given, applies *rounding*; otherwise, uses the rounding " "method in either the supplied *context* or the current context." msgstr "" -#: ../../library/decimal.rst:892 +#: ../../library/decimal.rst:893 msgid "Logical operands" msgstr "" -#: ../../library/decimal.rst:894 +#: ../../library/decimal.rst:895 msgid "" "The :meth:`logical_and`, :meth:`logical_invert`, :meth:`logical_or`, and :" "meth:`logical_xor` methods expect their arguments to be *logical operands*. " @@ -886,38 +888,38 @@ msgid "" "are both zero, and whose digits are all either :const:`0` or :const:`1`." msgstr "" -#: ../../library/decimal.rst:906 +#: ../../library/decimal.rst:907 msgid "Context objects" msgstr "" -#: ../../library/decimal.rst:908 +#: ../../library/decimal.rst:909 msgid "" "Contexts are environments for arithmetic operations. They govern precision, " "set rules for rounding, determine which signals are treated as exceptions, " "and limit the range for exponents." msgstr "" -#: ../../library/decimal.rst:912 +#: ../../library/decimal.rst:913 msgid "" "Each thread has its own current context which is accessed or changed using " "the :func:`getcontext` and :func:`setcontext` functions:" msgstr "" -#: ../../library/decimal.rst:918 +#: ../../library/decimal.rst:919 msgid "Return the current context for the active thread." msgstr "" -#: ../../library/decimal.rst:923 +#: ../../library/decimal.rst:924 msgid "Set the current context for the active thread to *c*." msgstr "" -#: ../../library/decimal.rst:925 +#: ../../library/decimal.rst:926 msgid "" "You can also use the :keyword:`with` statement and the :func:`localcontext` " "function to temporarily change the active context." msgstr "" -#: ../../library/decimal.rst:930 +#: ../../library/decimal.rst:931 msgid "" "Return a context manager that will set the current context for the active " "thread to a copy of *ctx* on entry to the with-statement and restore the " @@ -925,20 +927,20 @@ msgid "" "specified, a copy of the current context is used." msgstr "" -#: ../../library/decimal.rst:935 +#: ../../library/decimal.rst:936 msgid "" "For example, the following code sets the current decimal precision to 42 " "places, performs a calculation, and then automatically restores the previous " "context::" msgstr "" -#: ../../library/decimal.rst:945 +#: ../../library/decimal.rst:946 msgid "" "New contexts can also be created using the :class:`Context` constructor " "described below. In addition, the module provides three pre-made contexts:" msgstr "" -#: ../../library/decimal.rst:951 +#: ../../library/decimal.rst:952 msgid "" "This is a standard context defined by the General Decimal Arithmetic " "Specification. Precision is set to nine. Rounding is set to :const:" @@ -947,12 +949,12 @@ msgid "" "`Subnormal`." msgstr "" -#: ../../library/decimal.rst:957 +#: ../../library/decimal.rst:958 msgid "" "Because many of the traps are enabled, this context is useful for debugging." msgstr "" -#: ../../library/decimal.rst:962 +#: ../../library/decimal.rst:963 msgid "" "This is a standard context defined by the General Decimal Arithmetic " "Specification. Precision is set to nine. Rounding is set to :const:" @@ -960,7 +962,7 @@ msgid "" "exceptions are not raised during computations)." msgstr "" -#: ../../library/decimal.rst:967 +#: ../../library/decimal.rst:968 msgid "" "Because the traps are disabled, this context is useful for applications that " "prefer to have result value of :const:`NaN` or :const:`Infinity` instead of " @@ -968,7 +970,7 @@ msgid "" "presence of conditions that would otherwise halt the program." msgstr "" -#: ../../library/decimal.rst:975 +#: ../../library/decimal.rst:976 msgid "" "This context is used by the :class:`Context` constructor as a prototype for " "new contexts. Changing a field (such a precision) has the effect of " @@ -976,7 +978,7 @@ msgid "" "constructor." msgstr "" -#: ../../library/decimal.rst:979 +#: ../../library/decimal.rst:980 msgid "" "This context is most useful in multi-threaded environments. Changing one of " "the fields before threads are started has the effect of setting system-wide " @@ -984,65 +986,65 @@ msgid "" "as it would require thread synchronization to prevent race conditions." msgstr "" -#: ../../library/decimal.rst:984 +#: ../../library/decimal.rst:985 msgid "" "In single threaded environments, it is preferable to not use this context at " "all. Instead, simply create contexts explicitly as described below." msgstr "" -#: ../../library/decimal.rst:987 +#: ../../library/decimal.rst:988 msgid "" "The default values are :attr:`prec`\\ =\\ :const:`28`, :attr:`rounding`\\ =" "\\ :const:`ROUND_HALF_EVEN`, and enabled traps for :class:`Overflow`, :class:" "`InvalidOperation`, and :class:`DivisionByZero`." msgstr "" -#: ../../library/decimal.rst:992 +#: ../../library/decimal.rst:993 msgid "" "In addition to the three supplied contexts, new contexts can be created with " "the :class:`Context` constructor." msgstr "" -#: ../../library/decimal.rst:998 +#: ../../library/decimal.rst:999 msgid "" "Creates a new context. If a field is not specified or is :const:`None`, the " "default values are copied from the :const:`DefaultContext`. If the *flags* " "field is not specified or is :const:`None`, all flags are cleared." msgstr "" -#: ../../library/decimal.rst:1002 +#: ../../library/decimal.rst:1003 msgid "" "*prec* is an integer in the range [:const:`1`, :const:`MAX_PREC`] that sets " "the precision for arithmetic operations in the context." msgstr "" -#: ../../library/decimal.rst:1005 +#: ../../library/decimal.rst:1006 msgid "" "The *rounding* option is one of the constants listed in the section " "`Rounding Modes`_." msgstr "" -#: ../../library/decimal.rst:1008 +#: ../../library/decimal.rst:1009 msgid "" "The *traps* and *flags* fields list any signals to be set. Generally, new " "contexts should only set traps and leave the flags clear." msgstr "" -#: ../../library/decimal.rst:1011 +#: ../../library/decimal.rst:1012 msgid "" "The *Emin* and *Emax* fields are integers specifying the outer limits " "allowable for exponents. *Emin* must be in the range [:const:`MIN_EMIN`, :" "const:`0`], *Emax* in the range [:const:`0`, :const:`MAX_EMAX`]." msgstr "" -#: ../../library/decimal.rst:1015 +#: ../../library/decimal.rst:1016 msgid "" "The *capitals* field is either :const:`0` or :const:`1` (the default). If " "set to :const:`1`, exponents are printed with a capital :const:`E`; " "otherwise, a lowercase :const:`e` is used: :const:`Decimal('6.02e+23')`." msgstr "" -#: ../../library/decimal.rst:1019 +#: ../../library/decimal.rst:1020 msgid "" "The *clamp* field is either :const:`0` (the default) or :const:`1`. If set " "to :const:`1`, the exponent ``e`` of a :class:`Decimal` instance " @@ -1056,13 +1058,13 @@ msgid "" "significant trailing zeros. For example::" msgstr "" -#: ../../library/decimal.rst:1034 +#: ../../library/decimal.rst:1035 msgid "" "A *clamp* value of :const:`1` allows compatibility with the fixed-width " "decimal interchange formats specified in IEEE 754." msgstr "" -#: ../../library/decimal.rst:1037 +#: ../../library/decimal.rst:1038 msgid "" "The :class:`Context` class defines several general purpose methods as well " "as a large number of methods for doing arithmetic directly in a given " @@ -1075,30 +1077,30 @@ msgid "" "a Decimal instance is accepted." msgstr "" -#: ../../library/decimal.rst:1050 +#: ../../library/decimal.rst:1051 msgid "Resets all of the flags to :const:`0`." msgstr "" -#: ../../library/decimal.rst:1054 +#: ../../library/decimal.rst:1055 msgid "Resets all of the traps to :const:`0`." msgstr "" -#: ../../library/decimal.rst:1060 +#: ../../library/decimal.rst:1061 msgid "Return a duplicate of the context." msgstr "" -#: ../../library/decimal.rst:1064 +#: ../../library/decimal.rst:1065 msgid "Return a copy of the Decimal instance num." msgstr "" -#: ../../library/decimal.rst:1068 +#: ../../library/decimal.rst:1069 msgid "" "Creates a new Decimal instance from *num* but using *self* as context. " "Unlike the :class:`Decimal` constructor, the context precision, rounding " "method, flags, and traps are applied to the conversion." msgstr "" -#: ../../library/decimal.rst:1072 +#: ../../library/decimal.rst:1073 msgid "" "This is useful because constants are often given to a greater precision than " "is needed by the application. Another benefit is that rounding immediately " @@ -1107,14 +1109,14 @@ msgid "" "sum can change the result:" msgstr "" -#: ../../library/decimal.rst:1086 +#: ../../library/decimal.rst:1087 msgid "" "This method implements the to-number operation of the IBM specification. If " "the argument is a string, no leading or trailing whitespace or underscores " "are permitted." msgstr "" -#: ../../library/decimal.rst:1092 +#: ../../library/decimal.rst:1093 msgid "" "Creates a new Decimal instance from a float *f* but rounding using *self* as " "the context. Unlike the :meth:`Decimal.from_float` class method, the " @@ -1122,18 +1124,18 @@ msgid "" "conversion." msgstr "" -#: ../../library/decimal.rst:1112 +#: ../../library/decimal.rst:1113 msgid "" "Returns a value equal to ``Emin - prec + 1`` which is the minimum exponent " "value for subnormal results. When underflow occurs, the exponent is set to :" "const:`Etiny`." msgstr "" -#: ../../library/decimal.rst:1118 +#: ../../library/decimal.rst:1119 msgid "Returns a value equal to ``Emax - prec + 1``." msgstr "" -#: ../../library/decimal.rst:1120 +#: ../../library/decimal.rst:1121 msgid "" "The usual approach to working with decimals is to create :class:`Decimal` " "instances and then apply arithmetic operations which take place within the " @@ -1143,189 +1145,189 @@ msgid "" "recounted here." msgstr "" -#: ../../library/decimal.rst:1130 +#: ../../library/decimal.rst:1131 msgid "Returns the absolute value of *x*." msgstr "" -#: ../../library/decimal.rst:1135 +#: ../../library/decimal.rst:1136 msgid "Return the sum of *x* and *y*." msgstr "" -#: ../../library/decimal.rst:1140 +#: ../../library/decimal.rst:1141 msgid "Returns the same Decimal object *x*." msgstr "" -#: ../../library/decimal.rst:1145 +#: ../../library/decimal.rst:1146 msgid "Compares *x* and *y* numerically." msgstr "" -#: ../../library/decimal.rst:1150 +#: ../../library/decimal.rst:1151 msgid "Compares the values of the two operands numerically." msgstr "" -#: ../../library/decimal.rst:1155 +#: ../../library/decimal.rst:1156 msgid "Compares two operands using their abstract representation." msgstr "" -#: ../../library/decimal.rst:1160 +#: ../../library/decimal.rst:1161 msgid "" "Compares two operands using their abstract representation, ignoring sign." msgstr "" -#: ../../library/decimal.rst:1165 +#: ../../library/decimal.rst:1166 msgid "Returns a copy of *x* with the sign set to 0." msgstr "" -#: ../../library/decimal.rst:1170 +#: ../../library/decimal.rst:1171 msgid "Returns a copy of *x* with the sign inverted." msgstr "" -#: ../../library/decimal.rst:1175 +#: ../../library/decimal.rst:1176 msgid "Copies the sign from *y* to *x*." msgstr "" -#: ../../library/decimal.rst:1180 +#: ../../library/decimal.rst:1181 msgid "Return *x* divided by *y*." msgstr "" -#: ../../library/decimal.rst:1185 +#: ../../library/decimal.rst:1186 msgid "Return *x* divided by *y*, truncated to an integer." msgstr "" -#: ../../library/decimal.rst:1190 +#: ../../library/decimal.rst:1191 msgid "Divides two numbers and returns the integer part of the result." msgstr "" -#: ../../library/decimal.rst:1195 +#: ../../library/decimal.rst:1196 msgid "Returns `e ** x`." msgstr "" -#: ../../library/decimal.rst:1200 +#: ../../library/decimal.rst:1201 msgid "Returns *x* multiplied by *y*, plus *z*." msgstr "" -#: ../../library/decimal.rst:1205 +#: ../../library/decimal.rst:1206 msgid "Returns ``True`` if *x* is canonical; otherwise returns ``False``." msgstr "" -#: ../../library/decimal.rst:1210 +#: ../../library/decimal.rst:1211 msgid "Returns ``True`` if *x* is finite; otherwise returns ``False``." msgstr "" -#: ../../library/decimal.rst:1215 +#: ../../library/decimal.rst:1216 msgid "Returns ``True`` if *x* is infinite; otherwise returns ``False``." msgstr "" -#: ../../library/decimal.rst:1220 +#: ../../library/decimal.rst:1221 msgid "Returns ``True`` if *x* is a qNaN or sNaN; otherwise returns ``False``." msgstr "" -#: ../../library/decimal.rst:1225 +#: ../../library/decimal.rst:1226 msgid "" "Returns ``True`` if *x* is a normal number; otherwise returns ``False``." msgstr "" -#: ../../library/decimal.rst:1230 +#: ../../library/decimal.rst:1231 msgid "Returns ``True`` if *x* is a quiet NaN; otherwise returns ``False``." msgstr "" -#: ../../library/decimal.rst:1235 +#: ../../library/decimal.rst:1236 msgid "Returns ``True`` if *x* is negative; otherwise returns ``False``." msgstr "" -#: ../../library/decimal.rst:1240 +#: ../../library/decimal.rst:1241 msgid "" "Returns ``True`` if *x* is a signaling NaN; otherwise returns ``False``." msgstr "" -#: ../../library/decimal.rst:1245 +#: ../../library/decimal.rst:1246 msgid "Returns ``True`` if *x* is subnormal; otherwise returns ``False``." msgstr "" -#: ../../library/decimal.rst:1250 +#: ../../library/decimal.rst:1251 msgid "Returns ``True`` if *x* is a zero; otherwise returns ``False``." msgstr "" -#: ../../library/decimal.rst:1255 +#: ../../library/decimal.rst:1256 msgid "Returns the natural (base e) logarithm of *x*." msgstr "" -#: ../../library/decimal.rst:1260 +#: ../../library/decimal.rst:1261 msgid "Returns the base 10 logarithm of *x*." msgstr "" -#: ../../library/decimal.rst:1265 +#: ../../library/decimal.rst:1266 msgid "Returns the exponent of the magnitude of the operand's MSD." msgstr "" -#: ../../library/decimal.rst:1270 +#: ../../library/decimal.rst:1271 msgid "Applies the logical operation *and* between each operand's digits." msgstr "" -#: ../../library/decimal.rst:1275 +#: ../../library/decimal.rst:1276 msgid "Invert all the digits in *x*." msgstr "" -#: ../../library/decimal.rst:1280 +#: ../../library/decimal.rst:1281 msgid "Applies the logical operation *or* between each operand's digits." msgstr "" -#: ../../library/decimal.rst:1285 +#: ../../library/decimal.rst:1286 msgid "Applies the logical operation *xor* between each operand's digits." msgstr "" -#: ../../library/decimal.rst:1290 +#: ../../library/decimal.rst:1291 msgid "Compares two values numerically and returns the maximum." msgstr "" -#: ../../library/decimal.rst:1295 ../../library/decimal.rst:1305 +#: ../../library/decimal.rst:1296 ../../library/decimal.rst:1306 msgid "Compares the values numerically with their sign ignored." msgstr "" -#: ../../library/decimal.rst:1300 +#: ../../library/decimal.rst:1301 msgid "Compares two values numerically and returns the minimum." msgstr "" -#: ../../library/decimal.rst:1310 +#: ../../library/decimal.rst:1311 msgid "Minus corresponds to the unary prefix minus operator in Python." msgstr "" -#: ../../library/decimal.rst:1315 +#: ../../library/decimal.rst:1316 msgid "Return the product of *x* and *y*." msgstr "" -#: ../../library/decimal.rst:1320 +#: ../../library/decimal.rst:1321 msgid "Returns the largest representable number smaller than *x*." msgstr "" -#: ../../library/decimal.rst:1325 +#: ../../library/decimal.rst:1326 msgid "Returns the smallest representable number larger than *x*." msgstr "" -#: ../../library/decimal.rst:1330 +#: ../../library/decimal.rst:1331 msgid "Returns the number closest to *x*, in direction towards *y*." msgstr "" -#: ../../library/decimal.rst:1335 +#: ../../library/decimal.rst:1336 msgid "Reduces *x* to its simplest form." msgstr "" -#: ../../library/decimal.rst:1340 +#: ../../library/decimal.rst:1341 msgid "Returns an indication of the class of *x*." msgstr "" -#: ../../library/decimal.rst:1345 +#: ../../library/decimal.rst:1346 msgid "" "Plus corresponds to the unary prefix plus operator in Python. This " "operation applies the context precision and rounding, so it is *not* an " "identity operation." msgstr "" -#: ../../library/decimal.rst:1352 +#: ../../library/decimal.rst:1353 msgid "Return ``x`` to the power of ``y``, reduced modulo ``modulo`` if given." msgstr "" -#: ../../library/decimal.rst:1354 +#: ../../library/decimal.rst:1355 msgid "" "With two arguments, compute ``x**y``. If ``x`` is negative then ``y`` must " "be integral. The result will be inexact unless ``y`` is integral and the " @@ -1334,42 +1336,42 @@ msgid "" "in the Python version." msgstr "" -#: ../../library/decimal.rst:1360 +#: ../../library/decimal.rst:1361 msgid "" "``Decimal(0) ** Decimal(0)`` results in ``InvalidOperation``, and if " "``InvalidOperation`` is not trapped, then results in ``Decimal('NaN')``." msgstr "" -#: ../../library/decimal.rst:1363 +#: ../../library/decimal.rst:1364 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:1369 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:1372 msgid "all three arguments must be integral" msgstr "" -#: ../../library/decimal.rst:1372 +#: ../../library/decimal.rst:1373 msgid "``y`` must be nonnegative" msgstr "" -#: ../../library/decimal.rst:1373 +#: ../../library/decimal.rst:1374 msgid "at least one of ``x`` or ``y`` must be nonzero" msgstr "" -#: ../../library/decimal.rst:1374 +#: ../../library/decimal.rst:1375 msgid "``modulo`` must be nonzero and have at most 'precision' digits" msgstr "" -#: ../../library/decimal.rst:1376 +#: ../../library/decimal.rst:1377 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 +1380,110 @@ msgid "" "result is always exact." msgstr "" -#: ../../library/decimal.rst:1386 +#: ../../library/decimal.rst:1387 msgid "Returns a value equal to *x* (rounded), having the exponent of *y*." msgstr "" -#: ../../library/decimal.rst:1391 +#: ../../library/decimal.rst:1392 msgid "Just returns 10, as this is Decimal, :)" msgstr "" -#: ../../library/decimal.rst:1396 +#: ../../library/decimal.rst:1397 msgid "Returns the remainder from integer division." msgstr "" -#: ../../library/decimal.rst:1398 +#: ../../library/decimal.rst:1399 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:1405 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:1411 msgid "Returns a rotated copy of *x*, *y* times." msgstr "" -#: ../../library/decimal.rst:1415 +#: ../../library/decimal.rst:1416 msgid "Returns ``True`` if the two operands have the same exponent." msgstr "" -#: ../../library/decimal.rst:1420 +#: ../../library/decimal.rst:1421 msgid "Returns the first operand after adding the second value its exp." msgstr "" -#: ../../library/decimal.rst:1425 +#: ../../library/decimal.rst:1426 msgid "Returns a shifted copy of *x*, *y* times." msgstr "" -#: ../../library/decimal.rst:1430 +#: ../../library/decimal.rst:1431 msgid "Square root of a non-negative number to context precision." msgstr "" -#: ../../library/decimal.rst:1435 +#: ../../library/decimal.rst:1436 msgid "Return the difference between *x* and *y*." msgstr "" -#: ../../library/decimal.rst:1449 +#: ../../library/decimal.rst:1450 msgid "Rounds to an integer." msgstr "" -#: ../../library/decimal.rst:1454 +#: ../../library/decimal.rst:1455 msgid "Converts a number to a string using scientific notation." msgstr "" -#: ../../library/decimal.rst:1461 +#: ../../library/decimal.rst:1462 msgid "Constants" msgstr "常數" -#: ../../library/decimal.rst:1463 +#: ../../library/decimal.rst:1464 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:1468 msgid "32-bit" msgstr "" -#: ../../library/decimal.rst:1467 +#: ../../library/decimal.rst:1468 msgid "64-bit" msgstr "" -#: ../../library/decimal.rst:1469 ../../library/decimal.rst:1471 +#: ../../library/decimal.rst:1470 ../../library/decimal.rst:1472 msgid ":const:`425000000`" msgstr ":const:`425000000`" -#: ../../library/decimal.rst:1469 ../../library/decimal.rst:1471 +#: ../../library/decimal.rst:1470 ../../library/decimal.rst:1472 msgid ":const:`999999999999999999`" msgstr ":const:`999999999999999999`" -#: ../../library/decimal.rst:1473 +#: ../../library/decimal.rst:1474 msgid ":const:`-425000000`" msgstr ":const:`-425000000`" -#: ../../library/decimal.rst:1473 +#: ../../library/decimal.rst:1474 msgid ":const:`-999999999999999999`" msgstr ":const:`-999999999999999999`" -#: ../../library/decimal.rst:1475 +#: ../../library/decimal.rst:1476 msgid ":const:`-849999999`" msgstr ":const:`-849999999`" -#: ../../library/decimal.rst:1475 +#: ../../library/decimal.rst:1476 msgid ":const:`-1999999999999999997`" msgstr ":const:`-1999999999999999997`" -#: ../../library/decimal.rst:1481 +#: ../../library/decimal.rst:1482 msgid "" "The value is ``True``. Deprecated, because Python now always has threads." msgstr "" -#: ../../library/decimal.rst:1487 +#: ../../library/decimal.rst:1488 msgid "" "The default value is ``True``. If Python is :option:`configured using the --" "without-decimal-contextvar option <--without-decimal-contextvar>`, the C " @@ -1490,59 +1492,59 @@ msgid "" "scenarios." msgstr "" -#: ../../library/decimal.rst:1492 +#: ../../library/decimal.rst:1493 msgid "backported to 3.7 and 3.8." msgstr "" -#: ../../library/decimal.rst:1496 +#: ../../library/decimal.rst:1497 msgid "Rounding modes" msgstr "" -#: ../../library/decimal.rst:1500 +#: ../../library/decimal.rst:1501 msgid "Round towards :const:`Infinity`." msgstr "" -#: ../../library/decimal.rst:1504 +#: ../../library/decimal.rst:1505 msgid "Round towards zero." msgstr "" -#: ../../library/decimal.rst:1508 +#: ../../library/decimal.rst:1509 msgid "Round towards :const:`-Infinity`." msgstr "" -#: ../../library/decimal.rst:1512 +#: ../../library/decimal.rst:1513 msgid "Round to nearest with ties going towards zero." msgstr "" -#: ../../library/decimal.rst:1516 +#: ../../library/decimal.rst:1517 msgid "Round to nearest with ties going to nearest even integer." msgstr "" -#: ../../library/decimal.rst:1520 +#: ../../library/decimal.rst:1521 msgid "Round to nearest with ties going away from zero." msgstr "" -#: ../../library/decimal.rst:1524 +#: ../../library/decimal.rst:1525 msgid "Round away from zero." msgstr "" -#: ../../library/decimal.rst:1528 +#: ../../library/decimal.rst:1529 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:1535 +#: ../../library/decimal.rst:1536 msgid "Signals" msgstr "" -#: ../../library/decimal.rst:1537 +#: ../../library/decimal.rst:1538 msgid "" "Signals represent conditions that arise during computation. Each corresponds " "to one context flag and one context trap enabler." msgstr "" -#: ../../library/decimal.rst:1540 +#: ../../library/decimal.rst:1541 msgid "" "The context flag is set whenever the condition is encountered. After the " "computation, flags may be checked for informational purposes (for instance, " @@ -1550,7 +1552,7 @@ msgid "" "sure to clear all flags before starting the next computation." msgstr "" -#: ../../library/decimal.rst:1545 +#: ../../library/decimal.rst:1546 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:" @@ -1558,26 +1560,26 @@ msgid "" "raised upon encountering the condition." msgstr "" -#: ../../library/decimal.rst:1553 +#: ../../library/decimal.rst:1554 msgid "Altered an exponent to fit representation constraints." msgstr "" -#: ../../library/decimal.rst:1555 +#: ../../library/decimal.rst:1556 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:1562 +#: ../../library/decimal.rst:1563 msgid "Base class for other signals and a subclass of :exc:`ArithmeticError`." msgstr "" -#: ../../library/decimal.rst:1567 +#: ../../library/decimal.rst:1568 msgid "Signals the division of a non-infinite number by zero." msgstr "" -#: ../../library/decimal.rst:1569 +#: ../../library/decimal.rst:1570 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` " @@ -1585,32 +1587,32 @@ msgid "" "calculation." msgstr "" -#: ../../library/decimal.rst:1576 +#: ../../library/decimal.rst:1577 msgid "Indicates that rounding occurred and the result is not exact." msgstr "" -#: ../../library/decimal.rst:1578 +#: ../../library/decimal.rst:1579 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:1585 +#: ../../library/decimal.rst:1586 msgid "An invalid operation was performed." msgstr "" -#: ../../library/decimal.rst:1587 +#: ../../library/decimal.rst:1588 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:1603 +#: ../../library/decimal.rst:1604 msgid "Numerical overflow." msgstr "" -#: ../../library/decimal.rst:1605 +#: ../../library/decimal.rst:1606 msgid "" "Indicates the exponent is larger than :attr:`Emax` after rounding has " "occurred. If not trapped, the result depends on the rounding mode, either " @@ -1619,11 +1621,11 @@ msgid "" "`Rounded` are also signaled." msgstr "" -#: ../../library/decimal.rst:1614 +#: ../../library/decimal.rst:1615 msgid "Rounding occurred though possibly no information was lost." msgstr "" -#: ../../library/decimal.rst:1616 +#: ../../library/decimal.rst:1617 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 " @@ -1631,31 +1633,31 @@ msgid "" "digits." msgstr "" -#: ../../library/decimal.rst:1624 +#: ../../library/decimal.rst:1625 msgid "Exponent was lower than :attr:`Emin` prior to rounding." msgstr "" -#: ../../library/decimal.rst:1626 +#: ../../library/decimal.rst:1627 msgid "" "Occurs when an operation result is subnormal (the exponent is too small). If " "not trapped, returns the result unchanged." msgstr "" -#: ../../library/decimal.rst:1632 +#: ../../library/decimal.rst:1633 msgid "Numerical underflow with result rounded to zero." msgstr "" -#: ../../library/decimal.rst:1634 +#: ../../library/decimal.rst:1635 msgid "" "Occurs when a subnormal result is pushed to zero by rounding. :class:" "`Inexact` and :class:`Subnormal` are also signaled." msgstr "" -#: ../../library/decimal.rst:1640 +#: ../../library/decimal.rst:1641 msgid "Enable stricter semantics for mixing floats and Decimals." msgstr "" -#: ../../library/decimal.rst:1642 +#: ../../library/decimal.rst:1643 msgid "" "If the signal is not trapped (default), mixing floats and Decimals is " "permitted in the :class:`~decimal.Decimal` constructor, :meth:`~decimal." @@ -1666,26 +1668,26 @@ msgid "" "Context.create_decimal_from_float` do not set the flag." msgstr "" -#: ../../library/decimal.rst:1650 +#: ../../library/decimal.rst:1651 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:1654 +#: ../../library/decimal.rst:1655 msgid "The following table summarizes the hierarchy of signals::" msgstr "" -#: ../../library/decimal.rst:1675 +#: ../../library/decimal.rst:1676 msgid "Floating Point Notes" msgstr "" -#: ../../library/decimal.rst:1679 +#: ../../library/decimal.rst:1680 msgid "Mitigating round-off error with increased precision" msgstr "" -#: ../../library/decimal.rst:1681 +#: ../../library/decimal.rst:1682 msgid "" "The use of decimal floating point eliminates decimal representation error " "(making it possible to represent :const:`0.1` exactly); however, some " @@ -1693,7 +1695,7 @@ msgid "" "fixed precision." msgstr "" -#: ../../library/decimal.rst:1685 +#: ../../library/decimal.rst:1686 msgid "" "The effects of round-off error can be amplified by the addition or " "subtraction of nearly offsetting quantities resulting in loss of " @@ -1702,24 +1704,24 @@ msgid "" "of the associative and distributive properties of addition:" msgstr "" -#: ../../library/decimal.rst:1709 +#: ../../library/decimal.rst:1710 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:1729 +#: ../../library/decimal.rst:1730 msgid "Special values" msgstr "" -#: ../../library/decimal.rst:1731 +#: ../../library/decimal.rst:1732 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:1735 +#: ../../library/decimal.rst:1736 msgid "" "Infinities can be constructed directly with: ``Decimal('Infinity')``. Also, " "they can arise from dividing by zero when the :exc:`DivisionByZero` signal " @@ -1728,14 +1730,14 @@ msgid "" "representable number." msgstr "" -#: ../../library/decimal.rst:1740 +#: ../../library/decimal.rst:1741 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:1744 +#: ../../library/decimal.rst:1745 msgid "" "Some operations are indeterminate and return :const:`NaN`, or if the :exc:" "`InvalidOperation` signal is trapped, raise an exception. For example, " @@ -1746,14 +1748,14 @@ msgid "" "the calculation to proceed while flagging specific results as invalid." msgstr "" -#: ../../library/decimal.rst:1752 +#: ../../library/decimal.rst:1753 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:1756 +#: ../../library/decimal.rst:1757 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 " @@ -1770,7 +1772,7 @@ msgid "" "methods instead." msgstr "" -#: ../../library/decimal.rst:1769 +#: ../../library/decimal.rst:1770 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 " @@ -1778,7 +1780,7 @@ msgid "" "negative zeros are treated as equal and their sign is informational." msgstr "" -#: ../../library/decimal.rst:1774 +#: ../../library/decimal.rst:1775 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 " @@ -1787,11 +1789,11 @@ msgid "" "that the following calculation returns a value equal to zero:" msgstr "" -#: ../../library/decimal.rst:1789 +#: ../../library/decimal.rst:1790 msgid "Working with threads" msgstr "" -#: ../../library/decimal.rst:1791 +#: ../../library/decimal.rst:1792 msgid "" "The :func:`getcontext` function accesses a different :class:`Context` object " "for each thread. Having separate thread contexts means that threads may " @@ -1799,20 +1801,20 @@ msgid "" "other threads." msgstr "" -#: ../../library/decimal.rst:1795 +#: ../../library/decimal.rst:1796 msgid "" "Likewise, the :func:`setcontext` function automatically assigns its target " "to the current thread." msgstr "" -#: ../../library/decimal.rst:1798 +#: ../../library/decimal.rst:1799 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:1802 +#: ../../library/decimal.rst:1803 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 " @@ -1821,50 +1823,50 @@ msgid "" "a race condition between threads calling :func:`getcontext`. For example::" msgstr "" -#: ../../library/decimal.rst:1827 +#: ../../library/decimal.rst:1828 msgid "Recipes" msgstr "" -#: ../../library/decimal.rst:1829 +#: ../../library/decimal.rst:1830 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:1984 +#: ../../library/decimal.rst:1985 msgid "Decimal FAQ" msgstr "" -#: ../../library/decimal.rst:1986 +#: ../../library/decimal.rst:1987 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:1989 +#: ../../library/decimal.rst:1990 msgid "A. Some users abbreviate the constructor to just a single letter:" msgstr "" -#: ../../library/decimal.rst:1995 +#: ../../library/decimal.rst:1996 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:1999 +#: ../../library/decimal.rst:2000 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:2017 +#: ../../library/decimal.rst:2018 msgid "" "Q. Once I have valid two place inputs, how do I maintain that invariant " "throughout an application?" msgstr "" -#: ../../library/decimal.rst:2020 +#: ../../library/decimal.rst:2021 msgid "" "A. Some operations like addition, subtraction, and multiplication by an " "integer will automatically preserve fixed point. Others operations, like " @@ -1872,13 +1874,13 @@ msgid "" "places and need to be followed-up with a :meth:`quantize` step:" msgstr "" -#: ../../library/decimal.rst:2038 +#: ../../library/decimal.rst:2039 msgid "" "In developing fixed-point applications, it is convenient to define functions " "to handle the :meth:`quantize` step:" msgstr "" -#: ../../library/decimal.rst:2051 +#: ../../library/decimal.rst:2052 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 " @@ -1886,19 +1888,19 @@ msgid "" "recognizable canonical value?" msgstr "" -#: ../../library/decimal.rst:2056 +#: ../../library/decimal.rst:2057 msgid "" "A. The :meth:`normalize` method maps all equivalent values to a single " "representative:" msgstr "" -#: ../../library/decimal.rst:2063 +#: ../../library/decimal.rst:2064 msgid "" "Q. Some decimal values always print with exponential notation. Is there a " "way to get a non-exponential representation?" msgstr "" -#: ../../library/decimal.rst:2066 +#: ../../library/decimal.rst:2067 msgid "" "A. For some values, exponential notation is the only way to express the " "number of significant places in the coefficient. For example, expressing :" @@ -1906,31 +1908,31 @@ msgid "" "original's two-place significance." msgstr "" -#: ../../library/decimal.rst:2071 +#: ../../library/decimal.rst:2072 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:2081 +#: ../../library/decimal.rst:2082 msgid "Q. Is there a way to convert a regular float to a :class:`Decimal`?" msgstr "" -#: ../../library/decimal.rst:2083 +#: ../../library/decimal.rst:2084 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:2092 +#: ../../library/decimal.rst:2093 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:2095 +#: ../../library/decimal.rst:2096 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. " @@ -1938,14 +1940,14 @@ msgid "" "issues, ill-conditioned inputs, or a numerically unstable algorithm." msgstr "" -#: ../../library/decimal.rst:2100 +#: ../../library/decimal.rst:2101 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:2104 +#: ../../library/decimal.rst:2105 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 " @@ -1954,23 +1956,23 @@ msgid "" "haven't been rounded:" msgstr "" -#: ../../library/decimal.rst:2117 +#: ../../library/decimal.rst:2118 msgid "" "The solution is either to increase precision or to force rounding of inputs " "using the unary plus operation:" msgstr "" -#: ../../library/decimal.rst:2126 +#: ../../library/decimal.rst:2127 msgid "" "Alternatively, inputs can be rounded upon creation using the :meth:`Context." "create_decimal` method:" msgstr "" -#: ../../library/decimal.rst:2132 +#: ../../library/decimal.rst:2133 msgid "Q. Is the CPython implementation fast for large numbers?" msgstr "" -#: ../../library/decimal.rst:2134 +#: ../../library/decimal.rst:2135 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: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -253,29 +253,29 @@ msgid "" "their contained methods and nested classes." msgstr "" -#: ../../library/doctest.rst:299 +#: ../../library/doctest.rst:295 msgid "How are Docstring Examples Recognized?" msgstr "" -#: ../../library/doctest.rst:301 +#: ../../library/doctest.rst:297 msgid "" "In most cases a copy-and-paste of an interactive console session works fine, " "but doctest isn't trying to do an exact emulation of any specific Python " "shell." msgstr "" -#: ../../library/doctest.rst:326 +#: ../../library/doctest.rst:322 msgid "" "Any expected output must immediately follow the final ``'>>> '`` or ``'... " "'`` line containing the code, and the expected output (if any) extends to " "the next ``'>>> '`` or all-whitespace line." msgstr "" -#: ../../library/doctest.rst:330 +#: ../../library/doctest.rst:326 msgid "The fine print:" msgstr "" -#: ../../library/doctest.rst:332 +#: ../../library/doctest.rst:328 msgid "" "Expected output cannot contain an all-whitespace line, since such a line is " "taken to signal the end of expected output. If expected output does contain " @@ -283,7 +283,7 @@ msgid "" "line is expected." msgstr "" -#: ../../library/doctest.rst:337 +#: ../../library/doctest.rst:333 msgid "" "All hard tab characters are expanded to spaces, using 8-column tab stops. " "Tabs in output generated by the tested code are not modified. Because any " @@ -298,20 +298,20 @@ msgid "" "`DocTestParser` class." msgstr "" -#: ../../library/doctest.rst:349 +#: ../../library/doctest.rst:345 msgid "" "Output to stdout is captured, but not output to stderr (exception tracebacks " "are captured via a different means)." msgstr "" -#: ../../library/doctest.rst:352 +#: ../../library/doctest.rst:348 msgid "" "If you continue a line via backslashing in an interactive session, or for " "any other reason use a backslash, you should use a raw docstring, which will " "preserve your backslashes exactly as you type them::" msgstr "" -#: ../../library/doctest.rst:361 +#: ../../library/doctest.rst:357 msgid "" "Otherwise, the backslash will be interpreted as part of the string. For " "example, the ``\\n`` above would be interpreted as a newline character. " @@ -319,21 +319,21 @@ msgid "" "use a raw string)::" msgstr "" -#: ../../library/doctest.rst:370 +#: ../../library/doctest.rst:366 msgid "The starting column doesn't matter::" msgstr "" -#: ../../library/doctest.rst:377 +#: ../../library/doctest.rst:373 msgid "" "and as many leading whitespace characters are stripped from the expected " "output as appeared in the initial ``'>>> '`` line that started the example." msgstr "" -#: ../../library/doctest.rst:384 +#: ../../library/doctest.rst:380 msgid "What's the Execution Context?" msgstr "" -#: ../../library/doctest.rst:386 +#: ../../library/doctest.rst:382 msgid "" "By default, each time :mod:`doctest` finds a docstring to test, it uses a " "*shallow copy* of :mod:`M`'s globals, so that running tests doesn't change " @@ -344,17 +344,17 @@ msgid "" "defined in other docstrings." msgstr "" -#: ../../library/doctest.rst:394 +#: ../../library/doctest.rst:390 msgid "" "You can force use of your own dict as the execution context by passing " "``globs=your_dict`` to :func:`testmod` or :func:`testfile` instead." msgstr "" -#: ../../library/doctest.rst:401 +#: ../../library/doctest.rst:397 msgid "What About Exceptions?" msgstr "" -#: ../../library/doctest.rst:403 +#: ../../library/doctest.rst:399 msgid "" "No problem, provided that the traceback is the only output produced by the " "example: just paste in the traceback. [#]_ Since tracebacks contain details " @@ -363,34 +363,34 @@ msgid "" "it accepts." msgstr "" -#: ../../library/doctest.rst:409 +#: ../../library/doctest.rst:405 msgid "Simple example::" msgstr "" "簡單範例:\n" "\n" "::" -#: ../../library/doctest.rst:416 +#: ../../library/doctest.rst:412 msgid "" "That doctest succeeds if :exc:`ValueError` is raised, with the ``list." "remove(x): x not in list`` detail as shown." msgstr "" -#: ../../library/doctest.rst:419 +#: ../../library/doctest.rst:415 msgid "" "The expected output for an exception must start with a traceback header, " "which may be either of the following two lines, indented the same as the " "first line of the example::" msgstr "" -#: ../../library/doctest.rst:426 +#: ../../library/doctest.rst:422 msgid "" "The traceback header is followed by an optional traceback stack, whose " "contents are ignored by doctest. The traceback stack is typically omitted, " "or copied verbatim from an interactive session." msgstr "" -#: ../../library/doctest.rst:430 +#: ../../library/doctest.rst:426 msgid "" "The traceback stack is followed by the most interesting part: the line(s) " "containing the exception type and detail. This is usually the last line of " @@ -398,20 +398,20 @@ msgid "" "multi-line detail::" msgstr "" -#: ../../library/doctest.rst:442 +#: ../../library/doctest.rst:438 msgid "" "The last three lines (starting with :exc:`ValueError`) are compared against " "the exception's type and detail, and the rest are ignored." msgstr "" -#: ../../library/doctest.rst:445 +#: ../../library/doctest.rst:441 msgid "" "Best practice is to omit the traceback stack, unless it adds significant " "documentation value to the example. So the last example is probably better " "as::" msgstr "" -#: ../../library/doctest.rst:455 +#: ../../library/doctest.rst:451 msgid "" "Note that tracebacks are treated very specially. In particular, in the " "rewritten example, the use of ``...`` is independent of doctest's :const:" @@ -420,11 +420,11 @@ msgid "" "transcript of a Monty Python skit." msgstr "" -#: ../../library/doctest.rst:461 +#: ../../library/doctest.rst:457 msgid "Some details you should read once, but won't need to remember:" msgstr "" -#: ../../library/doctest.rst:463 +#: ../../library/doctest.rst:459 msgid "" "Doctest can't guess whether your expected output came from an exception " "traceback or from ordinary printing. So, e.g., an example that expects " @@ -434,7 +434,7 @@ msgid "" "create real problems." msgstr "" -#: ../../library/doctest.rst:470 +#: ../../library/doctest.rst:466 msgid "" "Each line of the traceback stack (if present) must be indented further than " "the first line of the example, *or* start with a non-alphanumeric character. " @@ -443,14 +443,14 @@ msgid "" "course this does the right thing for genuine tracebacks." msgstr "" -#: ../../library/doctest.rst:476 +#: ../../library/doctest.rst:472 msgid "" "When the :const:`IGNORE_EXCEPTION_DETAIL` doctest option is specified, " "everything following the leftmost colon and any module information in the " "exception name is ignored." msgstr "" -#: ../../library/doctest.rst:480 +#: ../../library/doctest.rst:476 msgid "" "The interactive shell omits the traceback header line for some :exc:" "`SyntaxError`\\ s. But doctest uses the traceback header line to " @@ -459,13 +459,13 @@ msgid "" "need to manually add the traceback header line to your test example." msgstr "" -#: ../../library/doctest.rst:488 +#: ../../library/doctest.rst:484 msgid "" "For some :exc:`SyntaxError`\\ s, Python displays the character position of " "the syntax error, using a ``^`` marker::" msgstr "" -#: ../../library/doctest.rst:497 +#: ../../library/doctest.rst:493 msgid "" "Since the lines showing the position of the error come before the exception " "type and detail, they are not checked by doctest. For example, the " @@ -473,11 +473,11 @@ msgid "" "location::" msgstr "" -#: ../../library/doctest.rst:513 +#: ../../library/doctest.rst:509 msgid "Option Flags" msgstr "" -#: ../../library/doctest.rst:515 +#: ../../library/doctest.rst:511 msgid "" "A number of option flags control various aspects of doctest's behavior. " "Symbolic names for the flags are supplied as module constants, which can be :" @@ -487,17 +487,17 @@ msgid "" "option." msgstr "" -#: ../../library/doctest.rst:521 +#: ../../library/doctest.rst:517 msgid "The ``-o`` command line option." msgstr "" -#: ../../library/doctest.rst:524 +#: ../../library/doctest.rst:520 msgid "" "The first group of options define test semantics, controlling aspects of how " "doctest decides whether actual output matches an example's expected output:" msgstr "" -#: ../../library/doctest.rst:530 +#: ../../library/doctest.rst:526 msgid "" "By default, if an expected output block contains just ``1``, an actual " "output block containing just ``1`` or just ``True`` is considered to be a " @@ -509,7 +509,7 @@ msgid "" "not for several years." msgstr "" -#: ../../library/doctest.rst:542 +#: ../../library/doctest.rst:538 msgid "" "By default, if an expected output block contains a line containing only the " "string ````, then that line will match a blank line in the actual " @@ -518,7 +518,7 @@ msgid "" "`DONT_ACCEPT_BLANKLINE` is specified, this substitution is not allowed." msgstr "" -#: ../../library/doctest.rst:551 +#: ../../library/doctest.rst:547 msgid "" "When specified, all sequences of whitespace (blanks and newlines) are " "treated as equal. Any sequence of whitespace within the expected output " @@ -528,7 +528,7 @@ msgid "" "across multiple lines in your source." msgstr "" -#: ../../library/doctest.rst:562 +#: ../../library/doctest.rst:558 msgid "" "When specified, an ellipsis marker (``...``) in the expected output can " "match any substring in the actual output. This includes substrings that " @@ -537,48 +537,37 @@ msgid "" "matched too much!\" surprises that ``.*`` is prone to in regular expressions." msgstr "" -#: ../../library/doctest.rst:571 +#: ../../library/doctest.rst:567 msgid "" -"When specified, an example that expects an exception passes if an exception " -"of the expected type is raised, even if the exception detail does not " -"match. For example, an example expecting ``ValueError: 42`` will pass if " -"the actual exception raised is ``ValueError: 3*14``, but will fail, e.g., " -"if :exc:`TypeError` is raised." +"When specified, doctests expecting exceptions pass so long as an exception " +"of the expected type is raised, even if the details (message and fully-" +"qualified exception name) don't match." msgstr "" -#: ../../library/doctest.rst:577 +#: ../../library/doctest.rst:571 msgid "" -"It will also ignore the module name used in Python 3 doctest reports. Hence " -"both of these variations will work with the flag specified, regardless of " -"whether the test is run under Python 2.7 or Python 3.2 (or later versions)::" +"For example, an example expecting ``ValueError: 42`` will pass if the actual " +"exception raised is ``ValueError: 3*14``, but will fail if, say, a :exc:" +"`TypeError` is raised instead. It will also ignore any fully-qualified name " +"included before the exception class, which can vary between implementations " +"and versions of Python and the code/libraries in use. Hence, all three of " +"these variations will work with the flag specified:" msgstr "" -#: ../../library/doctest.rst:589 +#: ../../library/doctest.rst:593 msgid "" "Note that :const:`ELLIPSIS` can also be used to ignore the details of the " -"exception message, but such a test may still fail based on whether or not " -"the module details are printed as part of the exception name. Using :const:" -"`IGNORE_EXCEPTION_DETAIL` and the details from Python 2.3 is also the only " -"clear way to write a doctest that doesn't care about the exception detail " -"yet continues to pass under Python 2.3 or earlier (those releases do not " -"support :ref:`doctest directives ` and ignore them as " -"irrelevant comments). For example::" -msgstr "" - -#: ../../library/doctest.rst:603 -msgid "" -"passes under Python 2.3 and later Python versions with the flag specified, " -"even though the detail changed in Python 2.4 to say \"does not\" instead of " -"\"doesn't\"." +"exception message, but such a test may still fail based on whether the " +"module name is present or matches exactly." msgstr "" -#: ../../library/doctest.rst:607 +#: ../../library/doctest.rst:597 msgid "" ":const:`IGNORE_EXCEPTION_DETAIL` now also ignores any information relating " "to the module containing the exception under test." msgstr "" -#: ../../library/doctest.rst:614 +#: ../../library/doctest.rst:604 msgid "" "When specified, do not run the example at all. This can be useful in " "contexts where doctest examples serve as both documentation and test cases, " @@ -587,32 +576,32 @@ msgid "" "might depend on resources which would be unavailable to the test driver." msgstr "" -#: ../../library/doctest.rst:620 +#: ../../library/doctest.rst:610 msgid "" "The SKIP flag can also be used for temporarily \"commenting out\" examples." msgstr "" -#: ../../library/doctest.rst:625 +#: ../../library/doctest.rst:615 msgid "A bitmask or'ing together all the comparison flags above." msgstr "" -#: ../../library/doctest.rst:627 +#: ../../library/doctest.rst:617 msgid "The second group of options controls how test failures are reported:" msgstr "" -#: ../../library/doctest.rst:632 +#: ../../library/doctest.rst:622 msgid "" "When specified, failures that involve multi-line expected and actual outputs " "are displayed using a unified diff." msgstr "" -#: ../../library/doctest.rst:638 +#: ../../library/doctest.rst:628 msgid "" "When specified, failures that involve multi-line expected and actual outputs " "will be displayed using a context diff." msgstr "" -#: ../../library/doctest.rst:644 +#: ../../library/doctest.rst:634 msgid "" "When specified, differences are computed by ``difflib.Differ``, using the " "same algorithm as the popular :file:`ndiff.py` utility. This is the only " @@ -622,7 +611,7 @@ msgid "" "mismatching column positions." msgstr "" -#: ../../library/doctest.rst:653 +#: ../../library/doctest.rst:643 msgid "" "When specified, display the first failing example in each doctest, but " "suppress output for all remaining examples. This will prevent doctest from " @@ -633,7 +622,7 @@ msgid "" "of failures reported; only the output is suppressed." msgstr "" -#: ../../library/doctest.rst:664 +#: ../../library/doctest.rst:654 msgid "" "When specified, exit after the first failing example and don't attempt to " "run the remaining examples. Thus, the number of failures reported will be at " @@ -641,23 +630,23 @@ msgid "" "first failure won't even produce debugging output." msgstr "" -#: ../../library/doctest.rst:669 +#: ../../library/doctest.rst:659 msgid "" "The doctest command line accepts the option ``-f`` as a shorthand for ``-o " "FAIL_FAST``." msgstr "" -#: ../../library/doctest.rst:677 +#: ../../library/doctest.rst:667 msgid "A bitmask or'ing together all the reporting flags above." msgstr "" -#: ../../library/doctest.rst:680 +#: ../../library/doctest.rst:670 msgid "" "There is also a way to register new option flag names, though this isn't " "useful unless you intend to extend :mod:`doctest` internals via subclassing:" msgstr "" -#: ../../library/doctest.rst:686 +#: ../../library/doctest.rst:676 msgid "" "Create a new option flag with a given name, and return the new flag's " "integer value. :func:`register_optionflag` can be used when subclassing :" @@ -666,62 +655,62 @@ msgid "" "be called using the following idiom::" msgstr "" -#: ../../library/doctest.rst:702 +#: ../../library/doctest.rst:692 msgid "Directives" msgstr "" -#: ../../library/doctest.rst:704 +#: ../../library/doctest.rst:694 msgid "" "Doctest directives may be used to modify the :ref:`option flags ` for an individual example. Doctest directives are special Python " "comments following an example's source code:" msgstr "" -#: ../../library/doctest.rst:715 +#: ../../library/doctest.rst:705 msgid "" "Whitespace is not allowed between the ``+`` or ``-`` and the directive " "option name. The directive option name can be any of the option flag names " "explained above." msgstr "" -#: ../../library/doctest.rst:719 +#: ../../library/doctest.rst:709 msgid "" "An example's doctest directives modify doctest's behavior for that single " "example. Use ``+`` to enable the named behavior, or ``-`` to disable it." msgstr "" -#: ../../library/doctest.rst:722 -msgid "For example, this test passes::" +#: ../../library/doctest.rst:712 +msgid "For example, this test passes:" msgstr "" -#: ../../library/doctest.rst:728 +#: ../../library/doctest.rst:721 msgid "" "Without the directive it would fail, both because the actual output doesn't " "have two blanks before the single-digit list elements, and because the " "actual output is on a single line. This test also passes, and also requires " -"a directive to do so::" +"a directive to do so:" msgstr "" -#: ../../library/doctest.rst:736 +#: ../../library/doctest.rst:732 msgid "" "Multiple directives can be used on a single physical line, separated by " -"commas::" +"commas:" msgstr "" -#: ../../library/doctest.rst:742 +#: ../../library/doctest.rst:741 msgid "" "If multiple directive comments are used for a single example, then they are " -"combined::" +"combined:" msgstr "" -#: ../../library/doctest.rst:749 +#: ../../library/doctest.rst:751 msgid "" "As the previous example shows, you can add ``...`` lines to your example " "containing only directives. This can be useful when an example is too long " -"for a directive to comfortably fit on the same line::" +"for a directive to comfortably fit on the same line:" msgstr "" -#: ../../library/doctest.rst:757 +#: ../../library/doctest.rst:762 msgid "" "Note that since all options are disabled by default, and directives apply " "only to the example they appear in, enabling options (via ``+`` in a " @@ -731,11 +720,11 @@ msgid "" "be useful." msgstr "" -#: ../../library/doctest.rst:767 +#: ../../library/doctest.rst:772 msgid "Warnings" msgstr "" -#: ../../library/doctest.rst:769 +#: ../../library/doctest.rst:774 msgid "" ":mod:`doctest` is serious about requiring exact matches in expected output. " "If even a single character doesn't match, the test fails. This will " @@ -745,58 +734,51 @@ msgid "" "test like ::" msgstr "" -#: ../../library/doctest.rst:778 +#: ../../library/doctest.rst:783 msgid "is vulnerable! One workaround is to do ::" msgstr "" -#: ../../library/doctest.rst:783 +#: ../../library/doctest.rst:788 msgid "instead. Another is to do ::" msgstr "" -#: ../../library/doctest.rst:791 -msgid "" -"Before Python 3.6, when printing a dict, Python did not guarantee that the " -"key-value pairs was printed in any particular order." -msgstr "" - #: ../../library/doctest.rst:794 msgid "There are others, but you get the idea." msgstr "" #: ../../library/doctest.rst:796 -msgid "" -"Another bad idea is to print things that embed an object address, like ::" +msgid "Another bad idea is to print things that embed an object address, like" msgstr "" -#: ../../library/doctest.rst:804 +#: ../../library/doctest.rst:806 msgid "" -"The :const:`ELLIPSIS` directive gives a nice approach for the last example::" +"The :const:`ELLIPSIS` directive gives a nice approach for the last example:" msgstr "" -#: ../../library/doctest.rst:809 +#: ../../library/doctest.rst:814 msgid "" "Floating-point numbers are also subject to small output variations across " "platforms, because Python defers to the platform C library for float " "formatting, and C libraries vary widely in quality here. ::" msgstr "" -#: ../../library/doctest.rst:820 +#: ../../library/doctest.rst:825 msgid "" "Numbers of the form ``I/2.**J`` are safe across all platforms, and I often " "contrive doctest examples to produce numbers of that form::" msgstr "" -#: ../../library/doctest.rst:826 +#: ../../library/doctest.rst:831 msgid "" "Simple fractions are also easier for people to understand, and that makes " "for better documentation." msgstr "" -#: ../../library/doctest.rst:833 +#: ../../library/doctest.rst:838 msgid "Basic API" msgstr "" -#: ../../library/doctest.rst:835 +#: ../../library/doctest.rst:840 msgid "" "The functions :func:`testmod` and :func:`testfile` provide a simple " "interface to doctest that should be sufficient for most basic uses. For a " @@ -804,25 +786,25 @@ msgid "" "simple-testmod` and :ref:`doctest-simple-testfile`." msgstr "" -#: ../../library/doctest.rst:843 +#: ../../library/doctest.rst:848 msgid "" "All arguments except *filename* are optional, and should be specified in " "keyword form." msgstr "" -#: ../../library/doctest.rst:846 +#: ../../library/doctest.rst:851 msgid "" "Test examples in the file named *filename*. Return ``(failure_count, " "test_count)``." msgstr "" -#: ../../library/doctest.rst:849 +#: ../../library/doctest.rst:854 msgid "" "Optional argument *module_relative* specifies how the filename should be " "interpreted:" msgstr "" -#: ../../library/doctest.rst:852 +#: ../../library/doctest.rst:857 msgid "" "If *module_relative* is ``True`` (the default), then *filename* specifies an " "OS-independent module-relative path. By default, this path is relative to " @@ -832,20 +814,20 @@ msgid "" "absolute path (i.e., it may not begin with ``/``)." msgstr "" -#: ../../library/doctest.rst:859 +#: ../../library/doctest.rst:864 msgid "" "If *module_relative* is ``False``, then *filename* specifies an OS-specific " "path. The path may be absolute or relative; relative paths are resolved " "with respect to the current working directory." msgstr "" -#: ../../library/doctest.rst:863 +#: ../../library/doctest.rst:868 msgid "" "Optional argument *name* gives the name of the test; by default, or if " "``None``, ``os.path.basename(filename)`` is used." msgstr "" -#: ../../library/doctest.rst:866 +#: ../../library/doctest.rst:871 msgid "" "Optional argument *package* is a Python package or the name of a Python " "package whose directory should be used as the base directory for a module-" @@ -854,7 +836,7 @@ msgid "" "is an error to specify *package* if *module_relative* is ``False``." msgstr "" -#: ../../library/doctest.rst:872 +#: ../../library/doctest.rst:877 msgid "" "Optional argument *globs* gives a dict to be used as the globals when " "executing examples. A new shallow copy of this dict is created for the " @@ -862,7 +844,7 @@ msgid "" "``None``, a new empty dict is used." msgstr "" -#: ../../library/doctest.rst:877 +#: ../../library/doctest.rst:882 msgid "" "Optional argument *extraglobs* gives a dict merged into the globals used to " "execute examples. This works like :meth:`dict.update`: if *globs* and " @@ -875,27 +857,27 @@ msgid "" "tested." msgstr "" -#: ../../library/doctest.rst:886 +#: ../../library/doctest.rst:891 msgid "" "Optional argument *verbose* prints lots of stuff if true, and prints only " "failures if false; by default, or if ``None``, it's true if and only if ``'-" "v'`` is in ``sys.argv``." msgstr "" -#: ../../library/doctest.rst:890 +#: ../../library/doctest.rst:895 msgid "" "Optional argument *report* prints a summary at the end when true, else " "prints nothing at the end. In verbose mode, the summary is detailed, else " "the summary is very brief (in fact, empty if all tests passed)." msgstr "" -#: ../../library/doctest.rst:894 +#: ../../library/doctest.rst:899 msgid "" "Optional argument *optionflags* (default value 0) takes the :ref:`bitwise OR " "` of option flags. See section :ref:`doctest-options`." msgstr "" -#: ../../library/doctest.rst:898 +#: ../../library/doctest.rst:903 msgid "" "Optional argument *raise_on_error* defaults to false. If true, an exception " "is raised upon the first failure or unexpected exception in an example. " @@ -903,33 +885,33 @@ msgid "" "continue running examples." msgstr "" -#: ../../library/doctest.rst:903 ../../library/doctest.rst:1043 +#: ../../library/doctest.rst:908 ../../library/doctest.rst:1048 msgid "" "Optional argument *parser* specifies a :class:`DocTestParser` (or subclass) " "that should be used to extract tests from the files. It defaults to a " "normal parser (i.e., ``DocTestParser()``)." msgstr "" -#: ../../library/doctest.rst:907 ../../library/doctest.rst:1047 +#: ../../library/doctest.rst:912 ../../library/doctest.rst:1052 msgid "" "Optional argument *encoding* specifies an encoding that should be used to " "convert the file to unicode." msgstr "" -#: ../../library/doctest.rst:913 +#: ../../library/doctest.rst:918 msgid "" "All arguments are optional, and all except for *m* should be specified in " "keyword form." msgstr "" -#: ../../library/doctest.rst:916 +#: ../../library/doctest.rst:921 msgid "" "Test examples in docstrings in functions and classes reachable from module " "*m* (or module :mod:`__main__` if *m* is not supplied or is ``None``), " "starting with ``m.__doc__``." msgstr "" -#: ../../library/doctest.rst:920 +#: ../../library/doctest.rst:925 msgid "" "Also test examples reachable from dict ``m.__test__``, if it exists and is " "not ``None``. ``m.__test__`` maps names (strings) to functions, classes and " @@ -937,22 +919,22 @@ msgid "" "are searched directly, as if they were docstrings." msgstr "" -#: ../../library/doctest.rst:925 +#: ../../library/doctest.rst:930 msgid "" "Only docstrings attached to objects belonging to module *m* are searched." msgstr "" -#: ../../library/doctest.rst:927 +#: ../../library/doctest.rst:932 msgid "Return ``(failure_count, test_count)``." msgstr "" -#: ../../library/doctest.rst:929 +#: ../../library/doctest.rst:934 msgid "" "Optional argument *name* gives the name of the module; by default, or if " "``None``, ``m.__name__`` is used." msgstr "" -#: ../../library/doctest.rst:932 +#: ../../library/doctest.rst:937 msgid "" "Optional argument *exclude_empty* defaults to false. If true, objects for " "which no doctests are found are excluded from consideration. The default is " @@ -962,39 +944,39 @@ msgid "" "class:`DocTestFinder` constructor defaults to true." msgstr "" -#: ../../library/doctest.rst:939 +#: ../../library/doctest.rst:944 msgid "" "Optional arguments *extraglobs*, *verbose*, *report*, *optionflags*, " "*raise_on_error*, and *globs* are the same as for function :func:`testfile` " "above, except that *globs* defaults to ``m.__dict__``." msgstr "" -#: ../../library/doctest.rst:946 +#: ../../library/doctest.rst:951 msgid "" "Test examples associated with object *f*; for example, *f* may be a string, " "a module, a function, or a class object." msgstr "" -#: ../../library/doctest.rst:949 +#: ../../library/doctest.rst:954 msgid "" "A shallow copy of dictionary argument *globs* is used for the execution " "context." msgstr "" -#: ../../library/doctest.rst:951 +#: ../../library/doctest.rst:956 msgid "" "Optional argument *name* is used in failure messages, and defaults to ``" "\"NoName\"``." msgstr "" -#: ../../library/doctest.rst:954 +#: ../../library/doctest.rst:959 msgid "" "If optional argument *verbose* is true, output is generated even if there " "are no failures. By default, output is generated only in case of an example " "failure." msgstr "" -#: ../../library/doctest.rst:957 +#: ../../library/doctest.rst:962 msgid "" "Optional argument *compileflags* gives the set of flags that should be used " "by the Python compiler when running the examples. By default, or if " @@ -1002,16 +984,16 @@ msgid "" "found in *globs*." msgstr "" -#: ../../library/doctest.rst:961 +#: ../../library/doctest.rst:966 msgid "" "Optional argument *optionflags* works as for function :func:`testfile` above." msgstr "" -#: ../../library/doctest.rst:967 +#: ../../library/doctest.rst:972 msgid "Unittest API" msgstr "" -#: ../../library/doctest.rst:969 +#: ../../library/doctest.rst:974 msgid "" "As your collection of doctest'ed modules grows, you'll want a way to run all " "their doctests systematically. :mod:`doctest` provides two functions that " @@ -1020,19 +1002,19 @@ msgid "" "discovery, include a :func:`load_tests` function in your test module::" msgstr "" -#: ../../library/doctest.rst:983 +#: ../../library/doctest.rst:988 msgid "" "There are two main functions for creating :class:`unittest.TestSuite` " "instances from text files and modules with doctests:" msgstr "" -#: ../../library/doctest.rst:989 +#: ../../library/doctest.rst:994 msgid "" "Convert doctest tests from one or more text files to a :class:`unittest." "TestSuite`." msgstr "" -#: ../../library/doctest.rst:992 +#: ../../library/doctest.rst:997 msgid "" "The returned :class:`unittest.TestSuite` is to be run by the unittest " "framework and runs the interactive examples in each file. If an example in " @@ -1041,21 +1023,21 @@ msgid "" "containing the test and a (sometimes approximate) line number." msgstr "" -#: ../../library/doctest.rst:998 +#: ../../library/doctest.rst:1003 msgid "Pass one or more paths (as strings) to text files to be examined." msgstr "" -#: ../../library/doctest.rst:1000 +#: ../../library/doctest.rst:1005 msgid "Options may be provided as keyword arguments:" msgstr "" -#: ../../library/doctest.rst:1002 +#: ../../library/doctest.rst:1007 msgid "" "Optional argument *module_relative* specifies how the filenames in *paths* " "should be interpreted:" msgstr "" -#: ../../library/doctest.rst:1005 +#: ../../library/doctest.rst:1010 msgid "" "If *module_relative* is ``True`` (the default), then each filename in " "*paths* specifies an OS-independent module-relative path. By default, this " @@ -1066,14 +1048,14 @@ msgid "" "``)." msgstr "" -#: ../../library/doctest.rst:1013 +#: ../../library/doctest.rst:1018 msgid "" "If *module_relative* is ``False``, then each filename in *paths* specifies " "an OS-specific path. The path may be absolute or relative; relative paths " "are resolved with respect to the current working directory." msgstr "" -#: ../../library/doctest.rst:1017 +#: ../../library/doctest.rst:1022 msgid "" "Optional argument *package* is a Python package or the name of a Python " "package whose directory should be used as the base directory for module-" @@ -1083,7 +1065,7 @@ msgid "" "``False``." msgstr "" -#: ../../library/doctest.rst:1024 +#: ../../library/doctest.rst:1029 msgid "" "Optional argument *setUp* specifies a set-up function for the test suite. " "This is called before running the tests in each file. The *setUp* function " @@ -1091,7 +1073,7 @@ msgid "" "test globals as the *globs* attribute of the test passed." msgstr "" -#: ../../library/doctest.rst:1029 +#: ../../library/doctest.rst:1034 msgid "" "Optional argument *tearDown* specifies a tear-down function for the test " "suite. This is called after running the tests in each file. The *tearDown* " @@ -1099,14 +1081,14 @@ msgid "" "access the test globals as the *globs* attribute of the test passed." msgstr "" -#: ../../library/doctest.rst:1034 ../../library/doctest.rst:1068 +#: ../../library/doctest.rst:1039 ../../library/doctest.rst:1073 msgid "" "Optional argument *globs* is a dictionary containing the initial global " "variables for the tests. A new copy of this dictionary is created for each " "test. By default, *globs* is a new empty dictionary." msgstr "" -#: ../../library/doctest.rst:1038 +#: ../../library/doctest.rst:1043 msgid "" "Optional argument *optionflags* specifies the default doctest options for " "the tests, created by or-ing together individual option flags. See section :" @@ -1114,17 +1096,17 @@ msgid "" "for a better way to set reporting options." msgstr "" -#: ../../library/doctest.rst:1050 +#: ../../library/doctest.rst:1055 msgid "" "The global ``__file__`` is added to the globals provided to doctests loaded " "from a text file using :func:`DocFileSuite`." msgstr "" -#: ../../library/doctest.rst:1056 +#: ../../library/doctest.rst:1061 msgid "Convert doctest tests for a module to a :class:`unittest.TestSuite`." msgstr "" -#: ../../library/doctest.rst:1058 +#: ../../library/doctest.rst:1063 msgid "" "The returned :class:`unittest.TestSuite` is to be run by the unittest " "framework and runs each doctest in the module. If any of the doctests fail, " @@ -1133,42 +1115,42 @@ msgid "" "(sometimes approximate) line number." msgstr "" -#: ../../library/doctest.rst:1064 +#: ../../library/doctest.rst:1069 msgid "" "Optional argument *module* provides the module to be tested. It can be a " "module object or a (possibly dotted) module name. If not specified, the " "module calling this function is used." msgstr "" -#: ../../library/doctest.rst:1072 +#: ../../library/doctest.rst:1077 msgid "" "Optional argument *extraglobs* specifies an extra set of global variables, " "which is merged into *globs*. By default, no extra globals are used." msgstr "" -#: ../../library/doctest.rst:1075 +#: ../../library/doctest.rst:1080 msgid "" "Optional argument *test_finder* is the :class:`DocTestFinder` object (or a " "drop-in replacement) that is used to extract doctests from the module." msgstr "" -#: ../../library/doctest.rst:1078 +#: ../../library/doctest.rst:1083 msgid "" "Optional arguments *setUp*, *tearDown*, and *optionflags* are the same as " "for function :func:`DocFileSuite` above." msgstr "" -#: ../../library/doctest.rst:1081 +#: ../../library/doctest.rst:1086 msgid "This function uses the same search technique as :func:`testmod`." msgstr "" -#: ../../library/doctest.rst:1083 +#: ../../library/doctest.rst:1088 msgid "" ":func:`DocTestSuite` returns an empty :class:`unittest.TestSuite` if " "*module* contains no docstrings instead of raising :exc:`ValueError`." msgstr "" -#: ../../library/doctest.rst:1088 +#: ../../library/doctest.rst:1093 msgid "" "Under the covers, :func:`DocTestSuite` creates a :class:`unittest.TestSuite` " "out of :class:`doctest.DocTestCase` instances, and :class:`DocTestCase` is a " @@ -1177,14 +1159,14 @@ msgid "" "questions about the exact details of :mod:`unittest` integration." msgstr "" -#: ../../library/doctest.rst:1094 +#: ../../library/doctest.rst:1099 msgid "" "Similarly, :func:`DocFileSuite` creates a :class:`unittest.TestSuite` out " "of :class:`doctest.DocFileCase` instances, and :class:`DocFileCase` is a " "subclass of :class:`DocTestCase`." msgstr "" -#: ../../library/doctest.rst:1098 +#: ../../library/doctest.rst:1103 msgid "" "So both ways of creating a :class:`unittest.TestSuite` run instances of :" "class:`DocTestCase`. This is important for a subtle reason: when you run :" @@ -1197,23 +1179,23 @@ msgid "" "through :mod:`unittest` to :mod:`doctest` test runners." msgstr "" -#: ../../library/doctest.rst:1108 +#: ../../library/doctest.rst:1113 msgid "" "For this reason, :mod:`doctest` also supports a notion of :mod:`doctest` " "reporting flags specific to :mod:`unittest` support, via this function:" msgstr "" -#: ../../library/doctest.rst:1114 +#: ../../library/doctest.rst:1119 msgid "Set the :mod:`doctest` reporting flags to use." msgstr "" -#: ../../library/doctest.rst:1116 +#: ../../library/doctest.rst:1121 msgid "" "Argument *flags* takes the :ref:`bitwise OR ` of option flags. See " "section :ref:`doctest-options`. Only \"reporting flags\" can be used." msgstr "" -#: ../../library/doctest.rst:1119 +#: ../../library/doctest.rst:1124 msgid "" "This is a module-global setting, and affects all future doctests run by " "module :mod:`unittest`: the :meth:`runTest` method of :class:`DocTestCase` " @@ -1227,17 +1209,17 @@ msgid "" "`doctest`'s :mod:`unittest` reporting flags are ignored." msgstr "" -#: ../../library/doctest.rst:1130 +#: ../../library/doctest.rst:1135 msgid "" "The value of the :mod:`unittest` reporting flags in effect before the " "function was called is returned by the function." msgstr "" -#: ../../library/doctest.rst:1137 +#: ../../library/doctest.rst:1142 msgid "Advanced API" msgstr "" -#: ../../library/doctest.rst:1139 +#: ../../library/doctest.rst:1144 msgid "" "The basic API is a simple wrapper that's intended to make doctest easy to " "use. It is fairly flexible, and should meet most users' needs; however, if " @@ -1245,85 +1227,85 @@ msgid "" "doctest's capabilities, then you should use the advanced API." msgstr "" -#: ../../library/doctest.rst:1144 +#: ../../library/doctest.rst:1149 msgid "" "The advanced API revolves around two container classes, which are used to " "store the interactive examples extracted from doctest cases:" msgstr "" -#: ../../library/doctest.rst:1147 +#: ../../library/doctest.rst:1152 msgid "" ":class:`Example`: A single Python :term:`statement`, paired with its " "expected output." msgstr "" -#: ../../library/doctest.rst:1150 +#: ../../library/doctest.rst:1155 msgid "" ":class:`DocTest`: A collection of :class:`Example`\\ s, typically extracted " "from a single docstring or text file." msgstr "" -#: ../../library/doctest.rst:1153 +#: ../../library/doctest.rst:1158 msgid "" "Additional processing classes are defined to find, parse, and run, and check " "doctest examples:" msgstr "" -#: ../../library/doctest.rst:1156 +#: ../../library/doctest.rst:1161 msgid "" ":class:`DocTestFinder`: Finds all docstrings in a given module, and uses a :" "class:`DocTestParser` to create a :class:`DocTest` from every docstring that " "contains interactive examples." msgstr "" -#: ../../library/doctest.rst:1160 +#: ../../library/doctest.rst:1165 msgid "" ":class:`DocTestParser`: Creates a :class:`DocTest` object from a string " "(such as an object's docstring)." msgstr "" -#: ../../library/doctest.rst:1163 +#: ../../library/doctest.rst:1168 msgid "" ":class:`DocTestRunner`: Executes the examples in a :class:`DocTest`, and " "uses an :class:`OutputChecker` to verify their output." msgstr "" -#: ../../library/doctest.rst:1166 +#: ../../library/doctest.rst:1171 msgid "" ":class:`OutputChecker`: Compares the actual output from a doctest example " "with the expected output, and decides whether they match." msgstr "" -#: ../../library/doctest.rst:1169 +#: ../../library/doctest.rst:1174 msgid "" "The relationships among these processing classes are summarized in the " "following diagram::" msgstr "" -#: ../../library/doctest.rst:1185 +#: ../../library/doctest.rst:1190 msgid "DocTest Objects" msgstr "DocTest 物件" -#: ../../library/doctest.rst:1190 +#: ../../library/doctest.rst:1195 msgid "" "A collection of doctest examples that should be run in a single namespace. " "The constructor arguments are used to initialize the attributes of the same " "names." msgstr "" -#: ../../library/doctest.rst:1194 +#: ../../library/doctest.rst:1199 msgid "" ":class:`DocTest` defines the following attributes. They are initialized by " "the constructor, and should not be modified directly." msgstr "" -#: ../../library/doctest.rst:1200 +#: ../../library/doctest.rst:1205 msgid "" "A list of :class:`Example` objects encoding the individual interactive " "Python examples that should be run by this test." msgstr "" -#: ../../library/doctest.rst:1206 +#: ../../library/doctest.rst:1211 msgid "" "The namespace (aka globals) that the examples should be run in. This is a " "dictionary mapping names to values. Any changes to the namespace made by " @@ -1331,57 +1313,57 @@ msgid "" "`globs` after the test is run." msgstr "" -#: ../../library/doctest.rst:1214 +#: ../../library/doctest.rst:1219 msgid "" "A string name identifying the :class:`DocTest`. Typically, this is the name " "of the object or file that the test was extracted from." msgstr "" -#: ../../library/doctest.rst:1220 +#: ../../library/doctest.rst:1225 msgid "" "The name of the file that this :class:`DocTest` was extracted from; or " "``None`` if the filename is unknown, or if the :class:`DocTest` was not " "extracted from a file." msgstr "" -#: ../../library/doctest.rst:1227 +#: ../../library/doctest.rst:1232 msgid "" "The line number within :attr:`filename` where this :class:`DocTest` begins, " "or ``None`` if the line number is unavailable. This line number is zero-" "based with respect to the beginning of the file." msgstr "" -#: ../../library/doctest.rst:1234 +#: ../../library/doctest.rst:1239 msgid "" "The string that the test was extracted from, or ``None`` if the string is " "unavailable, or if the test was not extracted from a string." msgstr "" -#: ../../library/doctest.rst:1241 +#: ../../library/doctest.rst:1246 msgid "Example Objects" msgstr "Example 物件" -#: ../../library/doctest.rst:1246 +#: ../../library/doctest.rst:1251 msgid "" "A single interactive example, consisting of a Python statement and its " "expected output. The constructor arguments are used to initialize the " "attributes of the same names." msgstr "" -#: ../../library/doctest.rst:1251 +#: ../../library/doctest.rst:1256 msgid "" ":class:`Example` defines the following attributes. They are initialized by " "the constructor, and should not be modified directly." msgstr "" -#: ../../library/doctest.rst:1257 +#: ../../library/doctest.rst:1262 msgid "" "A string containing the example's source code. This source code consists of " "a single Python statement, and always ends with a newline; the constructor " "adds a newline when necessary." msgstr "" -#: ../../library/doctest.rst:1264 +#: ../../library/doctest.rst:1269 msgid "" "The expected output from running the example's source code (either from " "stdout, or a traceback in case of exception). :attr:`want` ends with a " @@ -1389,7 +1371,7 @@ msgid "" "The constructor adds a newline when necessary." msgstr "" -#: ../../library/doctest.rst:1272 +#: ../../library/doctest.rst:1277 msgid "" "The exception message generated by the example, if the example is expected " "to generate an exception; or ``None`` if it is not expected to generate an " @@ -1398,20 +1380,20 @@ msgid "" "unless it's ``None``. The constructor adds a newline if needed." msgstr "" -#: ../../library/doctest.rst:1281 +#: ../../library/doctest.rst:1286 msgid "" "The line number within the string containing this example where the example " "begins. This line number is zero-based with respect to the beginning of the " "containing string." msgstr "" -#: ../../library/doctest.rst:1288 +#: ../../library/doctest.rst:1293 msgid "" "The example's indentation in the containing string, i.e., the number of " "space characters that precede the example's first prompt." msgstr "" -#: ../../library/doctest.rst:1294 +#: ../../library/doctest.rst:1299 msgid "" "A dictionary mapping from option flags to ``True`` or ``False``, which is " "used to override default options for this example. Any option flags not " @@ -1420,11 +1402,11 @@ msgid "" "are set." msgstr "" -#: ../../library/doctest.rst:1303 +#: ../../library/doctest.rst:1308 msgid "DocTestFinder objects" msgstr "DocTestFinder 物件" -#: ../../library/doctest.rst:1308 +#: ../../library/doctest.rst:1313 msgid "" "A processing class used to extract the :class:`DocTest`\\ s that are " "relevant to a given object, from its docstring and the docstrings of its " @@ -1432,48 +1414,48 @@ msgid "" "classes, functions, methods, staticmethods, classmethods, and properties." msgstr "" -#: ../../library/doctest.rst:1313 +#: ../../library/doctest.rst:1318 msgid "" "The optional argument *verbose* can be used to display the objects searched " "by the finder. It defaults to ``False`` (no output)." msgstr "" -#: ../../library/doctest.rst:1316 +#: ../../library/doctest.rst:1321 msgid "" "The optional argument *parser* specifies the :class:`DocTestParser` object " "(or a drop-in replacement) that is used to extract doctests from docstrings." msgstr "" -#: ../../library/doctest.rst:1319 +#: ../../library/doctest.rst:1324 msgid "" "If the optional argument *recurse* is false, then :meth:`DocTestFinder.find` " "will only examine the given object, and not any contained objects." msgstr "" -#: ../../library/doctest.rst:1322 +#: ../../library/doctest.rst:1327 msgid "" "If the optional argument *exclude_empty* is false, then :meth:`DocTestFinder." "find` will include tests for objects with empty docstrings." msgstr "" -#: ../../library/doctest.rst:1326 +#: ../../library/doctest.rst:1331 msgid ":class:`DocTestFinder` defines the following method:" msgstr "" -#: ../../library/doctest.rst:1331 +#: ../../library/doctest.rst:1336 msgid "" "Return a list of the :class:`DocTest`\\ s that are defined by *obj*'s " "docstring, or by any of its contained objects' docstrings." msgstr "" -#: ../../library/doctest.rst:1334 +#: ../../library/doctest.rst:1339 msgid "" "The optional argument *name* specifies the object's name; this name will be " "used to construct names for the returned :class:`DocTest`\\ s. If *name* is " "not specified, then ``obj.__name__`` is used." msgstr "" -#: ../../library/doctest.rst:1338 +#: ../../library/doctest.rst:1343 msgid "" "The optional parameter *module* is the module that contains the given " "object. If the module is not specified or is ``None``, then the test finder " @@ -1481,26 +1463,26 @@ msgid "" "module is used:" msgstr "" -#: ../../library/doctest.rst:1342 +#: ../../library/doctest.rst:1347 msgid "As a default namespace, if *globs* is not specified." msgstr "" -#: ../../library/doctest.rst:1344 +#: ../../library/doctest.rst:1349 msgid "" "To prevent the DocTestFinder from extracting DocTests from objects that are " "imported from other modules. (Contained objects with modules other than " "*module* are ignored.)" msgstr "" -#: ../../library/doctest.rst:1348 +#: ../../library/doctest.rst:1353 msgid "To find the name of the file containing the object." msgstr "" -#: ../../library/doctest.rst:1350 +#: ../../library/doctest.rst:1355 msgid "To help find the line number of the object within its file." msgstr "" -#: ../../library/doctest.rst:1352 +#: ../../library/doctest.rst:1357 msgid "" "If *module* is ``False``, no attempt to find the module will be made. This " "is obscure, of use mostly in testing doctest itself: if *module* is " @@ -1509,7 +1491,7 @@ msgid "" "contained objects will (recursively) be searched for doctests." msgstr "" -#: ../../library/doctest.rst:1358 +#: ../../library/doctest.rst:1363 msgid "" "The globals for each :class:`DocTest` is formed by combining *globs* and " "*extraglobs* (bindings in *extraglobs* override bindings in *globs*). A new " @@ -1519,34 +1501,34 @@ msgid "" "defaults to ``{}``." msgstr "" -#: ../../library/doctest.rst:1369 +#: ../../library/doctest.rst:1374 msgid "DocTestParser objects" msgstr "DocTestParser 物件" -#: ../../library/doctest.rst:1374 +#: ../../library/doctest.rst:1379 msgid "" "A processing class used to extract interactive examples from a string, and " "use them to create a :class:`DocTest` object." msgstr "" -#: ../../library/doctest.rst:1378 ../../library/doctest.rst:1446 +#: ../../library/doctest.rst:1383 ../../library/doctest.rst:1451 msgid ":class:`DocTestParser` defines the following methods:" msgstr "" -#: ../../library/doctest.rst:1383 +#: ../../library/doctest.rst:1388 msgid "" "Extract all doctest examples from the given string, and collect them into a :" "class:`DocTest` object." msgstr "" -#: ../../library/doctest.rst:1386 +#: ../../library/doctest.rst:1391 msgid "" "*globs*, *name*, *filename*, and *lineno* are attributes for the new :class:" "`DocTest` object. See the documentation for :class:`DocTest` for more " "information." msgstr "" -#: ../../library/doctest.rst:1393 +#: ../../library/doctest.rst:1398 msgid "" "Extract all doctest examples from the given string, and return them as a " "list of :class:`Example` objects. Line numbers are 0-based. The optional " @@ -1554,7 +1536,7 @@ msgid "" "error messages." msgstr "" -#: ../../library/doctest.rst:1400 +#: ../../library/doctest.rst:1405 msgid "" "Divide the given string into examples and intervening text, and return them " "as a list of alternating :class:`Example`\\ s and strings. Line numbers for " @@ -1562,17 +1544,17 @@ msgid "" "name identifying this string, and is only used for error messages." msgstr "" -#: ../../library/doctest.rst:1409 +#: ../../library/doctest.rst:1414 msgid "DocTestRunner objects" msgstr "DocTestRunner 物件" -#: ../../library/doctest.rst:1414 +#: ../../library/doctest.rst:1419 msgid "" "A processing class used to execute and verify the interactive examples in a :" "class:`DocTest`." msgstr "" -#: ../../library/doctest.rst:1417 +#: ../../library/doctest.rst:1422 msgid "" "The comparison between expected outputs and actual outputs is done by an :" "class:`OutputChecker`. This comparison may be customized with a number of " @@ -1582,7 +1564,7 @@ msgid "" "constructor." msgstr "" -#: ../../library/doctest.rst:1423 +#: ../../library/doctest.rst:1428 msgid "" "The test runner's display output can be controlled in two ways. First, an " "output function can be passed to :meth:`TestRunner.run`; this function will " @@ -1593,14 +1575,14 @@ msgid "" "`report_unexpected_exception`, and :meth:`report_failure`." msgstr "" -#: ../../library/doctest.rst:1431 +#: ../../library/doctest.rst:1436 msgid "" "The optional keyword argument *checker* specifies the :class:`OutputChecker` " "object (or drop-in replacement) that should be used to compare the expected " "outputs to the actual outputs of doctest examples." msgstr "" -#: ../../library/doctest.rst:1435 +#: ../../library/doctest.rst:1440 msgid "" "The optional keyword argument *verbose* controls the :class:" "`DocTestRunner`'s verbosity. If *verbose* is ``True``, then information is " @@ -1609,56 +1591,56 @@ msgid "" "verbose output is used iff the command-line switch ``-v`` is used." msgstr "" -#: ../../library/doctest.rst:1441 +#: ../../library/doctest.rst:1446 msgid "" "The optional keyword argument *optionflags* can be used to control how the " "test runner compares expected output to actual output, and how it displays " "failures. For more information, see section :ref:`doctest-options`." msgstr "" -#: ../../library/doctest.rst:1451 +#: ../../library/doctest.rst:1456 msgid "" "Report that the test runner is about to process the given example. This " "method is provided to allow subclasses of :class:`DocTestRunner` to " "customize their output; it should not be called directly." msgstr "" -#: ../../library/doctest.rst:1455 +#: ../../library/doctest.rst:1460 msgid "" "*example* is the example about to be processed. *test* is the test " "*containing example*. *out* is the output function that was passed to :meth:" "`DocTestRunner.run`." msgstr "" -#: ../../library/doctest.rst:1462 +#: ../../library/doctest.rst:1467 msgid "" "Report that the given example ran successfully. This method is provided to " "allow subclasses of :class:`DocTestRunner` to customize their output; it " "should not be called directly." msgstr "" -#: ../../library/doctest.rst:1466 ../../library/doctest.rst:1477 +#: ../../library/doctest.rst:1471 ../../library/doctest.rst:1482 msgid "" "*example* is the example about to be processed. *got* is the actual output " "from the example. *test* is the test containing *example*. *out* is the " "output function that was passed to :meth:`DocTestRunner.run`." msgstr "" -#: ../../library/doctest.rst:1473 +#: ../../library/doctest.rst:1478 msgid "" "Report that the given example failed. This method is provided to allow " "subclasses of :class:`DocTestRunner` to customize their output; it should " "not be called directly." msgstr "" -#: ../../library/doctest.rst:1484 +#: ../../library/doctest.rst:1489 msgid "" "Report that the given example raised an unexpected exception. This method is " "provided to allow subclasses of :class:`DocTestRunner` to customize their " "output; it should not be called directly." msgstr "" -#: ../../library/doctest.rst:1488 +#: ../../library/doctest.rst:1493 msgid "" "*example* is the example about to be processed. *exc_info* is a tuple " "containing information about the unexpected exception (as returned by :func:" @@ -1666,13 +1648,13 @@ msgid "" "output function that was passed to :meth:`DocTestRunner.run`." msgstr "" -#: ../../library/doctest.rst:1496 +#: ../../library/doctest.rst:1501 msgid "" "Run the examples in *test* (a :class:`DocTest` object), and display the " "results using the writer function *out*." msgstr "" -#: ../../library/doctest.rst:1499 +#: ../../library/doctest.rst:1504 msgid "" "The examples are run in the namespace ``test.globs``. If *clear_globs* is " "true (the default), then this namespace will be cleared after the test runs, " @@ -1680,39 +1662,39 @@ msgid "" "after the test completes, then use *clear_globs=False*." msgstr "" -#: ../../library/doctest.rst:1504 +#: ../../library/doctest.rst:1509 msgid "" "*compileflags* gives the set of flags that should be used by the Python " "compiler when running the examples. If not specified, then it will default " "to the set of future-import flags that apply to *globs*." msgstr "" -#: ../../library/doctest.rst:1508 +#: ../../library/doctest.rst:1513 msgid "" "The output of each example is checked using the :class:`DocTestRunner`'s " "output checker, and the results are formatted by the :meth:`DocTestRunner." "report_\\*` methods." msgstr "" -#: ../../library/doctest.rst:1515 +#: ../../library/doctest.rst:1520 msgid "" "Print a summary of all the test cases that have been run by this " "DocTestRunner, and return a :term:`named tuple` ``TestResults(failed, " "attempted)``." msgstr "" -#: ../../library/doctest.rst:1518 +#: ../../library/doctest.rst:1523 msgid "" "The optional *verbose* argument controls how detailed the summary is. If " "the verbosity is not specified, then the :class:`DocTestRunner`'s verbosity " "is used." msgstr "" -#: ../../library/doctest.rst:1525 +#: ../../library/doctest.rst:1530 msgid "OutputChecker objects" msgstr "OutputChecker 物件" -#: ../../library/doctest.rst:1530 +#: ../../library/doctest.rst:1535 msgid "" "A class used to check the whether the actual output from a doctest example " "matches the expected output. :class:`OutputChecker` defines two methods: :" @@ -1721,11 +1703,11 @@ msgid "" "string describing the differences between two outputs." msgstr "" -#: ../../library/doctest.rst:1537 +#: ../../library/doctest.rst:1542 msgid ":class:`OutputChecker` defines the following methods:" msgstr "" -#: ../../library/doctest.rst:1541 +#: ../../library/doctest.rst:1546 msgid "" "Return ``True`` iff the actual output from an example (*got*) matches the " "expected output (*want*). These strings are always considered to match if " @@ -1734,28 +1716,28 @@ msgid "" "`doctest-options` for more information about option flags." msgstr "" -#: ../../library/doctest.rst:1550 +#: ../../library/doctest.rst:1555 msgid "" "Return a string describing the differences between the expected output for a " "given example (*example*) and the actual output (*got*). *optionflags* is " "the set of option flags used to compare *want* and *got*." msgstr "" -#: ../../library/doctest.rst:1558 +#: ../../library/doctest.rst:1563 msgid "Debugging" msgstr "" -#: ../../library/doctest.rst:1560 +#: ../../library/doctest.rst:1565 msgid "Doctest provides several mechanisms for debugging doctest examples:" msgstr "" -#: ../../library/doctest.rst:1562 +#: ../../library/doctest.rst:1567 msgid "" "Several functions convert doctests to executable Python programs, which can " "be run under the Python debugger, :mod:`pdb`." msgstr "" -#: ../../library/doctest.rst:1565 +#: ../../library/doctest.rst:1570 msgid "" "The :class:`DebugRunner` class is a subclass of :class:`DocTestRunner` that " "raises an exception for the first failing example, containing information " @@ -1763,13 +1745,13 @@ msgid "" "debugging on the example." msgstr "" -#: ../../library/doctest.rst:1570 +#: ../../library/doctest.rst:1575 msgid "" "The :mod:`unittest` cases generated by :func:`DocTestSuite` support the :" "meth:`debug` method defined by :class:`unittest.TestCase`." msgstr "" -#: ../../library/doctest.rst:1573 +#: ../../library/doctest.rst:1578 msgid "" "You can add a call to :func:`pdb.set_trace` in a doctest example, and you'll " "drop into the Python debugger when that line is executed. Then you can " @@ -1777,21 +1759,21 @@ msgid "" "`a.py` contains just this module docstring::" msgstr "" -#: ../../library/doctest.rst:1588 +#: ../../library/doctest.rst:1593 msgid "Then an interactive Python session may look like this::" msgstr "" -#: ../../library/doctest.rst:1621 +#: ../../library/doctest.rst:1626 msgid "" "Functions that convert doctests to Python code, and possibly run the " "synthesized code under the debugger:" msgstr "" -#: ../../library/doctest.rst:1627 +#: ../../library/doctest.rst:1632 msgid "Convert text with examples to a script." msgstr "" -#: ../../library/doctest.rst:1629 +#: ../../library/doctest.rst:1634 msgid "" "Argument *s* is a string containing doctest examples. The string is " "converted to a Python script, where doctest examples in *s* are converted to " @@ -1799,22 +1781,22 @@ msgid "" "generated script is returned as a string. For example, ::" msgstr "" -#: ../../library/doctest.rst:1644 +#: ../../library/doctest.rst:1649 msgid "displays::" msgstr "" -#: ../../library/doctest.rst:1654 +#: ../../library/doctest.rst:1659 msgid "" "This function is used internally by other functions (see below), but can " "also be useful when you want to transform an interactive Python session into " "a Python script." msgstr "" -#: ../../library/doctest.rst:1661 +#: ../../library/doctest.rst:1666 msgid "Convert the doctest for an object to a script." msgstr "" -#: ../../library/doctest.rst:1663 +#: ../../library/doctest.rst:1668 msgid "" "Argument *module* is a module object, or dotted name of a module, containing " "the object whose doctests are of interest. Argument *name* is the name " @@ -1824,17 +1806,17 @@ msgid "" "module :file:`a.py` contains a top-level function :func:`f`, then ::" msgstr "" -#: ../../library/doctest.rst:1673 +#: ../../library/doctest.rst:1678 msgid "" "prints a script version of function :func:`f`'s docstring, with doctests " "converted to code, and the rest placed in comments." msgstr "" -#: ../../library/doctest.rst:1679 +#: ../../library/doctest.rst:1684 msgid "Debug the doctests for an object." msgstr "" -#: ../../library/doctest.rst:1681 +#: ../../library/doctest.rst:1686 msgid "" "The *module* and *name* arguments are the same as for function :func:" "`testsource` above. The synthesized Python script for the named object's " @@ -1842,13 +1824,13 @@ msgid "" "the control of the Python debugger, :mod:`pdb`." msgstr "" -#: ../../library/doctest.rst:1686 +#: ../../library/doctest.rst:1691 msgid "" "A shallow copy of ``module.__dict__`` is used for both local and global " "execution context." msgstr "" -#: ../../library/doctest.rst:1689 +#: ../../library/doctest.rst:1694 msgid "" "Optional argument *pm* controls whether post-mortem debugging is used. If " "*pm* has a true value, the script file is run directly, and the debugger " @@ -1860,30 +1842,30 @@ msgid "" "to :func:`pdb.run`." msgstr "" -#: ../../library/doctest.rst:1700 +#: ../../library/doctest.rst:1705 msgid "Debug the doctests in a string." msgstr "" -#: ../../library/doctest.rst:1702 +#: ../../library/doctest.rst:1707 msgid "" "This is like function :func:`debug` above, except that a string containing " "doctest examples is specified directly, via the *src* argument." msgstr "" -#: ../../library/doctest.rst:1705 +#: ../../library/doctest.rst:1710 msgid "" "Optional argument *pm* has the same meaning as in function :func:`debug` " "above." msgstr "" -#: ../../library/doctest.rst:1707 +#: ../../library/doctest.rst:1712 msgid "" "Optional argument *globs* gives a dictionary to use as both local and global " "execution context. If not specified, or ``None``, an empty dictionary is " "used. If specified, a shallow copy of the dictionary is used." msgstr "" -#: ../../library/doctest.rst:1712 +#: ../../library/doctest.rst:1717 msgid "" "The :class:`DebugRunner` class, and the special exceptions it may raise, are " "of most interest to testing framework authors, and will only be sketched " @@ -1891,7 +1873,7 @@ msgid "" "(which is a doctest!) for more details:" msgstr "" -#: ../../library/doctest.rst:1720 +#: ../../library/doctest.rst:1725 msgid "" "A subclass of :class:`DocTestRunner` that raises an exception as soon as a " "failure is encountered. If an unexpected exception occurs, an :exc:" @@ -1901,89 +1883,89 @@ msgid "" "the actual output." msgstr "" -#: ../../library/doctest.rst:1727 +#: ../../library/doctest.rst:1732 msgid "" "For information about the constructor parameters and methods, see the " "documentation for :class:`DocTestRunner` in section :ref:`doctest-advanced-" "api`." msgstr "" -#: ../../library/doctest.rst:1730 +#: ../../library/doctest.rst:1735 msgid "" "There are two exceptions that may be raised by :class:`DebugRunner` " "instances:" msgstr "" -#: ../../library/doctest.rst:1735 +#: ../../library/doctest.rst:1740 msgid "" "An exception raised by :class:`DocTestRunner` to signal that a doctest " "example's actual output did not match its expected output. The constructor " "arguments are used to initialize the attributes of the same names." msgstr "" -#: ../../library/doctest.rst:1739 +#: ../../library/doctest.rst:1744 msgid ":exc:`DocTestFailure` defines the following attributes:" msgstr "" -#: ../../library/doctest.rst:1744 ../../library/doctest.rst:1768 +#: ../../library/doctest.rst:1749 ../../library/doctest.rst:1773 msgid "The :class:`DocTest` object that was being run when the example failed." msgstr "" -#: ../../library/doctest.rst:1749 ../../library/doctest.rst:1773 +#: ../../library/doctest.rst:1754 ../../library/doctest.rst:1778 msgid "The :class:`Example` that failed." msgstr "" -#: ../../library/doctest.rst:1754 +#: ../../library/doctest.rst:1759 msgid "The example's actual output." msgstr "" -#: ../../library/doctest.rst:1759 +#: ../../library/doctest.rst:1764 msgid "" "An exception raised by :class:`DocTestRunner` to signal that a doctest " "example raised an unexpected exception. The constructor arguments are used " "to initialize the attributes of the same names." msgstr "" -#: ../../library/doctest.rst:1763 +#: ../../library/doctest.rst:1768 msgid ":exc:`UnexpectedException` defines the following attributes:" msgstr "" -#: ../../library/doctest.rst:1778 +#: ../../library/doctest.rst:1783 msgid "" "A tuple containing information about the unexpected exception, as returned " "by :func:`sys.exc_info`." msgstr "" -#: ../../library/doctest.rst:1785 +#: ../../library/doctest.rst:1790 msgid "Soapbox" msgstr "" -#: ../../library/doctest.rst:1787 +#: ../../library/doctest.rst:1792 msgid "" "As mentioned in the introduction, :mod:`doctest` has grown to have three " "primary uses:" msgstr "" -#: ../../library/doctest.rst:1790 +#: ../../library/doctest.rst:1795 msgid "Checking examples in docstrings." msgstr "" -#: ../../library/doctest.rst:1792 +#: ../../library/doctest.rst:1797 msgid "Regression testing." msgstr "" -#: ../../library/doctest.rst:1794 +#: ../../library/doctest.rst:1799 msgid "Executable documentation / literate testing." msgstr "" -#: ../../library/doctest.rst:1796 +#: ../../library/doctest.rst:1801 msgid "" "These uses have different requirements, and it is important to distinguish " "them. In particular, filling your docstrings with obscure test cases makes " "for bad documentation." msgstr "" -#: ../../library/doctest.rst:1800 +#: ../../library/doctest.rst:1805 msgid "" "When writing a docstring, choose docstring examples with care. There's an " "art to this that needs to be learned---it may not be natural at first. " @@ -1995,7 +1977,7 @@ msgid "" "\"harmless\" change." msgstr "" -#: ../../library/doctest.rst:1808 +#: ../../library/doctest.rst:1813 msgid "" "Doctest also makes an excellent tool for regression testing, especially if " "you don't skimp on explanatory text. By interleaving prose and examples, it " @@ -2016,13 +1998,13 @@ msgid "" "different results, blurring the distinction between testing and explaining." msgstr "" -#: ../../library/doctest.rst:1826 +#: ../../library/doctest.rst:1831 msgid "" "Regression testing is best confined to dedicated objects or files. There " "are several options for organizing tests:" msgstr "" -#: ../../library/doctest.rst:1829 +#: ../../library/doctest.rst:1834 msgid "" "Write text files containing test cases as interactive examples, and test the " "files using :func:`testfile` or :func:`DocFileSuite`. This is recommended, " @@ -2030,7 +2012,7 @@ msgid "" "doctest." msgstr "" -#: ../../library/doctest.rst:1834 +#: ../../library/doctest.rst:1839 msgid "" "Define functions named ``_regrtest_topic`` that consist of single " "docstrings, containing test cases for the named topics. These functions can " @@ -2038,13 +2020,13 @@ msgid "" "test file." msgstr "" -#: ../../library/doctest.rst:1838 +#: ../../library/doctest.rst:1843 msgid "" "Define a ``__test__`` dictionary mapping from regression test topics to " "docstrings containing test cases." msgstr "" -#: ../../library/doctest.rst:1841 +#: ../../library/doctest.rst:1846 msgid "" "When you have placed your tests in a module, the module can itself be the " "test runner. When a test fails, you can arrange for your test runner to re-" @@ -2052,11 +2034,11 @@ msgid "" "example of such a test runner::" msgstr "" -#: ../../library/doctest.rst:1863 +#: ../../library/doctest.rst:1868 msgid "Footnotes" msgstr "註解" -#: ../../library/doctest.rst:1864 +#: ../../library/doctest.rst:1869 msgid "" "Examples containing both expected output and an exception are not supported. " "Trying to guess where one ends and the other begins is too error-prone, and " diff --git a/library/email.charset.po b/library/email.charset.po index 6894ea4ad5..30544322af 100644 --- a/library/email.charset.po +++ b/library/email.charset.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.10\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2020-06-20 18:08+0800\n" +"POT-Creation-Date: 2022-05-21 17:35+0000\n" "PO-Revision-Date: 2018-05-23 14:43+0000\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -98,15 +98,15 @@ msgstr "" #: ../../library/email.charset.rst:60 msgid "" "If the character set must be encoded before it can be used in an email " -"header, this attribute will be set to ``Charset.QP`` (for quoted-printable), " -"``Charset.BASE64`` (for base64 encoding), or ``Charset.SHORTEST`` for the " +"header, this attribute will be set to ``charset.QP`` (for quoted-printable), " +"``charset.BASE64`` (for base64 encoding), or ``charset.SHORTEST`` for the " "shortest of QP or BASE64 encoding. Otherwise, it will be ``None``." msgstr "" #: ../../library/email.charset.rst:69 msgid "" "Same as *header_encoding*, but describes the encoding for the mail message's " -"body, which indeed may be different than the header encoding. ``Charset." +"body, which indeed may be different than the header encoding. ``charset." "SHORTEST`` is not allowed for *body_encoding*." msgstr "" @@ -240,8 +240,8 @@ msgstr "" #: ../../library/email.charset.rst:178 msgid "" -"Optional *header_enc* and *body_enc* is either ``Charset.QP`` for quoted-" -"printable, ``Charset.BASE64`` for base64 encoding, ``Charset.SHORTEST`` for " +"Optional *header_enc* and *body_enc* is either ``charset.QP`` for quoted-" +"printable, ``charset.BASE64`` for base64 encoding, ``charset.SHORTEST`` for " "the shortest of quoted-printable or base64 encoding, or ``None`` for no " "encoding. ``SHORTEST`` is only valid for *header_enc*. The default is " "``None`` for no encoding." diff --git a/library/fcntl.po b/library/fcntl.po index 14dd8f7b2b..a1ba84158b 100644 --- a/library/fcntl.po +++ b/library/fcntl.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.10\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2021-10-26 16:47+0000\n" +"POT-Creation-Date: 2022-05-21 17:35+0000\n" "PO-Revision-Date: 2017-09-22 18:26+0000\n" "Last-Translator: Liang-Bo Wang \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -57,21 +57,21 @@ msgid "" "On macOS, the fcntl module exposes the ``F_GETPATH`` constant, which obtains " "the path of a file from a file descriptor. On Linux(>=3.15), the fcntl " "module exposes the ``F_OFD_GETLK``, ``F_OFD_SETLK`` and ``F_OFD_SETLKW`` " -"constants, which working with open file description locks." +"constants, which are used when working with open file description locks." msgstr "" -#: ../../library/fcntl.rst:42 +#: ../../library/fcntl.rst:43 msgid "" "On Linux >= 2.6.11, the fcntl module exposes the ``F_GETPIPE_SZ`` and " "``F_SETPIPE_SZ`` constants, which allow to check and modify a pipe's size " "respectively." msgstr "" -#: ../../library/fcntl.rst:47 +#: ../../library/fcntl.rst:48 msgid "The module defines the following functions:" msgstr "" -#: ../../library/fcntl.rst:52 +#: ../../library/fcntl.rst:53 msgid "" "Perform the operation *cmd* on file descriptor *fd* (file objects providing " "a :meth:`~io.IOBase.fileno` method are accepted as well). The values used " @@ -90,23 +90,23 @@ msgid "" "result in a segmentation violation or a more subtle data corruption." msgstr "" -#: ../../library/fcntl.rst:69 +#: ../../library/fcntl.rst:70 msgid "If the :c:func:`fcntl` fails, an :exc:`OSError` is raised." msgstr "" -#: ../../library/fcntl.rst:71 +#: ../../library/fcntl.rst:72 msgid "" "Raises an :ref:`auditing event ` ``fcntl.fcntl`` with arguments " "``fd``, ``cmd``, ``arg``." msgstr "" -#: ../../library/fcntl.rst:76 +#: ../../library/fcntl.rst:77 msgid "" "This function is identical to the :func:`~fcntl.fcntl` function, except that " "the argument handling is even more complicated." msgstr "" -#: ../../library/fcntl.rst:79 +#: ../../library/fcntl.rst:80 msgid "" "The *request* parameter is limited to values that can fit in 32-bits. " "Additional constants of interest for use as the *request* argument can be " @@ -114,26 +114,26 @@ msgid "" "relevant C header files." msgstr "" -#: ../../library/fcntl.rst:84 +#: ../../library/fcntl.rst:85 msgid "" "The parameter *arg* can be one of an integer, an object supporting the read-" "only buffer interface (like :class:`bytes`) or an object supporting the read-" "write buffer interface (like :class:`bytearray`)." msgstr "" -#: ../../library/fcntl.rst:88 +#: ../../library/fcntl.rst:89 msgid "" "In all but the last case, behaviour is as for the :func:`~fcntl.fcntl` " "function." msgstr "" -#: ../../library/fcntl.rst:91 +#: ../../library/fcntl.rst:92 msgid "" "If a mutable buffer is passed, then the behaviour is determined by the value " "of the *mutate_flag* parameter." msgstr "" -#: ../../library/fcntl.rst:94 +#: ../../library/fcntl.rst:95 msgid "" "If it is false, the buffer's mutability is ignored and behaviour is as for a " "read-only buffer, except that the 1024 byte limit mentioned above is avoided " @@ -141,7 +141,7 @@ msgid "" "system wants to put there, things should work." msgstr "" -#: ../../library/fcntl.rst:99 +#: ../../library/fcntl.rst:100 msgid "" "If *mutate_flag* is true (the default), then the buffer is (in effect) " "passed to the underlying :func:`ioctl` system call, the latter's return code " @@ -152,24 +152,24 @@ msgid "" "copied back into the supplied buffer." msgstr "" -#: ../../library/fcntl.rst:107 +#: ../../library/fcntl.rst:108 msgid "If the :c:func:`ioctl` fails, an :exc:`OSError` exception is raised." msgstr "" -#: ../../library/fcntl.rst:109 +#: ../../library/fcntl.rst:110 msgid "An example::" msgstr "" "範例:\n" "\n" "::" -#: ../../library/fcntl.rst:122 +#: ../../library/fcntl.rst:123 msgid "" "Raises an :ref:`auditing event ` ``fcntl.ioctl`` with arguments " "``fd``, ``request``, ``arg``." msgstr "" -#: ../../library/fcntl.rst:127 +#: ../../library/fcntl.rst:128 msgid "" "Perform the lock operation *operation* on file descriptor *fd* (file objects " "providing a :meth:`~io.IOBase.fileno` method are accepted as well). See the " @@ -177,17 +177,17 @@ msgid "" "function is emulated using :c:func:`fcntl`.)" msgstr "" -#: ../../library/fcntl.rst:132 +#: ../../library/fcntl.rst:133 msgid "If the :c:func:`flock` fails, an :exc:`OSError` exception is raised." msgstr "" -#: ../../library/fcntl.rst:134 +#: ../../library/fcntl.rst:135 msgid "" "Raises an :ref:`auditing event ` ``fcntl.flock`` with arguments " "``fd``, ``operation``." msgstr "" -#: ../../library/fcntl.rst:139 +#: ../../library/fcntl.rst:140 msgid "" "This is essentially a wrapper around the :func:`~fcntl.fcntl` locking calls. " "*fd* is the file descriptor (file objects providing a :meth:`~io.IOBase." @@ -195,19 +195,19 @@ msgid "" "*cmd* is one of the following values:" msgstr "" -#: ../../library/fcntl.rst:144 +#: ../../library/fcntl.rst:145 msgid ":const:`LOCK_UN` -- unlock" msgstr "" -#: ../../library/fcntl.rst:145 +#: ../../library/fcntl.rst:146 msgid ":const:`LOCK_SH` -- acquire a shared lock" msgstr "" -#: ../../library/fcntl.rst:146 +#: ../../library/fcntl.rst:147 msgid ":const:`LOCK_EX` -- acquire an exclusive lock" msgstr "" -#: ../../library/fcntl.rst:148 +#: ../../library/fcntl.rst:149 msgid "" "When *cmd* is :const:`LOCK_SH` or :const:`LOCK_EX`, it can also be bitwise " "ORed with :const:`LOCK_NB` to avoid blocking on lock acquisition. If :const:" @@ -219,44 +219,44 @@ msgid "" "for writing." msgstr "" -#: ../../library/fcntl.rst:157 +#: ../../library/fcntl.rst:158 msgid "" "*len* is the number of bytes to lock, *start* is the byte offset at which " "the lock starts, relative to *whence*, and *whence* is as with :func:`io." "IOBase.seek`, specifically:" msgstr "" -#: ../../library/fcntl.rst:161 +#: ../../library/fcntl.rst:162 msgid ":const:`0` -- relative to the start of the file (:data:`os.SEEK_SET`)" msgstr "" -#: ../../library/fcntl.rst:162 +#: ../../library/fcntl.rst:163 msgid "" ":const:`1` -- relative to the current buffer position (:data:`os.SEEK_CUR`)" msgstr "" -#: ../../library/fcntl.rst:163 +#: ../../library/fcntl.rst:164 msgid ":const:`2` -- relative to the end of the file (:data:`os.SEEK_END`)" msgstr "" -#: ../../library/fcntl.rst:165 +#: ../../library/fcntl.rst:166 msgid "" "The default for *start* is 0, which means to start at the beginning of the " "file. The default for *len* is 0 which means to lock to the end of the " "file. The default for *whence* is also 0." msgstr "" -#: ../../library/fcntl.rst:169 +#: ../../library/fcntl.rst:170 msgid "" "Raises an :ref:`auditing event ` ``fcntl.lockf`` with arguments " "``fd``, ``cmd``, ``len``, ``start``, ``whence``." msgstr "" -#: ../../library/fcntl.rst:171 +#: ../../library/fcntl.rst:172 msgid "Examples (all on a SVR4 compliant system)::" msgstr "" -#: ../../library/fcntl.rst:181 +#: ../../library/fcntl.rst:182 msgid "" "Note that in the first example the return value variable *rv* will hold an " "integer value; in the second example it will hold a :class:`bytes` object. " @@ -264,11 +264,11 @@ msgid "" "therefore using the :func:`flock` call may be better." msgstr "" -#: ../../library/fcntl.rst:192 +#: ../../library/fcntl.rst:193 msgid "Module :mod:`os`" msgstr ":mod:`os` 模組" -#: ../../library/fcntl.rst:190 +#: ../../library/fcntl.rst:191 msgid "" "If the locking flags :data:`~os.O_SHLOCK` and :data:`~os.O_EXLOCK` are " "present in the :mod:`os` module (on BSD only), the :func:`os.open` function " diff --git a/library/fileinput.po b/library/fileinput.po index ee2ce6172b..ed3ad92189 100644 --- a/library/fileinput.po +++ b/library/fileinput.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.10\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2021-10-26 16:47+0000\n" +"POT-Creation-Date: 2022-05-21 17:35+0000\n" "PO-Revision-Date: 2018-05-23 16:01+0000\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -293,6 +293,6 @@ msgstr "新增可選參數 *errors*\\ 。" #: ../../library/fileinput.rst:229 msgid "" -"This function is deprecated since :func:`input` and :class:`FileInput` now " -"have *encoding* and *errors* parameters." +"This function is deprecated since :func:`fileinput.input` and :class:" +"`FileInput` now have *encoding* and *errors* parameters." msgstr "" diff --git a/library/fractions.po b/library/fractions.po index 11d2d1123b..7ab6bdbd3e 100644 --- a/library/fractions.po +++ b/library/fractions.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.10\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2020-06-20 18:08+0800\n" +"POT-Creation-Date: 2022-05-21 17:35+0000\n" "PO-Revision-Date: 2016-01-31 07:18+0000\n" "Last-Translator: Liang-Bo Wang \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -103,9 +103,9 @@ msgstr "" #: ../../library/fractions.rst:110 msgid "" -"This class method constructs a :class:`Fraction` representing the exact " -"value of *flt*, which must be a :class:`float`. Beware that ``Fraction." -"from_float(0.3)`` is not the same value as ``Fraction(3, 10)``." +"Alternative constructor which only accepts instances of :class:`float` or :" +"class:`numbers.Integral`. Beware that ``Fraction.from_float(0.3)`` is not " +"the same value as ``Fraction(3, 10)``." msgstr "" #: ../../library/fractions.rst:116 @@ -116,8 +116,8 @@ msgstr "" #: ../../library/fractions.rst:122 msgid "" -"This class method constructs a :class:`Fraction` representing the exact " -"value of *dec*, which must be a :class:`decimal.Decimal` instance." +"Alternative constructor which only accepts instances of :class:`decimal." +"Decimal` or :class:`numbers.Integral`." msgstr "" #: ../../library/fractions.rst:127 diff --git a/library/functions.po b/library/functions.po index adaf50effe..bb53d7004b 100644 --- a/library/functions.po +++ b/library/functions.po @@ -9,8 +9,8 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.10\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2022-04-21 00:16+0000\n" -"PO-Revision-Date: 2022-01-31 17:42+0800\n" +"POT-Creation-Date: 2022-05-21 17:35+0000\n" +"PO-Revision-Date: 2022-05-22 02:44+0800\n" "Last-Translator: Phil Lin \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" "tw)\n" @@ -483,7 +483,7 @@ msgid "" msgstr "如果不一定需要 \"0b\" 前綴,還可以使用如下的方法。" #: ../../library/functions.rst:139 ../../library/functions.rst:804 -#: ../../library/functions.rst:1099 +#: ../../library/functions.rst:1100 msgid "See also :func:`format` for more information." msgstr "可參考 :func:`format` 獲取更多資訊。" @@ -1546,8 +1546,8 @@ msgstr "" #: ../../library/functions.rst:849 msgid "" -"Raises an auditing event ``builtins.input/result`` with the result after " -"successfully reading input." +"Raises an :ref:`auditing event ` ``builtins.input/result`` with " +"the result after successfully reading input." msgstr "" #: ../../library/functions.rst:856 @@ -1627,7 +1627,7 @@ msgstr "" "是型別,也不是型別 tuple 或型別的遞迴 tuple,那麼會觸發 :exc:`TypeError` 異" "常。" -#: ../../library/functions.rst:907 ../../library/functions.rst:920 +#: ../../library/functions.rst:907 ../../library/functions.rst:921 msgid "*classinfo* can be a :ref:`types-union`." msgstr "" @@ -1635,17 +1635,18 @@ msgstr "" 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 or a :ref:" -"`types-union`, 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." +"subclass of itself. *classinfo* may be a tuple of class objects (or " +"recursively, other such tuples) or a :ref:`types-union`, 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." msgstr "" "如果 *class* 是 *classinfo* 的 subclass(直接、間接或 :term:`virtual " "`),則回傳 ``True``。\\ *classinfo* 可以是 class 物件" -"的 tuple 或是一個 :ref:`types-union`,此時若 *class* 是 *classinfo* 中任一元" -"素的 subclass 時則回傳 ``True``。其他情況,會觸發 :exc:`TypeError`。" +"的 tuple(或遞迴地其他類似 tuple)或是一個 :ref:`types-union`,此時若 " +"*class* 是 *classinfo* 中任一元素的 subclass 時則回傳 ``True``。其他情況,會" +"觸發 :exc:`TypeError`。" -#: ../../library/functions.rst:926 +#: ../../library/functions.rst:927 msgid "" "Return an :term:`iterator` object. The first argument is interpreted very " "differently depending on the presence of the second argument. Without a " @@ -1668,18 +1669,18 @@ msgstr "" "帶引數地呼叫 *object*\\ ;如果回傳的結果是 *sentinel* 則觸發 :exc:" "`StopIteration`,否則回傳呼叫結果。" -#: ../../library/functions.rst:939 +#: ../../library/functions.rst:940 msgid "See also :ref:`typeiter`." msgstr "另請參閱 :ref:`typeiter`。" -#: ../../library/functions.rst:941 +#: ../../library/functions.rst:942 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:953 +#: ../../library/functions.rst:954 msgid "" "Return the length (the number of items) of an object. The argument may be a " "sequence (such as a string, bytes, tuple, list, or range) or a collection " @@ -1688,13 +1689,13 @@ msgstr "" "回傳物件的長度(元素個數)。引數可以是序列(如 string、bytes、tuple、list 或 " "range)或集合(如 dictionary、set 或 frozen set)。" -#: ../../library/functions.rst:959 +#: ../../library/functions.rst:960 msgid "" "``len`` raises :exc:`OverflowError` on lengths larger than :data:`sys." "maxsize`, such as :class:`range(2 ** 100) `." msgstr "" -#: ../../library/functions.rst:967 +#: ../../library/functions.rst:968 msgid "" "Rather than being a function, :class:`list` is actually a mutable sequence " "type, as documented in :ref:`typesseq-list` and :ref:`typesseq`." @@ -1702,7 +1703,7 @@ msgstr "" "除了是函式,:class:`list` 也是可變序列型別,詳情請參閱 :ref:`typesseq-list` " "和 :ref:`typesseq`。" -#: ../../library/functions.rst:973 +#: ../../library/functions.rst:974 msgid "" "Update and return a dictionary representing the current local symbol table. " "Free variables are returned by :func:`locals` when it is called in function " @@ -1713,7 +1714,7 @@ msgstr "" "叫 :func:`locals` 時會回傳自由變數。請注意,在 module 階層中,\\ :func:" "`locals` 和 :func:`globals` 是相同的 dictionary。" -#: ../../library/functions.rst:979 +#: ../../library/functions.rst:980 msgid "" "The contents of this dictionary should not be modified; changes may not " "affect the values of local and free variables used by the interpreter." @@ -1721,7 +1722,7 @@ msgstr "" "此 dictionary 的內容不應該被更動;更改可能不會影響直譯器使用的本地變數或自由" "變數的值。" -#: ../../library/functions.rst:984 +#: ../../library/functions.rst:985 msgid "" "Return an iterator that applies *function* to every item of *iterable*, " "yielding the results. If additional *iterable* arguments are passed, " @@ -1736,13 +1737,13 @@ msgstr "" "iteratable 耗盡時 iterator 也會結束。如果函式的輸入已經是 tuple 的引數,請參" "閱 :func:`itertools.starmap`\\。" -#: ../../library/functions.rst:995 +#: ../../library/functions.rst:996 msgid "" "Return the largest item in an iterable or the largest of two or more " "arguments." msgstr "回傳 iterable 中最大的元素,或者回傳兩個及以上引數中最大的。" -#: ../../library/functions.rst:998 +#: ../../library/functions.rst:999 msgid "" "If one positional argument is provided, it should be an :term:`iterable`. " "The largest item in the iterable is returned. If two or more positional " @@ -1751,7 +1752,7 @@ msgstr "" "如果只提供了一個位置引數,它必須是個 :term:`iterable`,iterable 中最大的元素" "會被回傳。如果提供了兩個或以上的位置引數,則回傳最大的位置引數。" -#: ../../library/functions.rst:1003 ../../library/functions.rst:1040 +#: ../../library/functions.rst:1004 ../../library/functions.rst:1041 msgid "" "There are two optional keyword-only arguments. The *key* argument specifies " "a one-argument ordering function like that used for :meth:`list.sort`. The " @@ -1763,7 +1764,7 @@ msgstr "" "式,如同 :meth:`list.sort` 使用方式。*default* 引數是當 iterable 為空時回傳的" "值。如果 iterable 為空,並且沒有提供 *default*,則會觸發 :exc:`ValueError`。" -#: ../../library/functions.rst:1009 +#: ../../library/functions.rst:1010 msgid "" "If multiple items are maximal, the function returns the first one " "encountered. This is consistent with other sort-stability preserving tools " @@ -1774,15 +1775,15 @@ msgstr "" "``sorted(iterable, key=keyfunc, reverse=True)[0]`` 和 ``heapq.nlargest(1, " "iterable, key=keyfunc)`` 一致。" -#: ../../library/functions.rst:1014 ../../library/functions.rst:1051 +#: ../../library/functions.rst:1015 ../../library/functions.rst:1052 msgid "The *default* keyword-only argument." msgstr "*default* 僅限關鍵字引數。" -#: ../../library/functions.rst:1017 ../../library/functions.rst:1054 +#: ../../library/functions.rst:1018 ../../library/functions.rst:1055 msgid "The *key* can be ``None``." msgstr "" -#: ../../library/functions.rst:1025 +#: ../../library/functions.rst:1026 msgid "" "Return a \"memory view\" object created from the given argument. See :ref:" "`typememoryview` for more information." @@ -1790,13 +1791,13 @@ msgstr "" "回傳由給定的引數建立之 \"memory view\" 物件。有關詳細資訊,請參閱 :ref:" "`typememoryview`。" -#: ../../library/functions.rst:1032 +#: ../../library/functions.rst:1033 msgid "" "Return the smallest item in an iterable or the smallest of two or more " "arguments." msgstr "回傳 iterable 中最小的元素,或者回傳兩個及以上引數中最小的。" -#: ../../library/functions.rst:1035 +#: ../../library/functions.rst:1036 msgid "" "If one positional argument is provided, it should be an :term:`iterable`. " "The smallest item in the iterable is returned. If two or more positional " @@ -1805,7 +1806,7 @@ msgstr "" "如果只提供了一個位置引數,它必須是 :term:`iterable`,iterable 中最小的元素會" "被回傳。如果提供了兩個或以上的位置引數,則回傳最小的位置引數。" -#: ../../library/functions.rst:1046 +#: ../../library/functions.rst:1047 msgid "" "If multiple items are minimal, the function returns the first one " "encountered. This is consistent with other sort-stability preserving tools " @@ -1816,7 +1817,7 @@ msgstr "" "``sorted(iterable, key=keyfunc)[0]`` 和 ``heapq.nsmallest(1, iterable, " "key=keyfunc)`` 一致。" -#: ../../library/functions.rst:1060 +#: ../../library/functions.rst:1061 msgid "" "Retrieve the next item from the :term:`iterator` by calling its :meth:" "`~iterator.__next__` method. If *default* is given, it is returned if the " @@ -1826,7 +1827,7 @@ msgstr "" "素。如果 iterator 耗盡,則回傳給定的預設值 *default*,如果沒有預設值則觸發 :" "exc:`StopIteration`。" -#: ../../library/functions.rst:1067 +#: ../../library/functions.rst:1068 msgid "" "Return a new featureless object. :class:`object` is a base for all classes. " "It has methods that are common to all instances of Python classes. This " @@ -1835,7 +1836,7 @@ msgstr "" "回傳一個沒有特徵的新物件。:class:`object` 是所有 class 的基礎,它具有所有 " "Python class 實例的通用 method。這個函式不接受任何引數。" -#: ../../library/functions.rst:1073 +#: ../../library/functions.rst:1074 msgid "" ":class:`object` does *not* have a :attr:`~object.__dict__`, so you can't " "assign arbitrary attributes to an instance of the :class:`object` class." @@ -1843,7 +1844,7 @@ msgstr "" "由於 :class:`object` *沒有* :attr:`~object.__dict__`,因此無法將任意屬性賦" "給 :class:`object` class 的實例。" -#: ../../library/functions.rst:1079 +#: ../../library/functions.rst:1080 msgid "" "Convert an integer number to an octal string prefixed with \"0o\". The " "result is a valid Python expression. If *x* is not a Python :class:`int` " @@ -1854,7 +1855,7 @@ msgstr "" "Python 運算式。如果 *x* 不是 Python 的 :class:`int` 物件,那它需要定義 :meth:" "`__index__` method 回傳一個整數。舉例來說:" -#: ../../library/functions.rst:1089 +#: ../../library/functions.rst:1090 msgid "" "If you want to convert an integer number to an octal string either with the " "prefix \"0o\" or not, you can use either of the following ways." @@ -1862,7 +1863,7 @@ msgstr "" "如果要將整數轉換為八進位制字串,不論是否具備 \"0o\" 前綴,都可以使用下面的方" "法。" -#: ../../library/functions.rst:1106 +#: ../../library/functions.rst:1107 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 " @@ -1871,7 +1872,7 @@ msgstr "" "開啟 *file* 並回傳對應的 :term:`file object`。如果該檔案不能開啟,則觸發 :" "exc:`OSError`。關於使用此函式的更多方法請參閱\\ :ref:`tut-files`。" -#: ../../library/functions.rst:1110 +#: ../../library/functions.rst:1111 msgid "" "*file* is a :term:`path-like object` giving the pathname (absolute or " "relative to the current working directory) of the file to be opened or an " @@ -1884,7 +1885,7 @@ msgstr "" "果有提供檔案描述器,它會隨著回傳的 I/O 物件關閉而關閉,除非 *closefd* 被設為 " "``False``。)" -#: ../../library/functions.rst:1116 +#: ../../library/functions.rst:1117 msgid "" "*mode* is an optional string that specifies the mode in which the file is " "opened. It defaults to ``'r'`` which means open for reading in text mode. " @@ -1905,71 +1906,71 @@ msgstr "" "getpreferredencoding(False)`` 來獲取當前的本地編碼。(要讀取和寫入原始 " "bytes,請使用二進位制模式且不要指定 *encoding*。)可用的模式有:" -#: ../../library/functions.rst:1133 +#: ../../library/functions.rst:1134 msgid "Character" msgstr "字元" -#: ../../library/functions.rst:1133 +#: ../../library/functions.rst:1134 msgid "Meaning" msgstr "意義" -#: ../../library/functions.rst:1135 +#: ../../library/functions.rst:1136 msgid "``'r'``" msgstr "``'r'``" -#: ../../library/functions.rst:1135 +#: ../../library/functions.rst:1136 msgid "open for reading (default)" msgstr "讀取(預設)" -#: ../../library/functions.rst:1136 +#: ../../library/functions.rst:1137 msgid "``'w'``" msgstr "``'w'``" -#: ../../library/functions.rst:1136 +#: ../../library/functions.rst:1137 msgid "open for writing, truncating the file first" msgstr "" -#: ../../library/functions.rst:1137 +#: ../../library/functions.rst:1138 msgid "``'x'``" msgstr "``'x'``" -#: ../../library/functions.rst:1137 +#: ../../library/functions.rst:1138 msgid "open for exclusive creation, failing if the file already exists" msgstr "唯一性創建,如果文件已存在則會失敗" -#: ../../library/functions.rst:1138 +#: ../../library/functions.rst:1139 msgid "``'a'``" msgstr "``'a'``" -#: ../../library/functions.rst:1138 +#: ../../library/functions.rst:1139 msgid "open for writing, appending to the end of file if it exists" msgstr "寫入,如果文件存在則在末尾追加寫入內容" -#: ../../library/functions.rst:1139 +#: ../../library/functions.rst:1140 msgid "``'b'``" msgstr "``'b'``" -#: ../../library/functions.rst:1139 +#: ../../library/functions.rst:1140 msgid "binary mode" msgstr "二進制模式" -#: ../../library/functions.rst:1140 +#: ../../library/functions.rst:1141 msgid "``'t'``" msgstr "``'t'``" -#: ../../library/functions.rst:1140 +#: ../../library/functions.rst:1141 msgid "text mode (default)" msgstr "文字模式(預設)" -#: ../../library/functions.rst:1141 +#: ../../library/functions.rst:1142 msgid "``'+'``" msgstr "``'+'``" -#: ../../library/functions.rst:1141 +#: ../../library/functions.rst:1142 msgid "open for updating (reading and writing)" msgstr "更新(讀取並寫入)" -#: ../../library/functions.rst:1144 +#: ../../library/functions.rst:1145 msgid "" "The default mode is ``'r'`` (open for reading text, a synonym of ``'rt'``). " "Modes ``'w+'`` and ``'w+b'`` open and truncate the file. Modes ``'r+'`` and " @@ -1978,7 +1979,7 @@ msgstr "" "預設的模式是 ``'r'``\\ (開啟並讀取文字,同 ``'rt'``)。對於二進位制寫入," "``'w+b'`` 模式開啟並把檔案內容變成 0 bytes,``'r+b'`` 則不會捨棄原始內容。" -#: ../../library/functions.rst:1148 +#: ../../library/functions.rst:1149 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* " @@ -1989,7 +1990,7 @@ msgid "" "specified *encoding* if given." msgstr "" -#: ../../library/functions.rst:1156 +#: ../../library/functions.rst:1157 msgid "" "There is an additional mode character permitted, ``'U'``, which no longer " "has any effect, and is considered deprecated. It previously enabled :term:" @@ -1998,14 +1999,14 @@ msgid "" "parameter>` parameter for further details." msgstr "" -#: ../../library/functions.rst:1164 +#: ../../library/functions.rst:1165 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:1168 +#: ../../library/functions.rst:1169 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 " @@ -2018,7 +2019,7 @@ msgid "" "given, the default buffering policy works as follows:" msgstr "" -#: ../../library/functions.rst:1178 +#: ../../library/functions.rst:1179 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 " @@ -2026,14 +2027,14 @@ msgid "" "the buffer will typically be 4096 or 8192 bytes long." msgstr "" -#: ../../library/functions.rst:1183 +#: ../../library/functions.rst:1184 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:1187 +#: ../../library/functions.rst:1188 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 " @@ -2042,7 +2043,7 @@ msgid "" "module for the list of supported encodings." msgstr "" -#: ../../library/functions.rst:1194 +#: ../../library/functions.rst:1195 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 " @@ -2051,25 +2052,25 @@ msgid "" "register_error` is also valid. The standard names include:" msgstr "" -#: ../../library/functions.rst:1202 +#: ../../library/functions.rst:1203 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:1206 +#: ../../library/functions.rst:1207 msgid "" "``'ignore'`` ignores errors. Note that ignoring encoding errors can lead to " "data loss." msgstr "" -#: ../../library/functions.rst:1209 +#: ../../library/functions.rst:1210 msgid "" "``'replace'`` causes a replacement marker (such as ``'?'``) to be inserted " "where there is malformed data." msgstr "" -#: ../../library/functions.rst:1212 +#: ../../library/functions.rst:1213 msgid "" "``'surrogateescape'`` will represent any incorrect bytes as low surrogate " "code units ranging from U+DC80 to U+DCFF. These surrogate code units will " @@ -2078,33 +2079,33 @@ msgid "" "an unknown encoding." msgstr "" -#: ../../library/functions.rst:1219 +#: ../../library/functions.rst:1220 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:1223 +#: ../../library/functions.rst:1224 msgid "" "``'backslashreplace'`` replaces malformed data by Python's backslashed " "escape sequences." msgstr "" -#: ../../library/functions.rst:1226 +#: ../../library/functions.rst:1227 msgid "" "``'namereplace'`` (also only supported when writing) replaces unsupported " "characters with ``\\N{...}`` escape sequences." msgstr "" -#: ../../library/functions.rst:1234 +#: ../../library/functions.rst:1235 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:1238 +#: ../../library/functions.rst:1239 msgid "" "When reading input from the stream, if *newline* is ``None``, universal " "newlines mode is enabled. Lines in the input can end in ``'\\n'``, " @@ -2115,7 +2116,7 @@ msgid "" "given string, and the line ending is returned to the caller untranslated." msgstr "" -#: ../../library/functions.rst:1246 +#: ../../library/functions.rst:1247 msgid "" "When writing output to the stream, if *newline* is ``None``, any ``'\\n'`` " "characters written are translated to the system default line separator, :" @@ -2124,7 +2125,7 @@ msgid "" "characters written are translated to the given string." msgstr "" -#: ../../library/functions.rst:1252 +#: ../../library/functions.rst:1253 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 " @@ -2132,7 +2133,7 @@ msgid "" "otherwise, an error will be raised." msgstr "" -#: ../../library/functions.rst:1257 +#: ../../library/functions.rst:1258 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 " @@ -2141,11 +2142,11 @@ msgid "" "similar to passing ``None``)." msgstr "" -#: ../../library/functions.rst:1263 +#: ../../library/functions.rst:1264 msgid "The newly created file is :ref:`non-inheritable `." msgstr "新建立的檔案是\\ :ref:`不可繼承的 `。" -#: ../../library/functions.rst:1265 +#: ../../library/functions.rst:1266 msgid "" "The following example uses the :ref:`dir_fd ` parameter of the :func:" "`os.open` function to open a file relative to a given directory::" @@ -2155,7 +2156,7 @@ msgstr "" "\n" "::" -#: ../../library/functions.rst:1278 +#: ../../library/functions.rst:1279 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 " @@ -2170,7 +2171,7 @@ msgid "" "FileIO`, is returned." msgstr "" -#: ../../library/functions.rst:1299 +#: ../../library/functions.rst:1300 msgid "" "See also the file handling modules, such as :mod:`fileinput`, :mod:`io` " "(where :func:`open` is declared), :mod:`os`, :mod:`os.path`, :mod:" @@ -2180,31 +2181,31 @@ msgstr "" "`open` 的 module )、:mod:`os`、:mod:`os.path`、:mod:`tempfile` 以及 :mod:" "`shutil`。" -#: ../../library/functions.rst:1303 +#: ../../library/functions.rst:1304 msgid "" "Raises an :ref:`auditing event ` ``open`` with arguments ``file``, " "``mode``, ``flags``." msgstr "" -#: ../../library/functions.rst:1305 +#: ../../library/functions.rst:1306 msgid "" "The ``mode`` and ``flags`` arguments may have been modified or inferred from " "the original call." msgstr "" -#: ../../library/functions.rst:1311 +#: ../../library/functions.rst:1312 msgid "The *opener* parameter was added." msgstr "增加了 *opener* 參數。" -#: ../../library/functions.rst:1312 +#: ../../library/functions.rst:1313 msgid "The ``'x'`` mode was added." msgstr "增加了 ``'x'`` 模式。" -#: ../../library/functions.rst:1313 +#: ../../library/functions.rst:1314 msgid ":exc:`IOError` used to be raised, it is now an alias of :exc:`OSError`." msgstr "過去觸發的 :exc:`IOError`,現在是 :exc:`OSError` 的別名。" -#: ../../library/functions.rst:1314 +#: ../../library/functions.rst:1315 msgid "" ":exc:`FileExistsError` is now raised if the file opened in exclusive " "creation mode (``'x'``) already exists." @@ -2212,15 +2213,15 @@ msgstr "" "如果檔案已存在但使用了唯一性建立模式 (\\ ``'x'``\\ ),現在會觸發 :exc:" "`FileExistsError`。" -#: ../../library/functions.rst:1320 +#: ../../library/functions.rst:1321 msgid "The file is now non-inheritable." msgstr "檔案在當前版本開始禁止繼承。" -#: ../../library/functions.rst:1324 +#: ../../library/functions.rst:1325 msgid "The ``'U'`` mode." msgstr "``'U'`` 模式。" -#: ../../library/functions.rst:1329 +#: ../../library/functions.rst:1330 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 :" @@ -2229,15 +2230,15 @@ msgstr "" "如果系統呼叫被中斷,但訊號處理程序沒有觸發例外,此函式現在會重試系統呼叫,而" "不是觸發 :exc:`InterruptedError`\\ (原因詳見 :pep:`475`)。" -#: ../../library/functions.rst:1332 +#: ../../library/functions.rst:1333 msgid "The ``'namereplace'`` error handler was added." msgstr "增加了 ``'namereplace'`` 錯誤處理程式。" -#: ../../library/functions.rst:1337 +#: ../../library/functions.rst:1338 msgid "Support added to accept objects implementing :class:`os.PathLike`." msgstr "增加對實現了 :class:`os.PathLike` 物件的支援。" -#: ../../library/functions.rst:1338 +#: ../../library/functions.rst:1339 msgid "" "On Windows, opening a console buffer may return a subclass of :class:`io." "RawIOBase` other than :class:`io.FileIO`." @@ -2245,7 +2246,7 @@ msgstr "" "在 Windows 上,開啟一個控制臺緩衝區可能會回傳 :class:`io.RawIOBase` 的 " "subclass,而不是 :class:`io.FileIO`。" -#: ../../library/functions.rst:1343 +#: ../../library/functions.rst:1344 msgid "" "Given a string representing one Unicode character, return an integer " "representing the Unicode code point of that character. For example, " @@ -2256,7 +2257,7 @@ msgstr "" "``ord('a')`` 回傳整數 ``97``、\\ ``ord('€')``\\ (歐元符號)回傳 ``8364``。這" "是 :func:`chr` 的逆函式。" -#: ../../library/functions.rst:1351 +#: ../../library/functions.rst:1352 msgid "" "Return *base* to the power *exp*; if *mod* is present, return *base* to the " "power *exp*, modulo *mod* (computed more efficiently than ``pow(base, exp) % " @@ -2267,7 +2268,7 @@ msgstr "" "*mod* 取餘數(比直接呼叫 ``pow(base, exp) % mod`` 計算更高效)。兩個引數形式" "的 ``pow(exp, exp)`` 等價於次方運算子:``base**exp``。" -#: ../../library/functions.rst:1356 +#: ../../library/functions.rst:1357 msgid "" "The arguments must have numeric types. With mixed operand types, the " "coercion rules for binary arithmetic operators apply. For :class:`int` " @@ -2280,7 +2281,7 @@ msgid "" "close to ``3j``." msgstr "" -#: ../../library/functions.rst:1366 +#: ../../library/functions.rst:1367 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 " @@ -2289,29 +2290,29 @@ msgid "" "*base* modulo *mod*." msgstr "" -#: ../../library/functions.rst:1372 +#: ../../library/functions.rst:1373 msgid "Here's an example of computing an inverse for ``38`` modulo ``97``::" msgstr "" -#: ../../library/functions.rst:1379 +#: ../../library/functions.rst:1380 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:1384 +#: ../../library/functions.rst:1385 msgid "" "Allow keyword arguments. Formerly, only positional arguments were supported." msgstr "" -#: ../../library/functions.rst:1391 +#: ../../library/functions.rst:1392 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:1395 +#: ../../library/functions.rst:1396 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* " @@ -2320,7 +2321,7 @@ msgid "" "*end*." msgstr "" -#: ../../library/functions.rst:1401 +#: ../../library/functions.rst:1402 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 " @@ -2328,38 +2329,38 @@ msgid "" "binary mode file objects. For these, use ``file.write(...)`` instead." msgstr "" -#: ../../library/functions.rst:1406 +#: ../../library/functions.rst:1407 msgid "" "Whether the output is buffered is usually determined by *file*, but if the " "*flush* keyword argument is true, the stream is forcibly flushed." msgstr "" -#: ../../library/functions.rst:1409 +#: ../../library/functions.rst:1410 msgid "Added the *flush* keyword argument." msgstr "增加了 *flush* 關鍵字引數。" -#: ../../library/functions.rst:1415 +#: ../../library/functions.rst:1416 msgid "Return a property attribute." msgstr "回傳 property 屬性。" -#: ../../library/functions.rst:1417 +#: ../../library/functions.rst:1418 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:1421 +#: ../../library/functions.rst:1422 msgid "A typical use is to define a managed attribute ``x``::" msgstr "" -#: ../../library/functions.rst:1438 +#: ../../library/functions.rst:1439 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:1441 +#: ../../library/functions.rst:1442 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 " @@ -2367,14 +2368,14 @@ msgid "" "term:`decorator`::" msgstr "" -#: ../../library/functions.rst:1454 +#: ../../library/functions.rst:1455 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:1458 +#: ../../library/functions.rst:1459 msgid "" "A property object has :attr:`~property.getter`, :attr:`~property.setter`, " "and :attr:`~property.deleter` methods usable as decorators that create a " @@ -2382,30 +2383,30 @@ msgid "" "decorated function. This is best explained with an example::" msgstr "" -#: ../../library/functions.rst:1480 +#: ../../library/functions.rst:1481 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:1484 +#: ../../library/functions.rst:1485 msgid "" "The returned property object also has the attributes ``fget``, ``fset``, and " "``fdel`` corresponding to the constructor arguments." msgstr "" -#: ../../library/functions.rst:1487 +#: ../../library/functions.rst:1488 msgid "The docstrings of property objects are now writeable." msgstr "" -#: ../../library/functions.rst:1496 +#: ../../library/functions.rst:1497 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:1502 +#: ../../library/functions.rst:1503 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 " @@ -2416,7 +2417,7 @@ msgid "" "function returns for its instances by defining a :meth:`__repr__` method." msgstr "" -#: ../../library/functions.rst:1513 +#: ../../library/functions.rst:1514 msgid "" "Return a reverse :term:`iterator`. *seq* must be an object which has a :" "meth:`__reversed__` method or supports the sequence protocol (the :meth:" @@ -2424,14 +2425,14 @@ msgid "" "starting at ``0``)." msgstr "" -#: ../../library/functions.rst:1521 +#: ../../library/functions.rst:1522 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:1525 +#: ../../library/functions.rst:1526 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 " @@ -2442,13 +2443,13 @@ msgid "" "``None``. Otherwise, the return value has the same type as *number*." msgstr "" -#: ../../library/functions.rst:1534 +#: ../../library/functions.rst:1535 msgid "" "For a general Python object ``number``, ``round`` delegates to ``number." "__round__``." msgstr "" -#: ../../library/functions.rst:1539 +#: ../../library/functions.rst:1540 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 " @@ -2457,21 +2458,21 @@ msgid "" "information." msgstr "" -#: ../../library/functions.rst:1550 +#: ../../library/functions.rst:1551 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:1554 +#: ../../library/functions.rst:1555 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:1561 +#: ../../library/functions.rst:1562 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 " @@ -2480,14 +2481,14 @@ msgid "" "is equivalent to ``x.foobar = 123``." msgstr "" -#: ../../library/functions.rst:1569 +#: ../../library/functions.rst:1570 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:1578 +#: ../../library/functions.rst:1579 msgid "" "Return a :term:`slice` object representing the set of indices specified by " "``range(start, stop, step)``. The *start* and *step* arguments default to " @@ -2500,35 +2501,35 @@ msgid "" "func:`itertools.islice` for an alternate version that returns an iterator." msgstr "" -#: ../../library/functions.rst:1591 +#: ../../library/functions.rst:1592 msgid "Return a new sorted list from the items in *iterable*." msgstr "" -#: ../../library/functions.rst:1593 +#: ../../library/functions.rst:1594 msgid "" "Has two optional arguments which must be specified as keyword arguments." msgstr "有兩個選擇性引數,只能使用關鍵字引數來指定。" -#: ../../library/functions.rst:1595 +#: ../../library/functions.rst:1596 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:1599 +#: ../../library/functions.rst:1600 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:1602 +#: ../../library/functions.rst:1603 msgid "" "Use :func:`functools.cmp_to_key` to convert an old-style *cmp* function to a " "*key* function." msgstr "" -#: ../../library/functions.rst:1605 +#: ../../library/functions.rst:1606 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 " @@ -2536,7 +2537,7 @@ msgid "" "example, sort by department, then by salary grade)." msgstr "" -#: ../../library/functions.rst:1610 +#: ../../library/functions.rst:1611 msgid "" "The sort algorithm uses only ``<`` comparisons between items. While " "defining an :meth:`~object.__lt__` method will suffice for sorting, :PEP:`8` " @@ -2548,22 +2549,22 @@ msgid "" "method." msgstr "" -#: ../../library/functions.rst:1619 +#: ../../library/functions.rst:1620 msgid "" "For sorting examples and a brief sorting tutorial, see :ref:`sortinghowto`." msgstr "" -#: ../../library/functions.rst:1623 +#: ../../library/functions.rst:1624 msgid "Transform a method into a static method." msgstr "" -#: ../../library/functions.rst:1625 +#: ../../library/functions.rst:1626 msgid "" "A static method does not receive an implicit first argument. To declare a " "static method, use this idiom::" msgstr "" -#: ../../library/functions.rst:1632 +#: ../../library/functions.rst:1633 msgid "" "The ``@staticmethod`` form is a function :term:`decorator` -- see :ref:" "`function` for details." @@ -2571,21 +2572,21 @@ msgstr "" "``@staticmethod`` 語法是一個函式 :term:`decorator` - 參見 :ref:`function` 中" "的詳細介紹。" -#: ../../library/functions.rst:1635 +#: ../../library/functions.rst:1636 msgid "" "A static method can be called either on the class (such as ``C.f()``) or on " "an instance (such as ``C().f()``). Moreover, they can be called as regular " "functions (such as ``f()``)." msgstr "" -#: ../../library/functions.rst:1639 +#: ../../library/functions.rst:1640 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:1643 +#: ../../library/functions.rst:1644 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 " @@ -2594,36 +2595,36 @@ msgid "" "cases, use this idiom::" msgstr "" -#: ../../library/functions.rst:1655 +#: ../../library/functions.rst:1656 msgid "For more information on static methods, see :ref:`types`." msgstr "關於 static method 的更多資訊,請參考 :ref:`types`。" -#: ../../library/functions.rst:1657 +#: ../../library/functions.rst:1658 msgid "" "Static methods now inherit the method attributes (``__module__``, " "``__name__``, ``__qualname__``, ``__doc__`` and ``__annotations__``), have a " "new ``__wrapped__`` attribute, and are now callable as regular functions." msgstr "" -#: ../../library/functions.rst:1672 +#: ../../library/functions.rst:1673 msgid "" "Return a :class:`str` version of *object*. See :func:`str` for details." msgstr "" -#: ../../library/functions.rst:1674 +#: ../../library/functions.rst:1675 msgid "" "``str`` is the built-in string :term:`class`. For general information about " "strings, see :ref:`textseq`." msgstr "" -#: ../../library/functions.rst:1680 +#: ../../library/functions.rst:1681 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:1684 +#: ../../library/functions.rst:1685 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 ``''." @@ -2632,31 +2633,31 @@ msgid "" "using :func:`itertools.chain`." msgstr "" -#: ../../library/functions.rst:1690 +#: ../../library/functions.rst:1691 msgid "The *start* parameter can be specified as a keyword argument." msgstr "*start* 參數可被指定為關鍵字引數。" -#: ../../library/functions.rst:1695 +#: ../../library/functions.rst:1696 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:1699 +#: ../../library/functions.rst:1700 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:1703 +#: ../../library/functions.rst:1704 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:1707 +#: ../../library/functions.rst:1708 msgid "" "The :attr:`~class.__mro__` attribute of the *object-or-type* lists the " "method resolution search order used by both :func:`getattr` and :func:" @@ -2664,7 +2665,7 @@ msgid "" "hierarchy is updated." msgstr "" -#: ../../library/functions.rst:1712 +#: ../../library/functions.rst:1713 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. " @@ -2672,7 +2673,7 @@ msgid "" "(this is useful for classmethods)." msgstr "" -#: ../../library/functions.rst:1717 +#: ../../library/functions.rst:1718 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 " @@ -2680,7 +2681,7 @@ msgid "" "closely parallels the use of *super* in other programming languages." msgstr "" -#: ../../library/functions.rst:1722 +#: ../../library/functions.rst:1723 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 " @@ -2693,18 +2694,18 @@ msgid "" "classes that are unknown prior to runtime)." msgstr "" -#: ../../library/functions.rst:1732 +#: ../../library/functions.rst:1733 msgid "For both use cases, a typical superclass call looks like this::" msgstr "" -#: ../../library/functions.rst:1739 +#: ../../library/functions.rst:1740 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:1743 +#: ../../library/functions.rst:1744 msgid "" "Note that :func:`super` is implemented as part of the binding process for " "explicit dotted attribute lookups such as ``super().__getitem__(name)``. It " @@ -2714,7 +2715,7 @@ msgid "" "using statements or operators such as ``super()[name]``." msgstr "" -#: ../../library/functions.rst:1750 +#: ../../library/functions.rst:1751 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 " @@ -2724,33 +2725,33 @@ msgid "" "accessing the current instance for ordinary methods." msgstr "" -#: ../../library/functions.rst:1757 +#: ../../library/functions.rst:1758 msgid "" "For practical suggestions on how to design cooperative classes using :func:" "`super`, see `guide to using super() `_." msgstr "" -#: ../../library/functions.rst:1766 +#: ../../library/functions.rst:1767 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:1775 +#: ../../library/functions.rst:1776 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:1779 +#: ../../library/functions.rst:1780 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:1783 +#: ../../library/functions.rst:1784 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 " @@ -2763,11 +2764,11 @@ msgid "" "identical :class:`type` objects:" msgstr "" -#: ../../library/functions.rst:1798 +#: ../../library/functions.rst:1799 msgid "See also :ref:`bltin-type-objects`." msgstr "另請參閱 :ref:`bltin-type-objects`。" -#: ../../library/functions.rst:1800 +#: ../../library/functions.rst:1801 msgid "" "Keyword arguments provided to the three argument form are passed to the " "appropriate metaclass machinery (usually :meth:`~object.__init_subclass__`) " @@ -2775,23 +2776,23 @@ msgid "" "would." msgstr "" -#: ../../library/functions.rst:1805 +#: ../../library/functions.rst:1806 msgid "See also :ref:`class-customization`." msgstr "另請參閱 :ref:`class-customization`。" -#: ../../library/functions.rst:1807 +#: ../../library/functions.rst:1808 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:1813 +#: ../../library/functions.rst:1814 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:1816 +#: ../../library/functions.rst:1817 msgid "" "Objects such as modules and instances have an updateable :attr:`~object." "__dict__` attribute; however, other objects may have write restrictions on " @@ -2799,54 +2800,54 @@ msgid "" "`types.MappingProxyType` to prevent direct dictionary updates)." msgstr "" -#: ../../library/functions.rst:1821 +#: ../../library/functions.rst:1822 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:1825 +#: ../../library/functions.rst:1826 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:1831 +#: ../../library/functions.rst:1832 msgid "" "Iterate over several iterables in parallel, producing tuples with an item " "from each one." msgstr "" -#: ../../library/functions.rst:1834 +#: ../../library/functions.rst:1835 msgid "Example::" msgstr "" "例如:\n" "\n" "::" -#: ../../library/functions.rst:1843 +#: ../../library/functions.rst:1844 msgid "" "More formally: :func:`zip` returns an iterator of tuples, where the *i*-th " "tuple contains the *i*-th element from each of the argument iterables." msgstr "" -#: ../../library/functions.rst:1846 +#: ../../library/functions.rst:1847 msgid "" "Another way to think of :func:`zip` is that it turns rows into columns, and " "columns into rows. This is similar to `transposing a matrix `_." msgstr "" -#: ../../library/functions.rst:1850 +#: ../../library/functions.rst:1851 msgid "" ":func:`zip` is lazy: The elements won't be processed until the iterable is " "iterated on, e.g. by a :keyword:`!for` loop or by wrapping in a :class:" "`list`." msgstr "" -#: ../../library/functions.rst:1854 +#: ../../library/functions.rst:1855 msgid "" "One thing to consider is that the iterables passed to :func:`zip` could have " "different lengths; sometimes by design, and sometimes because of a bug in " @@ -2854,51 +2855,51 @@ msgid "" "approaches to dealing with this issue:" msgstr "" -#: ../../library/functions.rst:1859 +#: ../../library/functions.rst:1860 msgid "" "By default, :func:`zip` stops when the shortest iterable is exhausted. It " "will ignore the remaining items in the longer iterables, cutting off the " "result to the length of the shortest iterable::" msgstr "" -#: ../../library/functions.rst:1866 +#: ../../library/functions.rst:1867 msgid "" ":func:`zip` is often used in cases where the iterables are assumed to be of " "equal length. In such cases, it's recommended to use the ``strict=True`` " "option. Its output is the same as regular :func:`zip`::" msgstr "" -#: ../../library/functions.rst:1873 +#: ../../library/functions.rst:1874 msgid "" "Unlike the default behavior, it checks that the lengths of iterables are " "identical, raising a :exc:`ValueError` if they aren't:" msgstr "" -#: ../../library/functions.rst:1881 +#: ../../library/functions.rst:1882 msgid "" "Without the ``strict=True`` argument, any bug that results in iterables of " "different lengths will be silenced, possibly manifesting as a hard-to-find " "bug in another part of the program." msgstr "" -#: ../../library/functions.rst:1885 +#: ../../library/functions.rst:1886 msgid "" "Shorter iterables can be padded with a constant value to make all the " "iterables have the same length. This is done by :func:`itertools." "zip_longest`." msgstr "" -#: ../../library/functions.rst:1889 +#: ../../library/functions.rst:1890 msgid "" "Edge cases: With a single iterable argument, :func:`zip` returns an iterator " "of 1-tuples. With no arguments, it returns an empty iterator." msgstr "" -#: ../../library/functions.rst:1892 +#: ../../library/functions.rst:1893 msgid "Tips and tricks:" msgstr "" -#: ../../library/functions.rst:1894 +#: ../../library/functions.rst:1895 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 " @@ -2907,23 +2908,23 @@ msgid "" "iterator. This has the effect of dividing the input into n-length chunks." msgstr "" -#: ../../library/functions.rst:1900 +#: ../../library/functions.rst:1901 msgid "" ":func:`zip` in conjunction with the ``*`` operator can be used to unzip a " "list::" msgstr "" -#: ../../library/functions.rst:1911 +#: ../../library/functions.rst:1912 msgid "Added the ``strict`` argument." msgstr "增加了 ``strict`` 引數。" -#: ../../library/functions.rst:1923 +#: ../../library/functions.rst:1924 msgid "" "This is an advanced function that is not needed in everyday Python " "programming, unlike :func:`importlib.import_module`." msgstr "" -#: ../../library/functions.rst:1926 +#: ../../library/functions.rst:1927 msgid "" "This function is invoked by the :keyword:`import` statement. It can be " "replaced (by importing the :mod:`builtins` module and assigning to " @@ -2935,7 +2936,7 @@ msgid "" "discouraged in favor of :func:`importlib.import_module`." msgstr "" -#: ../../library/functions.rst:1935 +#: ../../library/functions.rst:1936 msgid "" "The function imports the module *name*, potentially using the given " "*globals* and *locals* to determine how to interpret the name in a package " @@ -2945,7 +2946,7 @@ msgid "" "determine the package context of the :keyword:`import` statement." msgstr "" -#: ../../library/functions.rst:1942 +#: ../../library/functions.rst:1943 msgid "" "*level* specifies whether to use absolute or relative imports. ``0`` (the " "default) means only perform absolute imports. Positive values for *level* " @@ -2954,7 +2955,7 @@ msgid "" "details)." msgstr "" -#: ../../library/functions.rst:1948 +#: ../../library/functions.rst:1949 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 " @@ -2962,58 +2963,58 @@ msgid "" "given, the module named by *name* is returned." msgstr "" -#: ../../library/functions.rst:1953 +#: ../../library/functions.rst:1954 msgid "" "For example, the statement ``import spam`` results in bytecode resembling " "the following code::" msgstr "" -#: ../../library/functions.rst:1958 +#: ../../library/functions.rst:1959 msgid "The statement ``import spam.ham`` results in this call::" msgstr "" -#: ../../library/functions.rst:1962 +#: ../../library/functions.rst:1963 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:1965 +#: ../../library/functions.rst:1966 msgid "" "On the other hand, the statement ``from spam.ham import eggs, sausage as " "saus`` results in ::" msgstr "" -#: ../../library/functions.rst:1972 +#: ../../library/functions.rst:1973 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:1976 +#: ../../library/functions.rst:1977 msgid "" "If you simply want to import a module (potentially within a package) by " "name, use :func:`importlib.import_module`." msgstr "" -#: ../../library/functions.rst:1979 +#: ../../library/functions.rst:1980 msgid "" "Negative values for *level* are no longer supported (which also changes the " "default value to 0)." msgstr "" -#: ../../library/functions.rst:1983 +#: ../../library/functions.rst:1984 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:1988 +#: ../../library/functions.rst:1989 msgid "Footnotes" msgstr "註解" -#: ../../library/functions.rst:1989 +#: ../../library/functions.rst:1990 msgid "" "Note that the parser only accepts the Unix-style end of line convention. If " "you are reading the code from a file, make sure to use newline conversion " diff --git a/library/glob.po b/library/glob.po index 4fe9893251..891873ccab 100644 --- a/library/glob.po +++ b/library/glob.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.10\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2021-10-26 16:47+0000\n" +"POT-Creation-Date: 2022-05-21 17:35+0000\n" "PO-Revision-Date: 2018-05-23 16:02+0000\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -33,23 +33,28 @@ msgid "" "in arbitrary order. No tilde expansion is done, but ``*``, ``?``, and " "character ranges expressed with ``[]`` will be correctly matched. This is " "done by using the :func:`os.scandir` and :func:`fnmatch.fnmatch` functions " -"in concert, and not by actually invoking a subshell. Note that unlike :func:" -"`fnmatch.fnmatch`, :mod:`glob` treats filenames beginning with a dot (``.``) " -"as special cases. (For tilde and shell variable expansion, use :func:`os." -"path.expanduser` and :func:`os.path.expandvars`.)" +"in concert, and not by actually invoking a subshell." msgstr "" -#: ../../library/glob.rst:31 +#: ../../library/glob.rst:28 +msgid "" +"Note that files beginning with a dot (``.``) can only be matched by patterns " +"that also start with a dot, unlike :func:`fnmatch.fnmatch` or :func:`pathlib." +"Path.glob`. (For tilde and shell variable expansion, use :func:`os.path." +"expanduser` and :func:`os.path.expandvars`.)" +msgstr "" + +#: ../../library/glob.rst:34 msgid "" "For a literal match, wrap the meta-characters in brackets. For example, " "``'[?]'`` matches the character ``'?'``." msgstr "" -#: ../../library/glob.rst:36 +#: ../../library/glob.rst:39 msgid "The :mod:`pathlib` module offers high-level path objects." msgstr "" -#: ../../library/glob.rst:41 +#: ../../library/glob.rst:44 msgid "" "Return a possibly-empty list of path names that match *pathname*, which must " "be a string containing a path specification. *pathname* can be either " @@ -61,7 +66,7 @@ msgid "" "path name for that file be included is unspecified." msgstr "" -#: ../../library/glob.rst:50 +#: ../../library/glob.rst:53 msgid "" "If *root_dir* is not ``None``, it should be a :term:`path-like object` " "specifying the root directory for searching. It has the same effect on :" @@ -69,13 +74,13 @@ msgid "" "*pathname* is relative, the result will contain paths relative to *root_dir*." msgstr "" -#: ../../library/glob.rst:56 +#: ../../library/glob.rst:59 msgid "" "This function can support :ref:`paths relative to directory descriptors " "` with the *dir_fd* parameter." msgstr "" -#: ../../library/glob.rst:62 +#: ../../library/glob.rst:65 msgid "" "If *recursive* is true, the pattern \"``**``\" will match any files and zero " "or more directories, subdirectories and symbolic links to directories. If " @@ -83,39 +88,39 @@ msgid "" "will not match." msgstr "" -#: ../../library/glob.rst:67 ../../library/glob.rst:86 +#: ../../library/glob.rst:70 ../../library/glob.rst:89 msgid "" "Raises an :ref:`auditing event ` ``glob.glob`` with arguments " "``pathname``, ``recursive``." msgstr "" -#: ../../library/glob.rst:68 ../../library/glob.rst:87 +#: ../../library/glob.rst:71 ../../library/glob.rst:90 msgid "" "Raises an :ref:`auditing event ` ``glob.glob/2`` with arguments " "``pathname``, ``recursive``, ``root_dir``, ``dir_fd``." msgstr "" -#: ../../library/glob.rst:71 +#: ../../library/glob.rst:74 msgid "" "Using the \"``**``\" pattern in large directory trees may consume an " "inordinate amount of time." msgstr "" -#: ../../library/glob.rst:74 ../../library/glob.rst:89 +#: ../../library/glob.rst:77 ../../library/glob.rst:92 msgid "Support for recursive globs using \"``**``\"." msgstr "" -#: ../../library/glob.rst:77 ../../library/glob.rst:92 +#: ../../library/glob.rst:80 ../../library/glob.rst:95 msgid "Added the *root_dir* and *dir_fd* parameters." msgstr "新增 *root_dir* 與 *dir_fd* 參數。" -#: ../../library/glob.rst:83 +#: ../../library/glob.rst:86 msgid "" "Return an :term:`iterator` which yields the same values as :func:`glob` " "without actually storing them all simultaneously." msgstr "" -#: ../../library/glob.rst:98 +#: ../../library/glob.rst:101 msgid "" "Escape all special characters (``'?'``, ``'*'`` and ``'['``). This is useful " "if you want to match an arbitrary literal string that may have special " @@ -124,7 +129,7 @@ msgid "" "c:/Quo vadis[?].txt'``." msgstr "" -#: ../../library/glob.rst:107 +#: ../../library/glob.rst:110 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 " @@ -133,17 +138,17 @@ msgid "" "preserved. ::" msgstr "" -#: ../../library/glob.rst:125 +#: ../../library/glob.rst:128 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:137 +#: ../../library/glob.rst:140 msgid "Module :mod:`fnmatch`" msgstr ":mod:`fnmatch` 模組" -#: ../../library/glob.rst:138 +#: ../../library/glob.rst:141 msgid "Shell-style filename (not path) expansion" msgstr "" diff --git a/library/imghdr.po b/library/imghdr.po index 281a5d7266..6a40c87a89 100644 --- a/library/imghdr.po +++ b/library/imghdr.po @@ -7,8 +7,8 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.10\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2022-03-23 00:14+0000\n" -"PO-Revision-Date: 2018-05-23 16:04+0000\n" +"POT-Creation-Date: 2022-05-21 17:35+0000\n" +"PO-Revision-Date: 2022-05-22 02:06+0800\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" "tw)\n" @@ -17,6 +17,7 @@ msgstr "" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" "Plural-Forms: nplurals=1; plural=0;\n" +"X-Generator: Poedit 3.0.1\n" #: ../../library/imghdr.rst:2 msgid ":mod:`imghdr` --- Determine the type of an image" @@ -27,172 +28,176 @@ msgid "**Source code:** :source:`Lib/imghdr.py`" msgstr "**原始碼:**\\ :source:`Lib/imghdr.py`" #: ../../library/imghdr.rst:10 -msgid "The :mod:`imghdr` module is deprecated (see :pep:`594` for details)." -msgstr ":mod:`imghdr` 模組 (module) 即將被棄用(詳見 :pep:`594`\\ )。" +msgid "" +"The :mod:`imghdr` module is deprecated (see :pep:`PEP 594 <594#imghdr>` for " +"details and alternatives)." +msgstr "" +":mod:`imghdr` 模組 (module) 即將被棄用(詳情與替代方案見 :pep:`PEP 594 " +"<594#imghdr>`\\ )。" -#: ../../library/imghdr.rst:15 +#: ../../library/imghdr.rst:16 msgid "" "The :mod:`imghdr` module determines the type of image contained in a file or " "byte stream." msgstr "" -#: ../../library/imghdr.rst:18 +#: ../../library/imghdr.rst:19 msgid "The :mod:`imghdr` module defines the following function:" msgstr "" -#: ../../library/imghdr.rst:23 +#: ../../library/imghdr.rst:24 msgid "" "Tests the image data contained in the file named by *file*, and returns a " "string describing the image type. If optional *h* is provided, the *file* " "argument is ignored and *h* is assumed to contain the byte stream to test." msgstr "" -#: ../../library/imghdr.rst:27 +#: ../../library/imghdr.rst:28 msgid "Accepts a :term:`path-like object`." msgstr "" -#: ../../library/imghdr.rst:30 +#: ../../library/imghdr.rst:31 msgid "" "The following image types are recognized, as listed below with the return " "value from :func:`what`:" msgstr "" -#: ../../library/imghdr.rst:34 +#: ../../library/imghdr.rst:35 msgid "Value" msgstr "" -#: ../../library/imghdr.rst:34 +#: ../../library/imghdr.rst:35 msgid "Image format" msgstr "" -#: ../../library/imghdr.rst:36 +#: ../../library/imghdr.rst:37 msgid "``'rgb'``" msgstr "``'rgb'``" -#: ../../library/imghdr.rst:36 +#: ../../library/imghdr.rst:37 msgid "SGI ImgLib Files" msgstr "" -#: ../../library/imghdr.rst:38 +#: ../../library/imghdr.rst:39 msgid "``'gif'``" msgstr "``'gif'``" -#: ../../library/imghdr.rst:38 +#: ../../library/imghdr.rst:39 msgid "GIF 87a and 89a Files" msgstr "" -#: ../../library/imghdr.rst:40 +#: ../../library/imghdr.rst:41 msgid "``'pbm'``" msgstr "``'pbm'``" -#: ../../library/imghdr.rst:40 +#: ../../library/imghdr.rst:41 msgid "Portable Bitmap Files" msgstr "" -#: ../../library/imghdr.rst:42 +#: ../../library/imghdr.rst:43 msgid "``'pgm'``" msgstr "``'pgm'``" -#: ../../library/imghdr.rst:42 +#: ../../library/imghdr.rst:43 msgid "Portable Graymap Files" msgstr "" -#: ../../library/imghdr.rst:44 +#: ../../library/imghdr.rst:45 msgid "``'ppm'``" msgstr "``'ppm'``" -#: ../../library/imghdr.rst:44 +#: ../../library/imghdr.rst:45 msgid "Portable Pixmap Files" msgstr "" -#: ../../library/imghdr.rst:46 +#: ../../library/imghdr.rst:47 msgid "``'tiff'``" msgstr "``'tiff'``" -#: ../../library/imghdr.rst:46 +#: ../../library/imghdr.rst:47 msgid "TIFF Files" msgstr "TIFF 檔案" -#: ../../library/imghdr.rst:48 +#: ../../library/imghdr.rst:49 msgid "``'rast'``" msgstr "``'rast'``" -#: ../../library/imghdr.rst:48 +#: ../../library/imghdr.rst:49 msgid "Sun Raster Files" msgstr "" -#: ../../library/imghdr.rst:50 +#: ../../library/imghdr.rst:51 msgid "``'xbm'``" msgstr "``'xbm'``" -#: ../../library/imghdr.rst:50 +#: ../../library/imghdr.rst:51 msgid "X Bitmap Files" msgstr "" -#: ../../library/imghdr.rst:52 +#: ../../library/imghdr.rst:53 msgid "``'jpeg'``" msgstr "``'jpeg'``" -#: ../../library/imghdr.rst:52 +#: ../../library/imghdr.rst:53 msgid "JPEG data in JFIF or Exif formats" msgstr "" -#: ../../library/imghdr.rst:54 +#: ../../library/imghdr.rst:55 msgid "``'bmp'``" msgstr "``'bmp'``" -#: ../../library/imghdr.rst:54 +#: ../../library/imghdr.rst:55 msgid "BMP files" msgstr "BMP 檔案" -#: ../../library/imghdr.rst:56 +#: ../../library/imghdr.rst:57 msgid "``'png'``" msgstr "``'png'``" -#: ../../library/imghdr.rst:56 +#: ../../library/imghdr.rst:57 msgid "Portable Network Graphics" msgstr "" -#: ../../library/imghdr.rst:58 +#: ../../library/imghdr.rst:59 msgid "``'webp'``" msgstr "``'webp'``" -#: ../../library/imghdr.rst:58 +#: ../../library/imghdr.rst:59 msgid "WebP files" msgstr "WebP 檔案" -#: ../../library/imghdr.rst:60 +#: ../../library/imghdr.rst:61 msgid "``'exr'``" msgstr "``'exr'``" -#: ../../library/imghdr.rst:60 +#: ../../library/imghdr.rst:61 msgid "OpenEXR Files" msgstr "OpenEXR 檔案" -#: ../../library/imghdr.rst:63 +#: ../../library/imghdr.rst:64 msgid "The *exr* and *webp* formats were added." msgstr "新增 *exr* 與 *webp* 格式。" -#: ../../library/imghdr.rst:67 +#: ../../library/imghdr.rst:68 msgid "" "You can extend the list of file types :mod:`imghdr` can recognize by " "appending to this variable:" msgstr "" -#: ../../library/imghdr.rst:73 +#: ../../library/imghdr.rst:74 msgid "" "A list of functions performing the individual tests. Each function takes " "two arguments: the byte-stream and an open file-like object. When :func:" "`what` is called with a byte-stream, the file-like object will be ``None``." msgstr "" -#: ../../library/imghdr.rst:77 +#: ../../library/imghdr.rst:78 msgid "" "The test function should return a string describing the image type if the " "test succeeded, or ``None`` if it failed." msgstr "" -#: ../../library/imghdr.rst:80 +#: ../../library/imghdr.rst:81 msgid "Example::" msgstr "" "範例:\n" diff --git a/library/importlib.po b/library/importlib.po index 2dd8e42d2b..1620412373 100644 --- a/library/importlib.po +++ b/library/importlib.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.10\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2021-11-01 00:09+0000\n" +"POT-Creation-Date: 2022-05-21 17:35+0000\n" "PO-Revision-Date: 2018-05-23 16:04+0000\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -390,16 +390,14 @@ msgid "" msgstr "" #: ../../library/importlib.rst:267 -msgid "" -"An abstract base class representing a :term:`meta path finder`. For " -"compatibility, this is a subclass of :class:`Finder`." +msgid "An abstract base class representing a :term:`meta path finder`." msgstr "" -#: ../../library/importlib.rst:272 ../../library/importlib.rst:327 +#: ../../library/importlib.rst:271 ../../library/importlib.rst:326 msgid "No longer a subclass of :class:`Finder`." msgstr "" -#: ../../library/importlib.rst:277 +#: ../../library/importlib.rst:276 msgid "" "An abstract method for finding a :term:`spec ` for the " "specified module. If this is a top-level import, *path* will be ``None``. " @@ -411,7 +409,7 @@ msgid "" "implementing concrete ``MetaPathFinders``." msgstr "" -#: ../../library/importlib.rst:291 +#: ../../library/importlib.rst:290 msgid "" "A legacy method for finding a :term:`loader` for the specified module. If " "this is a top-level import, *path* will be ``None``. Otherwise, this is a " @@ -420,36 +418,36 @@ msgid "" "returned." msgstr "" -#: ../../library/importlib.rst:297 +#: ../../library/importlib.rst:296 msgid "" "If :meth:`find_spec` is defined, backwards-compatible functionality is " "provided." msgstr "" -#: ../../library/importlib.rst:300 +#: ../../library/importlib.rst:299 msgid "" "Returns ``None`` when called instead of raising :exc:`NotImplementedError`. " "Can use :meth:`find_spec` to provide functionality." msgstr "" -#: ../../library/importlib.rst:305 ../../library/importlib.rst:361 -#: ../../library/importlib.rst:369 ../../library/importlib.rst:1189 -#: ../../library/importlib.rst:1246 +#: ../../library/importlib.rst:304 ../../library/importlib.rst:360 +#: ../../library/importlib.rst:368 ../../library/importlib.rst:1188 +#: ../../library/importlib.rst:1245 msgid "Use :meth:`find_spec` instead." msgstr "" -#: ../../library/importlib.rst:310 +#: ../../library/importlib.rst:309 msgid "" "An optional method which, when called, should invalidate any internal cache " "used by the finder. Used by :func:`importlib.invalidate_caches` when " "invalidating the caches of all finders on :data:`sys.meta_path`." msgstr "" -#: ../../library/importlib.rst:314 +#: ../../library/importlib.rst:313 msgid "Returns ``None`` when called instead of ``NotImplemented``." msgstr "" -#: ../../library/importlib.rst:320 +#: ../../library/importlib.rst:319 msgid "" "An abstract base class representing a :term:`path entry finder`. Though it " "bears some similarities to :class:`MetaPathFinder`, ``PathEntryFinder`` is " @@ -457,7 +455,7 @@ msgid "" "`importlib.machinery.PathFinder`." msgstr "" -#: ../../library/importlib.rst:332 +#: ../../library/importlib.rst:331 msgid "" "An abstract method for finding a :term:`spec ` for the " "specified module. The finder will search for the module only within the :" @@ -468,7 +466,7 @@ msgid "" "concrete ``PathEntryFinders``." msgstr "" -#: ../../library/importlib.rst:344 +#: ../../library/importlib.rst:343 msgid "" "A legacy method for finding a :term:`loader` for the specified module. " "Returns a 2-tuple of ``(loader, portion)`` where ``portion`` is a sequence " @@ -481,62 +479,62 @@ msgid "" "failure to find anything for the module)." msgstr "" -#: ../../library/importlib.rst:354 +#: ../../library/importlib.rst:353 msgid "" "If :meth:`find_spec` is defined then backwards-compatible functionality is " "provided." msgstr "" -#: ../../library/importlib.rst:357 +#: ../../library/importlib.rst:356 msgid "" "Returns ``(None, [])`` instead of raising :exc:`NotImplementedError`. Uses :" "meth:`find_spec` when available to provide functionality." msgstr "" -#: ../../library/importlib.rst:366 +#: ../../library/importlib.rst:365 msgid "" "A concrete implementation of :meth:`Finder.find_module` which is equivalent " "to ``self.find_loader(fullname)[0]``." msgstr "" -#: ../../library/importlib.rst:374 +#: ../../library/importlib.rst:373 msgid "" "An optional method which, when called, should invalidate any internal cache " "used by the finder. Used by :meth:`importlib.machinery.PathFinder." "invalidate_caches` when invalidating the caches of all cached finders." msgstr "" -#: ../../library/importlib.rst:382 +#: ../../library/importlib.rst:381 msgid "" "An abstract base class for a :term:`loader`. See :pep:`302` for the exact " "definition for a loader." msgstr "" -#: ../../library/importlib.rst:385 ../../library/importlib.rst:910 +#: ../../library/importlib.rst:384 ../../library/importlib.rst:909 msgid "" "Loaders that wish to support resource reading should implement a " "``get_resource_reader(fullname)`` method as specified by :class:`importlib." "abc.ResourceReader`." msgstr "" -#: ../../library/importlib.rst:389 +#: ../../library/importlib.rst:388 msgid "Introduced the optional ``get_resource_reader()`` method." msgstr "" -#: ../../library/importlib.rst:394 +#: ../../library/importlib.rst:393 msgid "" "A method that returns the module object to use when importing a module. " "This method may return ``None``, indicating that default module creation " "semantics should take place." msgstr "" -#: ../../library/importlib.rst:400 +#: ../../library/importlib.rst:399 msgid "" "Starting in Python 3.6, this method will not be optional when :meth:" "`exec_module` is defined." msgstr "" -#: ../../library/importlib.rst:406 +#: ../../library/importlib.rst:405 msgid "" "An abstract method that executes the module in its own namespace when a " "module is imported or reloaded. The module should already be initialized " @@ -544,17 +542,17 @@ msgid "" "abc.Loader.create_module` must be defined." msgstr "" -#: ../../library/importlib.rst:413 +#: ../../library/importlib.rst:412 msgid ":meth:`~importlib.abc.Loader.create_module` must also be defined." msgstr ":meth:`~importlib.abc.Loader.create_module` 也必須被定義。" -#: ../../library/importlib.rst:418 +#: ../../library/importlib.rst:417 msgid "" "A legacy method for loading a module. If the module cannot be loaded, :exc:" "`ImportError` is raised, otherwise the loaded module is returned." msgstr "" -#: ../../library/importlib.rst:422 +#: ../../library/importlib.rst:421 msgid "" "If the requested module already exists in :data:`sys.modules`, that module " "should be used and reloaded. Otherwise the loader should create a new module " @@ -565,54 +563,54 @@ msgid "" "left alone (see :func:`importlib.util.module_for_loader`)." msgstr "" -#: ../../library/importlib.rst:431 +#: ../../library/importlib.rst:430 msgid "" "The loader should set several attributes on the module. (Note that some of " "these attributes can change when a module is reloaded):" msgstr "" -#: ../../library/importlib.rst:436 +#: ../../library/importlib.rst:435 msgid ":attr:`__name__`" msgstr ":attr:`__name__`" -#: ../../library/importlib.rst:436 +#: ../../library/importlib.rst:435 msgid "The name of the module." msgstr "" -#: ../../library/importlib.rst:440 +#: ../../library/importlib.rst:439 msgid ":attr:`__file__`" msgstr ":attr:`__file__`" -#: ../../library/importlib.rst:439 +#: ../../library/importlib.rst:438 msgid "" "The path to where the module data is stored (not set for built-in modules)." msgstr "" -#: ../../library/importlib.rst:444 +#: ../../library/importlib.rst:443 msgid ":attr:`__cached__`" msgstr ":attr:`__cached__`" -#: ../../library/importlib.rst:443 +#: ../../library/importlib.rst:442 msgid "" "The path to where a compiled version of the module is/should be stored (not " "set when the attribute would be inappropriate)." msgstr "" -#: ../../library/importlib.rst:448 +#: ../../library/importlib.rst:447 msgid ":attr:`__path__`" msgstr ":attr:`__path__`" -#: ../../library/importlib.rst:447 +#: ../../library/importlib.rst:446 msgid "" "A list of strings specifying the search path within a package. This " "attribute is not set on modules." msgstr "" -#: ../../library/importlib.rst:455 +#: ../../library/importlib.rst:454 msgid ":attr:`__package__`" msgstr ":attr:`__package__`" -#: ../../library/importlib.rst:451 +#: ../../library/importlib.rst:450 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 " @@ -620,29 +618,29 @@ msgid "" "decorator can handle the details for :attr:`__package__`." msgstr "" -#: ../../library/importlib.rst:460 +#: ../../library/importlib.rst:459 msgid ":attr:`__loader__`" msgstr ":attr:`__loader__`" -#: ../../library/importlib.rst:458 +#: ../../library/importlib.rst:457 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:462 +#: ../../library/importlib.rst:461 msgid "" "When :meth:`exec_module` is available then backwards-compatible " "functionality is provided." msgstr "" -#: ../../library/importlib.rst:465 +#: ../../library/importlib.rst:464 msgid "" "Raise :exc:`ImportError` when called instead of :exc:`NotImplementedError`. " "Functionality provided when :meth:`exec_module` is available." msgstr "" -#: ../../library/importlib.rst:470 +#: ../../library/importlib.rst:469 msgid "" "The recommended API for loading a module is :meth:`exec_module` (and :meth:" "`create_module`). Loaders should implement it instead of load_module(). " @@ -650,31 +648,31 @@ msgid "" "load_module() when exec_module() is implemented." msgstr "" -#: ../../library/importlib.rst:479 +#: ../../library/importlib.rst:478 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:485 +#: ../../library/importlib.rst:484 msgid "Made optional instead of an abstractmethod." msgstr "" -#: ../../library/importlib.rst:488 +#: ../../library/importlib.rst:487 msgid "The import machinery now takes care of this automatically." msgstr "" -#: ../../library/importlib.rst:494 +#: ../../library/importlib.rst:493 msgid "*Superseded by TraversableResources*" msgstr "" -#: ../../library/importlib.rst:496 +#: ../../library/importlib.rst:495 msgid "" "An :term:`abstract base class` to provide the ability to read *resources*." msgstr "" -#: ../../library/importlib.rst:499 +#: ../../library/importlib.rst:498 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 " @@ -684,7 +682,7 @@ msgid "" "file versus on the file system." msgstr "" -#: ../../library/importlib.rst:507 +#: ../../library/importlib.rst:506 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 " @@ -696,7 +694,7 @@ msgid "" "potentially representing multiple packages or a module)." msgstr "" -#: ../../library/importlib.rst:518 +#: ../../library/importlib.rst:517 msgid "" "Loaders that wish to support resource reading are expected to provide a " "method called ``get_resource_reader(fullname)`` which returns an object " @@ -705,33 +703,33 @@ msgid "" "with this ABC should only be returned when the specified module is a package." msgstr "" -#: ../../library/importlib.rst:529 +#: ../../library/importlib.rst:528 msgid "" "Returns an opened, :term:`file-like object` for binary reading of the " "*resource*." msgstr "" -#: ../../library/importlib.rst:532 +#: ../../library/importlib.rst:531 msgid "If the resource cannot be found, :exc:`FileNotFoundError` is raised." msgstr "" -#: ../../library/importlib.rst:537 +#: ../../library/importlib.rst:536 msgid "Returns the file system path to the *resource*." msgstr "" -#: ../../library/importlib.rst:539 +#: ../../library/importlib.rst:538 msgid "" "If the resource does not concretely exist on the file system, raise :exc:" "`FileNotFoundError`." msgstr "" -#: ../../library/importlib.rst:544 +#: ../../library/importlib.rst:543 msgid "" "Returns ``True`` if the named *name* is considered a resource. :exc:" "`FileNotFoundError` is raised if *name* does not exist." msgstr "" -#: ../../library/importlib.rst:549 +#: ../../library/importlib.rst:548 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 " @@ -739,7 +737,7 @@ msgid "" "`is_resource` would be false." msgstr "" -#: ../../library/importlib.rst:555 +#: ../../library/importlib.rst:554 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-" @@ -748,23 +746,23 @@ msgid "" "stored on the file system then those subdirectory names can be used directly." msgstr "" -#: ../../library/importlib.rst:563 +#: ../../library/importlib.rst:562 msgid "The abstract method returns an iterable of no items." msgstr "" -#: ../../library/importlib.rst:568 +#: ../../library/importlib.rst:567 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:572 +#: ../../library/importlib.rst:571 msgid "" "This ABC is deprecated in favour of supporting resource loading through :" "class:`importlib.abc.ResourceReader`." msgstr "" -#: ../../library/importlib.rst:578 +#: ../../library/importlib.rst:577 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 " @@ -774,34 +772,34 @@ msgid "" "attribute or an item from a package's :attr:`__path__`." msgstr "" -#: ../../library/importlib.rst:586 +#: ../../library/importlib.rst:585 msgid "Raises :exc:`OSError` instead of :exc:`NotImplementedError`." msgstr "" -#: ../../library/importlib.rst:592 +#: ../../library/importlib.rst:591 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:597 +#: ../../library/importlib.rst:596 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:603 +#: ../../library/importlib.rst:602 msgid "" "While the method has a default implementation, it is suggested that it be " "overridden if possible for performance." msgstr "" -#: ../../library/importlib.rst:609 +#: ../../library/importlib.rst:608 msgid "No longer abstract and a concrete implementation is provided." msgstr "" -#: ../../library/importlib.rst:614 +#: ../../library/importlib.rst:613 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 " @@ -810,23 +808,23 @@ msgid "" "cannot find the module specified." msgstr "" -#: ../../library/importlib.rst:620 ../../library/importlib.rst:629 -#: ../../library/importlib.rst:679 +#: ../../library/importlib.rst:619 ../../library/importlib.rst:628 +#: ../../library/importlib.rst:678 msgid "Raises :exc:`ImportError` instead of :exc:`NotImplementedError`." msgstr "" -#: ../../library/importlib.rst:625 +#: ../../library/importlib.rst:624 msgid "" "An optional 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:634 +#: ../../library/importlib.rst:633 msgid "Create a code object from Python source." msgstr "" -#: ../../library/importlib.rst:636 +#: ../../library/importlib.rst:635 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 " @@ -834,106 +832,106 @@ msgid "" "in a zip file)." msgstr "" -#: ../../library/importlib.rst:641 +#: ../../library/importlib.rst:640 msgid "" "With the subsequent code object one can execute it in a module by running " "``exec(code, module.__dict__)``." msgstr "" -#: ../../library/importlib.rst:646 +#: ../../library/importlib.rst:645 msgid "Made the method static." msgstr "" -#: ../../library/importlib.rst:651 +#: ../../library/importlib.rst:650 msgid "Implementation of :meth:`Loader.exec_module`." msgstr "" -#: ../../library/importlib.rst:657 +#: ../../library/importlib.rst:656 msgid "Implementation of :meth:`Loader.load_module`." msgstr "" -#: ../../library/importlib.rst:659 +#: ../../library/importlib.rst:658 msgid "use :meth:`exec_module` instead." msgstr "" -#: ../../library/importlib.rst:665 +#: ../../library/importlib.rst:664 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:671 +#: ../../library/importlib.rst:670 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:675 +#: ../../library/importlib.rst:674 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:685 +#: ../../library/importlib.rst:684 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:689 +#: ../../library/importlib.rst:688 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:696 +#: ../../library/importlib.rst:695 msgid "The name of the module the loader can handle." msgstr "" -#: ../../library/importlib.rst:700 +#: ../../library/importlib.rst:699 msgid "Path to the file of the module." msgstr "" -#: ../../library/importlib.rst:704 +#: ../../library/importlib.rst:703 msgid "Calls super's ``load_module()``." msgstr "" -#: ../../library/importlib.rst:706 +#: ../../library/importlib.rst:705 msgid "Use :meth:`Loader.exec_module` instead." msgstr "" -#: ../../library/importlib.rst:711 ../../library/importlib.rst:1391 +#: ../../library/importlib.rst:710 ../../library/importlib.rst:1390 msgid "Returns :attr:`path`." msgstr "" -#: ../../library/importlib.rst:715 +#: ../../library/importlib.rst:714 msgid "Reads *path* as a binary file and returns the bytes from it." msgstr "" -#: ../../library/importlib.rst:720 +#: ../../library/importlib.rst:719 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:724 +#: ../../library/importlib.rst:723 msgid ":meth:`ResourceLoader.get_data`" msgstr ":meth:`ResourceLoader.get_data`" -#: ../../library/importlib.rst:727 +#: ../../library/importlib.rst:726 msgid ":meth:`ExecutionLoader.get_filename`" msgstr ":meth:`ExecutionLoader.get_filename`" -#: ../../library/importlib.rst:726 +#: ../../library/importlib.rst:725 msgid "" "Should only return the path to the source file; sourceless loading is not " "supported." msgstr "" -#: ../../library/importlib.rst:729 +#: ../../library/importlib.rst:728 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 :" @@ -945,83 +943,83 @@ msgid "" "bytecode-specific API is exposed." msgstr "" -#: ../../library/importlib.rst:740 +#: ../../library/importlib.rst:739 msgid "" "Optional abstract method which returns a :class:`dict` containing metadata " "about the specified path. Supported dictionary keys are:" msgstr "" -#: ../../library/importlib.rst:743 +#: ../../library/importlib.rst:742 msgid "" "``'mtime'`` (mandatory): an integer or floating-point number representing " "the modification time of the source code;" msgstr "" -#: ../../library/importlib.rst:745 +#: ../../library/importlib.rst:744 msgid "``'size'`` (optional): the size in bytes of the source code." msgstr "" -#: ../../library/importlib.rst:747 +#: ../../library/importlib.rst:746 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:752 ../../library/importlib.rst:765 +#: ../../library/importlib.rst:751 ../../library/importlib.rst:764 msgid "Raise :exc:`OSError` instead of :exc:`NotImplementedError`." msgstr "" -#: ../../library/importlib.rst:757 +#: ../../library/importlib.rst:756 msgid "" "Optional abstract method which returns the modification time for the " "specified path." msgstr "" -#: ../../library/importlib.rst:760 +#: ../../library/importlib.rst:759 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:770 +#: ../../library/importlib.rst:769 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:774 +#: ../../library/importlib.rst:773 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:778 +#: ../../library/importlib.rst:777 msgid "No longer raises :exc:`NotImplementedError` when called." msgstr "" -#: ../../library/importlib.rst:783 +#: ../../library/importlib.rst:782 msgid "Concrete implementation of :meth:`InspectLoader.get_code`." msgstr "" -#: ../../library/importlib.rst:787 +#: ../../library/importlib.rst:786 msgid "Concrete implementation of :meth:`Loader.exec_module`." msgstr "" -#: ../../library/importlib.rst:793 +#: ../../library/importlib.rst:792 msgid "Concrete implementation of :meth:`Loader.load_module`." msgstr "" -#: ../../library/importlib.rst:795 +#: ../../library/importlib.rst:794 msgid "Use :meth:`exec_module` instead." msgstr "" -#: ../../library/importlib.rst:800 +#: ../../library/importlib.rst:799 msgid "Concrete implementation of :meth:`InspectLoader.get_source`." msgstr "" -#: ../../library/importlib.rst:804 +#: ../../library/importlib.rst:803 msgid "" "Concrete implementation of :meth:`InspectLoader.is_package`. A module is " "determined to be a package if its file path (as provided by :meth:" @@ -1030,53 +1028,53 @@ msgid "" "``__init__``." msgstr "" -#: ../../library/importlib.rst:813 +#: ../../library/importlib.rst:812 msgid "" "An object with a subset of pathlib.Path methods suitable for traversing " "directories and opening files." msgstr "" -#: ../../library/importlib.rst:820 +#: ../../library/importlib.rst:819 msgid "The base name of this object without any parent references." msgstr "" -#: ../../library/importlib.rst:824 +#: ../../library/importlib.rst:823 msgid "Yield Traversable objects in self." msgstr "" -#: ../../library/importlib.rst:828 +#: ../../library/importlib.rst:827 msgid "Return True if self is a directory." msgstr "" -#: ../../library/importlib.rst:832 +#: ../../library/importlib.rst:831 msgid "Return True if self is a file." msgstr "" -#: ../../library/importlib.rst:836 ../../library/importlib.rst:840 +#: ../../library/importlib.rst:835 ../../library/importlib.rst:839 msgid "Return Traversable child in self." msgstr "" -#: ../../library/importlib.rst:844 +#: ../../library/importlib.rst:843 msgid "" "*mode* may be 'r' or 'rb' to open as text or binary. Return a handle " "suitable for reading (same as :attr:`pathlib.Path.open`)." msgstr "" -#: ../../library/importlib.rst:847 +#: ../../library/importlib.rst:846 msgid "" "When opening as text, accepts encoding parameters such as those accepted by :" "attr:`io.TextIOWrapper`." msgstr "" -#: ../../library/importlib.rst:852 +#: ../../library/importlib.rst:851 msgid "Read contents of self as bytes." msgstr "" -#: ../../library/importlib.rst:856 +#: ../../library/importlib.rst:855 msgid "Read contents of self as text." msgstr "" -#: ../../library/importlib.rst:861 +#: ../../library/importlib.rst:860 msgid "" "An abstract base class for resource readers capable of serving the ``files`` " "interface. Subclasses ResourceReader and provides concrete implementations " @@ -1084,21 +1082,21 @@ msgid "" "TraversableReader also supplies ResourceReader." msgstr "" -#: ../../library/importlib.rst:867 +#: ../../library/importlib.rst:866 msgid "" "Loaders that wish to support resource reading are expected to implement this " "interface." msgstr "" -#: ../../library/importlib.rst:874 +#: ../../library/importlib.rst:873 msgid ":mod:`importlib.resources` -- Resources" msgstr "" -#: ../../library/importlib.rst:879 +#: ../../library/importlib.rst:878 msgid "**Source code:** :source:`Lib/importlib/resources.py`" msgstr "**原始碼:**\\ :source:`Lib/importlib/resources.py`" -#: ../../library/importlib.rst:885 +#: ../../library/importlib.rst:884 msgid "" "This module leverages Python's import system to provide access to " "*resources* within *packages*. If you can import a package, you can access " @@ -1106,7 +1104,7 @@ msgid "" "binary or text mode." msgstr "" -#: ../../library/importlib.rst:890 +#: ../../library/importlib.rst:889 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 " @@ -1114,7 +1112,7 @@ msgid "" "file system." msgstr "" -#: ../../library/importlib.rst:896 +#: ../../library/importlib.rst:895 msgid "" "This module provides functionality similar to `pkg_resources `_ `Basic Resource " @@ -1124,7 +1122,7 @@ msgid "" "consistent semantics." msgstr "" -#: ../../library/importlib.rst:904 +#: ../../library/importlib.rst:903 msgid "" "The standalone backport of this module provides more information on `using " "importlib.resources `_." msgstr "" -#: ../../library/importlib.rst:914 +#: ../../library/importlib.rst:913 msgid "The following types are defined." msgstr "" -#: ../../library/importlib.rst:918 +#: ../../library/importlib.rst:917 msgid "" "The ``Package`` type is defined as ``Union[str, ModuleType]``. This means " "that where the function describes accepting a ``Package``, you can pass in " @@ -1144,17 +1142,17 @@ msgid "" "``__spec__.submodule_search_locations`` that is not ``None``." msgstr "" -#: ../../library/importlib.rst:925 +#: ../../library/importlib.rst:924 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:929 +#: ../../library/importlib.rst:928 msgid "The following functions are available." msgstr "" -#: ../../library/importlib.rst:934 +#: ../../library/importlib.rst:933 msgid "" "Returns an :class:`importlib.resources.abc.Traversable` object representing " "the resource container for the package (think directory) and its resources " @@ -1162,13 +1160,13 @@ msgid "" "subdirectories)." msgstr "" -#: ../../library/importlib.rst:939 ../../library/importlib.rst:1040 +#: ../../library/importlib.rst:938 ../../library/importlib.rst:1039 msgid "" "*package* is either a name or a module object which conforms to the " "``Package`` requirements." msgstr "" -#: ../../library/importlib.rst:946 +#: ../../library/importlib.rst:945 msgid "" "Given a :class:`importlib.resources.abc.Traversable` object representing a " "file, typically from :func:`importlib.resources.files`, return a context " @@ -1176,23 +1174,23 @@ msgid "" "a :class:`pathlib.Path` object." msgstr "" -#: ../../library/importlib.rst:951 +#: ../../library/importlib.rst:950 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:954 +#: ../../library/importlib.rst:953 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:962 +#: ../../library/importlib.rst:961 msgid "Open for binary reading the *resource* within *package*." msgstr "" -#: ../../library/importlib.rst:964 +#: ../../library/importlib.rst:963 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 " @@ -1201,13 +1199,13 @@ msgid "" "BinaryIO`` instance, a binary I/O stream open for reading." msgstr "" -#: ../../library/importlib.rst:973 +#: ../../library/importlib.rst:972 msgid "" "Open for text reading the *resource* within *package*. By default, the " "resource is opened for reading as UTF-8." msgstr "" -#: ../../library/importlib.rst:976 +#: ../../library/importlib.rst:975 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 " @@ -1216,18 +1214,18 @@ msgid "" "same meaning as with built-in :func:`open`." msgstr "" -#: ../../library/importlib.rst:982 +#: ../../library/importlib.rst:981 msgid "" "This function returns a ``typing.TextIO`` instance, a text I/O stream open " "for reading." msgstr "" -#: ../../library/importlib.rst:988 +#: ../../library/importlib.rst:987 msgid "" "Read and return the contents of the *resource* within *package* as ``bytes``." msgstr "" -#: ../../library/importlib.rst:991 +#: ../../library/importlib.rst:990 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 " @@ -1236,13 +1234,13 @@ msgid "" "contents of the resource as :class:`bytes`." msgstr "" -#: ../../library/importlib.rst:1000 +#: ../../library/importlib.rst:999 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:1003 +#: ../../library/importlib.rst:1002 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 " @@ -1252,20 +1250,20 @@ msgid "" "contents of the resource as :class:`str`." msgstr "" -#: ../../library/importlib.rst:1013 +#: ../../library/importlib.rst:1012 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:1017 +#: ../../library/importlib.rst:1016 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:1020 +#: ../../library/importlib.rst:1019 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 " @@ -1273,7 +1271,7 @@ msgid "" "resources (i.e. it cannot be a directory)." msgstr "" -#: ../../library/importlib.rst:1028 +#: ../../library/importlib.rst:1027 msgid "" "Return ``True`` if there is a resource named *name* in the package, " "otherwise ``False``. Remember that directories are *not* resources! " @@ -1281,66 +1279,66 @@ msgid "" "``Package`` requirements." msgstr "" -#: ../../library/importlib.rst:1036 +#: ../../library/importlib.rst:1035 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:1045 +#: ../../library/importlib.rst:1044 msgid ":mod:`importlib.machinery` -- Importers and path hooks" msgstr "" -#: ../../library/importlib.rst:1050 +#: ../../library/importlib.rst:1049 msgid "**Source code:** :source:`Lib/importlib/machinery.py`" msgstr "**原始碼:**\\ :source:`Lib/importlib/machinery.py`" -#: ../../library/importlib.rst:1054 +#: ../../library/importlib.rst:1053 msgid "" "This module contains the various objects that help :keyword:`import` find " "and load modules." msgstr "" -#: ../../library/importlib.rst:1059 +#: ../../library/importlib.rst:1058 msgid "" "A list of strings representing the recognized file suffixes for source " "modules." msgstr "" -#: ../../library/importlib.rst:1066 +#: ../../library/importlib.rst:1065 msgid "" "A list of strings representing the file suffixes for non-optimized bytecode " "modules." msgstr "" -#: ../../library/importlib.rst:1071 ../../library/importlib.rst:1081 +#: ../../library/importlib.rst:1070 ../../library/importlib.rst:1080 msgid "Use :attr:`BYTECODE_SUFFIXES` instead." msgstr "" -#: ../../library/importlib.rst:1076 +#: ../../library/importlib.rst:1075 msgid "" "A list of strings representing the file suffixes for optimized bytecode " "modules." msgstr "" -#: ../../library/importlib.rst:1086 +#: ../../library/importlib.rst:1085 msgid "" "A list of strings representing the recognized file suffixes for bytecode " "modules (including the leading dot)." msgstr "" -#: ../../library/importlib.rst:1091 +#: ../../library/importlib.rst:1090 msgid "The value is no longer dependent on ``__debug__``." msgstr "" -#: ../../library/importlib.rst:1096 +#: ../../library/importlib.rst:1095 msgid "" "A list of strings representing the recognized file suffixes for extension " "modules." msgstr "" -#: ../../library/importlib.rst:1103 +#: ../../library/importlib.rst:1102 msgid "" "Returns a combined list of strings representing all file suffixes for " "modules recognized by the standard import machinery. This is a helper for " @@ -1349,57 +1347,57 @@ msgid "" "`inspect.getmodulename`)." msgstr "" -#: ../../library/importlib.rst:1114 +#: ../../library/importlib.rst:1113 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:1119 ../../library/importlib.rst:1133 -#: ../../library/importlib.rst:1146 ../../library/importlib.rst:1161 +#: ../../library/importlib.rst:1118 ../../library/importlib.rst:1132 +#: ../../library/importlib.rst:1145 ../../library/importlib.rst:1160 msgid "" "Only class methods are defined by this class to alleviate the need for " "instantiation." msgstr "" -#: ../../library/importlib.rst:1122 +#: ../../library/importlib.rst:1121 msgid "" "As part of :pep:`489`, the builtin importer now implements :meth:`Loader." "create_module` and :meth:`Loader.exec_module`" msgstr "" -#: ../../library/importlib.rst:1129 +#: ../../library/importlib.rst:1128 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:1136 +#: ../../library/importlib.rst:1135 msgid "" "Gained :meth:`~Loader.create_module` and :meth:`~Loader.exec_module` methods." msgstr "" -#: ../../library/importlib.rst:1143 +#: ../../library/importlib.rst:1142 msgid "" ":term:`Finder ` for modules declared in the Windows registry. This " "class implements the :class:`importlib.abc.MetaPathFinder` ABC." msgstr "" -#: ../../library/importlib.rst:1151 +#: ../../library/importlib.rst:1150 msgid "" "Use :mod:`site` configuration instead. Future versions of Python may not " "enable this finder by default." msgstr "" -#: ../../library/importlib.rst:1158 +#: ../../library/importlib.rst:1157 msgid "" "A :term:`Finder ` for :data:`sys.path` and package ``__path__`` " "attributes. This class implements the :class:`importlib.abc.MetaPathFinder` " "ABC." msgstr "" -#: ../../library/importlib.rst:1166 +#: ../../library/importlib.rst:1165 msgid "" "Class method that attempts to find a :term:`spec ` for the " "module specified by *fullname* on :data:`sys.path` or, if defined, on " @@ -1413,47 +1411,47 @@ msgid "" "cache and returned." msgstr "" -#: ../../library/importlib.rst:1180 +#: ../../library/importlib.rst:1179 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:1187 +#: ../../library/importlib.rst:1186 msgid "A legacy wrapper around :meth:`find_spec`." msgstr "" -#: ../../library/importlib.rst:1194 +#: ../../library/importlib.rst:1193 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:1199 +#: ../../library/importlib.rst:1198 msgid "Entries of ``None`` in :data:`sys.path_importer_cache` are deleted." msgstr "" -#: ../../library/importlib.rst:1202 +#: ../../library/importlib.rst:1201 msgid "" "Calls objects in :data:`sys.path_hooks` with the current working directory " "for ``''`` (i.e. the empty string)." msgstr "" -#: ../../library/importlib.rst:1209 +#: ../../library/importlib.rst:1208 msgid "" "A concrete implementation of :class:`importlib.abc.PathEntryFinder` which " "caches results from the file system." msgstr "" -#: ../../library/importlib.rst:1212 +#: ../../library/importlib.rst:1211 msgid "" "The *path* argument is the directory for which the finder is in charge of " "searching." msgstr "" -#: ../../library/importlib.rst:1215 +#: ../../library/importlib.rst:1214 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. " @@ -1461,7 +1459,7 @@ msgid "" "module's name and the path to the file found." msgstr "" -#: ../../library/importlib.rst:1220 +#: ../../library/importlib.rst:1219 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 " @@ -1474,152 +1472,152 @@ msgid "" "to call :func:`importlib.invalidate_caches`." msgstr "" -#: ../../library/importlib.rst:1234 +#: ../../library/importlib.rst:1233 msgid "The path the finder will search in." msgstr "" -#: ../../library/importlib.rst:1238 +#: ../../library/importlib.rst:1237 msgid "Attempt to find the spec to handle *fullname* within :attr:`path`." msgstr "" -#: ../../library/importlib.rst:1244 +#: ../../library/importlib.rst:1243 msgid "Attempt to find the loader to handle *fullname* within :attr:`path`." msgstr "" -#: ../../library/importlib.rst:1251 +#: ../../library/importlib.rst:1250 msgid "Clear out the internal cache." msgstr "" -#: ../../library/importlib.rst:1255 +#: ../../library/importlib.rst:1254 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:1260 +#: ../../library/importlib.rst:1259 msgid "" "If the argument to the closure is not an existing directory, :exc:" "`ImportError` is raised." msgstr "" -#: ../../library/importlib.rst:1266 +#: ../../library/importlib.rst:1265 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:1274 +#: ../../library/importlib.rst:1273 msgid "The name of the module that this loader will handle." msgstr "" -#: ../../library/importlib.rst:1278 +#: ../../library/importlib.rst:1277 msgid "The path to the source file." msgstr "" -#: ../../library/importlib.rst:1282 +#: ../../library/importlib.rst:1281 msgid "Return ``True`` if :attr:`path` appears to be for a package." msgstr "" -#: ../../library/importlib.rst:1286 +#: ../../library/importlib.rst:1285 msgid "" "Concrete implementation of :meth:`importlib.abc.SourceLoader.path_stats`." msgstr "" -#: ../../library/importlib.rst:1290 +#: ../../library/importlib.rst:1289 msgid "Concrete implementation of :meth:`importlib.abc.SourceLoader.set_data`." msgstr "" -#: ../../library/importlib.rst:1294 ../../library/importlib.rst:1337 +#: ../../library/importlib.rst:1293 ../../library/importlib.rst:1336 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:1299 ../../library/importlib.rst:1342 +#: ../../library/importlib.rst:1298 ../../library/importlib.rst:1341 msgid "Use :meth:`importlib.abc.Loader.exec_module` instead." msgstr "" -#: ../../library/importlib.rst:1304 +#: ../../library/importlib.rst:1303 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:1307 +#: ../../library/importlib.rst:1306 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:1316 +#: ../../library/importlib.rst:1315 msgid "The name of the module the loader will handle." msgstr "" -#: ../../library/importlib.rst:1320 +#: ../../library/importlib.rst:1319 msgid "The path to the bytecode file." msgstr "" -#: ../../library/importlib.rst:1324 +#: ../../library/importlib.rst:1323 msgid "Determines if the module is a package based on :attr:`path`." msgstr "" -#: ../../library/importlib.rst:1328 +#: ../../library/importlib.rst:1327 msgid "Returns the code object for :attr:`name` created from :attr:`path`." msgstr "" -#: ../../library/importlib.rst:1332 +#: ../../library/importlib.rst:1331 msgid "" "Returns ``None`` as bytecode files have no source when this loader is used." msgstr "" -#: ../../library/importlib.rst:1347 +#: ../../library/importlib.rst:1346 msgid "" "A concrete implementation of :class:`importlib.abc.ExecutionLoader` for " "extension modules." msgstr "" -#: ../../library/importlib.rst:1350 +#: ../../library/importlib.rst:1349 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:1357 +#: ../../library/importlib.rst:1356 msgid "Name of the module the loader supports." msgstr "" -#: ../../library/importlib.rst:1361 +#: ../../library/importlib.rst:1360 msgid "Path to the extension module." msgstr "" -#: ../../library/importlib.rst:1365 +#: ../../library/importlib.rst:1364 msgid "" "Creates the module object from the given specification in accordance with :" "pep:`489`." msgstr "" -#: ../../library/importlib.rst:1372 +#: ../../library/importlib.rst:1371 msgid "Initializes the given module object in accordance with :pep:`489`." msgstr "" -#: ../../library/importlib.rst:1378 +#: ../../library/importlib.rst:1377 msgid "" "Returns ``True`` if the file path points to a package's ``__init__`` module " "based on :attr:`EXTENSION_SUFFIXES`." msgstr "" -#: ../../library/importlib.rst:1383 +#: ../../library/importlib.rst:1382 msgid "Returns ``None`` as extension modules lack a code object." msgstr "" -#: ../../library/importlib.rst:1387 +#: ../../library/importlib.rst:1386 msgid "Returns ``None`` as extension modules do not have source code." msgstr "" -#: ../../library/importlib.rst:1398 +#: ../../library/importlib.rst:1397 msgid "" "A specification for a module's import-system-related state. This is " "typically exposed as the module's ``__spec__`` attribute. In the " @@ -1632,29 +1630,29 @@ msgid "" "``__spec__.submodule_search_locations``." msgstr "" -#: ../../library/importlib.rst:1412 +#: ../../library/importlib.rst:1411 msgid "(``__name__``)" msgstr "(``__name__``)" -#: ../../library/importlib.rst:1414 +#: ../../library/importlib.rst:1413 msgid "A string for the fully-qualified name of the module." msgstr "" -#: ../../library/importlib.rst:1418 +#: ../../library/importlib.rst:1417 msgid "(``__loader__``)" msgstr "(``__loader__``)" -#: ../../library/importlib.rst:1420 +#: ../../library/importlib.rst:1419 msgid "" "The :term:`Loader ` that should be used when loading the module. :" "term:`Finders ` should always set this." msgstr "" -#: ../../library/importlib.rst:1425 +#: ../../library/importlib.rst:1424 msgid "(``__file__``)" msgstr "(``__file__``)" -#: ../../library/importlib.rst:1427 +#: ../../library/importlib.rst:1426 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 " @@ -1662,67 +1660,67 @@ msgid "" "indicates it is unspecified (e.g. for namespace packages)." msgstr "" -#: ../../library/importlib.rst:1434 +#: ../../library/importlib.rst:1433 msgid "(``__path__``)" msgstr "(``__path__``)" -#: ../../library/importlib.rst:1436 +#: ../../library/importlib.rst:1435 msgid "" "List of strings for where to find submodules, if a package (``None`` " "otherwise)." msgstr "" -#: ../../library/importlib.rst:1441 +#: ../../library/importlib.rst:1440 msgid "" "Container of extra module-specific data for use during loading (or ``None``)." msgstr "" -#: ../../library/importlib.rst:1446 +#: ../../library/importlib.rst:1445 msgid "(``__cached__``)" msgstr "(``__cached__``)" -#: ../../library/importlib.rst:1448 +#: ../../library/importlib.rst:1447 msgid "String for where the compiled module should be stored (or ``None``)." msgstr "" -#: ../../library/importlib.rst:1452 +#: ../../library/importlib.rst:1451 msgid "(``__package__``)" msgstr "(``__package__``)" -#: ../../library/importlib.rst:1454 +#: ../../library/importlib.rst:1453 msgid "" "(Read-only) The fully-qualified name of the package under which the module " "should be loaded as a submodule (or the empty string for top-level modules). " "For packages, it is the same as :attr:`__name__`." msgstr "" -#: ../../library/importlib.rst:1460 +#: ../../library/importlib.rst:1459 msgid "" "Boolean indicating whether or not the module's \"origin\" attribute refers " "to a loadable location." msgstr "" -#: ../../library/importlib.rst:1464 +#: ../../library/importlib.rst:1463 msgid ":mod:`importlib.util` -- Utility code for importers" msgstr "" -#: ../../library/importlib.rst:1470 +#: ../../library/importlib.rst:1469 msgid "**Source code:** :source:`Lib/importlib/util.py`" msgstr "**原始碼:**\\ :source:`Lib/importlib/util.py`" -#: ../../library/importlib.rst:1474 +#: ../../library/importlib.rst:1473 msgid "" "This module contains the various objects that help in the construction of " "an :term:`importer`." msgstr "" -#: ../../library/importlib.rst:1479 +#: ../../library/importlib.rst:1478 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:1486 +#: ../../library/importlib.rst:1485 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 " @@ -1732,7 +1730,7 @@ msgid "" "`NotImplementedError` will be raised)." msgstr "" -#: ../../library/importlib.rst:1493 +#: ../../library/importlib.rst:1492 msgid "" "The *optimization* parameter is used to specify the optimization level of " "the bytecode file. An empty string represents no optimization, so ``/foo/bar/" @@ -1745,7 +1743,7 @@ msgid "" "be alphanumeric, else :exc:`ValueError` is raised." msgstr "" -#: ../../library/importlib.rst:1503 +#: ../../library/importlib.rst:1502 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 " @@ -1754,18 +1752,18 @@ msgid "" "are not ``None`` then :exc:`TypeError` is raised." msgstr "" -#: ../../library/importlib.rst:1511 +#: ../../library/importlib.rst:1510 msgid "" "The *optimization* parameter was added and the *debug_override* parameter " "was deprecated." msgstr "" -#: ../../library/importlib.rst:1515 ../../library/importlib.rst:1531 -#: ../../library/importlib.rst:1680 +#: ../../library/importlib.rst:1514 ../../library/importlib.rst:1530 +#: ../../library/importlib.rst:1679 msgid "Accepts a :term:`path-like object`." msgstr "" -#: ../../library/importlib.rst:1521 +#: ../../library/importlib.rst:1520 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." @@ -1775,25 +1773,25 @@ msgid "" "cache_tag` is not defined, :exc:`NotImplementedError` is raised." msgstr "" -#: ../../library/importlib.rst:1536 +#: ../../library/importlib.rst:1535 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:1544 +#: ../../library/importlib.rst:1543 msgid "Resolve a relative module name to an absolute one." msgstr "" -#: ../../library/importlib.rst:1546 +#: ../../library/importlib.rst:1545 msgid "" "If **name** has no leading dots, then **name** is simply returned. This " "allows for usage such as ``importlib.util.resolve_name('sys', __spec__." "parent)`` without doing a check to see if the **package** argument is needed." msgstr "" -#: ../../library/importlib.rst:1551 +#: ../../library/importlib.rst:1550 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:" @@ -1801,13 +1799,13 @@ msgid "" "package (e.g. requesting ``..bacon`` from within the ``spam`` package)." msgstr "" -#: ../../library/importlib.rst:1558 +#: ../../library/importlib.rst:1557 msgid "" "To improve consistency with import statements, raise :exc:`ImportError` " "instead of :exc:`ValueError` for invalid relative import attempts." msgstr "" -#: ../../library/importlib.rst:1565 +#: ../../library/importlib.rst:1564 msgid "" "Find the :term:`spec ` for a module, optionally relative to the " "specified **package** name. If the module is in :attr:`sys.modules`, then " @@ -1817,30 +1815,30 @@ msgid "" "if no spec is found." msgstr "" -#: ../../library/importlib.rst:1572 +#: ../../library/importlib.rst:1571 msgid "" "If **name** is for a submodule (contains a dot), the parent module is " "automatically imported." msgstr "" -#: ../../library/importlib.rst:1575 +#: ../../library/importlib.rst:1574 msgid "**name** and **package** work the same as for :func:`import_module`." msgstr "" -#: ../../library/importlib.rst:1579 +#: ../../library/importlib.rst:1578 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:1586 +#: ../../library/importlib.rst:1585 msgid "" "Create a new module based on **spec** and :meth:`spec.loader.create_module " "`." msgstr "" -#: ../../library/importlib.rst:1589 +#: ../../library/importlib.rst:1588 msgid "" "If :meth:`spec.loader.create_module ` " "does not return ``None``, then any pre-existing attributes will not be " @@ -1848,14 +1846,14 @@ msgid "" "accessing **spec** or setting an attribute on the module." msgstr "" -#: ../../library/importlib.rst:1594 +#: ../../library/importlib.rst:1593 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:1602 +#: ../../library/importlib.rst:1601 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 " @@ -1865,7 +1863,7 @@ msgid "" "work on static methods because of the assumption of two arguments." msgstr "" -#: ../../library/importlib.rst:1611 +#: ../../library/importlib.rst:1610 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." @@ -1875,7 +1873,7 @@ msgid "" "available). These attributes are set unconditionally to support reloading." msgstr "" -#: ../../library/importlib.rst:1619 +#: ../../library/importlib.rst:1618 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 " @@ -1883,25 +1881,25 @@ msgid "" "was already in :data:`sys.modules` then it is left alone." msgstr "" -#: ../../library/importlib.rst:1624 +#: ../../library/importlib.rst:1623 msgid "" ":attr:`__loader__` and :attr:`__package__` are automatically set (when " "possible)." msgstr "" -#: ../../library/importlib.rst:1628 +#: ../../library/importlib.rst:1627 msgid "" "Set :attr:`__name__`, :attr:`__loader__` :attr:`__package__` unconditionally " "to support reloading." msgstr "" -#: ../../library/importlib.rst:1632 +#: ../../library/importlib.rst:1631 msgid "" "The import machinery now directly performs all the functionality provided by " "this function." msgstr "" -#: ../../library/importlib.rst:1638 +#: ../../library/importlib.rst:1637 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 " @@ -1910,23 +1908,23 @@ msgid "" "`__loader__` should be set to." msgstr "" -#: ../../library/importlib.rst:1645 +#: ../../library/importlib.rst:1644 msgid "" "Set ``__loader__`` if set to ``None``, as if the attribute does not exist." msgstr "" -#: ../../library/importlib.rst:1649 ../../library/importlib.rst:1658 +#: ../../library/importlib.rst:1648 ../../library/importlib.rst:1657 msgid "The import machinery takes care of this automatically." msgstr "" -#: ../../library/importlib.rst:1654 +#: ../../library/importlib.rst:1653 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:1663 +#: ../../library/importlib.rst:1662 msgid "" "A factory function for creating a :class:`~importlib.machinery.ModuleSpec` " "instance based on a loader. The parameters have the same meaning as they do " @@ -1935,7 +1933,7 @@ msgid "" "spec." msgstr "" -#: ../../library/importlib.rst:1673 +#: ../../library/importlib.rst:1672 msgid "" "A factory function for creating a :class:`~importlib.machinery.ModuleSpec` " "instance based on the path to a file. Missing information will be filled in " @@ -1943,20 +1941,20 @@ msgid "" "module will be file-based." msgstr "" -#: ../../library/importlib.rst:1685 +#: ../../library/importlib.rst:1684 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:1693 +#: ../../library/importlib.rst:1692 msgid "" "A class which postpones the execution of the loader of a module until the " "module has an attribute accessed." msgstr "" -#: ../../library/importlib.rst:1696 +#: ../../library/importlib.rst:1695 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 " @@ -1969,7 +1967,7 @@ msgid "" "raised if such a substitution is detected." msgstr "" -#: ../../library/importlib.rst:1707 +#: ../../library/importlib.rst:1706 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 " @@ -1978,66 +1976,66 @@ msgid "" "postponed and thus occurring out of context." msgstr "" -#: ../../library/importlib.rst:1715 +#: ../../library/importlib.rst:1714 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:1722 +#: ../../library/importlib.rst:1721 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:1735 +#: ../../library/importlib.rst:1734 msgid "Examples" msgstr "範例" -#: ../../library/importlib.rst:1738 +#: ../../library/importlib.rst:1737 msgid "Importing programmatically" msgstr "" -#: ../../library/importlib.rst:1740 +#: ../../library/importlib.rst:1739 msgid "" "To programmatically import a module, use :func:`importlib.import_module`. ::" msgstr "" -#: ../../library/importlib.rst:1749 +#: ../../library/importlib.rst:1748 msgid "Checking if a module can be imported" msgstr "" -#: ../../library/importlib.rst:1751 +#: ../../library/importlib.rst:1750 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:1774 +#: ../../library/importlib.rst:1773 msgid "Importing a source file directly" msgstr "" -#: ../../library/importlib.rst:1776 +#: ../../library/importlib.rst:1775 msgid "" "To import a Python source file directly, use the following recipe (Python " "3.5 and newer only)::" msgstr "" -#: ../../library/importlib.rst:1794 +#: ../../library/importlib.rst:1793 msgid "Implementing lazy imports" msgstr "" -#: ../../library/importlib.rst:1796 +#: ../../library/importlib.rst:1795 msgid "The example below shows how to implement lazy imports::" msgstr "" -#: ../../library/importlib.rst:1818 +#: ../../library/importlib.rst:1817 msgid "Setting up an importer" msgstr "" -#: ../../library/importlib.rst:1820 +#: ../../library/importlib.rst:1819 msgid "" "For deep customizations of import, you typically want to implement an :term:" "`importer`. This means managing both the :term:`finder` and :term:`loader` " @@ -2051,11 +2049,11 @@ msgid "" "for the appropriate classes defined within this package)::" msgstr "" -#: ../../library/importlib.rst:1852 +#: ../../library/importlib.rst:1851 msgid "Approximating :func:`importlib.import_module`" msgstr "" -#: ../../library/importlib.rst:1854 +#: ../../library/importlib.rst:1853 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/inspect.po b/library/inspect.po index d4a86c4d49..391f7c569a 100644 --- a/library/inspect.po +++ b/library/inspect.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.10\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2022-03-03 00:13+0000\n" +"POT-Creation-Date: 2022-05-21 17:35+0000\n" "PO-Revision-Date: 2018-05-23 16:04+0000\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -761,14 +761,15 @@ msgid "" "Get the documentation string for an object, cleaned up with :func:" "`cleandoc`. If the documentation string for an object is not provided and " "the object is a class, a method, a property or a descriptor, retrieve the " -"documentation string from the inheritance hierarchy." +"documentation string from the inheritance hierarchy. Return ``None`` if the " +"documentation string is invalid or missing." msgstr "" -#: ../../library/inspect.rst:486 +#: ../../library/inspect.rst:487 msgid "Documentation strings are now inherited if not overridden." msgstr "" -#: ../../library/inspect.rst:492 +#: ../../library/inspect.rst:493 msgid "" "Return in a single string any lines of comments immediately preceding the " "object's source code (for a class, function, or method), or at the top of " @@ -777,25 +778,27 @@ msgid "" "been defined in C or the interactive shell." msgstr "" -#: ../../library/inspect.rst:501 +#: ../../library/inspect.rst:502 msgid "" "Return the name of the (text or binary) file in which an object was defined. " "This will fail with a :exc:`TypeError` if the object is a built-in module, " "class, or function." msgstr "" -#: ../../library/inspect.rst:508 -msgid "Try to guess which module an object was defined in." +#: ../../library/inspect.rst:509 +msgid "" +"Try to guess which module an object was defined in. Return ``None`` if the " +"module cannot be determined." msgstr "" -#: ../../library/inspect.rst:513 +#: ../../library/inspect.rst:515 msgid "" -"Return the name of the Python source file in which an object was defined. " -"This will fail with a :exc:`TypeError` if the object is a built-in module, " -"class, or function." +"Return the name of the Python source file in which an object was defined or " +"``None`` if no way can be identified to get the source. This will fail with " +"a :exc:`TypeError` if the object is a built-in module, class, or function." msgstr "" -#: ../../library/inspect.rst:520 +#: ../../library/inspect.rst:523 msgid "" "Return a list of source lines and starting line number for an object. The " "argument may be a module, class, method, function, traceback, frame, or code " @@ -805,13 +808,13 @@ msgid "" "code cannot be retrieved." msgstr "" -#: ../../library/inspect.rst:527 ../../library/inspect.rst:539 +#: ../../library/inspect.rst:530 ../../library/inspect.rst:542 msgid "" ":exc:`OSError` is raised instead of :exc:`IOError`, now an alias of the " "former." msgstr "" -#: ../../library/inspect.rst:534 +#: ../../library/inspect.rst:537 msgid "" "Return the text of the source code for an object. The argument may be a " "module, class, method, function, traceback, frame, or code object. The " @@ -819,13 +822,13 @@ msgid "" "the source code cannot be retrieved." msgstr "" -#: ../../library/inspect.rst:546 +#: ../../library/inspect.rst:549 msgid "" "Clean up indentation from docstrings that are indented to line up with " "blocks of code." msgstr "" -#: ../../library/inspect.rst:549 +#: ../../library/inspect.rst:552 msgid "" "All leading whitespace is removed from the first line. Any leading " "whitespace that can be uniformly removed from the second line onwards is " @@ -833,28 +836,28 @@ msgid "" "Also, all tabs are expanded to spaces." msgstr "" -#: ../../library/inspect.rst:558 +#: ../../library/inspect.rst:561 msgid "Introspecting callables with the Signature object" msgstr "" -#: ../../library/inspect.rst:562 +#: ../../library/inspect.rst:565 msgid "" "The Signature object represents the call signature of a callable object and " "its return annotation. To retrieve a Signature object, use the :func:" "`signature` function." msgstr "" -#: ../../library/inspect.rst:568 +#: ../../library/inspect.rst:571 msgid "Return a :class:`Signature` object for the given ``callable``::" msgstr "" -#: ../../library/inspect.rst:585 +#: ../../library/inspect.rst:588 msgid "" "Accepts a wide range of Python callables, from plain functions and classes " "to :func:`functools.partial` objects." msgstr "" -#: ../../library/inspect.rst:588 +#: ../../library/inspect.rst:591 msgid "" "For objects defined in modules using stringized annotations (``from " "__future__ import annotations``), :func:`signature` will attempt to " @@ -865,7 +868,7 @@ msgid "" "instructions on how to use these parameters." msgstr "" -#: ../../library/inspect.rst:597 +#: ../../library/inspect.rst:600 msgid "" "Raises :exc:`ValueError` if no signature can be provided, and :exc:" "`TypeError` if that type of object is not supported. Also, if the " @@ -874,39 +877,39 @@ msgid "" "exception." msgstr "" -#: ../../library/inspect.rst:603 +#: ../../library/inspect.rst:606 msgid "" "A slash(/) in the signature of a function denotes that the parameters prior " "to it are positional-only. For more info, see :ref:`the FAQ entry on " "positional-only parameters `." msgstr "" -#: ../../library/inspect.rst:607 +#: ../../library/inspect.rst:610 msgid "" "``follow_wrapped`` parameter. Pass ``False`` to get a signature of " "``callable`` specifically (``callable.__wrapped__`` will not be used to " "unwrap decorated callables.)" msgstr "" -#: ../../library/inspect.rst:612 +#: ../../library/inspect.rst:615 msgid "``globals``, ``locals``, and ``eval_str`` parameters." msgstr "" -#: ../../library/inspect.rst:617 +#: ../../library/inspect.rst:620 msgid "" "Some callables may not be introspectable in certain implementations of " "Python. For example, in CPython, some built-in functions defined in C " "provide no metadata about their arguments." msgstr "" -#: ../../library/inspect.rst:624 +#: ../../library/inspect.rst:627 msgid "" "A Signature object represents the call signature of a function and its " "return annotation. For each parameter accepted by the function it stores a :" "class:`Parameter` object in its :attr:`parameters` collection." msgstr "" -#: ../../library/inspect.rst:628 +#: ../../library/inspect.rst:631 msgid "" "The optional *parameters* argument is a sequence of :class:`Parameter` " "objects, which is validated to check that there are no parameters with " @@ -915,54 +918,54 @@ msgid "" "defaults follow parameters without defaults." msgstr "" -#: ../../library/inspect.rst:634 +#: ../../library/inspect.rst:637 msgid "" "The optional *return_annotation* argument, can be an arbitrary Python " "object, is the \"return\" annotation of the callable." msgstr "" -#: ../../library/inspect.rst:637 +#: ../../library/inspect.rst:640 msgid "" "Signature objects are *immutable*. Use :meth:`Signature.replace` to make a " "modified copy." msgstr "" -#: ../../library/inspect.rst:640 +#: ../../library/inspect.rst:643 msgid "Signature objects are picklable and hashable." msgstr "" -#: ../../library/inspect.rst:645 +#: ../../library/inspect.rst:648 msgid "A special class-level marker to specify absence of a return annotation." msgstr "" -#: ../../library/inspect.rst:649 +#: ../../library/inspect.rst:652 msgid "" "An ordered mapping of parameters' names to the corresponding :class:" "`Parameter` objects. Parameters appear in strict definition order, " "including keyword-only parameters." msgstr "" -#: ../../library/inspect.rst:653 ../../library/inspect.rst:997 +#: ../../library/inspect.rst:656 ../../library/inspect.rst:1000 msgid "" "Python only explicitly guaranteed that it preserved the declaration order of " "keyword-only parameters as of version 3.7, although in practice this order " "had always been preserved in Python 3." msgstr "" -#: ../../library/inspect.rst:660 +#: ../../library/inspect.rst:663 msgid "" "The \"return\" annotation for the callable. If the callable has no \"return" "\" annotation, this attribute is set to :attr:`Signature.empty`." msgstr "" -#: ../../library/inspect.rst:665 +#: ../../library/inspect.rst:668 msgid "" "Create a mapping from positional and keyword arguments to parameters. " "Returns :class:`BoundArguments` if ``*args`` and ``**kwargs`` match the " "signature, or raises a :exc:`TypeError`." msgstr "" -#: ../../library/inspect.rst:671 +#: ../../library/inspect.rst:674 msgid "" "Works the same way as :meth:`Signature.bind`, but allows the omission of " "some required arguments (mimics :func:`functools.partial` behavior.) " @@ -970,7 +973,7 @@ msgid "" "arguments do not match the signature." msgstr "" -#: ../../library/inspect.rst:678 +#: ../../library/inspect.rst:681 msgid "" "Create a new Signature instance based on the instance replace was invoked " "on. It is possible to pass different ``parameters`` and/or " @@ -979,7 +982,7 @@ msgid "" "attr:`Signature.empty`." msgstr "" -#: ../../library/inspect.rst:695 +#: ../../library/inspect.rst:698 msgid "" "Return a :class:`Signature` (or its subclass) object for a given callable " "``obj``. Pass ``follow_wrapped=False`` to get a signature of ``obj`` " @@ -987,138 +990,138 @@ msgid "" "will be used as the namespaces when resolving annotations." msgstr "" -#: ../../library/inspect.rst:700 +#: ../../library/inspect.rst:703 msgid "This method simplifies subclassing of :class:`Signature`::" msgstr "" -#: ../../library/inspect.rst:709 +#: ../../library/inspect.rst:712 msgid "``globalns`` and ``localns`` parameters." msgstr "" -#: ../../library/inspect.rst:715 +#: ../../library/inspect.rst:718 msgid "" "Parameter objects are *immutable*. Instead of modifying a Parameter object, " "you can use :meth:`Parameter.replace` to create a modified copy." msgstr "" -#: ../../library/inspect.rst:718 +#: ../../library/inspect.rst:721 msgid "Parameter objects are picklable and hashable." msgstr "" -#: ../../library/inspect.rst:723 +#: ../../library/inspect.rst:726 msgid "" "A special class-level marker to specify absence of default values and " "annotations." msgstr "" -#: ../../library/inspect.rst:728 +#: ../../library/inspect.rst:731 msgid "" "The name of the parameter as a string. The name must be a valid Python " "identifier." msgstr "" -#: ../../library/inspect.rst:733 +#: ../../library/inspect.rst:736 msgid "" "CPython generates implicit parameter names of the form ``.0`` on the code " "objects used to implement comprehensions and generator expressions." msgstr "" -#: ../../library/inspect.rst:737 +#: ../../library/inspect.rst:740 msgid "" "These parameter names are exposed by this module as names like ``implicit0``." msgstr "" -#: ../../library/inspect.rst:743 +#: ../../library/inspect.rst:746 msgid "" "The default value for the parameter. If the parameter has no default value, " "this attribute is set to :attr:`Parameter.empty`." msgstr "" -#: ../../library/inspect.rst:748 +#: ../../library/inspect.rst:751 msgid "" "The annotation for the parameter. If the parameter has no annotation, this " "attribute is set to :attr:`Parameter.empty`." msgstr "" -#: ../../library/inspect.rst:753 +#: ../../library/inspect.rst:756 msgid "" "Describes how argument values are bound to the parameter. Possible values " "(accessible via :class:`Parameter`, like ``Parameter.KEYWORD_ONLY``):" msgstr "" -#: ../../library/inspect.rst:759 +#: ../../library/inspect.rst:762 msgid "Name" msgstr "名稱" -#: ../../library/inspect.rst:759 +#: ../../library/inspect.rst:762 msgid "Meaning" msgstr "意義" -#: ../../library/inspect.rst:761 +#: ../../library/inspect.rst:764 msgid "*POSITIONAL_ONLY*" msgstr "*POSITIONAL_ONLY*" -#: ../../library/inspect.rst:761 +#: ../../library/inspect.rst:764 msgid "" "Value must be supplied as a positional argument. Positional only parameters " "are those which appear before a ``/`` entry (if present) in a Python " "function definition." msgstr "" -#: ../../library/inspect.rst:766 +#: ../../library/inspect.rst:769 msgid "*POSITIONAL_OR_KEYWORD*" msgstr "*POSITIONAL_OR_KEYWORD*" -#: ../../library/inspect.rst:766 +#: ../../library/inspect.rst:769 msgid "" "Value may be supplied as either a keyword or positional argument (this is " "the standard binding behaviour for functions implemented in Python.)" msgstr "" -#: ../../library/inspect.rst:771 +#: ../../library/inspect.rst:774 msgid "*VAR_POSITIONAL*" msgstr "*VAR_POSITIONAL*" -#: ../../library/inspect.rst:771 +#: ../../library/inspect.rst:774 msgid "" "A tuple of positional arguments that aren't bound to any other parameter. " "This corresponds to a ``*args`` parameter in a Python function definition." msgstr "" -#: ../../library/inspect.rst:776 +#: ../../library/inspect.rst:779 msgid "*KEYWORD_ONLY*" msgstr "*KEYWORD_ONLY*" -#: ../../library/inspect.rst:776 +#: ../../library/inspect.rst:779 msgid "" "Value must be supplied as a keyword argument. Keyword only parameters are " "those which appear after a ``*`` or ``*args`` entry in a Python function " "definition." msgstr "" -#: ../../library/inspect.rst:781 +#: ../../library/inspect.rst:784 msgid "*VAR_KEYWORD*" msgstr "*VAR_KEYWORD*" -#: ../../library/inspect.rst:781 +#: ../../library/inspect.rst:784 msgid "" "A dict of keyword arguments that aren't bound to any other parameter. This " "corresponds to a ``**kwargs`` parameter in a Python function definition." msgstr "" -#: ../../library/inspect.rst:787 +#: ../../library/inspect.rst:790 msgid "Example: print all keyword-only arguments without default values::" msgstr "" -#: ../../library/inspect.rst:801 +#: ../../library/inspect.rst:804 msgid "Describes a enum value of Parameter.kind." msgstr "" -#: ../../library/inspect.rst:805 +#: ../../library/inspect.rst:808 msgid "Example: print all descriptions of arguments::" msgstr "" -#: ../../library/inspect.rst:820 +#: ../../library/inspect.rst:823 msgid "" "Create a new Parameter instance based on the instance replaced was invoked " "on. To override a :class:`Parameter` attribute, pass the corresponding " @@ -1126,94 +1129,94 @@ msgid "" "pass :attr:`Parameter.empty`." msgstr "" -#: ../../library/inspect.rst:838 +#: ../../library/inspect.rst:841 msgid "" "In Python 3.3 Parameter objects were allowed to have ``name`` set to " "``None`` if their ``kind`` was set to ``POSITIONAL_ONLY``. This is no longer " "permitted." msgstr "" -#: ../../library/inspect.rst:845 +#: ../../library/inspect.rst:848 msgid "" "Result of a :meth:`Signature.bind` or :meth:`Signature.bind_partial` call. " "Holds the mapping of arguments to the function's parameters." msgstr "" -#: ../../library/inspect.rst:850 +#: ../../library/inspect.rst:853 msgid "" "A mutable mapping of parameters' names to arguments' values. Contains only " "explicitly bound arguments. Changes in :attr:`arguments` will reflect in :" "attr:`args` and :attr:`kwargs`." msgstr "" -#: ../../library/inspect.rst:854 +#: ../../library/inspect.rst:857 msgid "" "Should be used in conjunction with :attr:`Signature.parameters` for any " "argument processing purposes." msgstr "" -#: ../../library/inspect.rst:859 +#: ../../library/inspect.rst:862 msgid "" "Arguments for which :meth:`Signature.bind` or :meth:`Signature.bind_partial` " "relied on a default value are skipped. However, if needed, use :meth:" "`BoundArguments.apply_defaults` to add them." msgstr "" -#: ../../library/inspect.rst:864 +#: ../../library/inspect.rst:867 msgid "" ":attr:`arguments` is now of type :class:`dict`. Formerly, it was of type :" "class:`collections.OrderedDict`." msgstr "" -#: ../../library/inspect.rst:870 +#: ../../library/inspect.rst:873 msgid "" "A tuple of positional arguments values. Dynamically computed from the :attr:" "`arguments` attribute." msgstr "" -#: ../../library/inspect.rst:875 +#: ../../library/inspect.rst:878 msgid "" "A dict of keyword arguments values. Dynamically computed from the :attr:" "`arguments` attribute." msgstr "" -#: ../../library/inspect.rst:880 +#: ../../library/inspect.rst:883 msgid "A reference to the parent :class:`Signature` object." msgstr "" -#: ../../library/inspect.rst:884 +#: ../../library/inspect.rst:887 msgid "Set default values for missing arguments." msgstr "" -#: ../../library/inspect.rst:886 +#: ../../library/inspect.rst:889 msgid "" "For variable-positional arguments (``*args``) the default is an empty tuple." msgstr "" -#: ../../library/inspect.rst:889 +#: ../../library/inspect.rst:892 msgid "" "For variable-keyword arguments (``**kwargs``) the default is an empty dict." msgstr "" -#: ../../library/inspect.rst:902 +#: ../../library/inspect.rst:905 msgid "" "The :attr:`args` and :attr:`kwargs` properties can be used to invoke " "functions::" msgstr "" -#: ../../library/inspect.rst:915 +#: ../../library/inspect.rst:918 msgid ":pep:`362` - Function Signature Object." msgstr "" -#: ../../library/inspect.rst:916 +#: ../../library/inspect.rst:919 msgid "The detailed specification, implementation details and examples." msgstr "" -#: ../../library/inspect.rst:922 +#: ../../library/inspect.rst:925 msgid "Classes and functions" msgstr "" -#: ../../library/inspect.rst:926 +#: ../../library/inspect.rst:929 msgid "" "Arrange the given list of classes into a hierarchy of nested lists. Where a " "nested list appears, it contains classes derived from the class whose entry " @@ -1224,7 +1227,7 @@ msgid "" "will appear multiple times." msgstr "" -#: ../../library/inspect.rst:937 +#: ../../library/inspect.rst:940 msgid "" "Get the names and default values of a Python function's parameters. A :term:" "`named tuple` ``ArgSpec(args, varargs, keywords, defaults)`` is returned. " @@ -1235,33 +1238,33 @@ msgid "" "in *args*." msgstr "" -#: ../../library/inspect.rst:945 +#: ../../library/inspect.rst:948 msgid "" "Use :func:`getfullargspec` for an updated API that is usually a drop-in " "replacement, but also correctly handles function annotations and keyword-" "only parameters." msgstr "" -#: ../../library/inspect.rst:950 +#: ../../library/inspect.rst:953 msgid "" "Alternatively, use :func:`signature` and :ref:`Signature Object `, which provide a more structured introspection API for " "callables." msgstr "" -#: ../../library/inspect.rst:957 +#: ../../library/inspect.rst:960 msgid "" "Get the names and default values of a Python function's parameters. A :term:" "`named tuple` is returned:" msgstr "" -#: ../../library/inspect.rst:960 +#: ../../library/inspect.rst:963 msgid "" "``FullArgSpec(args, varargs, varkw, defaults, kwonlyargs, kwonlydefaults, " "annotations)``" msgstr "" -#: ../../library/inspect.rst:963 +#: ../../library/inspect.rst:966 msgid "" "*args* is a list of the positional parameter names. *varargs* is the name of " "the ``*`` parameter or ``None`` if arbitrary positional arguments are not " @@ -1276,7 +1279,7 @@ msgid "" "report the function return value annotation (if any)." msgstr "" -#: ../../library/inspect.rst:978 +#: ../../library/inspect.rst:981 msgid "" "Note that :func:`signature` and :ref:`Signature Object ` provide the recommended API for callable introspection, and support " @@ -1286,14 +1289,14 @@ msgid "" "``inspect`` module API." msgstr "" -#: ../../library/inspect.rst:985 +#: ../../library/inspect.rst:988 msgid "" "This function is now based on :func:`signature`, but still ignores " "``__wrapped__`` attributes and includes the already bound first parameter in " "the signature output for bound methods." msgstr "" -#: ../../library/inspect.rst:990 +#: ../../library/inspect.rst:993 msgid "" "This method was previously documented as deprecated in favour of :func:" "`signature` in Python 3.5, but that decision has been reversed in order to " @@ -1301,7 +1304,7 @@ msgid "" "code migrating away from the legacy :func:`getargspec` API." msgstr "" -#: ../../library/inspect.rst:1005 +#: ../../library/inspect.rst:1008 msgid "" "Get information about arguments passed into a particular frame. A :term:" "`named tuple` ``ArgInfo(args, varargs, keywords, locals)`` is returned. " @@ -1310,47 +1313,47 @@ msgid "" "dictionary of the given frame." msgstr "" -#: ../../library/inspect.rst:1012 ../../library/inspect.rst:1049 +#: ../../library/inspect.rst:1015 ../../library/inspect.rst:1052 msgid "This function was inadvertently marked as deprecated in Python 3.5." msgstr "" -#: ../../library/inspect.rst:1017 +#: ../../library/inspect.rst:1020 msgid "" "Format a pretty argument spec from the values returned by :func:" "`getfullargspec`." msgstr "" -#: ../../library/inspect.rst:1020 +#: ../../library/inspect.rst:1023 msgid "" "The first seven arguments are (``args``, ``varargs``, ``varkw``, " "``defaults``, ``kwonlyargs``, ``kwonlydefaults``, ``annotations``)." msgstr "" -#: ../../library/inspect.rst:1023 +#: ../../library/inspect.rst:1026 msgid "" "The other six arguments are functions that are called to turn argument " "names, ``*`` argument name, ``**`` argument name, default values, return " "annotation and individual annotations into strings, respectively." msgstr "" -#: ../../library/inspect.rst:1027 +#: ../../library/inspect.rst:1030 msgid "For example:" msgstr "" -#: ../../library/inspect.rst:1036 +#: ../../library/inspect.rst:1039 msgid "" "Use :func:`signature` and :ref:`Signature Object `, which provide a better introspecting API for callables." msgstr "" -#: ../../library/inspect.rst:1044 +#: ../../library/inspect.rst:1047 msgid "" "Format a pretty argument spec from the four values returned by :func:" "`getargvalues`. The format\\* arguments are the corresponding optional " "formatting functions that are called to turn names and values into strings." msgstr "" -#: ../../library/inspect.rst:1054 +#: ../../library/inspect.rst:1057 msgid "" "Return a tuple of class cls's base classes, including cls, in method " "resolution order. No class appears more than once in this tuple. Note that " @@ -1358,7 +1361,7 @@ msgid "" "user-defined metatype is in use, cls will be the first element of the tuple." msgstr "" -#: ../../library/inspect.rst:1062 +#: ../../library/inspect.rst:1065 msgid "" "Bind the *args* and *kwds* to the argument names of the Python function or " "method *func*, as if it was called with them. For bound methods, bind also " @@ -1371,11 +1374,11 @@ msgid "" "example::" msgstr "" -#: ../../library/inspect.rst:1085 +#: ../../library/inspect.rst:1088 msgid "Use :meth:`Signature.bind` and :meth:`Signature.bind_partial` instead." msgstr "" -#: ../../library/inspect.rst:1091 +#: ../../library/inspect.rst:1094 msgid "" "Get the mapping of external name references in a Python function or method " "*func* to their current values. A :term:`named tuple` " @@ -1387,18 +1390,18 @@ msgid "" "builtins." msgstr "" -#: ../../library/inspect.rst:1100 +#: ../../library/inspect.rst:1103 msgid "" ":exc:`TypeError` is raised if *func* is not a Python function or method." msgstr "" -#: ../../library/inspect.rst:1107 +#: ../../library/inspect.rst:1110 msgid "" "Get the object wrapped by *func*. It follows the chain of :attr:" "`__wrapped__` attributes returning the last object in the chain." msgstr "" -#: ../../library/inspect.rst:1110 +#: ../../library/inspect.rst:1113 msgid "" "*stop* is an optional callback accepting an object in the wrapper chain as " "its sole argument that allows the unwrapping to be terminated early if the " @@ -1408,68 +1411,68 @@ msgid "" "``__signature__`` attribute defined." msgstr "" -#: ../../library/inspect.rst:1117 +#: ../../library/inspect.rst:1120 msgid ":exc:`ValueError` is raised if a cycle is encountered." msgstr "" -#: ../../library/inspect.rst:1124 +#: ../../library/inspect.rst:1127 msgid "Compute the annotations dict for an object." msgstr "" -#: ../../library/inspect.rst:1126 +#: ../../library/inspect.rst:1129 msgid "" "``obj`` may be a callable, class, or module. Passing in an object of any " "other type raises :exc:`TypeError`." msgstr "" -#: ../../library/inspect.rst:1129 +#: ../../library/inspect.rst:1132 msgid "" "Returns a dict. ``get_annotations()`` returns a new dict every time it's " "called; calling it twice on the same object will return two different but " "equivalent dicts." msgstr "" -#: ../../library/inspect.rst:1133 +#: ../../library/inspect.rst:1136 msgid "This function handles several details for you:" msgstr "" -#: ../../library/inspect.rst:1135 +#: ../../library/inspect.rst:1138 msgid "" "If ``eval_str`` is true, values of type ``str`` will be un-stringized using :" "func:`eval()`. This is intended for use with stringized annotations (``from " "__future__ import annotations``)." msgstr "" -#: ../../library/inspect.rst:1139 +#: ../../library/inspect.rst:1142 msgid "" "If ``obj`` doesn't have an annotations dict, returns an empty dict. " "(Functions and methods always have an annotations dict; classes, modules, " "and other types of callables may not.)" msgstr "" -#: ../../library/inspect.rst:1143 +#: ../../library/inspect.rst:1146 msgid "" "Ignores inherited annotations on classes. If a class doesn't have its own " "annotations dict, returns an empty dict." msgstr "" -#: ../../library/inspect.rst:1145 +#: ../../library/inspect.rst:1148 msgid "" "All accesses to object members and dict values are done using ``getattr()`` " "and ``dict.get()`` for safety." msgstr "" -#: ../../library/inspect.rst:1147 +#: ../../library/inspect.rst:1150 msgid "Always, always, always returns a freshly-created dict." msgstr "" -#: ../../library/inspect.rst:1149 +#: ../../library/inspect.rst:1152 msgid "" "``eval_str`` controls whether or not values of type ``str`` are replaced " "with the result of calling :func:`eval()` on those values:" msgstr "" -#: ../../library/inspect.rst:1152 +#: ../../library/inspect.rst:1155 msgid "" "If eval_str is true, :func:`eval()` is called on values of type ``str``. " "(Note that ``get_annotations`` doesn't catch exceptions; if :func:`eval()` " @@ -1477,12 +1480,12 @@ msgid "" "call.)" msgstr "" -#: ../../library/inspect.rst:1156 +#: ../../library/inspect.rst:1159 msgid "" "If eval_str is false (the default), values of type ``str`` are unchanged." msgstr "" -#: ../../library/inspect.rst:1158 +#: ../../library/inspect.rst:1161 msgid "" "``globals`` and ``locals`` are passed in to :func:`eval()`; see the " "documentation for :func:`eval()` for more information. If ``globals`` or " @@ -1490,35 +1493,35 @@ msgid "" "specific default, contingent on ``type(obj)``:" msgstr "" -#: ../../library/inspect.rst:1163 +#: ../../library/inspect.rst:1166 msgid "If ``obj`` is a module, ``globals`` defaults to ``obj.__dict__``." msgstr "" -#: ../../library/inspect.rst:1164 +#: ../../library/inspect.rst:1167 msgid "" "If ``obj`` is a class, ``globals`` defaults to ``sys.modules[obj.__module__]." "__dict__`` and ``locals`` defaults to the ``obj`` class namespace." msgstr "" -#: ../../library/inspect.rst:1167 +#: ../../library/inspect.rst:1170 msgid "" "If ``obj`` is a callable, ``globals`` defaults to ``obj.__globals__``, " "although if ``obj`` is a wrapped function (using ``functools." "update_wrapper()``) it is first unwrapped." msgstr "" -#: ../../library/inspect.rst:1171 +#: ../../library/inspect.rst:1174 msgid "" "Calling ``get_annotations`` is best practice for accessing the annotations " "dict of any object. See :ref:`annotations-howto` for more information on " "annotations best practices." msgstr "" -#: ../../library/inspect.rst:1181 +#: ../../library/inspect.rst:1184 msgid "The interpreter stack" msgstr "" -#: ../../library/inspect.rst:1183 +#: ../../library/inspect.rst:1186 msgid "" "When the following functions return \"frame records,\" each record is a :" "term:`named tuple` ``FrameInfo(frame, filename, lineno, function, " @@ -1528,11 +1531,11 @@ msgid "" "list." msgstr "" -#: ../../library/inspect.rst:1191 +#: ../../library/inspect.rst:1194 msgid "Return a named tuple instead of a tuple." msgstr "" -#: ../../library/inspect.rst:1196 +#: ../../library/inspect.rst:1199 msgid "" "Keeping references to frame objects, as found in the first element of the " "frame records these functions return, can cause your program to create " @@ -1544,7 +1547,7 @@ msgid "" "consumption which occurs." msgstr "" -#: ../../library/inspect.rst:1204 +#: ../../library/inspect.rst:1207 msgid "" "Though the cycle detector will catch these, destruction of the frames (and " "local variables) can be made deterministic by removing the cycle in a :" @@ -1552,27 +1555,27 @@ msgid "" "disabled when Python was compiled or using :func:`gc.disable`. For example::" msgstr "" -#: ../../library/inspect.rst:1216 +#: ../../library/inspect.rst:1219 msgid "" "If you want to keep the frame around (for example to print a traceback " "later), you can also break reference cycles by using the :meth:`frame.clear` " "method." msgstr "" -#: ../../library/inspect.rst:1220 +#: ../../library/inspect.rst:1223 msgid "" "The optional *context* argument supported by most of these functions " "specifies the number of lines of context to return, which are centered " "around the current line." msgstr "" -#: ../../library/inspect.rst:1227 +#: ../../library/inspect.rst:1230 msgid "" "Get information about a frame or traceback object. A :term:`named tuple` " "``Traceback(filename, lineno, function, code_context, index)`` is returned." msgstr "" -#: ../../library/inspect.rst:1233 +#: ../../library/inspect.rst:1236 msgid "" "Get a list of frame records for a frame and all outer frames. These frames " "represent the calls that lead to the creation of *frame*. The first entry in " @@ -1580,14 +1583,14 @@ msgid "" "outermost call on *frame*'s stack." msgstr "" -#: ../../library/inspect.rst:1238 ../../library/inspect.rst:1251 -#: ../../library/inspect.rst:1275 ../../library/inspect.rst:1288 +#: ../../library/inspect.rst:1241 ../../library/inspect.rst:1254 +#: ../../library/inspect.rst:1278 ../../library/inspect.rst:1291 msgid "" "A list of :term:`named tuples ` ``FrameInfo(frame, filename, " "lineno, function, code_context, index)`` is returned." msgstr "" -#: ../../library/inspect.rst:1246 +#: ../../library/inspect.rst:1249 msgid "" "Get a list of frame records for a traceback's frame and all inner frames. " "These frames represent calls made as a consequence of *frame*. The first " @@ -1595,11 +1598,11 @@ msgid "" "the exception was raised." msgstr "" -#: ../../library/inspect.rst:1259 +#: ../../library/inspect.rst:1262 msgid "Return the frame object for the caller's stack frame." msgstr "" -#: ../../library/inspect.rst:1263 +#: ../../library/inspect.rst:1266 msgid "" "This function relies on Python stack frame support in the interpreter, which " "isn't guaranteed to exist in all implementations of Python. If running in " @@ -1607,14 +1610,14 @@ msgid "" "``None``." msgstr "" -#: ../../library/inspect.rst:1271 +#: ../../library/inspect.rst:1274 msgid "" "Return a list of frame records for the caller's stack. The first entry in " "the returned list represents the caller; the last entry represents the " "outermost call on the stack." msgstr "" -#: ../../library/inspect.rst:1283 +#: ../../library/inspect.rst:1286 msgid "" "Return a list of frame records for the stack between the current frame and " "the frame in which an exception currently being handled was raised in. The " @@ -1622,11 +1625,11 @@ msgid "" "where the exception was raised." msgstr "" -#: ../../library/inspect.rst:1295 +#: ../../library/inspect.rst:1298 msgid "Fetching attributes statically" msgstr "" -#: ../../library/inspect.rst:1297 +#: ../../library/inspect.rst:1300 msgid "" "Both :func:`getattr` and :func:`hasattr` can trigger code execution when " "fetching or checking for the existence of attributes. Descriptors, like " @@ -1634,20 +1637,20 @@ msgid "" "`__getattribute__` may be called." msgstr "" -#: ../../library/inspect.rst:1302 +#: ../../library/inspect.rst:1305 msgid "" "For cases where you want passive introspection, like documentation tools, " "this can be inconvenient. :func:`getattr_static` has the same signature as :" "func:`getattr` but avoids executing code when it fetches attributes." msgstr "" -#: ../../library/inspect.rst:1308 +#: ../../library/inspect.rst:1311 msgid "" "Retrieve attributes without triggering dynamic lookup via the descriptor " "protocol, :meth:`__getattr__` or :meth:`__getattribute__`." msgstr "" -#: ../../library/inspect.rst:1311 +#: ../../library/inspect.rst:1314 msgid "" "Note: this function may not be able to retrieve all attributes that getattr " "can fetch (like dynamically created attributes) and may find attributes that " @@ -1655,31 +1658,31 @@ msgid "" "return descriptors objects instead of instance members." msgstr "" -#: ../../library/inspect.rst:1317 +#: ../../library/inspect.rst:1320 msgid "" "If the instance :attr:`~object.__dict__` is shadowed by another member (for " "example a property) then this function will be unable to find instance " "members." msgstr "" -#: ../../library/inspect.rst:1323 +#: ../../library/inspect.rst:1326 msgid "" ":func:`getattr_static` does not resolve descriptors, for example slot " "descriptors or getset descriptors on objects implemented in C. The " "descriptor object is returned instead of the underlying attribute." msgstr "" -#: ../../library/inspect.rst:1327 +#: ../../library/inspect.rst:1330 msgid "" "You can handle these with code like the following. Note that for arbitrary " "getset descriptors invoking these may trigger code execution::" msgstr "" -#: ../../library/inspect.rst:1353 +#: ../../library/inspect.rst:1356 msgid "Current State of Generators and Coroutines" msgstr "" -#: ../../library/inspect.rst:1355 +#: ../../library/inspect.rst:1358 msgid "" "When implementing coroutine schedulers and for other advanced uses of " "generators, it is useful to determine whether a generator is currently " @@ -1688,31 +1691,31 @@ msgid "" "generator to be determined easily." msgstr "" -#: ../../library/inspect.rst:1363 +#: ../../library/inspect.rst:1366 msgid "Get current state of a generator-iterator." msgstr "" -#: ../../library/inspect.rst:1369 ../../library/inspect.rst:1384 +#: ../../library/inspect.rst:1372 ../../library/inspect.rst:1387 msgid "Possible states are:" msgstr "" -#: ../../library/inspect.rst:1366 +#: ../../library/inspect.rst:1369 msgid "GEN_CREATED: Waiting to start execution." msgstr "" -#: ../../library/inspect.rst:1367 +#: ../../library/inspect.rst:1370 msgid "GEN_RUNNING: Currently being executed by the interpreter." msgstr "" -#: ../../library/inspect.rst:1368 +#: ../../library/inspect.rst:1371 msgid "GEN_SUSPENDED: Currently suspended at a yield expression." msgstr "" -#: ../../library/inspect.rst:1369 +#: ../../library/inspect.rst:1372 msgid "GEN_CLOSED: Execution has completed." msgstr "" -#: ../../library/inspect.rst:1375 +#: ../../library/inspect.rst:1378 msgid "" "Get current state of a coroutine object. The function is intended to be " "used with coroutine objects created by :keyword:`async def` functions, but " @@ -1720,30 +1723,30 @@ msgid "" "``cr_frame`` attributes." msgstr "" -#: ../../library/inspect.rst:1381 +#: ../../library/inspect.rst:1384 msgid "CORO_CREATED: Waiting to start execution." msgstr "" -#: ../../library/inspect.rst:1382 +#: ../../library/inspect.rst:1385 msgid "CORO_RUNNING: Currently being executed by the interpreter." msgstr "" -#: ../../library/inspect.rst:1383 +#: ../../library/inspect.rst:1386 msgid "CORO_SUSPENDED: Currently suspended at an await expression." msgstr "" -#: ../../library/inspect.rst:1384 +#: ../../library/inspect.rst:1387 msgid "CORO_CLOSED: Execution has completed." msgstr "" -#: ../../library/inspect.rst:1388 +#: ../../library/inspect.rst:1391 msgid "" "The current internal state of the generator can also be queried. This is " "mostly useful for testing purposes, to ensure that internal state is being " "updated as expected:" msgstr "" -#: ../../library/inspect.rst:1394 +#: ../../library/inspect.rst:1397 msgid "" "Get the mapping of live local variables in *generator* to their current " "values. A dictionary is returned that maps from variable names to values. " @@ -1751,14 +1754,14 @@ msgid "" "generator, and all the same caveats apply." msgstr "" -#: ../../library/inspect.rst:1399 +#: ../../library/inspect.rst:1402 msgid "" "If *generator* is a :term:`generator` with no currently associated frame, " "then an empty dictionary is returned. :exc:`TypeError` is raised if " "*generator* is not a Python generator object." msgstr "" -#: ../../library/inspect.rst:1405 +#: ../../library/inspect.rst:1408 msgid "" "This function relies on the generator exposing a Python stack frame for " "introspection, which isn't guaranteed to be the case in all implementations " @@ -1766,76 +1769,76 @@ msgid "" "dictionary." msgstr "" -#: ../../library/inspect.rst:1414 +#: ../../library/inspect.rst:1417 msgid "" "This function is analogous to :func:`~inspect.getgeneratorlocals`, but works " "for coroutine objects created by :keyword:`async def` functions." msgstr "" -#: ../../library/inspect.rst:1423 +#: ../../library/inspect.rst:1426 msgid "Code Objects Bit Flags" msgstr "" -#: ../../library/inspect.rst:1425 +#: ../../library/inspect.rst:1428 msgid "" "Python code objects have a ``co_flags`` attribute, which is a bitmap of the " "following flags:" msgstr "" -#: ../../library/inspect.rst:1430 +#: ../../library/inspect.rst:1433 msgid "The code object is optimized, using fast locals." msgstr "" -#: ../../library/inspect.rst:1434 +#: ../../library/inspect.rst:1437 msgid "" "If set, a new dict will be created for the frame's ``f_locals`` when the " "code object is executed." msgstr "" -#: ../../library/inspect.rst:1439 +#: ../../library/inspect.rst:1442 msgid "The code object has a variable positional parameter (``*args``-like)." msgstr "" -#: ../../library/inspect.rst:1443 +#: ../../library/inspect.rst:1446 msgid "The code object has a variable keyword parameter (``**kwargs``-like)." msgstr "" -#: ../../library/inspect.rst:1447 +#: ../../library/inspect.rst:1450 msgid "The flag is set when the code object is a nested function." msgstr "" -#: ../../library/inspect.rst:1451 +#: ../../library/inspect.rst:1454 msgid "" "The flag is set when the code object is a generator function, i.e. a " "generator object is returned when the code object is executed." msgstr "" -#: ../../library/inspect.rst:1456 +#: ../../library/inspect.rst:1459 msgid "The flag is set if there are no free or cell variables." msgstr "" -#: ../../library/inspect.rst:1460 +#: ../../library/inspect.rst:1463 msgid "" "The flag is set when the code object is a coroutine function. When the code " "object is executed it returns a coroutine object. See :pep:`492` for more " "details." msgstr "" -#: ../../library/inspect.rst:1468 +#: ../../library/inspect.rst:1471 msgid "" "The flag is used to transform generators into generator-based coroutines. " "Generator objects with this flag can be used in ``await`` expression, and " "can ``yield from`` coroutine objects. See :pep:`492` for more details." msgstr "" -#: ../../library/inspect.rst:1477 +#: ../../library/inspect.rst:1480 msgid "" "The flag is set when the code object is an asynchronous generator function. " "When the code object is executed it returns an asynchronous generator " "object. See :pep:`525` for more details." msgstr "" -#: ../../library/inspect.rst:1484 +#: ../../library/inspect.rst:1487 msgid "" "The flags are specific to CPython, and may not be defined in other Python " "implementations. Furthermore, the flags are an implementation detail, and " @@ -1843,24 +1846,24 @@ msgid "" "use public APIs from the :mod:`inspect` module for any introspection needs." msgstr "" -#: ../../library/inspect.rst:1494 +#: ../../library/inspect.rst:1497 msgid "Command Line Interface" msgstr "" -#: ../../library/inspect.rst:1496 +#: ../../library/inspect.rst:1499 msgid "" "The :mod:`inspect` module also provides a basic introspection capability " "from the command line." msgstr "" -#: ../../library/inspect.rst:1501 +#: ../../library/inspect.rst:1504 msgid "" "By default, accepts the name of a module and prints the source of that " "module. A class or function within the module can be printed instead by " "appended a colon and the qualified name of the target object." msgstr "" -#: ../../library/inspect.rst:1507 +#: ../../library/inspect.rst:1510 msgid "" "Print information about the specified object rather than the source code" msgstr "" diff --git a/library/json.po b/library/json.po index af5fb920b9..1624f30b74 100644 --- a/library/json.po +++ b/library/json.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.10\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2021-12-07 18:17+0000\n" +"POT-Creation-Date: 2022-05-21 17:35+0000\n" "PO-Revision-Date: 2018-05-23 16:04+0000\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -89,54 +89,45 @@ msgid "" "default. Order is only lost if the underlying containers are unordered." msgstr "" -#: ../../library/json.rst:128 -msgid "" -"Prior to Python 3.7, :class:`dict` was not guaranteed to be ordered, so " -"inputs and outputs were typically scrambled unless :class:`collections." -"OrderedDict` was specifically requested. Starting with Python 3.7, the " -"regular :class:`dict` became order preserving, so it is no longer necessary " -"to specify :class:`collections.OrderedDict` for JSON generation and parsing." -msgstr "" - -#: ../../library/json.rst:137 +#: ../../library/json.rst:130 msgid "Basic Usage" -msgstr "" +msgstr "基本用法" -#: ../../library/json.rst:144 +#: ../../library/json.rst:137 msgid "" "Serialize *obj* as a JSON formatted stream to *fp* (a ``.write()``-" "supporting :term:`file-like object`) using this :ref:`conversion table `." msgstr "" -#: ../../library/json.rst:148 +#: ../../library/json.rst:141 msgid "" "If *skipkeys* is true (default: ``False``), then dict keys that are not of a " "basic type (:class:`str`, :class:`int`, :class:`float`, :class:`bool`, " "``None``) will be skipped instead of raising a :exc:`TypeError`." msgstr "" -#: ../../library/json.rst:152 +#: ../../library/json.rst:145 msgid "" "The :mod:`json` module always produces :class:`str` objects, not :class:" "`bytes` objects. Therefore, ``fp.write()`` must support :class:`str` input." msgstr "" -#: ../../library/json.rst:156 ../../library/json.rst:429 +#: ../../library/json.rst:149 ../../library/json.rst:422 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, " "these characters will be output as-is." msgstr "" -#: ../../library/json.rst:160 +#: ../../library/json.rst:153 msgid "" "If *check_circular* is false (default: ``True``), then the circular " "reference check for container types will be skipped and a circular reference " "will result in an :exc:`RecursionError` (or worse)." msgstr "" -#: ../../library/json.rst:164 +#: ../../library/json.rst:157 msgid "" "If *allow_nan* is false (default: ``True``), then it will be a :exc:" "`ValueError` to serialize out of range :class:`float` values (``nan``, " @@ -145,7 +136,7 @@ msgid "" "Infinity``) will be used." msgstr "" -#: ../../library/json.rst:170 ../../library/json.rst:448 +#: ../../library/json.rst:163 ../../library/json.rst:441 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 +146,11 @@ msgid "" "``\"\\t\"``), that string is used to indent each level." msgstr "" -#: ../../library/json.rst:177 ../../library/json.rst:455 +#: ../../library/json.rst:170 ../../library/json.rst:448 msgid "Allow strings for *indent* in addition to integers." msgstr "" -#: ../../library/json.rst:180 ../../library/json.rst:458 +#: ../../library/json.rst:173 ../../library/json.rst:451 msgid "" "If specified, *separators* should be an ``(item_separator, key_separator)`` " "tuple. The default is ``(', ', ': ')`` if *indent* is ``None`` and ``(',', " @@ -167,11 +158,11 @@ msgid "" "specify ``(',', ':')`` to eliminate whitespace." msgstr "" -#: ../../library/json.rst:185 ../../library/json.rst:463 +#: ../../library/json.rst:178 ../../library/json.rst:456 msgid "Use ``(',', ': ')`` as default if *indent* is not ``None``." msgstr "" -#: ../../library/json.rst:188 ../../library/json.rst:466 +#: ../../library/json.rst:181 ../../library/json.rst:459 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 " @@ -179,39 +170,39 @@ msgid "" "`TypeError` is raised." msgstr "" -#: ../../library/json.rst:193 +#: ../../library/json.rst:186 msgid "" "If *sort_keys* is true (default: ``False``), then the output of dictionaries " "will be sorted by key." msgstr "" -#: ../../library/json.rst:196 +#: ../../library/json.rst:189 msgid "" "To use a custom :class:`JSONEncoder` subclass (e.g. one that overrides the :" "meth:`default` method to serialize additional types), specify it with the " "*cls* kwarg; otherwise :class:`JSONEncoder` is used." msgstr "" -#: ../../library/json.rst:200 ../../library/json.rst:273 +#: ../../library/json.rst:193 ../../library/json.rst:266 msgid "" "All optional parameters are now :ref:`keyword-only `." msgstr "" -#: ../../library/json.rst:205 +#: ../../library/json.rst:198 msgid "" "Unlike :mod:`pickle` and :mod:`marshal`, JSON is not a framed protocol, so " "trying to serialize multiple objects with repeated calls to :func:`dump` " "using the same *fp* will result in an invalid JSON file." msgstr "" -#: ../../library/json.rst:214 +#: ../../library/json.rst:207 msgid "" "Serialize *obj* to a JSON formatted :class:`str` using this :ref:`conversion " "table `. The arguments have the same meaning as in :func:" "`dump`." msgstr "" -#: ../../library/json.rst:220 +#: ../../library/json.rst:213 msgid "" "Keys in key/value pairs of JSON are always of the type :class:`str`. When a " "dictionary is converted into JSON, all the keys of the dictionary are " @@ -220,14 +211,14 @@ msgid "" "original one. That is, ``loads(dumps(x)) != x`` if x has non-string keys." msgstr "" -#: ../../library/json.rst:229 +#: ../../library/json.rst:222 msgid "" "Deserialize *fp* (a ``.read()``-supporting :term:`text file` or :term:" "`binary file` containing a JSON document) to a Python object using this :ref:" "`conversion table `." msgstr "" -#: ../../library/json.rst:233 +#: ../../library/json.rst:226 msgid "" "*object_hook* is an optional function that will be called with the result of " "any object literal decoded (a :class:`dict`). The return value of " @@ -236,7 +227,7 @@ msgid "" "org>`_ class hinting)." msgstr "" -#: ../../library/json.rst:239 +#: ../../library/json.rst:232 msgid "" "*object_pairs_hook* is an optional function that will be called with the " "result of any object literal decoded with an ordered list of pairs. The " @@ -245,11 +236,11 @@ msgid "" "*object_hook* is also defined, the *object_pairs_hook* takes priority." msgstr "" -#: ../../library/json.rst:245 ../../library/json.rst:344 +#: ../../library/json.rst:238 ../../library/json.rst:337 msgid "Added support for *object_pairs_hook*." msgstr "新增對於 *object_pairs_hook* 的支援。" -#: ../../library/json.rst:248 ../../library/json.rst:347 +#: ../../library/json.rst:241 ../../library/json.rst:340 msgid "" "*parse_float*, if specified, will be called with the string of every JSON " "float to be decoded. By default, this is equivalent to ``float(num_str)``. " @@ -257,7 +248,7 @@ msgid "" "class:`decimal.Decimal`)." msgstr "" -#: ../../library/json.rst:253 ../../library/json.rst:352 +#: ../../library/json.rst:246 ../../library/json.rst:345 msgid "" "*parse_int*, if specified, will be called with the string of every JSON int " "to be decoded. By default, this is equivalent to ``int(num_str)``. This " @@ -265,149 +256,149 @@ msgid "" "`float`)." msgstr "" -#: ../../library/json.rst:258 ../../library/json.rst:357 +#: ../../library/json.rst:251 ../../library/json.rst:350 msgid "" "*parse_constant*, if specified, will be called with one of the following " "strings: ``'-Infinity'``, ``'Infinity'``, ``'NaN'``. This can be used to " "raise an exception if invalid JSON numbers are encountered." msgstr "" -#: ../../library/json.rst:263 +#: ../../library/json.rst:256 msgid "*parse_constant* doesn't get called on 'null', 'true', 'false' anymore." msgstr "" -#: ../../library/json.rst:266 +#: ../../library/json.rst:259 msgid "" "To use a custom :class:`JSONDecoder` subclass, specify it with the ``cls`` " "kwarg; otherwise :class:`JSONDecoder` is used. Additional keyword arguments " "will be passed to the constructor of the class." msgstr "" -#: ../../library/json.rst:270 ../../library/json.rst:288 -#: ../../library/json.rst:367 +#: ../../library/json.rst:263 ../../library/json.rst:281 +#: ../../library/json.rst:360 msgid "" "If the data being deserialized is not a valid JSON document, a :exc:" "`JSONDecodeError` will be raised." msgstr "" -#: ../../library/json.rst:276 +#: ../../library/json.rst:269 msgid "" "*fp* can now be a :term:`binary file`. The input encoding should be UTF-8, " "UTF-16 or UTF-32." msgstr "" -#: ../../library/json.rst:282 +#: ../../library/json.rst:275 msgid "" "Deserialize *s* (a :class:`str`, :class:`bytes` or :class:`bytearray` " "instance containing a JSON document) to a Python object using this :ref:" "`conversion table `." msgstr "" -#: ../../library/json.rst:286 +#: ../../library/json.rst:279 msgid "The other arguments have the same meaning as in :func:`load`." msgstr "" -#: ../../library/json.rst:291 +#: ../../library/json.rst:284 msgid "" "*s* can now be of type :class:`bytes` or :class:`bytearray`. The input " "encoding should be UTF-8, UTF-16 or UTF-32." msgstr "" -#: ../../library/json.rst:295 +#: ../../library/json.rst:288 msgid "The keyword argument *encoding* has been removed." msgstr "" -#: ../../library/json.rst:300 +#: ../../library/json.rst:293 msgid "Encoders and Decoders" msgstr "" -#: ../../library/json.rst:304 +#: ../../library/json.rst:297 msgid "Simple JSON decoder." msgstr "" -#: ../../library/json.rst:306 +#: ../../library/json.rst:299 msgid "Performs the following translations in decoding by default:" msgstr "" -#: ../../library/json.rst:311 ../../library/json.rst:400 +#: ../../library/json.rst:304 ../../library/json.rst:393 msgid "JSON" msgstr "JSON" -#: ../../library/json.rst:311 ../../library/json.rst:400 +#: ../../library/json.rst:304 ../../library/json.rst:393 msgid "Python" msgstr "Python" -#: ../../library/json.rst:313 ../../library/json.rst:402 +#: ../../library/json.rst:306 ../../library/json.rst:395 msgid "object" msgstr "object" -#: ../../library/json.rst:313 ../../library/json.rst:402 +#: ../../library/json.rst:306 ../../library/json.rst:395 msgid "dict" msgstr "dict" -#: ../../library/json.rst:315 ../../library/json.rst:404 +#: ../../library/json.rst:308 ../../library/json.rst:397 msgid "array" msgstr "array" -#: ../../library/json.rst:315 +#: ../../library/json.rst:308 msgid "list" msgstr "list" -#: ../../library/json.rst:317 ../../library/json.rst:406 +#: ../../library/json.rst:310 ../../library/json.rst:399 msgid "string" msgstr "string" -#: ../../library/json.rst:317 ../../library/json.rst:406 +#: ../../library/json.rst:310 ../../library/json.rst:399 msgid "str" msgstr "str" -#: ../../library/json.rst:319 +#: ../../library/json.rst:312 msgid "number (int)" msgstr "number (int)" -#: ../../library/json.rst:319 +#: ../../library/json.rst:312 msgid "int" msgstr "int" -#: ../../library/json.rst:321 +#: ../../library/json.rst:314 msgid "number (real)" msgstr "" -#: ../../library/json.rst:321 +#: ../../library/json.rst:314 msgid "float" msgstr "float" -#: ../../library/json.rst:323 ../../library/json.rst:410 +#: ../../library/json.rst:316 ../../library/json.rst:403 msgid "true" msgstr "true" -#: ../../library/json.rst:323 ../../library/json.rst:410 +#: ../../library/json.rst:316 ../../library/json.rst:403 msgid "True" msgstr "True" -#: ../../library/json.rst:325 ../../library/json.rst:412 +#: ../../library/json.rst:318 ../../library/json.rst:405 msgid "false" msgstr "false" -#: ../../library/json.rst:325 ../../library/json.rst:412 +#: ../../library/json.rst:318 ../../library/json.rst:405 msgid "False" msgstr "False" -#: ../../library/json.rst:327 ../../library/json.rst:414 +#: ../../library/json.rst:320 ../../library/json.rst:407 msgid "null" msgstr "null" -#: ../../library/json.rst:327 ../../library/json.rst:414 +#: ../../library/json.rst:320 ../../library/json.rst:407 msgid "None" msgstr "None" -#: ../../library/json.rst:330 +#: ../../library/json.rst:323 msgid "" "It also understands ``NaN``, ``Infinity``, and ``-Infinity`` as their " "corresponding ``float`` values, which is outside the JSON spec." msgstr "" -#: ../../library/json.rst:333 +#: ../../library/json.rst:326 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 :" @@ -415,7 +406,7 @@ msgid "" "support `JSON-RPC `_ class hinting)." msgstr "" -#: ../../library/json.rst:338 +#: ../../library/json.rst:331 msgid "" "*object_pairs_hook*, if specified will be called with the result of every " "JSON object decoded with an ordered list of pairs. The return value of " @@ -424,7 +415,7 @@ msgid "" "the *object_pairs_hook* takes priority." msgstr "" -#: ../../library/json.rst:362 +#: ../../library/json.rst:355 msgid "" "If *strict* is false (``True`` is the default), then control characters will " "be allowed inside strings. Control characters in this context are those " @@ -432,60 +423,60 @@ msgid "" "``'\\n'``, ``'\\r'`` and ``'\\0'``." msgstr "" -#: ../../library/json.rst:370 ../../library/json.rst:471 +#: ../../library/json.rst:363 ../../library/json.rst:464 msgid "All parameters are now :ref:`keyword-only `." msgstr "" -#: ../../library/json.rst:375 +#: ../../library/json.rst:368 msgid "" "Return the Python representation of *s* (a :class:`str` instance containing " "a JSON document)." msgstr "" -#: ../../library/json.rst:378 +#: ../../library/json.rst:371 msgid "" ":exc:`JSONDecodeError` will be raised if the given JSON document is not " "valid." msgstr "" -#: ../../library/json.rst:383 +#: ../../library/json.rst:376 msgid "" "Decode a JSON document from *s* (a :class:`str` beginning with a JSON " "document) and return a 2-tuple of the Python representation and the index in " "*s* where the document ended." msgstr "" -#: ../../library/json.rst:387 +#: ../../library/json.rst:380 msgid "" "This can be used to decode a JSON document from a string that may have " "extraneous data at the end." msgstr "" -#: ../../library/json.rst:393 +#: ../../library/json.rst:386 msgid "Extensible JSON encoder for Python data structures." msgstr "" -#: ../../library/json.rst:395 +#: ../../library/json.rst:388 msgid "Supports the following objects and types by default:" msgstr "" -#: ../../library/json.rst:404 +#: ../../library/json.rst:397 msgid "list, tuple" msgstr "list, tuple" -#: ../../library/json.rst:408 +#: ../../library/json.rst:401 msgid "int, float, int- & float-derived Enums" msgstr "" -#: ../../library/json.rst:408 +#: ../../library/json.rst:401 msgid "number" msgstr "" -#: ../../library/json.rst:417 +#: ../../library/json.rst:410 msgid "Added support for int- and float-derived Enum classes." msgstr "" -#: ../../library/json.rst:420 +#: ../../library/json.rst:413 msgid "" "To extend this to recognize other objects, subclass and implement a :meth:" "`default` method with another method that returns a serializable object for " @@ -493,14 +484,14 @@ msgid "" "(to raise :exc:`TypeError`)." msgstr "" -#: ../../library/json.rst:425 +#: ../../library/json.rst:418 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:" "`float` or ``None``. If *skipkeys* is true, such items are simply skipped." msgstr "" -#: ../../library/json.rst:433 +#: ../../library/json.rst:426 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 +499,7 @@ msgid "" "Otherwise, no such check takes place." msgstr "" -#: ../../library/json.rst:438 +#: ../../library/json.rst:431 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 +507,71 @@ msgid "" "decoders. Otherwise, it will be a :exc:`ValueError` to encode such floats." msgstr "" -#: ../../library/json.rst:444 +#: ../../library/json.rst:437 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:470 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:474 msgid "" "For example, to support arbitrary iterators, you could implement :meth:" "`default` like this::" msgstr "" -#: ../../library/json.rst:497 +#: ../../library/json.rst:490 msgid "" "Return a JSON string representation of a Python data structure, *o*. For " "example::" msgstr "" -#: ../../library/json.rst:506 +#: ../../library/json.rst:499 msgid "" "Encode the given object, *o*, and yield each string representation as " "available. For example::" msgstr "" -#: ../../library/json.rst:514 +#: ../../library/json.rst:507 msgid "Exceptions" msgstr "例外" -#: ../../library/json.rst:518 +#: ../../library/json.rst:511 msgid "Subclass of :exc:`ValueError` with the following additional attributes:" msgstr "" -#: ../../library/json.rst:522 +#: ../../library/json.rst:515 msgid "The unformatted error message." msgstr "" -#: ../../library/json.rst:526 +#: ../../library/json.rst:519 msgid "The JSON document being parsed." msgstr "" -#: ../../library/json.rst:530 +#: ../../library/json.rst:523 msgid "The start index of *doc* where parsing failed." msgstr "" -#: ../../library/json.rst:534 +#: ../../library/json.rst:527 msgid "The line corresponding to *pos*." msgstr "" -#: ../../library/json.rst:538 +#: ../../library/json.rst:531 msgid "The column corresponding to *pos*." msgstr "" -#: ../../library/json.rst:544 +#: ../../library/json.rst:537 msgid "Standard Compliance and Interoperability" msgstr "" -#: ../../library/json.rst:546 +#: ../../library/json.rst:539 msgid "" "The JSON format is specified by :rfc:`7159` and by `ECMA-404 `_. " @@ -589,48 +580,48 @@ msgid "" "parameters other than those explicitly mentioned, are not considered." msgstr "" -#: ../../library/json.rst:552 +#: ../../library/json.rst:545 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:548 msgid "Infinite and NaN number values are accepted and output;" msgstr "" -#: ../../library/json.rst:556 +#: ../../library/json.rst:549 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:552 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:557 msgid "Character Encodings" msgstr "" -#: ../../library/json.rst:566 +#: ../../library/json.rst:559 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:562 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:566 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 +629,7 @@ msgid "" "encodings." msgstr "" -#: ../../library/json.rst:578 +#: ../../library/json.rst:571 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 +638,7 @@ msgid "" "an initial BOM is present." msgstr "" -#: ../../library/json.rst:584 +#: ../../library/json.rst:577 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 +647,29 @@ msgid "" "class:`str`) code points for such sequences." msgstr "" -#: ../../library/json.rst:592 +#: ../../library/json.rst:585 msgid "Infinite and NaN Number Values" msgstr "" -#: ../../library/json.rst:594 +#: ../../library/json.rst:587 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:602 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:608 msgid "Repeated Names Within an Object" msgstr "" -#: ../../library/json.rst:617 +#: ../../library/json.rst:610 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 +677,15 @@ msgid "" "but the last name-value pair for a given name::" msgstr "" -#: ../../library/json.rst:626 +#: ../../library/json.rst:619 msgid "The *object_pairs_hook* parameter can be used to alter this behavior." msgstr "" -#: ../../library/json.rst:630 +#: ../../library/json.rst:623 msgid "Top-level Non-Object, Non-Array Values" msgstr "" -#: ../../library/json.rst:632 +#: ../../library/json.rst:625 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 +695,43 @@ msgid "" "its serializer or its deserializer." msgstr "" -#: ../../library/json.rst:639 +#: ../../library/json.rst:632 msgid "" "Regardless, for maximum interoperability, you may wish to voluntarily adhere " "to the restriction yourself." msgstr "" -#: ../../library/json.rst:644 +#: ../../library/json.rst:637 msgid "Implementation Limitations" msgstr "" -#: ../../library/json.rst:646 +#: ../../library/json.rst:639 msgid "Some JSON deserializer implementations may set limits on:" msgstr "" -#: ../../library/json.rst:648 +#: ../../library/json.rst:641 msgid "the size of accepted JSON texts" msgstr "" -#: ../../library/json.rst:649 +#: ../../library/json.rst:642 msgid "the maximum level of nesting of JSON objects and arrays" msgstr "" -#: ../../library/json.rst:650 +#: ../../library/json.rst:643 msgid "the range and precision of JSON numbers" msgstr "" -#: ../../library/json.rst:651 +#: ../../library/json.rst:644 msgid "the content and maximum length of JSON strings" msgstr "" -#: ../../library/json.rst:653 +#: ../../library/json.rst:646 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:649 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 +742,77 @@ msgid "" "as :class:`decimal.Decimal`." msgstr "" -#: ../../library/json.rst:669 +#: ../../library/json.rst:662 msgid "Command Line Interface" msgstr "" -#: ../../library/json.rst:674 +#: ../../library/json.rst:667 msgid "**Source code:** :source:`Lib/json/tool.py`" msgstr "**原始碼:**\\ :source:`Lib/json/tool.py`" -#: ../../library/json.rst:678 +#: ../../library/json.rst:671 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:674 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:686 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:693 msgid "Command line options" msgstr "" -#: ../../library/json.rst:704 +#: ../../library/json.rst:697 msgid "The JSON file to be validated or pretty-printed:" msgstr "" -#: ../../library/json.rst:720 +#: ../../library/json.rst:713 msgid "If *infile* is not specified, read from :attr:`sys.stdin`." msgstr "" -#: ../../library/json.rst:724 +#: ../../library/json.rst:717 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:722 msgid "Sort the output of dictionaries alphabetically by key." msgstr "" -#: ../../library/json.rst:735 +#: ../../library/json.rst:728 msgid "" "Disable escaping of non-ascii characters, see :func:`json.dumps` for more " "information." msgstr "" -#: ../../library/json.rst:741 +#: ../../library/json.rst:734 msgid "Parse every input line as separate JSON object." msgstr "" -#: ../../library/json.rst:747 +#: ../../library/json.rst:740 msgid "Mutually exclusive options for whitespace control." msgstr "" -#: ../../library/json.rst:753 +#: ../../library/json.rst:746 msgid "Show the help message." msgstr "" -#: ../../library/json.rst:757 +#: ../../library/json.rst:750 msgid "Footnotes" msgstr "註解" -#: ../../library/json.rst:758 +#: ../../library/json.rst:751 msgid "" "As noted in `the errata for RFC 7159 `_, JSON permits literal U+2028 (LINE SEPARATOR) " diff --git a/library/logging.po b/library/logging.po index 5006f6a119..02dbbf0b68 100644 --- a/library/logging.po +++ b/library/logging.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.10\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2021-12-07 18:17+0000\n" +"POT-Creation-Date: 2022-05-21 17:35+0000\n" "PO-Revision-Date: 2018-05-23 16:05+0000\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -1023,11 +1023,11 @@ msgstr "" msgid "Attribute name" msgstr "" -#: ../../library/logging.rst:799 ../../library/logging.rst:1188 +#: ../../library/logging.rst:799 ../../library/logging.rst:1178 msgid "Format" msgstr "格式" -#: ../../library/logging.rst:799 ../../library/logging.rst:1188 +#: ../../library/logging.rst:799 ../../library/logging.rst:1178 msgid "Description" msgstr "描述" @@ -1514,20 +1514,7 @@ msgid "" "are interpreted as for :func:`debug`." msgstr "" -#: ../../library/logging.rst:1083 -msgid "" -"The above module-level convenience functions, which delegate to the root " -"logger, call :func:`basicConfig` to ensure that at least one handler is " -"available. Because of this, they should *not* be used in threads, in " -"versions of Python earlier than 2.7.1 and 3.2, unless at least one handler " -"has been added to the root logger *before* the threads are started. In " -"earlier versions of Python, due to a thread safety shortcoming in :func:" -"`basicConfig`, this can (under rare circumstances) lead to handlers being " -"added multiple times to the root logger, which can in turn lead to multiple " -"messages for the same event." -msgstr "" - -#: ../../library/logging.rst:1095 +#: ../../library/logging.rst:1085 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 " @@ -1541,7 +1528,7 @@ msgid "" "individual loggers." msgstr "" -#: ../../library/logging.rst:1106 +#: ../../library/logging.rst:1096 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 " @@ -1549,13 +1536,13 @@ msgid "" "a suitable value." msgstr "" -#: ../../library/logging.rst:1111 +#: ../../library/logging.rst:1101 msgid "" "The *level* parameter was defaulted to level ``CRITICAL``. See :issue:" "`28524` for more information about this change." msgstr "" -#: ../../library/logging.rst:1117 +#: ../../library/logging.rst:1107 msgid "" "Associates level *level* with text *levelName* in an internal dictionary, " "which is used to map numeric levels to a textual representation, for example " @@ -1565,17 +1552,17 @@ msgid "" "and they should increase in increasing order of severity." msgstr "" -#: ../../library/logging.rst:1124 +#: ../../library/logging.rst:1114 msgid "" "If you are thinking of defining your own levels, please see the section on :" "ref:`custom-levels`." msgstr "" -#: ../../library/logging.rst:1129 +#: ../../library/logging.rst:1119 msgid "Returns the textual or numeric representation of logging level *level*." msgstr "" -#: ../../library/logging.rst:1131 +#: ../../library/logging.rst:1121 msgid "" "If *level* is one of the predefined levels :const:`CRITICAL`, :const:" "`ERROR`, :const:`WARNING`, :const:`INFO` or :const:`DEBUG` then you get the " @@ -1585,20 +1572,20 @@ msgid "" "the corresponding string representation is returned." msgstr "" -#: ../../library/logging.rst:1138 +#: ../../library/logging.rst:1128 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:1142 +#: ../../library/logging.rst:1132 msgid "" "If no matching numeric or string value is passed in, the string 'Level %s' % " "level is returned." msgstr "" -#: ../../library/logging.rst:1145 +#: ../../library/logging.rst:1135 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 " @@ -1607,7 +1594,7 @@ msgid "" "versa." msgstr "" -#: ../../library/logging.rst:1151 +#: ../../library/logging.rst:1141 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. " @@ -1615,7 +1602,7 @@ msgid "" "Python 3.4, but reinstated in 3.4.2 due to retain backward compatibility." msgstr "" -#: ../../library/logging.rst:1159 +#: ../../library/logging.rst:1149 msgid "" "Creates and returns a new :class:`LogRecord` instance whose attributes are " "defined by *attrdict*. This function is useful for taking a pickled :class:" @@ -1623,7 +1610,7 @@ msgid "" "as a :class:`LogRecord` instance at the receiving end." msgstr "" -#: ../../library/logging.rst:1167 +#: ../../library/logging.rst:1157 msgid "" "Does basic configuration for the logging system by creating a :class:" "`StreamHandler` with a default :class:`Formatter` and adding it to the root " @@ -1632,13 +1619,13 @@ msgid "" "no handlers are defined for the root logger." msgstr "" -#: ../../library/logging.rst:1173 +#: ../../library/logging.rst:1163 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:1176 +#: ../../library/logging.rst:1166 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 " @@ -1647,54 +1634,54 @@ msgid "" "unexpected results such as messages being duplicated in the log." msgstr "" -#: ../../library/logging.rst:1183 +#: ../../library/logging.rst:1173 msgid "The following keyword arguments are supported." msgstr "" -#: ../../library/logging.rst:1190 +#: ../../library/logging.rst:1180 msgid "*filename*" msgstr "*filename*" -#: ../../library/logging.rst:1190 +#: ../../library/logging.rst:1180 msgid "" "Specifies that a :class:`FileHandler` be created, using the specified " "filename, rather than a :class:`StreamHandler`." msgstr "" -#: ../../library/logging.rst:1194 +#: ../../library/logging.rst:1184 msgid "*filemode*" msgstr "*filemode*" -#: ../../library/logging.rst:1194 +#: ../../library/logging.rst:1184 msgid "" "If *filename* is specified, open the file in this :ref:`mode `. " "Defaults to ``'a'``." msgstr "" -#: ../../library/logging.rst:1198 +#: ../../library/logging.rst:1188 msgid "*format*" msgstr "*format*" -#: ../../library/logging.rst:1198 +#: ../../library/logging.rst:1188 msgid "" "Use the specified format string for the handler. Defaults to attributes " "``levelname``, ``name`` and ``message`` separated by colons." msgstr "" -#: ../../library/logging.rst:1203 +#: ../../library/logging.rst:1193 msgid "*datefmt*" msgstr "*datefmt*" -#: ../../library/logging.rst:1203 +#: ../../library/logging.rst:1193 msgid "" "Use the specified date/time format, as accepted by :func:`time.strftime`." msgstr "" -#: ../../library/logging.rst:1206 +#: ../../library/logging.rst:1196 msgid "*style*" msgstr "*style*" -#: ../../library/logging.rst:1206 +#: ../../library/logging.rst:1196 msgid "" "If *format* is specified, use this style for the format string. One of " "``'%'``, ``'{'`` or ``'$'`` for :ref:`printf-style `." msgstr "" -#: ../../library/logging.rst:1217 +#: ../../library/logging.rst:1207 msgid "*stream*" msgstr "*stream*" -#: ../../library/logging.rst:1217 +#: ../../library/logging.rst:1207 msgid "" "Use the specified stream to initialize the :class:`StreamHandler`. Note that " "this argument is incompatible with *filename* - if both are present, a " "``ValueError`` is raised." msgstr "" -#: ../../library/logging.rst:1223 +#: ../../library/logging.rst:1213 msgid "*handlers*" msgstr "*handlers*" -#: ../../library/logging.rst:1223 +#: ../../library/logging.rst:1213 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 " @@ -1734,33 +1721,33 @@ msgid "" "present, a ``ValueError`` is raised." msgstr "" -#: ../../library/logging.rst:1232 +#: ../../library/logging.rst:1222 msgid "*force*" msgstr "*force*" -#: ../../library/logging.rst:1232 +#: ../../library/logging.rst:1222 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:1238 +#: ../../library/logging.rst:1228 msgid "*encoding*" msgstr "*encoding*" -#: ../../library/logging.rst:1238 +#: ../../library/logging.rst:1228 msgid "" "If this keyword argument is specified along with *filename*, its value is " "used when the :class:`FileHandler` is created, and thus used when opening " "the output file." msgstr "" -#: ../../library/logging.rst:1243 +#: ../../library/logging.rst:1233 msgid "*errors*" msgstr "*errors*" -#: ../../library/logging.rst:1243 +#: ../../library/logging.rst:1233 msgid "" "If this keyword argument is specified along with *filename*, its value is " "used when the :class:`FileHandler` is created, and thus used when opening " @@ -1769,39 +1756,39 @@ msgid "" "`open`, which means that it will be treated the same as passing 'errors'." msgstr "" -#: ../../library/logging.rst:1254 +#: ../../library/logging.rst:1244 msgid "The *style* argument was added." msgstr "新增 *style* 引數。" -#: ../../library/logging.rst:1257 +#: ../../library/logging.rst:1247 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:1263 +#: ../../library/logging.rst:1253 msgid "The *force* argument was added." msgstr "新增 *force* 引數。" -#: ../../library/logging.rst:1266 +#: ../../library/logging.rst:1256 msgid "The *encoding* and *errors* arguments were added." msgstr "新增 *encoding* 與 *errors* 引數。" -#: ../../library/logging.rst:1271 +#: ../../library/logging.rst:1261 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:1275 +#: ../../library/logging.rst:1265 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:1282 +#: ../../library/logging.rst:1272 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 " @@ -1813,32 +1800,32 @@ msgid "" "loggers." msgstr "" -#: ../../library/logging.rst:1293 +#: ../../library/logging.rst:1283 msgid "Set a callable which is used to create a :class:`LogRecord`." msgstr "" -#: ../../library/logging.rst:1295 +#: ../../library/logging.rst:1285 msgid "The factory callable to be used to instantiate a log record." msgstr "" -#: ../../library/logging.rst:1297 +#: ../../library/logging.rst:1287 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:1302 +#: ../../library/logging.rst:1292 msgid "The factory has the following signature:" msgstr "" -#: ../../library/logging.rst:1304 +#: ../../library/logging.rst:1294 msgid "" "``factory(name, level, fn, lno, msg, args, exc_info, func=None, sinfo=None, " "**kwargs)``" msgstr "" -#: ../../library/logging.rst:1306 +#: ../../library/logging.rst:1296 msgid "The logger name." msgstr "" @@ -1846,7 +1833,7 @@ msgstr "" msgid "level" msgstr "" -#: ../../library/logging.rst:1307 +#: ../../library/logging.rst:1297 msgid "The logging level (numeric)." msgstr "" @@ -1854,7 +1841,7 @@ msgstr "" msgid "fn" msgstr "fn" -#: ../../library/logging.rst:1308 +#: ../../library/logging.rst:1298 msgid "The full pathname of the file where the logging call was made." msgstr "" @@ -1862,19 +1849,19 @@ msgstr "" msgid "lno" msgstr "lno" -#: ../../library/logging.rst:1309 +#: ../../library/logging.rst:1299 msgid "The line number in the file where the logging call was made." msgstr "" -#: ../../library/logging.rst:1310 +#: ../../library/logging.rst:1300 msgid "The logging message." msgstr "" -#: ../../library/logging.rst:1311 +#: ../../library/logging.rst:1301 msgid "The arguments for the logging message." msgstr "" -#: ../../library/logging.rst:1312 +#: ../../library/logging.rst:1302 msgid "An exception tuple, or ``None``." msgstr "" @@ -1882,7 +1869,7 @@ msgstr "" msgid "func" msgstr "func" -#: ../../library/logging.rst:1313 +#: ../../library/logging.rst:1303 msgid "The name of the function or method which invoked the logging call." msgstr "" @@ -1890,7 +1877,7 @@ msgstr "" msgid "sinfo" msgstr "sinfo" -#: ../../library/logging.rst:1315 +#: ../../library/logging.rst:1305 msgid "" "A stack traceback such as is provided by :func:`traceback.print_stack`, " "showing the call hierarchy." @@ -1900,15 +1887,15 @@ msgstr "" msgid "kwargs" msgstr "kwargs" -#: ../../library/logging.rst:1317 +#: ../../library/logging.rst:1307 msgid "Additional keyword arguments." msgstr "額外的關鍵字引數。" -#: ../../library/logging.rst:1321 +#: ../../library/logging.rst:1311 msgid "Module-Level Attributes" msgstr "" -#: ../../library/logging.rst:1325 +#: ../../library/logging.rst:1315 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``, " @@ -1919,22 +1906,22 @@ msgid "" "reason, ``lastResort`` can be set to ``None``." msgstr "" -#: ../../library/logging.rst:1336 +#: ../../library/logging.rst:1326 msgid "Integration with the warnings module" msgstr "" -#: ../../library/logging.rst:1338 +#: ../../library/logging.rst:1328 msgid "" "The :func:`captureWarnings` function can be used to integrate :mod:`logging` " "with the :mod:`warnings` module." msgstr "" -#: ../../library/logging.rst:1343 +#: ../../library/logging.rst:1333 msgid "" "This function is used to turn the capture of warnings by logging on and off." msgstr "" -#: ../../library/logging.rst:1346 +#: ../../library/logging.rst:1336 msgid "" "If *capture* is ``True``, warnings issued by the :mod:`warnings` module will " "be redirected to the logging system. Specifically, a warning will be " @@ -1943,46 +1930,46 @@ msgid "" "`WARNING`." msgstr "" -#: ../../library/logging.rst:1351 +#: ../../library/logging.rst:1341 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:1359 +#: ../../library/logging.rst:1349 msgid "Module :mod:`logging.config`" msgstr "" -#: ../../library/logging.rst:1359 +#: ../../library/logging.rst:1349 msgid "Configuration API for the logging module." msgstr "" -#: ../../library/logging.rst:1362 +#: ../../library/logging.rst:1352 msgid "Module :mod:`logging.handlers`" msgstr "" -#: ../../library/logging.rst:1362 +#: ../../library/logging.rst:1352 msgid "Useful handlers included with the logging module." msgstr "" -#: ../../library/logging.rst:1366 +#: ../../library/logging.rst:1356 msgid ":pep:`282` - A Logging System" msgstr "" -#: ../../library/logging.rst:1365 +#: ../../library/logging.rst:1355 msgid "" "The proposal which described this feature for inclusion in the Python " "standard library." msgstr "" -#: ../../library/logging.rst:1371 +#: ../../library/logging.rst:1361 msgid "" "`Original Python logging package `_" msgstr "" -#: ../../library/logging.rst:1369 +#: ../../library/logging.rst:1359 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/mailcap.po b/library/mailcap.po index 39d71e7fac..bf56a2733a 100644 --- a/library/mailcap.po +++ b/library/mailcap.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.10\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2021-10-26 16:47+0000\n" +"POT-Creation-Date: 2022-05-21 17:35+0000\n" "PO-Revision-Date: 2015-12-09 17:51+0000\n" "Last-Translator: Liang-Bo Wang \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -22,11 +22,17 @@ msgstr "" msgid ":mod:`mailcap` --- Mailcap file handling" msgstr "" -#: ../../library/mailcap.rst:7 +#: ../../library/mailcap.rst:8 msgid "**Source code:** :source:`Lib/mailcap.py`" msgstr "**原始碼:**\\ :source:`Lib/mailcap.py`" -#: ../../library/mailcap.rst:11 +#: ../../library/mailcap.rst:10 +msgid "" +"The :mod:`mailcap` module is deprecated (see :pep:`PEP 594 <594#mailcap>` " +"for details). The :mod:`mimetypes` module provides an alternative." +msgstr "" + +#: ../../library/mailcap.rst:17 msgid "" "Mailcap files are used to configure how MIME-aware applications such as mail " "readers and web browsers react to files with different MIME types. (The name " @@ -38,7 +44,7 @@ msgid "" "automatically started to view the file." msgstr "" -#: ../../library/mailcap.rst:20 +#: ../../library/mailcap.rst:26 msgid "" "The mailcap format is documented in :rfc:`1524`, \"A User Agent " "Configuration Mechanism For Multimedia Mail Format Information\", but is not " @@ -46,7 +52,7 @@ msgid "" "systems." msgstr "" -#: ../../library/mailcap.rst:27 +#: ../../library/mailcap.rst:33 msgid "" "Return a 2-tuple; the first element is a string containing the command line " "to be executed (which can be passed to :func:`os.system`), and the second " @@ -54,7 +60,7 @@ msgid "" "type can be found, ``(None, None)`` is returned." msgstr "" -#: ../../library/mailcap.rst:32 +#: ../../library/mailcap.rst:38 msgid "" "*key* is the name of the field desired, which represents the type of " "activity to be performed; the default value is 'view', since in the most " @@ -64,14 +70,14 @@ msgid "" "`1524` for a complete list of these fields." msgstr "" -#: ../../library/mailcap.rst:39 +#: ../../library/mailcap.rst:45 msgid "" "*filename* is the filename to be substituted for ``%s`` in the command line; " "the default value is ``'/dev/null'`` which is almost certainly not what you " "want, so usually you'll override it by specifying a filename." msgstr "" -#: ../../library/mailcap.rst:43 +#: ../../library/mailcap.rst:49 msgid "" "*plist* can be a list containing named parameters; the default value is " "simply an empty list. Each entry in the list must be a string containing " @@ -83,7 +89,7 @@ msgid "" "command line would be ``'showpartial 1 2 3'``." msgstr "" -#: ../../library/mailcap.rst:52 +#: ../../library/mailcap.rst:58 msgid "" "In a mailcap file, the \"test\" field can optionally be specified to test " "some external condition (such as the machine architecture, or the window " @@ -92,7 +98,7 @@ msgid "" "the check fails." msgstr "" -#: ../../library/mailcap.rst:60 +#: ../../library/mailcap.rst:66 msgid "" "Returns a dictionary mapping MIME types to a list of mailcap file entries. " "This dictionary must be passed to the :func:`findmatch` function. An entry " @@ -100,7 +106,7 @@ msgid "" "the details of this representation." msgstr "" -#: ../../library/mailcap.rst:65 +#: ../../library/mailcap.rst:71 msgid "" "The information is derived from all of the mailcap files found on the " "system. Settings in the user's mailcap file :file:`$HOME/.mailcap` will " @@ -108,6 +114,6 @@ msgid "" "usr/etc/mailcap`, and :file:`/usr/local/etc/mailcap`." msgstr "" -#: ../../library/mailcap.rst:70 +#: ../../library/mailcap.rst:76 msgid "An example usage::" msgstr "" diff --git a/library/msilib.po b/library/msilib.po index 1a73596189..b6966e85b4 100644 --- a/library/msilib.po +++ b/library/msilib.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.10\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2022-03-23 00:14+0000\n" +"POT-Creation-Date: 2022-05-21 17:35+0000\n" "PO-Revision-Date: 2018-05-23 16:06+0000\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -27,10 +27,13 @@ msgid "**Source code:** :source:`Lib/msilib/__init__.py`" msgstr "**原始碼:**\\ :source:`Lib/msilib/__init__.py`" #: ../../library/msilib.rst:16 -msgid "The :mod:`msilib` module is deprecated (see :pep:`594` for details)." -msgstr ":mod:`msilib` 模組 (module) 即將被棄用(詳見 :pep:`594`\\ )。" +msgid "" +"The :mod:`msilib` module is deprecated (see :pep:`PEP 594 <594#msilib>` for " +"details)." +msgstr "" +":mod:`msilib` 模組 (module) 即將被棄用(詳見 :pep:`PEP 594 <594#msilib>`\\ )。" -#: ../../library/msilib.rst:21 +#: ../../library/msilib.rst:22 msgid "" "The :mod:`msilib` supports the creation of Microsoft Installer (``.msi``) " "files. Because these files often contain an embedded \"cabinet\" file (``." @@ -39,7 +42,7 @@ msgid "" "database is possible." msgstr "" -#: ../../library/msilib.rst:26 +#: ../../library/msilib.rst:27 msgid "" "This package aims to provide complete access to all tables in an ``.msi`` " "file, therefore, it is a fairly low-level API. Two primary applications of " @@ -48,40 +51,40 @@ msgid "" "different version of ``msilib``)." msgstr "" -#: ../../library/msilib.rst:32 +#: ../../library/msilib.rst:33 msgid "" "The package contents can be roughly split into four parts: low-level CAB " "routines, low-level MSI routines, higher-level MSI routines, and standard " "table structures." msgstr "" -#: ../../library/msilib.rst:39 +#: ../../library/msilib.rst:40 msgid "" "Create a new CAB file named *cabname*. *files* must be a list of tuples, " "each containing the name of the file on disk, and the name of the file " "inside the CAB file." msgstr "" -#: ../../library/msilib.rst:43 +#: ../../library/msilib.rst:44 msgid "" "The files are added to the CAB file in the order they appear in the list. " "All files are added into a single CAB file, using the MSZIP compression " "algorithm." msgstr "" -#: ../../library/msilib.rst:46 +#: ../../library/msilib.rst:47 msgid "" "Callbacks to Python for the various steps of MSI creation are currently not " "exposed." msgstr "" -#: ../../library/msilib.rst:52 +#: ../../library/msilib.rst:53 msgid "" "Return the string representation of a new unique identifier. This wraps the " "Windows API functions :c:func:`UuidCreate` and :c:func:`UuidToString`." msgstr "" -#: ../../library/msilib.rst:58 +#: ../../library/msilib.rst:59 msgid "" "Return a new database object by calling MsiOpenDatabase. *path* is the " "file name of the MSI file; *persist* can be one of the constants " @@ -92,84 +95,84 @@ msgid "" "new one created." msgstr "" -#: ../../library/msilib.rst:69 +#: ../../library/msilib.rst:70 msgid "" "Return a new record object by calling :c:func:`MSICreateRecord`. *count* is " "the number of fields of the record." msgstr "" -#: ../../library/msilib.rst:75 +#: ../../library/msilib.rst:76 msgid "" "Create and return a new database *name*, initialize it with *schema*, and " "set the properties *ProductName*, *ProductCode*, *ProductVersion*, and " "*Manufacturer*." msgstr "" -#: ../../library/msilib.rst:79 +#: ../../library/msilib.rst:80 msgid "" "*schema* must be a module object containing ``tables`` and " "``_Validation_records`` attributes; typically, :mod:`msilib.schema` should " "be used." msgstr "" -#: ../../library/msilib.rst:83 +#: ../../library/msilib.rst:84 msgid "" "The database will contain just the schema and the validation records when " "this function returns." msgstr "" -#: ../../library/msilib.rst:89 +#: ../../library/msilib.rst:90 msgid "Add all *records* to the table named *table* in *database*." msgstr "" -#: ../../library/msilib.rst:91 +#: ../../library/msilib.rst:92 msgid "" "The *table* argument must be one of the predefined tables in the MSI schema, " "e.g. ``'Feature'``, ``'File'``, ``'Component'``, ``'Dialog'``, " "``'Control'``, etc." msgstr "" -#: ../../library/msilib.rst:95 +#: ../../library/msilib.rst:96 msgid "" "*records* should be a list of tuples, each one containing all fields of a " "record according to the schema of the table. For optional fields, ``None`` " "can be passed." msgstr "" -#: ../../library/msilib.rst:99 +#: ../../library/msilib.rst:100 msgid "Field values can be ints, strings, or instances of the Binary class." msgstr "" -#: ../../library/msilib.rst:104 +#: ../../library/msilib.rst:105 msgid "" "Represents entries in the Binary table; inserting such an object using :func:" "`add_data` reads the file named *filename* into the table." msgstr "" -#: ../../library/msilib.rst:110 +#: ../../library/msilib.rst:111 msgid "" "Add all table content from *module* to *database*. *module* must contain an " "attribute *tables* listing all tables for which content should be added, and " "one attribute per table that has the actual content." msgstr "" -#: ../../library/msilib.rst:114 +#: ../../library/msilib.rst:115 msgid "This is typically used to install the sequence tables." msgstr "" -#: ../../library/msilib.rst:119 +#: ../../library/msilib.rst:120 msgid "" "Add the file *path* into the ``_Stream`` table of *database*, with the " "stream name *name*." msgstr "" -#: ../../library/msilib.rst:125 +#: ../../library/msilib.rst:126 msgid "" "Return a new UUID, in the format that MSI typically requires (i.e. in curly " "braces, and with all hexdigits in upper-case)." msgstr "" -#: ../../library/msilib.rst:131 +#: ../../library/msilib.rst:132 msgid "" "`FCICreate `_ " "`UuidCreate `_" msgstr "" -#: ../../library/msilib.rst:138 +#: ../../library/msilib.rst:139 msgid "Database Objects" msgstr "" -#: ../../library/msilib.rst:143 +#: ../../library/msilib.rst:144 msgid "" "Return a view object, by calling :c:func:`MSIDatabaseOpenView`. *sql* is the " "SQL statement to execute." msgstr "" -#: ../../library/msilib.rst:149 +#: ../../library/msilib.rst:150 msgid "" "Commit the changes pending in the current transaction, by calling :c:func:" "`MSIDatabaseCommit`." msgstr "" -#: ../../library/msilib.rst:155 +#: ../../library/msilib.rst:156 msgid "" "Return a new summary information object, by calling :c:func:" "`MsiGetSummaryInformation`. *count* is the maximum number of updated values." msgstr "" -#: ../../library/msilib.rst:161 +#: ../../library/msilib.rst:162 msgid "Close the database object, through :c:func:`MsiCloseHandle`." msgstr "" -#: ../../library/msilib.rst:167 +#: ../../library/msilib.rst:168 msgid "" "`MSIDatabaseOpenView `_ `MSIDatabaseCommit `_" msgstr "" -#: ../../library/msilib.rst:175 +#: ../../library/msilib.rst:176 msgid "View Objects" msgstr "" -#: ../../library/msilib.rst:180 +#: ../../library/msilib.rst:181 msgid "" "Execute the SQL query of the view, through :c:func:`MSIViewExecute`. If " "*params* is not ``None``, it is a record describing actual values of the " "parameter tokens in the query." msgstr "" -#: ../../library/msilib.rst:187 +#: ../../library/msilib.rst:188 msgid "" "Return a record describing the columns of the view, through calling :c:func:" "`MsiViewGetColumnInfo`. *kind* can be either ``MSICOLINFO_NAMES`` or " "``MSICOLINFO_TYPES``." msgstr "" -#: ../../library/msilib.rst:194 +#: ../../library/msilib.rst:195 msgid "" "Return a result record of the query, through calling :c:func:`MsiViewFetch`." msgstr "" -#: ../../library/msilib.rst:199 +#: ../../library/msilib.rst:200 msgid "" "Modify the view, by calling :c:func:`MsiViewModify`. *kind* can be one of " "``MSIMODIFY_SEEK``, ``MSIMODIFY_REFRESH``, ``MSIMODIFY_INSERT``, " @@ -246,15 +249,15 @@ msgid "" "``MSIMODIFY_VALIDATE_FIELD``, or ``MSIMODIFY_VALIDATE_DELETE``." msgstr "" -#: ../../library/msilib.rst:206 +#: ../../library/msilib.rst:207 msgid "*data* must be a record describing the new data." msgstr "" -#: ../../library/msilib.rst:211 +#: ../../library/msilib.rst:212 msgid "Close the view, through :c:func:`MsiViewClose`." msgstr "" -#: ../../library/msilib.rst:216 +#: ../../library/msilib.rst:217 msgid "" "`MsiViewExecute `_ `MSIViewGetColumnInfo `_" msgstr "" -#: ../../library/msilib.rst:225 +#: ../../library/msilib.rst:226 msgid "Summary Information Objects" msgstr "" -#: ../../library/msilib.rst:230 +#: ../../library/msilib.rst:231 msgid "" "Return a property of the summary, through :c:func:" "`MsiSummaryInfoGetProperty`. *field* is the name of the property, and can be " @@ -280,26 +283,26 @@ msgid "" "``PID_WORDCOUNT``, ``PID_CHARCOUNT``, ``PID_APPNAME``, or ``PID_SECURITY``." msgstr "" -#: ../../library/msilib.rst:241 +#: ../../library/msilib.rst:242 msgid "" "Return the number of summary properties, through :c:func:" "`MsiSummaryInfoGetPropertyCount`." msgstr "" -#: ../../library/msilib.rst:247 +#: ../../library/msilib.rst:248 msgid "" "Set a property through :c:func:`MsiSummaryInfoSetProperty`. *field* can have " "the same values as in :meth:`GetProperty`, *value* is the new value of the " "property. Possible value types are integer and string." msgstr "" -#: ../../library/msilib.rst:254 +#: ../../library/msilib.rst:255 msgid "" "Write the modified properties to the summary information stream, using :c:" "func:`MsiSummaryInfoPersist`." msgstr "" -#: ../../library/msilib.rst:260 +#: ../../library/msilib.rst:261 msgid "" "`MsiSummaryInfoGetProperty `_ `MsiSummaryInfoGetPropertyCount `_" msgstr "" -#: ../../library/msilib.rst:268 +#: ../../library/msilib.rst:269 msgid "Record Objects" msgstr "" -#: ../../library/msilib.rst:273 +#: ../../library/msilib.rst:274 msgid "" "Return the number of fields of the record, through :c:func:" "`MsiRecordGetFieldCount`." msgstr "" -#: ../../library/msilib.rst:279 +#: ../../library/msilib.rst:280 msgid "" "Return the value of *field* as an integer where possible. *field* must be " "an integer." msgstr "" -#: ../../library/msilib.rst:285 +#: ../../library/msilib.rst:286 msgid "" "Return the value of *field* as a string where possible. *field* must be an " "integer." msgstr "" -#: ../../library/msilib.rst:291 +#: ../../library/msilib.rst:292 msgid "" "Set *field* to *value* through :c:func:`MsiRecordSetString`. *field* must be " "an integer; *value* a string." msgstr "" -#: ../../library/msilib.rst:297 +#: ../../library/msilib.rst:298 msgid "" "Set *field* to the contents of the file named *value*, through :c:func:" "`MsiRecordSetStream`. *field* must be an integer; *value* a string." msgstr "" -#: ../../library/msilib.rst:303 +#: ../../library/msilib.rst:304 msgid "" "Set *field* to *value* through :c:func:`MsiRecordSetInteger`. Both *field* " "and *value* must be an integer." msgstr "" -#: ../../library/msilib.rst:309 +#: ../../library/msilib.rst:310 msgid "" "Set all fields of the record to 0, through :c:func:`MsiRecordClearData`." msgstr "" -#: ../../library/msilib.rst:314 +#: ../../library/msilib.rst:315 msgid "" "`MsiRecordGetFieldCount `_ `MsiRecordSetString `_" msgstr "" -#: ../../library/msilib.rst:323 +#: ../../library/msilib.rst:324 msgid "Errors" msgstr "" -#: ../../library/msilib.rst:325 +#: ../../library/msilib.rst:326 msgid "" "All wrappers around MSI functions raise :exc:`MSIError`; the string inside " "the exception will contain more detail." msgstr "" -#: ../../library/msilib.rst:332 +#: ../../library/msilib.rst:333 msgid "CAB Objects" msgstr "CAB 物件" -#: ../../library/msilib.rst:337 +#: ../../library/msilib.rst:338 msgid "" "The class :class:`CAB` represents a CAB file. During MSI construction, files " "will be added simultaneously to the ``Files`` table, and to a CAB file. " @@ -387,34 +390,34 @@ msgid "" "added to the MSI file." msgstr "" -#: ../../library/msilib.rst:342 +#: ../../library/msilib.rst:343 msgid "*name* is the name of the CAB file in the MSI file." msgstr "" -#: ../../library/msilib.rst:347 +#: ../../library/msilib.rst:348 msgid "" "Add the file with the pathname *full* to the CAB file, under the name " "*logical*. If there is already a file named *logical*, a new file name is " "created." msgstr "" -#: ../../library/msilib.rst:351 +#: ../../library/msilib.rst:352 msgid "" "Return the index of the file in the CAB file, and the new name of the file " "inside the CAB file." msgstr "" -#: ../../library/msilib.rst:357 +#: ../../library/msilib.rst:358 msgid "" "Generate a CAB file, add it as a stream to the MSI file, put it into the " "``Media`` table, and remove the generated file from the disk." msgstr "" -#: ../../library/msilib.rst:364 +#: ../../library/msilib.rst:365 msgid "Directory Objects" msgstr "" -#: ../../library/msilib.rst:369 +#: ../../library/msilib.rst:370 msgid "" "Create a new directory in the Directory table. There is a current component " "at each point in time for the directory, which is either explicitly created " @@ -426,7 +429,7 @@ msgid "" "table. *componentflags* specifies the default flags that new components get." msgstr "" -#: ../../library/msilib.rst:381 +#: ../../library/msilib.rst:382 msgid "" "Add an entry to the Component table, and make this component the current " "component for this directory. If no component name is given, the directory " @@ -435,7 +438,7 @@ msgid "" "is given, the KeyPath is left null in the Component table." msgstr "" -#: ../../library/msilib.rst:390 +#: ../../library/msilib.rst:391 msgid "" "Add a file to the current component of the directory, starting a new one if " "there is no current component. By default, the file name in the source and " @@ -444,17 +447,17 @@ msgid "" "*language* can be specified for the entry in the File table." msgstr "" -#: ../../library/msilib.rst:399 +#: ../../library/msilib.rst:400 msgid "" "Add a list of files to the current component as specified in the glob " "pattern. Individual files can be excluded in the *exclude* list." msgstr "" -#: ../../library/msilib.rst:405 +#: ../../library/msilib.rst:406 msgid "Remove ``.pyc`` files on uninstall." msgstr "" -#: ../../library/msilib.rst:410 +#: ../../library/msilib.rst:411 msgid "" "`Directory Table `_ `File Table `_" msgstr "" -#: ../../library/msilib.rst:418 +#: ../../library/msilib.rst:419 msgid "Features" msgstr "" -#: ../../library/msilib.rst:423 +#: ../../library/msilib.rst:424 msgid "" "Add a new record to the ``Feature`` table, using the values *id*, *parent." "id*, *title*, *desc*, *display*, *level*, *directory*, and *attributes*. The " @@ -475,24 +478,24 @@ msgid "" "of :class:`Directory`." msgstr "" -#: ../../library/msilib.rst:431 +#: ../../library/msilib.rst:432 msgid "" "Make this feature the current feature of :mod:`msilib`. New components are " "automatically added to the default feature, unless a feature is explicitly " "specified." msgstr "" -#: ../../library/msilib.rst:438 +#: ../../library/msilib.rst:439 msgid "" "`Feature Table `_" msgstr "" -#: ../../library/msilib.rst:443 +#: ../../library/msilib.rst:444 msgid "GUI classes" msgstr "" -#: ../../library/msilib.rst:445 +#: ../../library/msilib.rst:446 msgid "" ":mod:`msilib` provides several classes that wrap the GUI tables in an MSI " "database. However, no standard user interface is provided; use :mod:" @@ -500,81 +503,81 @@ msgid "" "installing Python packages." msgstr "" -#: ../../library/msilib.rst:453 +#: ../../library/msilib.rst:454 msgid "" "Base class of the dialog controls. *dlg* is the dialog object the control " "belongs to, and *name* is the control's name." msgstr "" -#: ../../library/msilib.rst:459 +#: ../../library/msilib.rst:460 msgid "Make an entry into the ``ControlEvent`` table for this control." msgstr "" -#: ../../library/msilib.rst:464 +#: ../../library/msilib.rst:465 msgid "Make an entry into the ``EventMapping`` table for this control." msgstr "" -#: ../../library/msilib.rst:469 +#: ../../library/msilib.rst:470 msgid "Make an entry into the ``ControlCondition`` table for this control." msgstr "" -#: ../../library/msilib.rst:474 +#: ../../library/msilib.rst:475 msgid "" "Create a radio button control named *name*. *property* is the installer " "property that gets set when a radio button is selected." msgstr "" -#: ../../library/msilib.rst:480 +#: ../../library/msilib.rst:481 msgid "" "Add a radio button named *name* to the group, at the coordinates *x*, *y*, " "*width*, *height*, and with the label *text*. If *value* is ``None``, it " "defaults to *name*." msgstr "" -#: ../../library/msilib.rst:487 +#: ../../library/msilib.rst:488 msgid "" "Return a new :class:`Dialog` object. An entry in the ``Dialog`` table is " "made, with the specified coordinates, dialog attributes, title, name of the " "first, default, and cancel controls." msgstr "" -#: ../../library/msilib.rst:494 +#: ../../library/msilib.rst:495 msgid "" "Return a new :class:`Control` object. An entry in the ``Control`` table is " "made with the specified parameters." msgstr "" -#: ../../library/msilib.rst:497 +#: ../../library/msilib.rst:498 msgid "" "This is a generic method; for specific types, specialized methods are " "provided." msgstr "" -#: ../../library/msilib.rst:503 +#: ../../library/msilib.rst:504 msgid "Add and return a ``Text`` control." msgstr "" -#: ../../library/msilib.rst:508 +#: ../../library/msilib.rst:509 msgid "Add and return a ``Bitmap`` control." msgstr "" -#: ../../library/msilib.rst:513 +#: ../../library/msilib.rst:514 msgid "Add and return a ``Line`` control." msgstr "" -#: ../../library/msilib.rst:518 +#: ../../library/msilib.rst:519 msgid "Add and return a ``PushButton`` control." msgstr "" -#: ../../library/msilib.rst:523 +#: ../../library/msilib.rst:524 msgid "Add and return a ``RadioButtonGroup`` control." msgstr "" -#: ../../library/msilib.rst:528 +#: ../../library/msilib.rst:529 msgid "Add and return a ``CheckBox`` control." msgstr "" -#: ../../library/msilib.rst:533 +#: ../../library/msilib.rst:534 msgid "" "`Dialog Table `_ `Control Table `_" msgstr "" -#: ../../library/msilib.rst:544 +#: ../../library/msilib.rst:545 msgid "Precomputed tables" msgstr "" -#: ../../library/msilib.rst:546 +#: ../../library/msilib.rst:547 msgid "" ":mod:`msilib` provides a few subpackages that contain only schema and table " "definitions. Currently, these definitions are based on MSI version 2.0." msgstr "" -#: ../../library/msilib.rst:552 +#: ../../library/msilib.rst:553 msgid "" "This is the standard MSI schema for MSI 2.0, with the *tables* variable " "providing a list of table definitions, and *_Validation_records* providing " "the data for MSI validation." msgstr "" -#: ../../library/msilib.rst:559 +#: ../../library/msilib.rst:560 msgid "" "This module contains table contents for the standard sequence tables: " "*AdminExecuteSequence*, *AdminUISequence*, *AdvtExecuteSequence*, " "*InstallExecuteSequence*, and *InstallUISequence*." msgstr "" -#: ../../library/msilib.rst:566 +#: ../../library/msilib.rst:567 msgid "" "This module contains definitions for the UIText and ActionText tables, for " "the standard installer actions." diff --git a/library/multiprocessing.po b/library/multiprocessing.po index 2082d4684b..2e35255491 100644 --- a/library/multiprocessing.po +++ b/library/multiprocessing.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.10\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2022-02-15 00:10+0000\n" +"POT-Creation-Date: 2022-05-21 17:35+0000\n" "PO-Revision-Date: 2018-05-23 16:06+0000\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -1360,7 +1360,7 @@ msgid "" msgstr "" #: ../../library/multiprocessing.rst:1261 -#: ../../library/multiprocessing.rst:1795 +#: ../../library/multiprocessing.rst:1796 msgid "The :meth:`~threading.Condition.wait_for` method was added." msgstr "" @@ -1834,7 +1834,7 @@ msgid "" "proxies." msgstr "" -#: ../../library/multiprocessing.rst:1652 +#: ../../library/multiprocessing.rst:1653 msgid "" "Returns a started :class:`~multiprocessing.managers.SyncManager` object " "which can be used for sharing objects between processes. The returned " @@ -1842,31 +1842,31 @@ msgid "" "will create shared objects and return corresponding proxies." msgstr "" -#: ../../library/multiprocessing.rst:1660 +#: ../../library/multiprocessing.rst:1661 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:1666 +#: ../../library/multiprocessing.rst:1667 msgid "Create a BaseManager object." msgstr "" -#: ../../library/multiprocessing.rst:1668 +#: ../../library/multiprocessing.rst:1669 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:1671 +#: ../../library/multiprocessing.rst:1672 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:1674 +#: ../../library/multiprocessing.rst:1675 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`` " @@ -1874,50 +1874,50 @@ msgid "" "it must be a byte string." msgstr "" -#: ../../library/multiprocessing.rst:1681 +#: ../../library/multiprocessing.rst:1682 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:1686 +#: ../../library/multiprocessing.rst:1687 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:1695 +#: ../../library/multiprocessing.rst:1696 msgid ":class:`Server` additionally has an :attr:`address` attribute." msgstr "" -#: ../../library/multiprocessing.rst:1699 +#: ../../library/multiprocessing.rst:1700 msgid "Connect a local manager object to a remote manager process::" msgstr "" -#: ../../library/multiprocessing.rst:1707 +#: ../../library/multiprocessing.rst:1708 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:1710 +#: ../../library/multiprocessing.rst:1711 msgid "This can be called multiple times." msgstr "" -#: ../../library/multiprocessing.rst:1714 +#: ../../library/multiprocessing.rst:1715 msgid "" "A classmethod which can be used for registering a type or callable with the " "manager class." msgstr "" -#: ../../library/multiprocessing.rst:1717 +#: ../../library/multiprocessing.rst:1718 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:1720 +#: ../../library/multiprocessing.rst:1721 msgid "" "*callable* is a callable used for creating objects for this type " "identifier. If a manager instance will be connected to the server using " @@ -1925,14 +1925,14 @@ msgid "" "then this can be left as ``None``." msgstr "" -#: ../../library/multiprocessing.rst:1726 +#: ../../library/multiprocessing.rst:1727 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:1730 +#: ../../library/multiprocessing.rst:1731 msgid "" "*exposed* is used to specify a sequence of method names which proxies for " "this typeid should be allowed to access using :meth:`BaseProxy." @@ -1943,7 +1943,7 @@ msgid "" "method and whose name does not begin with ``'_'``.)" msgstr "" -#: ../../library/multiprocessing.rst:1739 +#: ../../library/multiprocessing.rst:1740 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 " @@ -1953,22 +1953,22 @@ msgid "" "returned by the method will be copied by value." msgstr "" -#: ../../library/multiprocessing.rst:1746 +#: ../../library/multiprocessing.rst:1747 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:1750 +#: ../../library/multiprocessing.rst:1751 msgid ":class:`BaseManager` instances also have one read-only property:" msgstr "" -#: ../../library/multiprocessing.rst:1754 +#: ../../library/multiprocessing.rst:1755 msgid "The address used by the manager." msgstr "" -#: ../../library/multiprocessing.rst:1756 +#: ../../library/multiprocessing.rst:1757 msgid "" "Manager objects support the context management protocol -- see :ref:" "`typecontextmanager`. :meth:`~contextmanager.__enter__` starts the server " @@ -1976,173 +1976,173 @@ msgid "" "object. :meth:`~contextmanager.__exit__` calls :meth:`shutdown`." msgstr "" -#: ../../library/multiprocessing.rst:1762 +#: ../../library/multiprocessing.rst:1763 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:1767 +#: ../../library/multiprocessing.rst:1768 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:1771 +#: ../../library/multiprocessing.rst:1772 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:1777 +#: ../../library/multiprocessing.rst:1778 msgid "" "Create a shared :class:`threading.Barrier` object and return a proxy for it." msgstr "" -#: ../../library/multiprocessing.rst:1784 +#: ../../library/multiprocessing.rst:1785 msgid "" "Create a shared :class:`threading.BoundedSemaphore` object and return a " "proxy for it." msgstr "" -#: ../../library/multiprocessing.rst:1789 +#: ../../library/multiprocessing.rst:1790 msgid "" "Create a shared :class:`threading.Condition` object and return a proxy for " "it." msgstr "" -#: ../../library/multiprocessing.rst:1792 +#: ../../library/multiprocessing.rst:1793 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:1800 +#: ../../library/multiprocessing.rst:1801 msgid "" "Create a shared :class:`threading.Event` object and return a proxy for it." msgstr "" -#: ../../library/multiprocessing.rst:1804 +#: ../../library/multiprocessing.rst:1805 msgid "" "Create a shared :class:`threading.Lock` object and return a proxy for it." msgstr "" -#: ../../library/multiprocessing.rst:1808 +#: ../../library/multiprocessing.rst:1809 msgid "Create a shared :class:`Namespace` object and return a proxy for it." msgstr "" -#: ../../library/multiprocessing.rst:1812 +#: ../../library/multiprocessing.rst:1813 msgid "Create a shared :class:`queue.Queue` object and return a proxy for it." msgstr "" -#: ../../library/multiprocessing.rst:1816 +#: ../../library/multiprocessing.rst:1817 msgid "" "Create a shared :class:`threading.RLock` object and return a proxy for it." msgstr "" -#: ../../library/multiprocessing.rst:1820 +#: ../../library/multiprocessing.rst:1821 msgid "" "Create a shared :class:`threading.Semaphore` object and return a proxy for " "it." msgstr "" -#: ../../library/multiprocessing.rst:1825 +#: ../../library/multiprocessing.rst:1826 msgid "Create an array and return a proxy for it." msgstr "" -#: ../../library/multiprocessing.rst:1829 +#: ../../library/multiprocessing.rst:1830 msgid "" "Create an object with a writable ``value`` attribute and return a proxy for " "it." msgstr "" -#: ../../library/multiprocessing.rst:1836 +#: ../../library/multiprocessing.rst:1837 msgid "Create a shared :class:`dict` object and return a proxy for it." msgstr "" -#: ../../library/multiprocessing.rst:1841 +#: ../../library/multiprocessing.rst:1842 msgid "Create a shared :class:`list` object and return a proxy for it." msgstr "" -#: ../../library/multiprocessing.rst:1843 +#: ../../library/multiprocessing.rst:1844 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:1850 +#: ../../library/multiprocessing.rst:1851 msgid "A type that can register with :class:`SyncManager`." msgstr "" -#: ../../library/multiprocessing.rst:1852 +#: ../../library/multiprocessing.rst:1853 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:1855 +#: ../../library/multiprocessing.rst:1856 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:1871 +#: ../../library/multiprocessing.rst:1872 msgid "Customized managers" msgstr "" -#: ../../library/multiprocessing.rst:1873 +#: ../../library/multiprocessing.rst:1874 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:1898 +#: ../../library/multiprocessing.rst:1899 msgid "Using a remote manager" msgstr "" -#: ../../library/multiprocessing.rst:1900 +#: ../../library/multiprocessing.rst:1901 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:1903 +#: ../../library/multiprocessing.rst:1904 msgid "" "Running the following commands creates a server for a single shared queue " "which remote clients can access::" msgstr "" -#: ../../library/multiprocessing.rst:1915 +#: ../../library/multiprocessing.rst:1916 msgid "One client can access the server as follows::" msgstr "" -#: ../../library/multiprocessing.rst:1925 +#: ../../library/multiprocessing.rst:1926 msgid "Another client can also use it::" msgstr "" -#: ../../library/multiprocessing.rst:1936 +#: ../../library/multiprocessing.rst:1937 msgid "" "Local processes can also access that queue, using the code from above on the " "client to access it remotely::" msgstr "" -#: ../../library/multiprocessing.rst:1961 +#: ../../library/multiprocessing.rst:1962 msgid "Proxy Objects" msgstr "" -#: ../../library/multiprocessing.rst:1963 +#: ../../library/multiprocessing.rst:1964 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:1967 +#: ../../library/multiprocessing.rst:1968 msgid "" "A proxy object has methods which invoke corresponding methods of its " "referent (although not every method of the referent will necessarily be " @@ -2150,14 +2150,14 @@ msgid "" "its referent can:" msgstr "" -#: ../../library/multiprocessing.rst:1985 +#: ../../library/multiprocessing.rst:1986 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:1989 +#: ../../library/multiprocessing.rst:1990 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:" @@ -2165,11 +2165,11 @@ msgid "" "lists, dicts, and other :ref:`multiprocessing-proxy_objects`:" msgstr "" -#: ../../library/multiprocessing.rst:2005 +#: ../../library/multiprocessing.rst:2006 msgid "Similarly, dict and list proxies may be nested inside one another::" msgstr "" -#: ../../library/multiprocessing.rst:2018 +#: ../../library/multiprocessing.rst:2019 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 " @@ -2180,53 +2180,53 @@ msgid "" "assign the modified value to the container proxy::" msgstr "" -#: ../../library/multiprocessing.rst:2037 +#: ../../library/multiprocessing.rst:2038 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:2043 +#: ../../library/multiprocessing.rst:2044 msgid "" "The proxy types in :mod:`multiprocessing` do nothing to support comparisons " "by value. So, for instance, we have:" msgstr "" -#: ../../library/multiprocessing.rst:2051 +#: ../../library/multiprocessing.rst:2052 msgid "" "One should just use a copy of the referent instead when making comparisons." msgstr "" -#: ../../library/multiprocessing.rst:2055 +#: ../../library/multiprocessing.rst:2056 msgid "Proxy objects are instances of subclasses of :class:`BaseProxy`." msgstr "" -#: ../../library/multiprocessing.rst:2059 +#: ../../library/multiprocessing.rst:2060 msgid "Call and return the result of a method of the proxy's referent." msgstr "" -#: ../../library/multiprocessing.rst:2061 +#: ../../library/multiprocessing.rst:2062 msgid "" "If ``proxy`` is a proxy whose referent is ``obj`` then the expression ::" msgstr "" -#: ../../library/multiprocessing.rst:2065 +#: ../../library/multiprocessing.rst:2066 msgid "will evaluate the expression ::" msgstr "" -#: ../../library/multiprocessing.rst:2069 +#: ../../library/multiprocessing.rst:2070 msgid "in the manager's process." msgstr "" -#: ../../library/multiprocessing.rst:2071 +#: ../../library/multiprocessing.rst:2072 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:2075 +#: ../../library/multiprocessing.rst:2076 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 " @@ -2234,79 +2234,79 @@ msgid "" "meth:`_callmethod`." msgstr "" -#: ../../library/multiprocessing.rst:2080 +#: ../../library/multiprocessing.rst:2081 msgid "" "Note in particular that an exception will be raised if *methodname* has not " "been *exposed*." msgstr "" -#: ../../library/multiprocessing.rst:2083 +#: ../../library/multiprocessing.rst:2084 msgid "An example of the usage of :meth:`_callmethod`:" msgstr "" -#: ../../library/multiprocessing.rst:2099 +#: ../../library/multiprocessing.rst:2100 msgid "Return a copy of the referent." msgstr "" -#: ../../library/multiprocessing.rst:2101 +#: ../../library/multiprocessing.rst:2102 msgid "If the referent is unpicklable then this will raise an exception." msgstr "" -#: ../../library/multiprocessing.rst:2105 +#: ../../library/multiprocessing.rst:2106 msgid "Return a representation of the proxy object." msgstr "" -#: ../../library/multiprocessing.rst:2109 +#: ../../library/multiprocessing.rst:2110 msgid "Return the representation of the referent." msgstr "" -#: ../../library/multiprocessing.rst:2113 +#: ../../library/multiprocessing.rst:2114 msgid "Cleanup" msgstr "" -#: ../../library/multiprocessing.rst:2115 +#: ../../library/multiprocessing.rst:2116 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:2118 +#: ../../library/multiprocessing.rst:2119 msgid "" "A shared object gets deleted from the manager process when there are no " "longer any proxies referring to it." msgstr "" -#: ../../library/multiprocessing.rst:2123 +#: ../../library/multiprocessing.rst:2124 msgid "Process Pools" msgstr "" -#: ../../library/multiprocessing.rst:2128 +#: ../../library/multiprocessing.rst:2129 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:2133 +#: ../../library/multiprocessing.rst:2134 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:2137 +#: ../../library/multiprocessing.rst:2138 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:2140 -#: ../../library/multiprocessing.rst:2701 +#: ../../library/multiprocessing.rst:2141 +#: ../../library/multiprocessing.rst:2702 msgid "" "If *initializer* is not ``None`` then each worker process will call " "``initializer(*initargs)`` when it starts." msgstr "" -#: ../../library/multiprocessing.rst:2143 +#: ../../library/multiprocessing.rst:2144 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 " @@ -2314,7 +2314,7 @@ msgid "" "which means worker processes will live as long as the pool." msgstr "" -#: ../../library/multiprocessing.rst:2148 +#: ../../library/multiprocessing.rst:2149 msgid "" "*context* can be used to specify the context used for starting the worker " "processes. Usually a pool is created using the function :func:" @@ -2322,13 +2322,13 @@ msgid "" "both cases *context* is set appropriately." msgstr "" -#: ../../library/multiprocessing.rst:2154 +#: ../../library/multiprocessing.rst:2155 msgid "" "Note that the methods of the pool object should only be called by the " "process which created the pool." msgstr "" -#: ../../library/multiprocessing.rst:2158 +#: ../../library/multiprocessing.rst:2159 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 " @@ -2336,22 +2336,22 @@ msgid "" "to do this can lead to the process hanging on finalization." msgstr "" -#: ../../library/multiprocessing.rst:2163 +#: ../../library/multiprocessing.rst:2164 msgid "" "Note that it is **not correct** to rely on the garbage collector to destroy " "the pool as CPython does not assure that the finalizer of the pool will be " "called (see :meth:`object.__del__` for more information)." msgstr "" -#: ../../library/multiprocessing.rst:2167 +#: ../../library/multiprocessing.rst:2168 msgid "*maxtasksperchild*" msgstr "" -#: ../../library/multiprocessing.rst:2170 +#: ../../library/multiprocessing.rst:2171 msgid "*context*" msgstr "" -#: ../../library/multiprocessing.rst:2175 +#: ../../library/multiprocessing.rst:2176 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 " @@ -2362,7 +2362,7 @@ msgid "" "ability to the end user." msgstr "" -#: ../../library/multiprocessing.rst:2185 +#: ../../library/multiprocessing.rst:2186 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 " @@ -2370,14 +2370,14 @@ msgid "" "executed in one of the workers of the pool." msgstr "" -#: ../../library/multiprocessing.rst:2192 +#: ../../library/multiprocessing.rst:2193 msgid "" "A variant of the :meth:`apply` method which returns a :class:" "`~multiprocessing.pool.AsyncResult` object." msgstr "" -#: ../../library/multiprocessing.rst:2195 -#: ../../library/multiprocessing.rst:2226 +#: ../../library/multiprocessing.rst:2196 +#: ../../library/multiprocessing.rst:2227 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, " @@ -2385,60 +2385,60 @@ msgid "" "applied instead." msgstr "" -#: ../../library/multiprocessing.rst:2200 -#: ../../library/multiprocessing.rst:2231 +#: ../../library/multiprocessing.rst:2201 +#: ../../library/multiprocessing.rst:2232 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:2204 -#: ../../library/multiprocessing.rst:2235 +#: ../../library/multiprocessing.rst:2205 +#: ../../library/multiprocessing.rst:2236 msgid "" "Callbacks should complete immediately since otherwise the thread which " "handles the results will get blocked." msgstr "" -#: ../../library/multiprocessing.rst:2209 +#: ../../library/multiprocessing.rst:2210 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:2213 +#: ../../library/multiprocessing.rst:2214 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:2217 +#: ../../library/multiprocessing.rst:2218 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:2223 +#: ../../library/multiprocessing.rst:2224 msgid "" "A variant of the :meth:`.map` method which returns a :class:" "`~multiprocessing.pool.AsyncResult` object." msgstr "" -#: ../../library/multiprocessing.rst:2240 +#: ../../library/multiprocessing.rst:2241 msgid "A lazier version of :meth:`.map`." msgstr "" -#: ../../library/multiprocessing.rst:2242 +#: ../../library/multiprocessing.rst:2243 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:2247 +#: ../../library/multiprocessing.rst:2248 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: " @@ -2446,65 +2446,65 @@ msgid "" "result cannot be returned within *timeout* seconds." msgstr "" -#: ../../library/multiprocessing.rst:2254 +#: ../../library/multiprocessing.rst:2255 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:2260 +#: ../../library/multiprocessing.rst:2261 msgid "" "Like :meth:`~multiprocessing.pool.Pool.map` except that the elements of the " "*iterable* are expected to be iterables that are unpacked as arguments." msgstr "" -#: ../../library/multiprocessing.rst:2264 +#: ../../library/multiprocessing.rst:2265 msgid "" "Hence an *iterable* of ``[(1,2), (3, 4)]`` results in ``[func(1,2), " "func(3,4)]``." msgstr "" -#: ../../library/multiprocessing.rst:2271 +#: ../../library/multiprocessing.rst:2272 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:2279 +#: ../../library/multiprocessing.rst:2280 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:2284 +#: ../../library/multiprocessing.rst:2285 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:2290 +#: ../../library/multiprocessing.rst:2291 msgid "" "Wait for the worker processes to exit. One must call :meth:`close` or :meth:" "`terminate` before using :meth:`join`." msgstr "" -#: ../../library/multiprocessing.rst:2293 +#: ../../library/multiprocessing.rst:2294 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:2301 +#: ../../library/multiprocessing.rst:2302 msgid "" "The class of the result returned by :meth:`Pool.apply_async` and :meth:`Pool." "map_async`." msgstr "" -#: ../../library/multiprocessing.rst:2306 +#: ../../library/multiprocessing.rst:2307 msgid "" "Return the result when it arrives. If *timeout* is not ``None`` and the " "result does not arrive within *timeout* seconds then :exc:`multiprocessing." @@ -2512,41 +2512,41 @@ msgid "" "exception will be reraised by :meth:`get`." msgstr "" -#: ../../library/multiprocessing.rst:2313 +#: ../../library/multiprocessing.rst:2314 msgid "Wait until the result is available or until *timeout* seconds pass." msgstr "" -#: ../../library/multiprocessing.rst:2317 +#: ../../library/multiprocessing.rst:2318 msgid "Return whether the call has completed." msgstr "" -#: ../../library/multiprocessing.rst:2321 +#: ../../library/multiprocessing.rst:2322 msgid "" "Return whether the call completed without raising an exception. Will raise :" "exc:`ValueError` if the result is not ready." msgstr "" -#: ../../library/multiprocessing.rst:2324 +#: ../../library/multiprocessing.rst:2325 msgid "" "If the result is not ready, :exc:`ValueError` is raised instead of :exc:" "`AssertionError`." msgstr "" -#: ../../library/multiprocessing.rst:2328 +#: ../../library/multiprocessing.rst:2329 msgid "The following example demonstrates the use of a pool::" msgstr "" -#: ../../library/multiprocessing.rst:2355 +#: ../../library/multiprocessing.rst:2356 msgid "Listeners and Clients" msgstr "" -#: ../../library/multiprocessing.rst:2360 +#: ../../library/multiprocessing.rst:2361 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:2364 +#: ../../library/multiprocessing.rst:2365 msgid "" "However, the :mod:`multiprocessing.connection` module allows some extra " "flexibility. It basically gives a high level message oriented API for " @@ -2555,46 +2555,46 @@ msgid "" "multiple connections at the same time." msgstr "" -#: ../../library/multiprocessing.rst:2373 +#: ../../library/multiprocessing.rst:2374 msgid "" "Send a randomly generated message to the other end of the connection and " "wait for a reply." msgstr "" -#: ../../library/multiprocessing.rst:2376 +#: ../../library/multiprocessing.rst:2377 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:2382 +#: ../../library/multiprocessing.rst:2383 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:2385 +#: ../../library/multiprocessing.rst:2386 msgid "" "If a welcome message is not received, then :exc:`~multiprocessing." "AuthenticationError` is raised." msgstr "" -#: ../../library/multiprocessing.rst:2390 +#: ../../library/multiprocessing.rst:2391 msgid "" "Attempt to set up a connection to the listener which is using address " "*address*, returning a :class:`~Connection`." msgstr "" -#: ../../library/multiprocessing.rst:2393 +#: ../../library/multiprocessing.rst:2394 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:2397 -#: ../../library/multiprocessing.rst:2432 +#: ../../library/multiprocessing.rst:2398 +#: ../../library/multiprocessing.rst:2433 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 " @@ -2603,26 +2603,26 @@ msgid "" "`multiprocessing-auth-keys`." msgstr "" -#: ../../library/multiprocessing.rst:2405 +#: ../../library/multiprocessing.rst:2406 msgid "" "A wrapper for a bound socket or Windows named pipe which is 'listening' for " "connections." msgstr "" -#: ../../library/multiprocessing.rst:2408 +#: ../../library/multiprocessing.rst:2409 msgid "" "*address* is the address to be used by the bound socket or named pipe of the " "listener object." msgstr "" -#: ../../library/multiprocessing.rst:2413 +#: ../../library/multiprocessing.rst:2414 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:2417 +#: ../../library/multiprocessing.rst:2418 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 " @@ -2636,49 +2636,49 @@ msgid "" "using :func:`tempfile.mkstemp`." msgstr "" -#: ../../library/multiprocessing.rst:2428 +#: ../../library/multiprocessing.rst:2429 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:2440 +#: ../../library/multiprocessing.rst:2441 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:2447 +#: ../../library/multiprocessing.rst:2448 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:2451 +#: ../../library/multiprocessing.rst:2452 msgid "Listener objects have the following read-only properties:" msgstr "" -#: ../../library/multiprocessing.rst:2455 +#: ../../library/multiprocessing.rst:2456 msgid "The address which is being used by the Listener object." msgstr "" -#: ../../library/multiprocessing.rst:2459 +#: ../../library/multiprocessing.rst:2460 msgid "" "The address from which the last accepted connection came. If this is " "unavailable then it is ``None``." msgstr "" -#: ../../library/multiprocessing.rst:2462 +#: ../../library/multiprocessing.rst:2463 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:2469 +#: ../../library/multiprocessing.rst:2470 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 " @@ -2687,32 +2687,32 @@ msgid "" "zero timeout." msgstr "" -#: ../../library/multiprocessing.rst:2475 +#: ../../library/multiprocessing.rst:2476 msgid "" "For both Unix and Windows, an object can appear in *object_list* if it is" msgstr "" -#: ../../library/multiprocessing.rst:2478 +#: ../../library/multiprocessing.rst:2479 msgid "a readable :class:`~multiprocessing.connection.Connection` object;" msgstr "" -#: ../../library/multiprocessing.rst:2479 +#: ../../library/multiprocessing.rst:2480 msgid "a connected and readable :class:`socket.socket` object; or" msgstr "" -#: ../../library/multiprocessing.rst:2480 +#: ../../library/multiprocessing.rst:2481 msgid "" "the :attr:`~multiprocessing.Process.sentinel` attribute of a :class:" "`~multiprocessing.Process` object." msgstr "" -#: ../../library/multiprocessing.rst:2483 +#: ../../library/multiprocessing.rst:2484 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:2486 +#: ../../library/multiprocessing.rst:2487 msgid "" "**Unix**: ``wait(object_list, timeout)`` almost equivalent ``select." "select(object_list, [], [], timeout)``. The difference is that, if :func:" @@ -2720,7 +2720,7 @@ msgid "" "an error number of ``EINTR``, whereas :func:`wait` will not." msgstr "" -#: ../../library/multiprocessing.rst:2492 +#: ../../library/multiprocessing.rst:2493 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 " @@ -2729,46 +2729,46 @@ msgid "" "that pipe handles and socket handles are **not** waitable handles.)" msgstr "" -#: ../../library/multiprocessing.rst:2502 +#: ../../library/multiprocessing.rst:2503 msgid "**Examples**" msgstr "" -#: ../../library/multiprocessing.rst:2504 +#: ../../library/multiprocessing.rst:2505 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:2523 +#: ../../library/multiprocessing.rst:2524 msgid "" "The following code connects to the server and receives some data from the " "server::" msgstr "" -#: ../../library/multiprocessing.rst:2540 +#: ../../library/multiprocessing.rst:2541 msgid "" "The following code uses :func:`~multiprocessing.connection.wait` to wait for " "messages from multiple processes at once::" msgstr "" -#: ../../library/multiprocessing.rst:2579 +#: ../../library/multiprocessing.rst:2580 msgid "Address Formats" msgstr "" -#: ../../library/multiprocessing.rst:2581 +#: ../../library/multiprocessing.rst:2582 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:2584 +#: ../../library/multiprocessing.rst:2585 msgid "" "An ``'AF_UNIX'`` address is a string representing a filename on the " "filesystem." msgstr "" -#: ../../library/multiprocessing.rst:2587 +#: ../../library/multiprocessing.rst:2588 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 " @@ -2776,17 +2776,17 @@ msgid "" "samp:`r'\\\\\\\\{ServerName}\\\\pipe\\\\{PipeName}'` instead." msgstr "" -#: ../../library/multiprocessing.rst:2592 +#: ../../library/multiprocessing.rst:2593 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:2599 +#: ../../library/multiprocessing.rst:2600 msgid "Authentication keys" msgstr "" -#: ../../library/multiprocessing.rst:2601 +#: ../../library/multiprocessing.rst:2602 msgid "" "When one uses :meth:`Connection.recv `, the data received " "is automatically unpickled. Unfortunately unpickling data from an untrusted " @@ -2794,7 +2794,7 @@ msgid "" "use the :mod:`hmac` module to provide digest authentication." msgstr "" -#: ../../library/multiprocessing.rst:2607 +#: ../../library/multiprocessing.rst:2608 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 " @@ -2802,7 +2802,7 @@ msgid "" "using the same key does **not** involve sending the key over the connection.)" msgstr "" -#: ../../library/multiprocessing.rst:2613 +#: ../../library/multiprocessing.rst:2614 msgid "" "If authentication is requested but no authentication key is specified then " "the return value of ``current_process().authkey`` is used (see :class:" @@ -2813,17 +2813,17 @@ msgid "" "setting up connections between themselves." msgstr "" -#: ../../library/multiprocessing.rst:2621 +#: ../../library/multiprocessing.rst:2622 msgid "" "Suitable authentication keys can also be generated by using :func:`os." "urandom`." msgstr "" -#: ../../library/multiprocessing.rst:2625 +#: ../../library/multiprocessing.rst:2626 msgid "Logging" msgstr "" -#: ../../library/multiprocessing.rst:2627 +#: ../../library/multiprocessing.rst:2628 msgid "" "Some support for logging is available. Note, however, that the :mod:" "`logging` package does not use process shared locks so it is possible " @@ -2831,27 +2831,27 @@ msgid "" "mixed up." msgstr "" -#: ../../library/multiprocessing.rst:2634 +#: ../../library/multiprocessing.rst:2635 msgid "" "Returns the logger used by :mod:`multiprocessing`. If necessary, a new one " "will be created." msgstr "" -#: ../../library/multiprocessing.rst:2637 +#: ../../library/multiprocessing.rst:2638 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:2641 +#: ../../library/multiprocessing.rst:2642 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:2648 +#: ../../library/multiprocessing.rst:2649 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 " @@ -2860,25 +2860,25 @@ msgid "" "``level`` argument." msgstr "" -#: ../../library/multiprocessing.rst:2654 +#: ../../library/multiprocessing.rst:2655 msgid "Below is an example session with logging turned on::" msgstr "" -#: ../../library/multiprocessing.rst:2669 +#: ../../library/multiprocessing.rst:2670 msgid "For a full table of logging levels, see the :mod:`logging` module." msgstr "" -#: ../../library/multiprocessing.rst:2673 +#: ../../library/multiprocessing.rst:2674 msgid "The :mod:`multiprocessing.dummy` module" msgstr "" -#: ../../library/multiprocessing.rst:2678 +#: ../../library/multiprocessing.rst:2679 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:2683 +#: ../../library/multiprocessing.rst:2684 msgid "" "In particular, the ``Pool`` function provided by :mod:`multiprocessing." "dummy` returns an instance of :class:`ThreadPool`, which is a subclass of :" @@ -2886,7 +2886,7 @@ msgid "" "worker threads rather than worker processes." msgstr "" -#: ../../library/multiprocessing.rst:2691 +#: ../../library/multiprocessing.rst:2692 msgid "" "A thread pool object which controls a pool of worker threads to which jobs " "can be submitted. :class:`ThreadPool` instances are fully interface " @@ -2896,18 +2896,18 @@ msgid "" "pool.Pool.terminate` manually." msgstr "" -#: ../../library/multiprocessing.rst:2698 +#: ../../library/multiprocessing.rst:2699 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:2704 +#: ../../library/multiprocessing.rst:2705 msgid "" "Unlike :class:`Pool`, *maxtasksperchild* and *context* cannot be provided." msgstr "" -#: ../../library/multiprocessing.rst:2708 +#: ../../library/multiprocessing.rst:2709 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 :" @@ -2917,7 +2917,7 @@ msgid "" "is not understood by any other libraries." msgstr "" -#: ../../library/multiprocessing.rst:2715 +#: ../../library/multiprocessing.rst:2716 msgid "" "Users should generally prefer to use :class:`concurrent.futures." "ThreadPoolExecutor`, which has a simpler interface that was designed around " @@ -2926,69 +2926,69 @@ msgid "" "`asyncio`." msgstr "" -#: ../../library/multiprocessing.rst:2725 +#: ../../library/multiprocessing.rst:2726 msgid "Programming guidelines" msgstr "" -#: ../../library/multiprocessing.rst:2727 +#: ../../library/multiprocessing.rst:2728 msgid "" "There are certain guidelines and idioms which should be adhered to when " "using :mod:`multiprocessing`." msgstr "" -#: ../../library/multiprocessing.rst:2732 +#: ../../library/multiprocessing.rst:2733 msgid "All start methods" msgstr "" -#: ../../library/multiprocessing.rst:2734 +#: ../../library/multiprocessing.rst:2735 msgid "The following applies to all start methods." msgstr "" -#: ../../library/multiprocessing.rst:2736 +#: ../../library/multiprocessing.rst:2737 msgid "Avoid shared state" msgstr "" -#: ../../library/multiprocessing.rst:2738 +#: ../../library/multiprocessing.rst:2739 msgid "" "As far as possible one should try to avoid shifting large amounts of data " "between processes." msgstr "" -#: ../../library/multiprocessing.rst:2741 +#: ../../library/multiprocessing.rst:2742 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:2745 +#: ../../library/multiprocessing.rst:2746 msgid "Picklability" msgstr "" -#: ../../library/multiprocessing.rst:2747 +#: ../../library/multiprocessing.rst:2748 msgid "Ensure that the arguments to the methods of proxies are picklable." msgstr "" -#: ../../library/multiprocessing.rst:2749 +#: ../../library/multiprocessing.rst:2750 msgid "Thread safety of proxies" msgstr "" -#: ../../library/multiprocessing.rst:2751 +#: ../../library/multiprocessing.rst:2752 msgid "" "Do not use a proxy object from more than one thread unless you protect it " "with a lock." msgstr "" -#: ../../library/multiprocessing.rst:2754 +#: ../../library/multiprocessing.rst:2755 msgid "" "(There is never a problem with different processes using the *same* proxy.)" msgstr "" -#: ../../library/multiprocessing.rst:2756 +#: ../../library/multiprocessing.rst:2757 msgid "Joining zombie processes" msgstr "" -#: ../../library/multiprocessing.rst:2758 +#: ../../library/multiprocessing.rst:2759 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 :" @@ -2999,11 +2999,11 @@ msgid "" "all the processes that you start." msgstr "" -#: ../../library/multiprocessing.rst:2766 +#: ../../library/multiprocessing.rst:2767 msgid "Better to inherit than pickle/unpickle" msgstr "" -#: ../../library/multiprocessing.rst:2768 +#: ../../library/multiprocessing.rst:2769 msgid "" "When using the *spawn* or *forkserver* start methods many types from :mod:" "`multiprocessing` need to be picklable so that child processes can use " @@ -3013,11 +3013,11 @@ msgid "" "inherit it from an ancestor process." msgstr "" -#: ../../library/multiprocessing.rst:2776 +#: ../../library/multiprocessing.rst:2777 msgid "Avoid terminating processes" msgstr "" -#: ../../library/multiprocessing.rst:2778 +#: ../../library/multiprocessing.rst:2779 msgid "" "Using the :meth:`Process.terminate ` " "method to stop a process is liable to cause any shared resources (such as " @@ -3025,18 +3025,18 @@ msgid "" "become broken or unavailable to other processes." msgstr "" -#: ../../library/multiprocessing.rst:2784 +#: ../../library/multiprocessing.rst:2785 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:2788 +#: ../../library/multiprocessing.rst:2789 msgid "Joining processes that use queues" msgstr "" -#: ../../library/multiprocessing.rst:2790 +#: ../../library/multiprocessing.rst:2791 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 " @@ -3045,7 +3045,7 @@ msgid "" "queue to avoid this behaviour.)" msgstr "" -#: ../../library/multiprocessing.rst:2796 +#: ../../library/multiprocessing.rst:2797 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 " @@ -3054,21 +3054,21 @@ msgid "" "processes will be joined automatically." msgstr "" -#: ../../library/multiprocessing.rst:2802 +#: ../../library/multiprocessing.rst:2803 msgid "An example which will deadlock is the following::" msgstr "" -#: ../../library/multiprocessing.rst:2816 +#: ../../library/multiprocessing.rst:2817 msgid "" "A fix here would be to swap the last two lines (or simply remove the ``p." "join()`` line)." msgstr "" -#: ../../library/multiprocessing.rst:2819 +#: ../../library/multiprocessing.rst:2820 msgid "Explicitly pass resources to child processes" msgstr "" -#: ../../library/multiprocessing.rst:2821 +#: ../../library/multiprocessing.rst:2822 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. " @@ -3076,7 +3076,7 @@ msgid "" "for the child process." msgstr "" -#: ../../library/multiprocessing.rst:2826 +#: ../../library/multiprocessing.rst:2827 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 " @@ -3085,29 +3085,29 @@ msgid "" "collected in the parent process." msgstr "" -#: ../../library/multiprocessing.rst:2833 +#: ../../library/multiprocessing.rst:2834 msgid "So for instance ::" msgstr "" -#: ../../library/multiprocessing.rst:2845 +#: ../../library/multiprocessing.rst:2846 msgid "should be rewritten as ::" msgstr "" -#: ../../library/multiprocessing.rst:2857 +#: ../../library/multiprocessing.rst:2858 msgid "Beware of replacing :data:`sys.stdin` with a \"file like object\"" msgstr "" -#: ../../library/multiprocessing.rst:2859 +#: ../../library/multiprocessing.rst:2860 msgid ":mod:`multiprocessing` originally unconditionally called::" msgstr "" -#: ../../library/multiprocessing.rst:2863 +#: ../../library/multiprocessing.rst:2864 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:2869 +#: ../../library/multiprocessing.rst:2870 msgid "" "Which solves the fundamental issue of processes colliding with each other " "resulting in a bad file descriptor error, but introduces a potential danger " @@ -3117,33 +3117,33 @@ msgid "" "data being flushed to the object multiple times, resulting in corruption." msgstr "" -#: ../../library/multiprocessing.rst:2876 +#: ../../library/multiprocessing.rst:2877 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:2888 +#: ../../library/multiprocessing.rst:2889 msgid "" "For more information, see :issue:`5155`, :issue:`5313` and :issue:`5331`" msgstr "" -#: ../../library/multiprocessing.rst:2891 +#: ../../library/multiprocessing.rst:2892 msgid "The *spawn* and *forkserver* start methods" msgstr "" -#: ../../library/multiprocessing.rst:2893 +#: ../../library/multiprocessing.rst:2894 msgid "" "There are a few extra restriction which don't apply to the *fork* start " "method." msgstr "" -#: ../../library/multiprocessing.rst:2896 +#: ../../library/multiprocessing.rst:2897 msgid "More picklability" msgstr "" -#: ../../library/multiprocessing.rst:2898 +#: ../../library/multiprocessing.rst:2899 msgid "" "Ensure that all arguments to :meth:`Process.__init__` are picklable. Also, " "if you subclass :class:`~multiprocessing.Process` then make sure that " @@ -3151,11 +3151,11 @@ msgid "" "Process.start>` method is called." msgstr "" -#: ../../library/multiprocessing.rst:2903 +#: ../../library/multiprocessing.rst:2904 msgid "Global variables" msgstr "" -#: ../../library/multiprocessing.rst:2905 +#: ../../library/multiprocessing.rst:2906 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 " @@ -3163,66 +3163,66 @@ msgid "" "Process.start>` was called." msgstr "" -#: ../../library/multiprocessing.rst:2910 +#: ../../library/multiprocessing.rst:2911 msgid "" "However, global variables which are just module level constants cause no " "problems." msgstr "" -#: ../../library/multiprocessing.rst:2913 +#: ../../library/multiprocessing.rst:2914 msgid "Safe importing of main module" msgstr "" -#: ../../library/multiprocessing.rst:2915 +#: ../../library/multiprocessing.rst:2916 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:2919 +#: ../../library/multiprocessing.rst:2920 msgid "" "For example, using the *spawn* or *forkserver* start method running the " "following module would fail with a :exc:`RuntimeError`::" msgstr "" -#: ../../library/multiprocessing.rst:2931 +#: ../../library/multiprocessing.rst:2932 msgid "" "Instead one should protect the \"entry point\" of the program by using ``if " "__name__ == '__main__':`` as follows::" msgstr "" -#: ../../library/multiprocessing.rst:2945 +#: ../../library/multiprocessing.rst:2946 msgid "" "(The ``freeze_support()`` line can be omitted if the program will be run " "normally instead of frozen.)" msgstr "" -#: ../../library/multiprocessing.rst:2948 +#: ../../library/multiprocessing.rst:2949 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:2951 +#: ../../library/multiprocessing.rst:2952 msgid "" "Similar restrictions apply if a pool or manager is created in the main " "module." msgstr "" -#: ../../library/multiprocessing.rst:2958 +#: ../../library/multiprocessing.rst:2959 msgid "Examples" msgstr "範例" -#: ../../library/multiprocessing.rst:2960 +#: ../../library/multiprocessing.rst:2961 msgid "Demonstration of how to create and use customized managers and proxies:" msgstr "" -#: ../../library/multiprocessing.rst:2966 +#: ../../library/multiprocessing.rst:2967 msgid "Using :class:`~multiprocessing.pool.Pool`:" msgstr "" -#: ../../library/multiprocessing.rst:2972 +#: ../../library/multiprocessing.rst:2973 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/nis.po b/library/nis.po index b187a3efdd..bd1fe3d518 100644 --- a/library/nis.po +++ b/library/nis.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.10\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2022-03-23 00:14+0000\n" +"POT-Creation-Date: 2022-05-21 17:35+0000\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-" @@ -23,26 +23,29 @@ msgid ":mod:`nis` --- Interface to Sun's NIS (Yellow Pages)" msgstr ":mod:`nis` --- Sun NIS (Yellow Pages) 介面" #: ../../library/nis.rst:13 -msgid "The :mod:`nis` module is deprecated (see :pep:`594` for details)." -msgstr ":mod:`nis` 模組 (module) 即將被棄用(詳見 :pep:`594`\\ )。" +msgid "" +"The :mod:`nis` module is deprecated (see :pep:`PEP 594 <594#nis>` for " +"details)." +msgstr "" +":mod:`nis` 模組 (module) 即將被棄用(詳見 :pep:`PEP 594 <594#nis>`\\ )。" -#: ../../library/nis.rst:18 +#: ../../library/nis.rst:19 msgid "" "The :mod:`nis` module gives a thin wrapper around the NIS library, useful " "for central administration of several hosts." msgstr "" -#: ../../library/nis.rst:21 +#: ../../library/nis.rst:22 msgid "" "Because NIS exists only on Unix systems, this module is only available for " "Unix." msgstr "" -#: ../../library/nis.rst:23 +#: ../../library/nis.rst:24 msgid "The :mod:`nis` module defines the following functions:" msgstr "" -#: ../../library/nis.rst:28 +#: ../../library/nis.rst:29 msgid "" "Return the match for *key* in map *mapname*, or raise an error (:exc:`nis." "error`) if there is none. Both should be strings, *key* is 8-bit clean. " @@ -50,35 +53,35 @@ msgid "" "joys)." msgstr "" -#: ../../library/nis.rst:33 ../../library/nis.rst:45 +#: ../../library/nis.rst:34 ../../library/nis.rst:46 msgid "Note that *mapname* is first checked if it is an alias to another name." msgstr "" -#: ../../library/nis.rst:35 ../../library/nis.rst:47 ../../library/nis.rst:55 +#: ../../library/nis.rst:36 ../../library/nis.rst:48 ../../library/nis.rst:56 msgid "" "The *domain* argument allows overriding the NIS domain used for the lookup. " "If unspecified, lookup is in the default NIS domain." msgstr "" -#: ../../library/nis.rst:41 +#: ../../library/nis.rst:42 msgid "" "Return a dictionary mapping *key* to *value* such that ``match(key, " "mapname)==value``. Note that both keys and values of the dictionary are " "arbitrary arrays of bytes." msgstr "" -#: ../../library/nis.rst:53 +#: ../../library/nis.rst:54 msgid "Return a list of all valid maps." msgstr "" -#: ../../library/nis.rst:61 +#: ../../library/nis.rst:62 msgid "Return the system default NIS domain." msgstr "" -#: ../../library/nis.rst:64 +#: ../../library/nis.rst:65 msgid "The :mod:`nis` module defines the following exception:" msgstr "" -#: ../../library/nis.rst:68 +#: ../../library/nis.rst:69 msgid "An error raised when a NIS function returns an error code." msgstr "" diff --git a/library/optparse.po b/library/optparse.po index 0b5af825d9..2ce5aa0f2f 100644 --- a/library/optparse.po +++ b/library/optparse.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.10\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2021-09-13 00:11+0000\n" +"POT-Creation-Date: 2022-05-21 17:35+0000\n" "PO-Revision-Date: 2018-05-23 16:07+0000\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -167,7 +167,7 @@ msgid "" "These option syntaxes are not supported by :mod:`optparse`, and they never " "will be. This is deliberate: the first three are non-standard on any " "environment, and the last only makes sense if you're exclusively targeting " -"VMS, MS-DOS, and/or Windows." +"Windows or certain legacy platforms (e.g. VMS, MS-DOS)." msgstr "" #: ../../library/optparse.rst:160 diff --git a/library/os.path.po b/library/os.path.po index 971ea43eff..ff88c35fe8 100644 --- a/library/os.path.po +++ b/library/os.path.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.10\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2022-04-17 00:15+0000\n" +"POT-Creation-Date: 2022-05-21 17:35+0000\n" "PO-Revision-Date: 2018-05-23 16:07+0000\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -25,10 +25,10 @@ msgstr "" #: ../../library/os.path.rst:7 msgid "" "**Source code:** :source:`Lib/posixpath.py` (for POSIX) and :source:`Lib/" -"ntpath.py` (for Windows NT)." +"ntpath.py` (for Windows)." msgstr "" "**原始碼:**\\ :source:`Lib/posixpath.py`\\ (對於 POSIX)與 :source:`Lib/" -"ntpath.py`\\(對於 Windows NT)。" +"ntpath.py`\\(對於 Windows)。" #: ../../library/os.path.rst:14 msgid "" diff --git a/library/os.po b/library/os.po index 4bd35a1f9b..c003d0d519 100644 --- a/library/os.po +++ b/library/os.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.10\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2022-04-21 00:16+0000\n" +"POT-Creation-Date: 2022-05-21 17:35+0000\n" "PO-Revision-Date: 2018-05-23 16:07+0000\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -266,54 +266,54 @@ msgid "" "Return the filename corresponding to the controlling terminal of the process." msgstr "" -#: ../../library/os.rst:168 ../../library/os.rst:333 ../../library/os.rst:342 -#: ../../library/os.rst:351 ../../library/os.rst:361 ../../library/os.rst:370 -#: ../../library/os.rst:405 ../../library/os.rst:413 ../../library/os.rst:450 -#: ../../library/os.rst:461 ../../library/os.rst:471 ../../library/os.rst:481 -#: ../../library/os.rst:491 ../../library/os.rst:501 ../../library/os.rst:533 -#: ../../library/os.rst:540 ../../library/os.rst:547 ../../library/os.rst:557 -#: ../../library/os.rst:568 ../../library/os.rst:577 ../../library/os.rst:595 -#: ../../library/os.rst:603 ../../library/os.rst:611 ../../library/os.rst:620 -#: ../../library/os.rst:628 ../../library/os.rst:635 ../../library/os.rst:642 -#: ../../library/os.rst:651 ../../library/os.rst:856 ../../library/os.rst:868 -#: ../../library/os.rst:877 ../../library/os.rst:899 ../../library/os.rst:920 -#: ../../library/os.rst:957 ../../library/os.rst:978 ../../library/os.rst:990 -#: ../../library/os.rst:1170 ../../library/os.rst:1185 -#: ../../library/os.rst:1200 ../../library/os.rst:1213 -#: ../../library/os.rst:1282 ../../library/os.rst:1397 -#: ../../library/os.rst:1417 ../../library/os.rst:1429 -#: ../../library/os.rst:1480 ../../library/os.rst:1489 -#: ../../library/os.rst:1497 ../../library/os.rst:1506 -#: ../../library/os.rst:1542 ../../library/os.rst:1790 -#: ../../library/os.rst:1859 ../../library/os.rst:1873 -#: ../../library/os.rst:1886 ../../library/os.rst:1913 -#: ../../library/os.rst:1928 ../../library/os.rst:1941 -#: ../../library/os.rst:2130 ../../library/os.rst:2152 -#: ../../library/os.rst:2196 ../../library/os.rst:2207 -#: ../../library/os.rst:2884 ../../library/os.rst:3038 -#: ../../library/os.rst:3270 ../../library/os.rst:3663 -#: ../../library/os.rst:3671 ../../library/os.rst:3678 -#: ../../library/os.rst:3685 ../../library/os.rst:3692 -#: ../../library/os.rst:3699 ../../library/os.rst:3706 -#: ../../library/os.rst:3713 ../../library/os.rst:3721 -#: ../../library/os.rst:3729 ../../library/os.rst:3736 -#: ../../library/os.rst:3743 ../../library/os.rst:3752 -#: ../../library/os.rst:3760 ../../library/os.rst:3768 -#: ../../library/os.rst:3775 ../../library/os.rst:3782 -#: ../../library/os.rst:3803 ../../library/os.rst:3858 -#: ../../library/os.rst:3865 ../../library/os.rst:3886 -#: ../../library/os.rst:4002 ../../library/os.rst:4050 -#: ../../library/os.rst:4282 ../../library/os.rst:4303 -#: ../../library/os.rst:4314 ../../library/os.rst:4334 -#: ../../library/os.rst:4349 ../../library/os.rst:4404 -#: ../../library/os.rst:4418 ../../library/os.rst:4456 -#: ../../library/os.rst:4472 ../../library/os.rst:4486 -#: ../../library/os.rst:4497 ../../library/os.rst:4509 -#: ../../library/os.rst:4516 ../../library/os.rst:4525 -#: ../../library/os.rst:4534 ../../library/os.rst:4543 -#: ../../library/os.rst:4552 ../../library/os.rst:4698 -#: ../../library/os.rst:4707 ../../library/os.rst:4728 -#: ../../library/os.rst:4738 ../../library/os.rst:4747 +#: ../../library/os.rst:168 ../../library/os.rst:340 ../../library/os.rst:349 +#: ../../library/os.rst:358 ../../library/os.rst:368 ../../library/os.rst:377 +#: ../../library/os.rst:412 ../../library/os.rst:420 ../../library/os.rst:457 +#: ../../library/os.rst:468 ../../library/os.rst:478 ../../library/os.rst:488 +#: ../../library/os.rst:498 ../../library/os.rst:508 ../../library/os.rst:541 +#: ../../library/os.rst:548 ../../library/os.rst:555 ../../library/os.rst:565 +#: ../../library/os.rst:576 ../../library/os.rst:585 ../../library/os.rst:603 +#: ../../library/os.rst:611 ../../library/os.rst:619 ../../library/os.rst:628 +#: ../../library/os.rst:636 ../../library/os.rst:643 ../../library/os.rst:650 +#: ../../library/os.rst:659 ../../library/os.rst:864 ../../library/os.rst:876 +#: ../../library/os.rst:885 ../../library/os.rst:907 ../../library/os.rst:928 +#: ../../library/os.rst:965 ../../library/os.rst:986 ../../library/os.rst:998 +#: ../../library/os.rst:1178 ../../library/os.rst:1193 +#: ../../library/os.rst:1208 ../../library/os.rst:1221 +#: ../../library/os.rst:1290 ../../library/os.rst:1405 +#: ../../library/os.rst:1425 ../../library/os.rst:1437 +#: ../../library/os.rst:1488 ../../library/os.rst:1497 +#: ../../library/os.rst:1505 ../../library/os.rst:1514 +#: ../../library/os.rst:1550 ../../library/os.rst:1798 +#: ../../library/os.rst:1867 ../../library/os.rst:1881 +#: ../../library/os.rst:1894 ../../library/os.rst:1921 +#: ../../library/os.rst:1936 ../../library/os.rst:1949 +#: ../../library/os.rst:2138 ../../library/os.rst:2160 +#: ../../library/os.rst:2204 ../../library/os.rst:2215 +#: ../../library/os.rst:2892 ../../library/os.rst:3046 +#: ../../library/os.rst:3278 ../../library/os.rst:3671 +#: ../../library/os.rst:3679 ../../library/os.rst:3686 +#: ../../library/os.rst:3693 ../../library/os.rst:3700 +#: ../../library/os.rst:3707 ../../library/os.rst:3714 +#: ../../library/os.rst:3721 ../../library/os.rst:3729 +#: ../../library/os.rst:3737 ../../library/os.rst:3744 +#: ../../library/os.rst:3751 ../../library/os.rst:3760 +#: ../../library/os.rst:3768 ../../library/os.rst:3776 +#: ../../library/os.rst:3783 ../../library/os.rst:3790 +#: ../../library/os.rst:3811 ../../library/os.rst:3866 +#: ../../library/os.rst:3873 ../../library/os.rst:3894 +#: ../../library/os.rst:4010 ../../library/os.rst:4058 +#: ../../library/os.rst:4290 ../../library/os.rst:4311 +#: ../../library/os.rst:4322 ../../library/os.rst:4342 +#: ../../library/os.rst:4357 ../../library/os.rst:4412 +#: ../../library/os.rst:4426 ../../library/os.rst:4464 +#: ../../library/os.rst:4480 ../../library/os.rst:4494 +#: ../../library/os.rst:4505 ../../library/os.rst:4517 +#: ../../library/os.rst:4524 ../../library/os.rst:4533 +#: ../../library/os.rst:4542 ../../library/os.rst:4551 +#: ../../library/os.rst:4560 ../../library/os.rst:4706 +#: ../../library/os.rst:4715 ../../library/os.rst:4736 +#: ../../library/os.rst:4746 ../../library/os.rst:4755 msgid ":ref:`Availability `: Unix." msgstr ":ref:`適用 `:Unix。" @@ -329,8 +329,9 @@ msgstr "" msgid "" "This mapping is captured the first time the :mod:`os` module is imported, " "typically during Python startup as part of processing :file:`site.py`. " -"Changes to the environment made after this time are not reflected in ``os." -"environ``, except for changes made by modifying ``os.environ`` directly." +"Changes to the environment made after this time are not reflected in :data:" +"`os.environ`, except for changes made by modifying :data:`os.environ` " +"directly." msgstr "" #: ../../library/os.rst:183 @@ -349,8 +350,8 @@ msgstr "" #: ../../library/os.rst:193 msgid "" -"Calling :func:`putenv` directly does not change ``os.environ``, so it's " -"better to modify ``os.environ``." +"Calling :func:`putenv` directly does not change :data:`os.environ`, so it's " +"better to modify :data:`os.environ`." msgstr "" #: ../../library/os.rst:198 @@ -362,8 +363,8 @@ msgstr "" #: ../../library/os.rst:202 msgid "" "You can delete items in this mapping to unset environment variables. :func:" -"`unsetenv` will be called automatically when an item is deleted from ``os." -"environ``, and when one of the :meth:`pop` or :meth:`clear` methods is " +"`unsetenv` will be called automatically when an item is deleted from :data:" +"`os.environ`, and when one of the :meth:`pop` or :meth:`clear` methods is " "called." msgstr "" @@ -447,37 +448,43 @@ msgstr "" #: ../../library/os.rst:294 msgid "" "Return the value of the environment variable *key* if it exists, or " -"*default* if it doesn't. *key*, *default* and the result are str." +"*default* if it doesn't. *key*, *default* and the result are str. Note that " +"since :func:`getenv` uses :data:`os.environ`, the mapping of :func:`getenv` " +"is similarly also captured on import, and the function may not reflect " +"future environment changes." msgstr "" -#: ../../library/os.rst:297 +#: ../../library/os.rst:300 msgid "" "On Unix, keys and values are decoded with :func:`sys.getfilesystemencoding` " "and ``'surrogateescape'`` error handler. Use :func:`os.getenvb` if you would " "like to use a different encoding." msgstr "" -#: ../../library/os.rst:301 +#: ../../library/os.rst:304 msgid ":ref:`Availability `: most flavors of Unix, Windows." msgstr ":ref:`適用 `:大部分的 Unix、Windows。" -#: ../../library/os.rst:306 +#: ../../library/os.rst:309 msgid "" "Return the value of the environment variable *key* if it exists, or " -"*default* if it doesn't. *key*, *default* and the result are bytes." +"*default* if it doesn't. *key*, *default* and the result are bytes. Note " +"that since :func:`getenvb` uses :data:`os.environb`, the mapping of :func:" +"`getenvb` is similarly also captured on import, and the function may not " +"reflect future environment changes." msgstr "" -#: ../../library/os.rst:309 +#: ../../library/os.rst:316 msgid "" ":func:`getenvb` is only available if :data:`supports_bytes_environ` is " "``True``." msgstr "" -#: ../../library/os.rst:313 +#: ../../library/os.rst:320 msgid ":ref:`Availability `: most flavors of Unix." msgstr ":ref:`適用 `:大部分的 Unix。" -#: ../../library/os.rst:319 +#: ../../library/os.rst:326 msgid "" "Returns the list of directories that will be searched for a named " "executable, similar to a shell, when launching a process. *env*, when " @@ -485,33 +492,33 @@ msgid "" "in. By default, when *env* is ``None``, :data:`environ` is used." msgstr "" -#: ../../library/os.rst:330 +#: ../../library/os.rst:337 msgid "" "Return the effective group id of the current process. This corresponds to " "the \"set id\" bit on the file being executed in the current process." msgstr "" -#: ../../library/os.rst:340 +#: ../../library/os.rst:347 msgid "Return the current process's effective user id." msgstr "" -#: ../../library/os.rst:349 +#: ../../library/os.rst:356 msgid "Return the real group id of the current process." msgstr "" -#: ../../library/os.rst:356 +#: ../../library/os.rst:363 msgid "" "Return list of group ids that *user* belongs to. If *group* is not in the " "list, it is included; typically, *group* is specified as the group ID field " "from the password record for *user*." msgstr "" -#: ../../library/os.rst:367 +#: ../../library/os.rst:374 msgid "" "Return list of supplemental group ids associated with the current process." msgstr "" -#: ../../library/os.rst:373 +#: ../../library/os.rst:380 msgid "" "On macOS, :func:`getgroups` behavior differs somewhat from other Unix " "platforms. If the Python interpreter was built with a deployment target of :" @@ -528,7 +535,7 @@ msgid "" "get_config_var`." msgstr "" -#: ../../library/os.rst:390 +#: ../../library/os.rst:397 msgid "" "Return the name of the user logged in on the controlling terminal of the " "process. For most purposes, it is more useful to use :func:`getpass." @@ -537,42 +544,42 @@ msgid "" "getpwuid(os.getuid())[0]`` to get the login name of the current real user id." msgstr "" -#: ../../library/os.rst:397 ../../library/os.rst:432 ../../library/os.rst:932 -#: ../../library/os.rst:944 ../../library/os.rst:1146 ../../library/os.rst:1568 -#: ../../library/os.rst:1957 ../../library/os.rst:2230 -#: ../../library/os.rst:3018 ../../library/os.rst:3052 -#: ../../library/os.rst:3630 ../../library/os.rst:4135 -#: ../../library/os.rst:4146 ../../library/os.rst:4240 -#: ../../library/os.rst:4264 +#: ../../library/os.rst:404 ../../library/os.rst:439 ../../library/os.rst:940 +#: ../../library/os.rst:952 ../../library/os.rst:1154 ../../library/os.rst:1576 +#: ../../library/os.rst:1965 ../../library/os.rst:2238 +#: ../../library/os.rst:3026 ../../library/os.rst:3060 +#: ../../library/os.rst:3638 ../../library/os.rst:4143 +#: ../../library/os.rst:4154 ../../library/os.rst:4248 +#: ../../library/os.rst:4272 msgid ":ref:`Availability `: Unix, Windows." msgstr ":ref:`適用 `:Unix、Windows。" -#: ../../library/os.rst:402 +#: ../../library/os.rst:409 msgid "" "Return the process group id of the process with process id *pid*. If *pid* " "is 0, the process group id of the current process is returned." msgstr "" -#: ../../library/os.rst:411 +#: ../../library/os.rst:418 msgid "Return the id of the current process group." msgstr "" -#: ../../library/os.rst:420 +#: ../../library/os.rst:427 msgid "Return the current process id." msgstr "" -#: ../../library/os.rst:427 +#: ../../library/os.rst:434 msgid "" "Return the parent's process id. When the parent process has exited, on Unix " "the id returned is the one of the init process (1), on Windows it is still " "the same id, which may be already reused by another process." msgstr "" -#: ../../library/os.rst:433 +#: ../../library/os.rst:440 msgid "Added support for Windows." msgstr "新增對 Windows 的支援。" -#: ../../library/os.rst:441 +#: ../../library/os.rst:448 msgid "" "Get program scheduling priority. The value *which* is one of :const:" "`PRIO_PROCESS`, :const:`PRIO_PGRP`, or :const:`PRIO_USER`, and *who* is " @@ -583,78 +590,80 @@ msgid "" "user ID of the calling process." msgstr "" -#: ../../library/os.rst:458 +#: ../../library/os.rst:465 msgid "" "Parameters for the :func:`getpriority` and :func:`setpriority` functions." msgstr "" -#: ../../library/os.rst:467 +#: ../../library/os.rst:474 msgid "" "Return a tuple (ruid, euid, suid) denoting the current process's real, " "effective, and saved user ids." msgstr "" -#: ../../library/os.rst:477 +#: ../../library/os.rst:484 msgid "" "Return a tuple (rgid, egid, sgid) denoting the current process's real, " "effective, and saved group ids." msgstr "" -#: ../../library/os.rst:489 +#: ../../library/os.rst:496 msgid "Return the current process's real user id." msgstr "" -#: ../../library/os.rst:496 +#: ../../library/os.rst:503 msgid "" "Call the system initgroups() to initialize the group access list with all of " "the groups of which the specified username is a member, plus the specified " "group id." msgstr "" -#: ../../library/os.rst:509 +#: ../../library/os.rst:516 msgid "" "Set the environment variable named *key* to the string *value*. Such " "changes to the environment affect subprocesses started with :func:`os." "system`, :func:`popen` or :func:`fork` and :func:`execv`." msgstr "" -#: ../../library/os.rst:513 +#: ../../library/os.rst:520 msgid "" -"Assignments to items in ``os.environ`` are automatically translated into " +"Assignments to items in :data:`os.environ` are automatically translated into " "corresponding calls to :func:`putenv`; however, calls to :func:`putenv` " -"don't update ``os.environ``, so it is actually preferable to assign to items " -"of ``os.environ``." +"don't update :data:`os.environ`, so it is actually preferable to assign to " +"items of :data:`os.environ`. This also applies to :func:`getenv` and :func:" +"`getenvb`, which respectively use :data:`os.environ` and :data:`os.environb` " +"in their implementations." msgstr "" -#: ../../library/os.rst:520 +#: ../../library/os.rst:528 msgid "" "On some platforms, including FreeBSD and macOS, setting ``environ`` may " "cause memory leaks. Refer to the system documentation for :c:func:`putenv`." msgstr "" -#: ../../library/os.rst:523 +#: ../../library/os.rst:531 msgid "" "Raises an :ref:`auditing event ` ``os.putenv`` with arguments " "``key``, ``value``." msgstr "" -#: ../../library/os.rst:525 +#: ../../library/os.rst:533 msgid "The function is now always available." msgstr "" -#: ../../library/os.rst:531 +#: ../../library/os.rst:539 msgid "Set the current process's effective group id." msgstr "" -#: ../../library/os.rst:538 +#: ../../library/os.rst:546 msgid "Set the current process's effective user id." msgstr "" -#: ../../library/os.rst:545 +#: ../../library/os.rst:553 msgid "Set the current process' group id." msgstr "" -#: ../../library/os.rst:552 +#: ../../library/os.rst:560 msgid "" "Set the list of supplemental group ids associated with the current process " "to *groups*. *groups* must be a sequence, and each element must be an " @@ -662,7 +671,7 @@ msgid "" "the superuser." msgstr "" -#: ../../library/os.rst:558 +#: ../../library/os.rst:566 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:" @@ -670,21 +679,21 @@ msgid "" "calling setgroups()." msgstr "" -#: ../../library/os.rst:565 +#: ../../library/os.rst:573 msgid "" "Call the system call :c:func:`setpgrp` or ``setpgrp(0, 0)`` depending on " "which version is implemented (if any). See the Unix manual for the " "semantics." msgstr "" -#: ../../library/os.rst:573 +#: ../../library/os.rst:581 msgid "" "Call the system call :c:func:`setpgid` to set the process group id of the " "process with id *pid* to the process group with id *pgrp*. See the Unix " "manual for the semantics." msgstr "" -#: ../../library/os.rst:584 +#: ../../library/os.rst:592 msgid "" "Set program scheduling priority. The value *which* is one of :const:" "`PRIO_PROCESS`, :const:`PRIO_PGRP`, or :const:`PRIO_USER`, and *who* is " @@ -697,141 +706,141 @@ msgid "" "scheduling." msgstr "" -#: ../../library/os.rst:601 +#: ../../library/os.rst:609 msgid "Set the current process's real and effective group ids." msgstr "" -#: ../../library/os.rst:608 +#: ../../library/os.rst:616 msgid "Set the current process's real, effective, and saved group ids." msgstr "" -#: ../../library/os.rst:617 +#: ../../library/os.rst:625 msgid "Set the current process's real, effective, and saved user ids." msgstr "" -#: ../../library/os.rst:626 +#: ../../library/os.rst:634 msgid "Set the current process's real and effective user ids." msgstr "" -#: ../../library/os.rst:633 +#: ../../library/os.rst:641 msgid "" "Call the system call :c:func:`getsid`. See the Unix manual for the " "semantics." msgstr "" -#: ../../library/os.rst:640 +#: ../../library/os.rst:648 msgid "" "Call the system call :c:func:`setsid`. See the Unix manual for the " "semantics." msgstr "" -#: ../../library/os.rst:649 +#: ../../library/os.rst:657 msgid "Set the current process's user id." msgstr "" -#: ../../library/os.rst:657 +#: ../../library/os.rst:665 msgid "" "Return the error message corresponding to the error code in *code*. On " "platforms where :c:func:`strerror` returns ``NULL`` when given an unknown " "error number, :exc:`ValueError` is raised." msgstr "" -#: ../../library/os.rst:664 +#: ../../library/os.rst:672 msgid "" "``True`` if the native OS type of the environment is bytes (eg. ``False`` on " "Windows)." msgstr "" -#: ../../library/os.rst:672 +#: ../../library/os.rst:680 msgid "Set the current numeric umask and return the previous umask." msgstr "" -#: ../../library/os.rst:681 +#: ../../library/os.rst:689 msgid "" "Returns information identifying the current operating system. The return " "value is an object with five attributes:" msgstr "" -#: ../../library/os.rst:684 +#: ../../library/os.rst:692 msgid ":attr:`sysname` - operating system name" msgstr ":attr:`sysname` - 作業系統名稱" -#: ../../library/os.rst:685 +#: ../../library/os.rst:693 msgid ":attr:`nodename` - name of machine on network (implementation-defined)" msgstr "" -#: ../../library/os.rst:686 +#: ../../library/os.rst:694 msgid ":attr:`release` - operating system release" msgstr "" -#: ../../library/os.rst:687 +#: ../../library/os.rst:695 msgid ":attr:`version` - operating system version" msgstr ":attr:`version` - 作業系統版本" -#: ../../library/os.rst:688 +#: ../../library/os.rst:696 msgid ":attr:`machine` - hardware identifier" msgstr "" -#: ../../library/os.rst:690 +#: ../../library/os.rst:698 msgid "" "For backwards compatibility, this object is also iterable, behaving like a " "five-tuple containing :attr:`sysname`, :attr:`nodename`, :attr:`release`, :" "attr:`version`, and :attr:`machine` in that order." msgstr "" -#: ../../library/os.rst:695 +#: ../../library/os.rst:703 msgid "" "Some systems truncate :attr:`nodename` to 8 characters or to the leading " "component; a better way to get the hostname is :func:`socket.gethostname` " "or even ``socket.gethostbyaddr(socket.gethostname())``." msgstr "" -#: ../../library/os.rst:701 +#: ../../library/os.rst:709 msgid ":ref:`Availability `: recent flavors of Unix." msgstr ":ref:`適用 `:近期的 Unix。" -#: ../../library/os.rst:702 ../../library/os.rst:4265 +#: ../../library/os.rst:710 ../../library/os.rst:4273 msgid "" "Return type changed from a tuple to a tuple-like object with named " "attributes." msgstr "" -#: ../../library/os.rst:711 +#: ../../library/os.rst:719 msgid "" "Unset (delete) the environment variable named *key*. Such changes to the " "environment affect subprocesses started with :func:`os.system`, :func:" "`popen` or :func:`fork` and :func:`execv`." msgstr "" -#: ../../library/os.rst:715 +#: ../../library/os.rst:723 msgid "" -"Deletion of items in ``os.environ`` is automatically translated into a " +"Deletion of items in :data:`os.environ` is automatically translated into a " "corresponding call to :func:`unsetenv`; however, calls to :func:`unsetenv` " -"don't update ``os.environ``, so it is actually preferable to delete items of " -"``os.environ``." +"don't update :data:`os.environ`, so it is actually preferable to delete " +"items of :data:`os.environ`." msgstr "" -#: ../../library/os.rst:720 +#: ../../library/os.rst:728 msgid "" "Raises an :ref:`auditing event ` ``os.unsetenv`` with argument " "``key``." msgstr "" -#: ../../library/os.rst:722 +#: ../../library/os.rst:730 msgid "The function is now always available and is also available on Windows." msgstr "" -#: ../../library/os.rst:729 +#: ../../library/os.rst:737 msgid "File Object Creation" msgstr "" -#: ../../library/os.rst:731 +#: ../../library/os.rst:739 msgid "" "These functions create new :term:`file objects `. (See also :" "func:`~os.open` for opening file descriptors.)" msgstr "" -#: ../../library/os.rst:737 +#: ../../library/os.rst:745 msgid "" "Return an open file object connected to the file descriptor *fd*. This is " "an alias of the :func:`open` built-in function and accepts the same " @@ -839,16 +848,16 @@ msgid "" "must always be an integer." msgstr "" -#: ../../library/os.rst:746 +#: ../../library/os.rst:754 msgid "File Descriptor Operations" msgstr "" -#: ../../library/os.rst:748 +#: ../../library/os.rst:756 msgid "" "These functions operate on I/O streams referenced using file descriptors." msgstr "" -#: ../../library/os.rst:750 +#: ../../library/os.rst:758 msgid "" "File descriptors are small integers corresponding to a file that has been " "opened by the current process. For example, standard input is usually file " @@ -858,7 +867,7 @@ msgid "" "pipes are also referenced by file descriptors." msgstr "" -#: ../../library/os.rst:757 +#: ../../library/os.rst:765 msgid "" "The :meth:`~io.IOBase.fileno` method can be used to obtain the file " "descriptor associated with a :term:`file object` when required. Note that " @@ -866,11 +875,11 @@ msgid "" "ignoring aspects such as internal buffering of data." msgstr "" -#: ../../library/os.rst:765 +#: ../../library/os.rst:773 msgid "Close file descriptor *fd*." msgstr "" -#: ../../library/os.rst:769 +#: ../../library/os.rst:777 msgid "" "This function is intended for low-level I/O and must be applied to a file " "descriptor as returned by :func:`os.open` or :func:`pipe`. To close a " @@ -878,13 +887,13 @@ msgid "" "`popen` or :func:`fdopen`, use its :meth:`~io.IOBase.close` method." msgstr "" -#: ../../library/os.rst:777 +#: ../../library/os.rst:785 msgid "" "Close all file descriptors from *fd_low* (inclusive) to *fd_high* " "(exclusive), ignoring errors. Equivalent to (but much faster than)::" msgstr "" -#: ../../library/os.rst:789 +#: ../../library/os.rst:797 msgid "" "Copy *count* bytes from file descriptor *src*, starting from offset " "*offset_src*, to file descriptor *dst*, starting from offset *offset_dst*. " @@ -894,7 +903,7 @@ msgid "" "attr:`~OSError.errno` set to :data:`errno.EXDEV`." msgstr "" -#: ../../library/os.rst:796 ../../library/os.rst:1444 +#: ../../library/os.rst:804 ../../library/os.rst:1452 msgid "" "This copy is done without the additional cost of transferring data from the " "kernel to user space and then back into the kernel. Additionally, some " @@ -902,50 +911,50 @@ msgid "" "files are opened as binary." msgstr "" -#: ../../library/os.rst:801 +#: ../../library/os.rst:809 msgid "" "The return value is the amount of bytes copied. This could be less than the " "amount requested." msgstr "" -#: ../../library/os.rst:805 +#: ../../library/os.rst:813 msgid "" ":ref:`Availability `: Linux kernel >= 4.5 or glibc >= 2.27." msgstr "" -#: ../../library/os.rst:811 +#: ../../library/os.rst:819 msgid "" "Return a string describing the encoding of the device associated with *fd* " "if it is connected to a terminal; else return :const:`None`." msgstr "" -#: ../../library/os.rst:814 +#: ../../library/os.rst:822 msgid "" "On Unix, if the :ref:`Python UTF-8 Mode ` is enabled, return " "``'UTF-8'`` rather than the device encoding." msgstr "" -#: ../../library/os.rst:817 +#: ../../library/os.rst:825 msgid "On Unix, the function now implements the Python UTF-8 Mode." msgstr "" -#: ../../library/os.rst:823 +#: ../../library/os.rst:831 msgid "" "Return a duplicate of file descriptor *fd*. The new file descriptor is :ref:" "`non-inheritable `." msgstr "" -#: ../../library/os.rst:826 +#: ../../library/os.rst:834 msgid "" "On Windows, when duplicating a standard stream (0: stdin, 1: stdout, 2: " "stderr), the new file descriptor is :ref:`inheritable `." msgstr "" -#: ../../library/os.rst:830 ../../library/os.rst:1032 +#: ../../library/os.rst:838 ../../library/os.rst:1040 msgid "The new file descriptor is now non-inheritable." msgstr "" -#: ../../library/os.rst:836 +#: ../../library/os.rst:844 msgid "" "Duplicate file descriptor *fd* to *fd2*, closing the latter first if " "necessary. Return *fd2*. The new file descriptor is :ref:`inheritable " @@ -953,51 +962,51 @@ msgid "" "``False``." msgstr "" -#: ../../library/os.rst:841 +#: ../../library/os.rst:849 msgid "Add the optional *inheritable* parameter." msgstr "" -#: ../../library/os.rst:844 +#: ../../library/os.rst:852 msgid "Return *fd2* on success. Previously, ``None`` was always returned." msgstr "" -#: ../../library/os.rst:850 +#: ../../library/os.rst:858 msgid "" "Change the mode of the file given by *fd* to the numeric *mode*. See the " "docs for :func:`chmod` for possible values of *mode*. As of Python 3.3, " "this is equivalent to ``os.chmod(fd, mode)``." msgstr "" -#: ../../library/os.rst:854 ../../library/os.rst:1834 ../../library/os.rst:1925 +#: ../../library/os.rst:862 ../../library/os.rst:1842 ../../library/os.rst:1933 msgid "" "Raises an :ref:`auditing event ` ``os.chmod`` with arguments " "``path``, ``mode``, ``dir_fd``." msgstr "" -#: ../../library/os.rst:861 +#: ../../library/os.rst:869 msgid "" "Change the owner and group id of the file given by *fd* to the numeric *uid* " "and *gid*. To leave one of the ids unchanged, set it to -1. See :func:" "`chown`. As of Python 3.3, this is equivalent to ``os.chown(fd, uid, gid)``." msgstr "" -#: ../../library/os.rst:866 ../../library/os.rst:1856 ../../library/os.rst:1938 +#: ../../library/os.rst:874 ../../library/os.rst:1864 ../../library/os.rst:1946 msgid "" "Raises an :ref:`auditing event ` ``os.chown`` with arguments " "``path``, ``uid``, ``gid``, ``dir_fd``." msgstr "" -#: ../../library/os.rst:873 +#: ../../library/os.rst:881 msgid "" "Force write of file with filedescriptor *fd* to disk. Does not force update " "of metadata." msgstr "" -#: ../../library/os.rst:879 +#: ../../library/os.rst:887 msgid "This function is not available on MacOS." msgstr "" -#: ../../library/os.rst:884 +#: ../../library/os.rst:892 msgid "" "Return system configuration information relevant to an open file. *name* " "specifies the configuration value to retrieve; it may be a string which is " @@ -1008,7 +1017,7 @@ msgid "" "included in that mapping, passing an integer for *name* is also accepted." msgstr "" -#: ../../library/os.rst:892 ../../library/os.rst:2187 +#: ../../library/os.rst:900 ../../library/os.rst:2195 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 " @@ -1016,80 +1025,80 @@ msgid "" "`errno.EINVAL` for the error number." msgstr "" -#: ../../library/os.rst:897 +#: ../../library/os.rst:905 msgid "As of Python 3.3, this is equivalent to ``os.pathconf(fd, name)``." msgstr "" -#: ../../library/os.rst:904 +#: ../../library/os.rst:912 msgid "" "Get the status of the file descriptor *fd*. Return a :class:`stat_result` " "object." msgstr "" -#: ../../library/os.rst:907 +#: ../../library/os.rst:915 msgid "As of Python 3.3, this is equivalent to ``os.stat(fd)``." msgstr "" -#: ../../library/os.rst:911 ../../library/os.rst:2022 +#: ../../library/os.rst:919 ../../library/os.rst:2030 msgid "The :func:`.stat` function." msgstr "" -#: ../../library/os.rst:916 +#: ../../library/os.rst:924 msgid "" "Return information about the filesystem containing the file associated with " "file descriptor *fd*, like :func:`statvfs`. As of Python 3.3, this is " "equivalent to ``os.statvfs(fd)``." msgstr "" -#: ../../library/os.rst:925 +#: ../../library/os.rst:933 msgid "" "Force write of file with filedescriptor *fd* to disk. On Unix, this calls " "the native :c:func:`fsync` function; on Windows, the MS :c:func:`_commit` " "function." msgstr "" -#: ../../library/os.rst:928 +#: ../../library/os.rst:936 msgid "" "If you're starting with a buffered Python :term:`file object` *f*, first do " "``f.flush()``, and then do ``os.fsync(f.fileno())``, to ensure that all " "internal buffers associated with *f* are written to disk." msgstr "" -#: ../../library/os.rst:937 +#: ../../library/os.rst:945 msgid "" "Truncate the file corresponding to file descriptor *fd*, so that it is at " "most *length* bytes in size. As of Python 3.3, this is equivalent to ``os." "truncate(fd, length)``." msgstr "" -#: ../../library/os.rst:941 +#: ../../library/os.rst:949 msgid "" "Raises an :ref:`auditing event ` ``os.truncate`` with arguments " "``fd``, ``length``." msgstr "" -#: ../../library/os.rst:945 ../../library/os.rst:3055 +#: ../../library/os.rst:953 ../../library/os.rst:3063 msgid "Added support for Windows" msgstr "新增對 Windows 的支援" -#: ../../library/os.rst:951 +#: ../../library/os.rst:959 msgid "" "Get the blocking mode of the file descriptor: ``False`` if the :data:" "`O_NONBLOCK` flag is set, ``True`` if the flag is cleared." msgstr "" -#: ../../library/os.rst:954 +#: ../../library/os.rst:962 msgid "See also :func:`set_blocking` and :meth:`socket.socket.setblocking`." msgstr "" "另請參閱 :func:`set_blocking` 與 :meth:`socket.socket.setblocking`\\ 。" -#: ../../library/os.rst:963 +#: ../../library/os.rst:971 msgid "" "Return ``True`` if the file descriptor *fd* is open and connected to a tty(-" "like) device, else ``False``." msgstr "" -#: ../../library/os.rst:969 +#: ../../library/os.rst:977 msgid "" "Apply, test or remove a POSIX lock on an open file descriptor. *fd* is an " "open file descriptor. *cmd* specifies the command to use - one of :data:" @@ -1097,17 +1106,17 @@ msgid "" "specifies the section of the file to lock." msgstr "" -#: ../../library/os.rst:975 +#: ../../library/os.rst:983 msgid "" "Raises an :ref:`auditing event ` ``os.lockf`` with arguments " "``fd``, ``cmd``, ``len``." msgstr "" -#: ../../library/os.rst:987 +#: ../../library/os.rst:995 msgid "Flags that specify what action :func:`lockf` will take." msgstr "" -#: ../../library/os.rst:996 +#: ../../library/os.rst:1004 msgid "" "Set the current position of file descriptor *fd* to position *pos*, modified " "by *how*: :const:`SEEK_SET` or ``0`` to set the position relative to the " @@ -1117,19 +1126,19 @@ msgid "" "beginning." msgstr "" -#: ../../library/os.rst:1007 +#: ../../library/os.rst:1015 msgid "" "Parameters to the :func:`lseek` function. Their values are 0, 1, and 2, " "respectively." msgstr "" -#: ../../library/os.rst:1010 +#: ../../library/os.rst:1018 msgid "" "Some operating systems could support additional values, like :data:`os." "SEEK_HOLE` or :data:`os.SEEK_DATA`." msgstr "" -#: ../../library/os.rst:1017 +#: ../../library/os.rst:1025 msgid "" "Open the file *path* and set various flags according to *flags* and possibly " "its mode according to *mode*. When computing *mode*, the current umask " @@ -1137,7 +1146,7 @@ msgid "" "file. The new file descriptor is :ref:`non-inheritable `." msgstr "" -#: ../../library/os.rst:1022 +#: ../../library/os.rst:1030 msgid "" "For a description of the flag and mode values, see the C run-time " "documentation; flag constants (like :const:`O_RDONLY` and :const:`O_WRONLY`) " @@ -1145,19 +1154,19 @@ msgid "" "const:`O_BINARY` is needed to open files in binary mode." msgstr "" -#: ../../library/os.rst:1027 +#: ../../library/os.rst:1035 msgid "" "This function can support :ref:`paths relative to directory descriptors " "` with the *dir_fd* parameter." msgstr "" -#: ../../library/os.rst:1030 +#: ../../library/os.rst:1038 msgid "" "Raises an :ref:`auditing event ` ``open`` with arguments ``path``, " "``mode``, ``flags``." msgstr "" -#: ../../library/os.rst:1037 +#: ../../library/os.rst:1045 msgid "" "This function is intended for low-level I/O. For normal usage, use the " "built-in function :func:`open`, which returns a :term:`file object` with :" @@ -1165,39 +1174,39 @@ msgid "" "a file descriptor in a file object, use :func:`fdopen`." msgstr "" -#: ../../library/os.rst:1042 ../../library/os.rst:2063 -#: ../../library/os.rst:2131 ../../library/os.rst:2153 -#: ../../library/os.rst:2234 ../../library/os.rst:2265 +#: ../../library/os.rst:1050 ../../library/os.rst:2071 +#: ../../library/os.rst:2139 ../../library/os.rst:2161 +#: ../../library/os.rst:2242 ../../library/os.rst:2273 msgid "The *dir_fd* argument." msgstr "*dir_fd* 引數。" -#: ../../library/os.rst:1045 ../../library/os.rst:1364 -#: ../../library/os.rst:1523 ../../library/os.rst:4386 +#: ../../library/os.rst:1053 ../../library/os.rst:1372 +#: ../../library/os.rst:1531 ../../library/os.rst:4394 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 :" "exc:`InterruptedError` exception (see :pep:`475` for the rationale)." msgstr "" -#: ../../library/os.rst:1050 ../../library/os.rst:1731 -#: ../../library/os.rst:1763 ../../library/os.rst:1794 -#: ../../library/os.rst:1840 ../../library/os.rst:1874 -#: ../../library/os.rst:1914 ../../library/os.rst:1929 -#: ../../library/os.rst:1942 ../../library/os.rst:2001 -#: ../../library/os.rst:2030 ../../library/os.rst:2066 -#: ../../library/os.rst:2107 ../../library/os.rst:2134 -#: ../../library/os.rst:2156 ../../library/os.rst:2197 -#: ../../library/os.rst:2268 ../../library/os.rst:2287 -#: ../../library/os.rst:2373 ../../library/os.rst:2646 -#: ../../library/os.rst:2897 ../../library/os.rst:3058 -#: ../../library/os.rst:3074 ../../library/os.rst:3114 -#: ../../library/os.rst:3212 ../../library/os.rst:3273 -#: ../../library/os.rst:3456 ../../library/os.rst:3635 -#: ../../library/os.rst:4123 +#: ../../library/os.rst:1058 ../../library/os.rst:1739 +#: ../../library/os.rst:1771 ../../library/os.rst:1802 +#: ../../library/os.rst:1848 ../../library/os.rst:1882 +#: ../../library/os.rst:1922 ../../library/os.rst:1937 +#: ../../library/os.rst:1950 ../../library/os.rst:2009 +#: ../../library/os.rst:2038 ../../library/os.rst:2074 +#: ../../library/os.rst:2115 ../../library/os.rst:2142 +#: ../../library/os.rst:2164 ../../library/os.rst:2205 +#: ../../library/os.rst:2276 ../../library/os.rst:2295 +#: ../../library/os.rst:2381 ../../library/os.rst:2654 +#: ../../library/os.rst:2905 ../../library/os.rst:3066 +#: ../../library/os.rst:3082 ../../library/os.rst:3122 +#: ../../library/os.rst:3220 ../../library/os.rst:3281 +#: ../../library/os.rst:3464 ../../library/os.rst:3643 +#: ../../library/os.rst:4131 msgid "Accepts a :term:`path-like object`." msgstr "" -#: ../../library/os.rst:1053 +#: ../../library/os.rst:1061 msgid "" "The following constants are options for the *flags* parameter to the :func:" "`~os.open` function. They can be combined using the bitwise OR operator ``|" @@ -1207,45 +1216,45 @@ msgid "" "on Windows." msgstr "" -#: ../../library/os.rst:1068 +#: ../../library/os.rst:1076 msgid "The above constants are available on Unix and Windows." msgstr "" -#: ../../library/os.rst:1079 +#: ../../library/os.rst:1087 msgid "The above constants are only available on Unix." msgstr "" -#: ../../library/os.rst:1081 +#: ../../library/os.rst:1089 msgid "Add :data:`O_CLOEXEC` constant." msgstr "" -#: ../../library/os.rst:1092 +#: ../../library/os.rst:1100 msgid "The above constants are only available on Windows." msgstr "" -#: ../../library/os.rst:1099 +#: ../../library/os.rst:1107 msgid "The above constants are only available on macOS." msgstr "" -#: ../../library/os.rst:1101 +#: ../../library/os.rst:1109 msgid "" "Add :data:`O_EVTONLY`, :data:`O_FSYNC`, :data:`O_SYMLINK` and :data:" "`O_NOFOLLOW_ANY` constants." msgstr "" -#: ../../library/os.rst:1115 +#: ../../library/os.rst:1123 msgid "" "The above constants are extensions and not present if they are not defined " "by the C library." msgstr "" -#: ../../library/os.rst:1118 +#: ../../library/os.rst:1126 msgid "" "Add :data:`O_PATH` on systems that support it. Add :data:`O_TMPFILE`, only " "available on Linux Kernel 3.11 or newer." msgstr "" -#: ../../library/os.rst:1128 +#: ../../library/os.rst:1136 msgid "" "Open a new pseudo-terminal pair. Return a pair of file descriptors " "``(master, slave)`` for the pty and the tty, respectively. The new file " @@ -1253,23 +1262,23 @@ msgid "" "more portable approach, use the :mod:`pty` module." msgstr "" -#: ../../library/os.rst:1134 ../../library/os.rst:1160 -#: ../../library/os.rst:3820 +#: ../../library/os.rst:1142 ../../library/os.rst:1168 +#: ../../library/os.rst:3828 msgid ":ref:`Availability `: some flavors of Unix." msgstr ":ref:`適用 `:部分的 Unix。" -#: ../../library/os.rst:1135 ../../library/os.rst:1147 +#: ../../library/os.rst:1143 ../../library/os.rst:1155 msgid "The new file descriptors are now non-inheritable." msgstr "" -#: ../../library/os.rst:1141 +#: ../../library/os.rst:1149 msgid "" "Create a pipe. Return a pair of file descriptors ``(r, w)`` usable for " "reading and writing, respectively. The new file descriptor is :ref:`non-" "inheritable `." msgstr "" -#: ../../library/os.rst:1153 +#: ../../library/os.rst:1161 msgid "" "Create a pipe with *flags* set atomically. *flags* can be constructed by " "ORing together one or more of these values: :data:`O_NONBLOCK`, :data:" @@ -1277,13 +1286,13 @@ msgid "" "and writing, respectively." msgstr "" -#: ../../library/os.rst:1166 +#: ../../library/os.rst:1174 msgid "" "Ensures that enough disk space is allocated for the file specified by *fd* " "starting from *offset* and continuing for *len* bytes." msgstr "" -#: ../../library/os.rst:1176 +#: ../../library/os.rst:1184 msgid "" "Announces an intention to access data in a specific pattern thus allowing " "the kernel to make optimizations. The advice applies to the region of the " @@ -1294,25 +1303,25 @@ msgid "" "`POSIX_FADV_DONTNEED`." msgstr "" -#: ../../library/os.rst:1196 +#: ../../library/os.rst:1204 msgid "" "Flags that can be used in *advice* in :func:`posix_fadvise` that specify the " "access pattern that is likely to be used." msgstr "" -#: ../../library/os.rst:1206 +#: ../../library/os.rst:1214 msgid "" "Read at most *n* bytes from file descriptor *fd* at a position of *offset*, " "leaving the file offset unchanged." msgstr "" -#: ../../library/os.rst:1209 ../../library/os.rst:1353 +#: ../../library/os.rst:1217 ../../library/os.rst:1361 msgid "" "Return a bytestring containing the bytes read. If the end of the file " "referred to by *fd* has been reached, an empty bytes object is returned." msgstr "" -#: ../../library/os.rst:1219 +#: ../../library/os.rst:1227 msgid "" "Read from a file descriptor *fd* at a position of *offset* into mutable :" "term:`bytes-like objects ` *buffers*, leaving the file " @@ -1320,89 +1329,89 @@ msgid "" "move on to the next buffer in the sequence to hold the rest of the data." msgstr "" -#: ../../library/os.rst:1224 ../../library/os.rst:1294 +#: ../../library/os.rst:1232 ../../library/os.rst:1302 msgid "" "The flags argument contains a bitwise OR of zero or more of the following " "flags:" msgstr "" -#: ../../library/os.rst:1227 +#: ../../library/os.rst:1235 msgid ":data:`RWF_HIPRI`" msgstr ":data:`RWF_HIPRI`" -#: ../../library/os.rst:1228 +#: ../../library/os.rst:1236 msgid ":data:`RWF_NOWAIT`" msgstr ":data:`RWF_NOWAIT`" -#: ../../library/os.rst:1230 ../../library/os.rst:1473 +#: ../../library/os.rst:1238 ../../library/os.rst:1481 msgid "" "Return the total number of bytes actually read which can be less than the " "total capacity of all the objects." msgstr "" -#: ../../library/os.rst:1233 ../../library/os.rst:1303 -#: ../../library/os.rst:1476 ../../library/os.rst:1538 +#: ../../library/os.rst:1241 ../../library/os.rst:1311 +#: ../../library/os.rst:1484 ../../library/os.rst:1546 msgid "" "The operating system may set a limit (:func:`sysconf` value " "``'SC_IOV_MAX'``) on the number of buffers that can be used." msgstr "" -#: ../../library/os.rst:1236 +#: ../../library/os.rst:1244 msgid "Combine the functionality of :func:`os.readv` and :func:`os.pread`." msgstr "" -#: ../../library/os.rst:1241 +#: ../../library/os.rst:1249 msgid "" ":ref:`Availability `: Linux 2.6.30 and newer, FreeBSD 6.0 and " "newer, OpenBSD 2.7 and newer, AIX 7.1 and newer. Using flags requires Linux " "4.6 or newer." msgstr "" -#: ../../library/os.rst:1247 +#: ../../library/os.rst:1255 msgid "" "Do not wait for data which is not immediately available. If this flag is " "specified, the system call will return instantly if it would have to read " "data from the backing storage or wait for a lock." msgstr "" -#: ../../library/os.rst:1251 +#: ../../library/os.rst:1259 msgid "" "If some data was successfully read, it will return the number of bytes read. " "If no bytes were read, it will return ``-1`` and set errno to :data:`errno." "EAGAIN`." msgstr "" -#: ../../library/os.rst:1256 +#: ../../library/os.rst:1264 msgid ":ref:`Availability `: Linux 4.14 and newer." msgstr ":ref:`適用 `:Linux 4.14 以上。" -#: ../../library/os.rst:1262 +#: ../../library/os.rst:1270 msgid "" "High priority read/write. Allows block-based filesystems to use polling of " "the device, which provides lower latency, but may use additional resources." msgstr "" -#: ../../library/os.rst:1266 +#: ../../library/os.rst:1274 msgid "" "Currently, on Linux, this feature is usable only on a file descriptor opened " "using the :data:`O_DIRECT` flag." msgstr "" -#: ../../library/os.rst:1270 +#: ../../library/os.rst:1278 msgid ":ref:`Availability `: Linux 4.6 and newer." msgstr ":ref:`適用 `:Linux 4.6 以上。" -#: ../../library/os.rst:1276 +#: ../../library/os.rst:1284 msgid "" "Write the bytestring in *str* to file descriptor *fd* at position of " "*offset*, leaving the file offset unchanged." msgstr "" -#: ../../library/os.rst:1279 ../../library/os.rst:1513 +#: ../../library/os.rst:1287 ../../library/os.rst:1521 msgid "Return the number of bytes actually written." msgstr "" -#: ../../library/os.rst:1288 +#: ../../library/os.rst:1296 msgid "" "Write the *buffers* contents to file descriptor *fd* at a offset *offset*, " "leaving the file offset unchanged. *buffers* must be a sequence of :term:" @@ -1411,50 +1420,50 @@ msgid "" "the second, and so on." msgstr "" -#: ../../library/os.rst:1297 +#: ../../library/os.rst:1305 msgid ":data:`RWF_DSYNC`" msgstr ":data:`RWF_DSYNC`" -#: ../../library/os.rst:1298 +#: ../../library/os.rst:1306 msgid ":data:`RWF_SYNC`" msgstr ":data:`RWF_SYNC`" -#: ../../library/os.rst:1299 +#: ../../library/os.rst:1307 msgid ":data:`RWF_APPEND`" msgstr ":data:`RWF_APPEND`" -#: ../../library/os.rst:1301 +#: ../../library/os.rst:1309 msgid "Return the total number of bytes actually written." msgstr "" -#: ../../library/os.rst:1306 +#: ../../library/os.rst:1314 msgid "Combine the functionality of :func:`os.writev` and :func:`os.pwrite`." msgstr "" -#: ../../library/os.rst:1311 +#: ../../library/os.rst:1319 msgid "" ":ref:`Availability `: Linux 2.6.30 and newer, FreeBSD 6.0 and " "newer, OpenBSD 2.7 and newer, AIX 7.1 and newer. Using flags requires Linux " "4.7 or newer." msgstr "" -#: ../../library/os.rst:1317 +#: ../../library/os.rst:1325 msgid "" "Provide a per-write equivalent of the :data:`O_DSYNC` :func:`os.open` flag. " "This flag effect applies only to the data range written by the system call." msgstr "" -#: ../../library/os.rst:1321 ../../library/os.rst:1331 +#: ../../library/os.rst:1329 ../../library/os.rst:1339 msgid ":ref:`Availability `: Linux 4.7 and newer." msgstr ":ref:`適用 `:Linux 4.7 以上。" -#: ../../library/os.rst:1327 +#: ../../library/os.rst:1335 msgid "" "Provide a per-write equivalent of the :data:`O_SYNC` :func:`os.open` flag. " "This flag effect applies only to the data range written by the system call." msgstr "" -#: ../../library/os.rst:1337 +#: ../../library/os.rst:1345 msgid "" "Provide a per-write equivalent of the :data:`O_APPEND` :func:`os.open` flag. " "This flag is meaningful only for :func:`os.pwritev`, and its effect applies " @@ -1464,15 +1473,15 @@ msgid "" "*offset* is updated." msgstr "" -#: ../../library/os.rst:1345 +#: ../../library/os.rst:1353 msgid ":ref:`Availability `: Linux 4.16 and newer." msgstr ":ref:`適用 `:Linux 4.16 以上。" -#: ../../library/os.rst:1351 +#: ../../library/os.rst:1359 msgid "Read at most *n* bytes from file descriptor *fd*." msgstr "" -#: ../../library/os.rst:1358 +#: ../../library/os.rst:1366 msgid "" "This function is intended for low-level I/O and must be applied to a file " "descriptor as returned by :func:`os.open` or :func:`pipe`. To read a \"file " @@ -1481,26 +1490,26 @@ msgid "" "`~file.readline` methods." msgstr "" -#: ../../library/os.rst:1373 +#: ../../library/os.rst:1381 msgid "" "Copy *count* bytes from file descriptor *in_fd* to file descriptor *out_fd* " "starting at *offset*. Return the number of bytes sent. When EOF is reached " "return ``0``." msgstr "" -#: ../../library/os.rst:1377 +#: ../../library/os.rst:1385 msgid "" "The first function notation is supported by all platforms that define :func:" "`sendfile`." msgstr "" -#: ../../library/os.rst:1380 +#: ../../library/os.rst:1388 msgid "" "On Linux, if *offset* is given as ``None``, the bytes are read from the " "current position of *in_fd* and the position of *in_fd* is updated." msgstr "" -#: ../../library/os.rst:1383 +#: ../../library/os.rst:1391 msgid "" "The second case may be used on macOS and FreeBSD where *headers* and " "*trailers* are arbitrary sequences of buffers that are written before and " @@ -1508,52 +1517,52 @@ msgid "" "case." msgstr "" -#: ../../library/os.rst:1387 +#: ../../library/os.rst:1395 msgid "" "On macOS and FreeBSD, a value of ``0`` for *count* specifies to send until " "the end of *in_fd* is reached." msgstr "" -#: ../../library/os.rst:1390 +#: ../../library/os.rst:1398 msgid "" "All platforms support sockets as *out_fd* file descriptor, and some " "platforms allow other types (e.g. regular file, pipe) as well." msgstr "" -#: ../../library/os.rst:1393 +#: ../../library/os.rst:1401 msgid "" "Cross-platform applications should not use *headers*, *trailers* and *flags* " "arguments." msgstr "" -#: ../../library/os.rst:1400 +#: ../../library/os.rst:1408 msgid "" "For a higher-level wrapper of :func:`sendfile`, see :meth:`socket.socket." "sendfile`." msgstr "" -#: ../../library/os.rst:1405 +#: ../../library/os.rst:1413 msgid "Parameters *out* and *in* was renamed to *out_fd* and *in_fd*." msgstr "" -#: ../../library/os.rst:1411 +#: ../../library/os.rst:1419 msgid "" "Set the blocking mode of the specified file descriptor. Set the :data:" "`O_NONBLOCK` flag if blocking is ``False``, clear the flag otherwise." msgstr "" -#: ../../library/os.rst:1414 +#: ../../library/os.rst:1422 msgid "See also :func:`get_blocking` and :meth:`socket.socket.setblocking`." msgstr "" "另請參閱 :func:`get_blocking` 與 :meth:`socket.socket.setblocking`\\ 。" -#: ../../library/os.rst:1425 +#: ../../library/os.rst:1433 msgid "" "Parameters to the :func:`sendfile` function, if the implementation supports " "them." msgstr "" -#: ../../library/os.rst:1435 +#: ../../library/os.rst:1443 msgid "" "Transfer *count* bytes from file descriptor *src*, starting from offset " "*offset_src*, to file descriptor *dst*, starting from offset *offset_dst*. " @@ -1565,7 +1574,7 @@ msgid "" "`~OSError.errno` set to :data:`errno.EXDEV`." msgstr "" -#: ../../library/os.rst:1449 +#: ../../library/os.rst:1457 msgid "" "Upon successful completion, returns the number of bytes spliced to or from " "the pipe. A return value of 0 means end of input. If *src* refers to a pipe, " @@ -1574,12 +1583,12 @@ msgid "" "the pipe." msgstr "" -#: ../../library/os.rst:1456 +#: ../../library/os.rst:1464 msgid "" ":ref:`Availability `: Linux kernel >= 2.6.17 and glibc >= 2.5" msgstr "" -#: ../../library/os.rst:1468 +#: ../../library/os.rst:1476 msgid "" "Read from a file descriptor *fd* into a number of mutable :term:`bytes-like " "objects ` *buffers*. Transfer data into each buffer until " @@ -1587,30 +1596,30 @@ msgid "" "rest of the data." msgstr "" -#: ../../library/os.rst:1486 +#: ../../library/os.rst:1494 msgid "" "Return the process group associated with the terminal given by *fd* (an open " "file descriptor as returned by :func:`os.open`)." msgstr "" -#: ../../library/os.rst:1494 +#: ../../library/os.rst:1502 msgid "" "Set the process group associated with the terminal given by *fd* (an open " "file descriptor as returned by :func:`os.open`) to *pg*." msgstr "" -#: ../../library/os.rst:1502 +#: ../../library/os.rst:1510 msgid "" "Return a string which specifies the terminal device associated with file " "descriptor *fd*. If *fd* is not associated with a terminal device, an " "exception is raised." msgstr "" -#: ../../library/os.rst:1511 +#: ../../library/os.rst:1519 msgid "Write the bytestring in *str* to file descriptor *fd*." msgstr "" -#: ../../library/os.rst:1517 +#: ../../library/os.rst:1525 msgid "" "This function is intended for low-level I/O and must be applied to a file " "descriptor as returned by :func:`os.open` or :func:`pipe`. To write a " @@ -1619,7 +1628,7 @@ msgid "" "its :meth:`~file.write` method." msgstr "" -#: ../../library/os.rst:1531 +#: ../../library/os.rst:1539 msgid "" "Write the contents of *buffers* to file descriptor *fd*. *buffers* must be a " "sequence of :term:`bytes-like objects `. Buffers are " @@ -1627,70 +1636,70 @@ msgid "" "before proceeding to the second, and so on." msgstr "" -#: ../../library/os.rst:1536 +#: ../../library/os.rst:1544 msgid "Returns the total number of bytes actually written." msgstr "" -#: ../../library/os.rst:1549 +#: ../../library/os.rst:1557 msgid "Querying the size of a terminal" msgstr "" -#: ../../library/os.rst:1555 +#: ../../library/os.rst:1563 msgid "" "Return the size of the terminal window as ``(columns, lines)``, tuple of " "type :class:`terminal_size`." msgstr "" -#: ../../library/os.rst:1558 +#: ../../library/os.rst:1566 msgid "" "The optional argument ``fd`` (default ``STDOUT_FILENO``, or standard output) " "specifies which file descriptor should be queried." msgstr "" -#: ../../library/os.rst:1561 +#: ../../library/os.rst:1569 msgid "" "If the file descriptor is not connected to a terminal, an :exc:`OSError` is " "raised." msgstr "" -#: ../../library/os.rst:1564 +#: ../../library/os.rst:1572 msgid "" ":func:`shutil.get_terminal_size` is the high-level function which should " "normally be used, ``os.get_terminal_size`` is the low-level implementation." msgstr "" -#: ../../library/os.rst:1572 +#: ../../library/os.rst:1580 msgid "" "A subclass of tuple, holding ``(columns, lines)`` of the terminal window " "size." msgstr "" -#: ../../library/os.rst:1576 +#: ../../library/os.rst:1584 msgid "Width of the terminal window in characters." msgstr "" -#: ../../library/os.rst:1580 +#: ../../library/os.rst:1588 msgid "Height of the terminal window in characters." msgstr "" -#: ../../library/os.rst:1586 +#: ../../library/os.rst:1594 msgid "Inheritance of File Descriptors" msgstr "" -#: ../../library/os.rst:1590 +#: ../../library/os.rst:1598 msgid "" "A file descriptor has an \"inheritable\" flag which indicates if the file " "descriptor can be inherited by child processes. Since Python 3.4, file " "descriptors created by Python are non-inheritable by default." msgstr "" -#: ../../library/os.rst:1594 +#: ../../library/os.rst:1602 msgid "" "On UNIX, non-inheritable file descriptors are closed in child processes at " "the execution of a new program, other file descriptors are inherited." msgstr "" -#: ../../library/os.rst:1597 +#: ../../library/os.rst:1605 msgid "" "On Windows, non-inheritable handles and file descriptors are closed in child " "processes, except for standard streams (file descriptors 0, 1 and 2: stdin, " @@ -1701,40 +1710,40 @@ msgid "" "only inherited if the *close_fds* parameter is ``False``." msgstr "" -#: ../../library/os.rst:1607 +#: ../../library/os.rst:1615 msgid "" "Get the \"inheritable\" flag of the specified file descriptor (a boolean)." msgstr "" -#: ../../library/os.rst:1611 +#: ../../library/os.rst:1619 msgid "Set the \"inheritable\" flag of the specified file descriptor." msgstr "" -#: ../../library/os.rst:1615 +#: ../../library/os.rst:1623 msgid "Get the \"inheritable\" flag of the specified handle (a boolean)." msgstr "" -#: ../../library/os.rst:1617 ../../library/os.rst:1623 -#: ../../library/os.rst:3562 ../../library/os.rst:4158 -#: ../../library/os.rst:4204 +#: ../../library/os.rst:1625 ../../library/os.rst:1631 +#: ../../library/os.rst:3570 ../../library/os.rst:4166 +#: ../../library/os.rst:4212 msgid ":ref:`Availability `: Windows." msgstr ":ref:`適用 `:Windows。" -#: ../../library/os.rst:1621 +#: ../../library/os.rst:1629 msgid "Set the \"inheritable\" flag of the specified handle." msgstr "" -#: ../../library/os.rst:1629 +#: ../../library/os.rst:1637 msgid "Files and Directories" msgstr "" -#: ../../library/os.rst:1631 +#: ../../library/os.rst:1639 msgid "" "On some Unix platforms, many of these functions support one or more of these " "features:" msgstr "" -#: ../../library/os.rst:1636 +#: ../../library/os.rst:1644 msgid "" "**specifying a file descriptor:** Normally the *path* argument provided to " "functions in the :mod:`os` module must be a string specifying a file path. " @@ -1745,7 +1754,7 @@ msgid "" "``chdir``).)" msgstr "" -#: ../../library/os.rst:1644 +#: ../../library/os.rst:1652 msgid "" "You can check whether or not *path* can be specified as a file descriptor " "for a particular function on your platform using :data:`os.supports_fd`. If " @@ -1753,13 +1762,13 @@ msgid "" "`NotImplementedError`." msgstr "" -#: ../../library/os.rst:1649 +#: ../../library/os.rst:1657 msgid "" "If the function also supports *dir_fd* or *follow_symlinks* arguments, it's " "an error to specify one of those when supplying *path* as a file descriptor." msgstr "" -#: ../../library/os.rst:1654 +#: ../../library/os.rst:1662 msgid "" "**paths relative to directory descriptors:** If *dir_fd* is not ``None``, it " "should be a file descriptor referring to a directory, and the path to " @@ -1770,14 +1779,14 @@ msgid "" "``access``)." msgstr "" -#: ../../library/os.rst:1661 +#: ../../library/os.rst:1669 msgid "" "You can check whether or not *dir_fd* is supported for a particular function " "on your platform using :data:`os.supports_dir_fd`. If it's unavailable, " "using it will raise a :exc:`NotImplementedError`." msgstr "" -#: ../../library/os.rst:1667 +#: ../../library/os.rst:1675 msgid "" "**not following symlinks:** If *follow_symlinks* is ``False``, and the last " "element of the path to operate on is a symbolic link, the function will " @@ -1786,14 +1795,14 @@ msgid "" "function.)" msgstr "" -#: ../../library/os.rst:1673 +#: ../../library/os.rst:1681 msgid "" "You can check whether or not *follow_symlinks* is supported for a particular " "function on your platform using :data:`os.supports_follow_symlinks`. If it's " "unavailable, using it will raise a :exc:`NotImplementedError`." msgstr "" -#: ../../library/os.rst:1681 +#: ../../library/os.rst:1689 msgid "" "Use the real uid/gid to test for access to *path*. Note that most " "operations will use the effective uid/gid, therefore this routine can be " @@ -1805,13 +1814,13 @@ msgid "" "manpage:`access(2)` for more information." msgstr "" -#: ../../library/os.rst:1690 +#: ../../library/os.rst:1698 msgid "" "This function can support specifying :ref:`paths relative to directory " "descriptors ` and :ref:`not following symlinks `." msgstr "" -#: ../../library/os.rst:1693 +#: ../../library/os.rst:1701 msgid "" "If *effective_ids* is ``True``, :func:`access` will perform its access " "checks using the effective uid/gid instead of the real uid/gid. " @@ -1820,7 +1829,7 @@ msgid "" "unavailable, using it will raise a :exc:`NotImplementedError`." msgstr "" -#: ../../library/os.rst:1701 +#: ../../library/os.rst:1709 msgid "" "Using :func:`access` to check if a user is authorized to e.g. open a file " "before actually doing so using :func:`open` creates a security hole, because " @@ -1829,279 +1838,279 @@ msgid "" "For example::" msgstr "" -#: ../../library/os.rst:1712 +#: ../../library/os.rst:1720 msgid "is better written as::" msgstr "" -#: ../../library/os.rst:1724 +#: ../../library/os.rst:1732 msgid "" "I/O operations may fail even when :func:`access` indicates that they would " "succeed, particularly for operations on network filesystems which may have " "permissions semantics beyond the usual POSIX permission-bit model." msgstr "" -#: ../../library/os.rst:1728 +#: ../../library/os.rst:1736 msgid "Added the *dir_fd*, *effective_ids*, and *follow_symlinks* parameters." msgstr "新增 *dir_fd*\\ 、\\ *effective_ids* 與 *follow_symlinks* 參數。" -#: ../../library/os.rst:1740 +#: ../../library/os.rst:1748 msgid "" "Values to pass as the *mode* parameter of :func:`access` to test the " "existence, readability, writability and executability of *path*, " "respectively." msgstr "" -#: ../../library/os.rst:1749 +#: ../../library/os.rst:1757 msgid "Change the current working directory to *path*." msgstr "" -#: ../../library/os.rst:1751 +#: ../../library/os.rst:1759 msgid "" "This function can support :ref:`specifying a file descriptor `. " "The descriptor must refer to an opened directory, not an open file." msgstr "" -#: ../../library/os.rst:1754 +#: ../../library/os.rst:1762 msgid "" "This function can raise :exc:`OSError` and subclasses such as :exc:" "`FileNotFoundError`, :exc:`PermissionError`, and :exc:`NotADirectoryError`." msgstr "" -#: ../../library/os.rst:1757 ../../library/os.rst:1884 +#: ../../library/os.rst:1765 ../../library/os.rst:1892 msgid "" "Raises an :ref:`auditing event ` ``os.chdir`` with argument " "``path``." msgstr "" -#: ../../library/os.rst:1759 +#: ../../library/os.rst:1767 msgid "" "Added support for specifying *path* as a file descriptor on some platforms." msgstr "" -#: ../../library/os.rst:1769 +#: ../../library/os.rst:1777 msgid "" "Set the flags of *path* to the numeric *flags*. *flags* may take a " "combination (bitwise OR) of the following values (as defined in the :mod:" "`stat` module):" msgstr "" -#: ../../library/os.rst:1772 +#: ../../library/os.rst:1780 msgid ":data:`stat.UF_NODUMP`" msgstr ":data:`stat.UF_NODUMP`" -#: ../../library/os.rst:1773 +#: ../../library/os.rst:1781 msgid ":data:`stat.UF_IMMUTABLE`" msgstr ":data:`stat.UF_IMMUTABLE`" -#: ../../library/os.rst:1774 +#: ../../library/os.rst:1782 msgid ":data:`stat.UF_APPEND`" msgstr ":data:`stat.UF_APPEND`" -#: ../../library/os.rst:1775 +#: ../../library/os.rst:1783 msgid ":data:`stat.UF_OPAQUE`" msgstr ":data:`stat.UF_OPAQUE`" -#: ../../library/os.rst:1776 +#: ../../library/os.rst:1784 msgid ":data:`stat.UF_NOUNLINK`" msgstr ":data:`stat.UF_NOUNLINK`" -#: ../../library/os.rst:1777 +#: ../../library/os.rst:1785 msgid ":data:`stat.UF_COMPRESSED`" msgstr ":data:`stat.UF_COMPRESSED`" -#: ../../library/os.rst:1778 +#: ../../library/os.rst:1786 msgid ":data:`stat.UF_HIDDEN`" msgstr ":data:`stat.UF_HIDDEN`" -#: ../../library/os.rst:1779 +#: ../../library/os.rst:1787 msgid ":data:`stat.SF_ARCHIVED`" msgstr ":data:`stat.SF_ARCHIVED`" -#: ../../library/os.rst:1780 +#: ../../library/os.rst:1788 msgid ":data:`stat.SF_IMMUTABLE`" msgstr ":data:`stat.SF_IMMUTABLE`" -#: ../../library/os.rst:1781 +#: ../../library/os.rst:1789 msgid ":data:`stat.SF_APPEND`" msgstr ":data:`stat.SF_APPEND`" -#: ../../library/os.rst:1782 +#: ../../library/os.rst:1790 msgid ":data:`stat.SF_NOUNLINK`" msgstr ":data:`stat.SF_NOUNLINK`" -#: ../../library/os.rst:1783 +#: ../../library/os.rst:1791 msgid ":data:`stat.SF_SNAPSHOT`" msgstr ":data:`stat.SF_SNAPSHOT`" -#: ../../library/os.rst:1785 +#: ../../library/os.rst:1793 msgid "" "This function can support :ref:`not following symlinks `." msgstr "" -#: ../../library/os.rst:1787 ../../library/os.rst:1910 +#: ../../library/os.rst:1795 ../../library/os.rst:1918 msgid "" "Raises an :ref:`auditing event ` ``os.chflags`` with arguments " "``path``, ``flags``." msgstr "" -#: ../../library/os.rst:1791 +#: ../../library/os.rst:1799 msgid "The *follow_symlinks* argument." msgstr "*follow_symlinks* 引數。" -#: ../../library/os.rst:1800 +#: ../../library/os.rst:1808 msgid "" "Change the mode of *path* to the numeric *mode*. *mode* may take one of the " "following values (as defined in the :mod:`stat` module) or bitwise ORed " "combinations of them:" msgstr "" -#: ../../library/os.rst:1804 +#: ../../library/os.rst:1812 msgid ":data:`stat.S_ISUID`" msgstr ":data:`stat.S_ISUID`" -#: ../../library/os.rst:1805 +#: ../../library/os.rst:1813 msgid ":data:`stat.S_ISGID`" msgstr ":data:`stat.S_ISGID`" -#: ../../library/os.rst:1806 +#: ../../library/os.rst:1814 msgid ":data:`stat.S_ENFMT`" msgstr ":data:`stat.S_ENFMT`" -#: ../../library/os.rst:1807 +#: ../../library/os.rst:1815 msgid ":data:`stat.S_ISVTX`" msgstr ":data:`stat.S_ISVTX`" -#: ../../library/os.rst:1808 +#: ../../library/os.rst:1816 msgid ":data:`stat.S_IREAD`" msgstr ":data:`stat.S_IREAD`" -#: ../../library/os.rst:1809 +#: ../../library/os.rst:1817 msgid ":data:`stat.S_IWRITE`" msgstr ":data:`stat.S_IWRITE`" -#: ../../library/os.rst:1810 +#: ../../library/os.rst:1818 msgid ":data:`stat.S_IEXEC`" msgstr ":data:`stat.S_IEXEC`" -#: ../../library/os.rst:1811 +#: ../../library/os.rst:1819 msgid ":data:`stat.S_IRWXU`" msgstr ":data:`stat.S_IRWXU`" -#: ../../library/os.rst:1812 +#: ../../library/os.rst:1820 msgid ":data:`stat.S_IRUSR`" msgstr ":data:`stat.S_IRUSR`" -#: ../../library/os.rst:1813 +#: ../../library/os.rst:1821 msgid ":data:`stat.S_IWUSR`" msgstr ":data:`stat.S_IWUSR`" -#: ../../library/os.rst:1814 +#: ../../library/os.rst:1822 msgid ":data:`stat.S_IXUSR`" msgstr ":data:`stat.S_IXUSR`" -#: ../../library/os.rst:1815 +#: ../../library/os.rst:1823 msgid ":data:`stat.S_IRWXG`" msgstr ":data:`stat.S_IRWXG`" -#: ../../library/os.rst:1816 +#: ../../library/os.rst:1824 msgid ":data:`stat.S_IRGRP`" msgstr ":data:`stat.S_IRGRP`" -#: ../../library/os.rst:1817 +#: ../../library/os.rst:1825 msgid ":data:`stat.S_IWGRP`" msgstr ":data:`stat.S_IWGRP`" -#: ../../library/os.rst:1818 +#: ../../library/os.rst:1826 msgid ":data:`stat.S_IXGRP`" msgstr ":data:`stat.S_IXGRP`" -#: ../../library/os.rst:1819 +#: ../../library/os.rst:1827 msgid ":data:`stat.S_IRWXO`" msgstr ":data:`stat.S_IRWXO`" -#: ../../library/os.rst:1820 +#: ../../library/os.rst:1828 msgid ":data:`stat.S_IROTH`" msgstr ":data:`stat.S_IROTH`" -#: ../../library/os.rst:1821 +#: ../../library/os.rst:1829 msgid ":data:`stat.S_IWOTH`" msgstr ":data:`stat.S_IWOTH`" -#: ../../library/os.rst:1822 +#: ../../library/os.rst:1830 msgid ":data:`stat.S_IXOTH`" msgstr ":data:`stat.S_IXOTH`" -#: ../../library/os.rst:1824 ../../library/os.rst:1849 -#: ../../library/os.rst:3104 +#: ../../library/os.rst:1832 ../../library/os.rst:1857 +#: ../../library/os.rst:3112 msgid "" "This function can support :ref:`specifying a file descriptor `, :" "ref:`paths relative to directory descriptors ` and :ref:`not " "following symlinks `." msgstr "" -#: ../../library/os.rst:1830 +#: ../../library/os.rst:1838 msgid "" "Although Windows supports :func:`chmod`, you can only set the file's read-" "only flag with it (via the ``stat.S_IWRITE`` and ``stat.S_IREAD`` constants " "or a corresponding integer value). All other bits are ignored." msgstr "" -#: ../../library/os.rst:1836 ../../library/os.rst:1860 +#: ../../library/os.rst:1844 ../../library/os.rst:1868 msgid "" "Added support for specifying *path* as an open file descriptor, and the " "*dir_fd* and *follow_symlinks* arguments." msgstr "" -#: ../../library/os.rst:1846 +#: ../../library/os.rst:1854 msgid "" "Change the owner and group id of *path* to the numeric *uid* and *gid*. To " "leave one of the ids unchanged, set it to -1." msgstr "" -#: ../../library/os.rst:1853 +#: ../../library/os.rst:1861 msgid "" "See :func:`shutil.chown` for a higher-level function that accepts names in " "addition to numeric ids." msgstr "" -#: ../../library/os.rst:1864 +#: ../../library/os.rst:1872 msgid "Supports a :term:`path-like object`." msgstr "" -#: ../../library/os.rst:1870 +#: ../../library/os.rst:1878 msgid "Change the root directory of the current process to *path*." msgstr "" -#: ../../library/os.rst:1880 +#: ../../library/os.rst:1888 msgid "" "Change the current working directory to the directory represented by the " "file descriptor *fd*. The descriptor must refer to an opened directory, not " "an open file. As of Python 3.3, this is equivalent to ``os.chdir(fd)``." msgstr "" -#: ../../library/os.rst:1891 +#: ../../library/os.rst:1899 msgid "Return a string representing the current working directory." msgstr "" -#: ../../library/os.rst:1896 +#: ../../library/os.rst:1904 msgid "Return a bytestring representing the current working directory." msgstr "" -#: ../../library/os.rst:1898 +#: ../../library/os.rst:1906 msgid "" "The function now uses the UTF-8 encoding on Windows, rather than the ANSI " "code page: see :pep:`529` for the rationale. The function is no longer " "deprecated on Windows." msgstr "" -#: ../../library/os.rst:1906 +#: ../../library/os.rst:1914 msgid "" "Set the flags of *path* to the numeric *flags*, like :func:`chflags`, but do " "not follow symbolic links. As of Python 3.3, this is equivalent to ``os." "chflags(path, flags, follow_symlinks=False)``." msgstr "" -#: ../../library/os.rst:1920 +#: ../../library/os.rst:1928 msgid "" "Change the mode of *path* to the numeric *mode*. If path is a symlink, this " "affects the symlink rather than the target. See the docs for :func:`chmod` " @@ -2109,44 +2118,44 @@ msgid "" "chmod(path, mode, follow_symlinks=False)``." msgstr "" -#: ../../library/os.rst:1934 +#: ../../library/os.rst:1942 msgid "" "Change the owner and group id of *path* to the numeric *uid* and *gid*. " "This function will not follow symbolic links. As of Python 3.3, this is " "equivalent to ``os.chown(path, uid, gid, follow_symlinks=False)``." msgstr "" -#: ../../library/os.rst:1948 +#: ../../library/os.rst:1956 msgid "Create a hard link pointing to *src* named *dst*." msgstr "" -#: ../../library/os.rst:1950 +#: ../../library/os.rst:1958 msgid "" "This function can support specifying *src_dir_fd* and/or *dst_dir_fd* to " "supply :ref:`paths relative to directory descriptors `, and :ref:" "`not following symlinks `." msgstr "" -#: ../../library/os.rst:1954 +#: ../../library/os.rst:1962 msgid "" "Raises an :ref:`auditing event ` ``os.link`` with arguments " "``src``, ``dst``, ``src_dir_fd``, ``dst_dir_fd``." msgstr "" -#: ../../library/os.rst:1958 +#: ../../library/os.rst:1966 msgid "Added Windows support." msgstr "新支援 Windows。" -#: ../../library/os.rst:1961 +#: ../../library/os.rst:1969 msgid "Added the *src_dir_fd*, *dst_dir_fd*, and *follow_symlinks* arguments." msgstr "增加 *src_dir_fd*\\ 、\\ *dst_dir_fd* 與 *follow_symlinks* 引數。" -#: ../../library/os.rst:1964 ../../library/os.rst:2317 -#: ../../library/os.rst:2354 ../../library/os.rst:3026 +#: ../../library/os.rst:1972 ../../library/os.rst:2325 +#: ../../library/os.rst:2362 ../../library/os.rst:3034 msgid "Accepts a :term:`path-like object` for *src* and *dst*." msgstr "" -#: ../../library/os.rst:1970 +#: ../../library/os.rst:1978 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 " @@ -2155,7 +2164,7 @@ msgid "" "function, whether a name for that file be included is unspecified." msgstr "" -#: ../../library/os.rst:1976 +#: ../../library/os.rst:1984 msgid "" "*path* may be a :term:`path-like object`. If *path* is of type ``bytes`` " "(directly or indirectly through the :class:`PathLike` interface), the " @@ -2163,73 +2172,73 @@ msgid "" "circumstances, they will be of type ``str``." msgstr "" -#: ../../library/os.rst:1981 ../../library/os.rst:2402 +#: ../../library/os.rst:1989 ../../library/os.rst:2410 msgid "" "This function can also support :ref:`specifying a file descriptor " "`; the file descriptor must refer to a directory." msgstr "" -#: ../../library/os.rst:1984 +#: ../../library/os.rst:1992 msgid "" "Raises an :ref:`auditing event ` ``os.listdir`` with argument " "``path``." msgstr "" -#: ../../library/os.rst:1987 +#: ../../library/os.rst:1995 msgid "To encode ``str`` filenames to ``bytes``, use :func:`~os.fsencode`." msgstr "" -#: ../../library/os.rst:1991 +#: ../../library/os.rst:1999 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:1995 +#: ../../library/os.rst:2003 msgid "The *path* parameter became optional." msgstr "" -#: ../../library/os.rst:1998 ../../library/os.rst:2888 +#: ../../library/os.rst:2006 ../../library/os.rst:2896 msgid "Added support for specifying *path* as an open file descriptor." msgstr "" -#: ../../library/os.rst:2007 +#: ../../library/os.rst:2015 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:2011 +#: ../../library/os.rst:2019 msgid "" "On platforms that do not support symbolic links, this is an alias for :func:" "`~os.stat`." msgstr "" -#: ../../library/os.rst:2014 +#: ../../library/os.rst:2022 msgid "" "As of Python 3.3, this is equivalent to ``os.stat(path, dir_fd=dir_fd, " "follow_symlinks=False)``." msgstr "" -#: ../../library/os.rst:2017 ../../library/os.rst:2055 -#: ../../library/os.rst:2120 ../../library/os.rst:2148 -#: ../../library/os.rst:2222 +#: ../../library/os.rst:2025 ../../library/os.rst:2063 +#: ../../library/os.rst:2128 ../../library/os.rst:2156 +#: ../../library/os.rst:2230 msgid "" "This function can also support :ref:`paths relative to directory descriptors " "`." msgstr "" -#: ../../library/os.rst:2024 ../../library/os.rst:2231 -#: ../../library/os.rst:3019 +#: ../../library/os.rst:2032 ../../library/os.rst:2239 +#: ../../library/os.rst:3027 msgid "Added support for Windows 6.0 (Vista) symbolic links." msgstr "" -#: ../../library/os.rst:2027 +#: ../../library/os.rst:2035 msgid "Added the *dir_fd* parameter." msgstr "新增 *dir_fd* 參數。" -#: ../../library/os.rst:2033 +#: ../../library/os.rst:2041 msgid "" "On Windows, now opens reparse points that represent another path (name " "surrogates), including symbolic links and directory junctions. Other kinds " @@ -2237,18 +2246,18 @@ msgid "" "stat`." msgstr "" -#: ../../library/os.rst:2042 +#: ../../library/os.rst:2050 msgid "Create a directory named *path* with numeric mode *mode*." msgstr "" -#: ../../library/os.rst:2044 +#: ../../library/os.rst:2052 msgid "" "If the directory already exists, :exc:`FileExistsError` is raised. If a " "parent directory in the path does not exist, :exc:`FileNotFoundError` is " "raised." msgstr "" -#: ../../library/os.rst:2049 +#: ../../library/os.rst:2057 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 " @@ -2257,25 +2266,25 @@ msgid "" "call :func:`chmod` explicitly to set them." msgstr "" -#: ../../library/os.rst:2058 +#: ../../library/os.rst:2066 msgid "" "It is also possible to create temporary directories; see the :mod:`tempfile` " "module's :func:`tempfile.mkdtemp` function." msgstr "" -#: ../../library/os.rst:2061 ../../library/os.rst:2095 +#: ../../library/os.rst:2069 ../../library/os.rst:2103 msgid "" "Raises an :ref:`auditing event ` ``os.mkdir`` with arguments " "``path``, ``mode``, ``dir_fd``." msgstr "" -#: ../../library/os.rst:2076 +#: ../../library/os.rst:2084 msgid "" "Recursive directory creation function. Like :func:`mkdir`, but makes all " "intermediate-level directories needed to contain the leaf directory." msgstr "" -#: ../../library/os.rst:2079 +#: ../../library/os.rst:2087 msgid "" "The *mode* parameter is passed to :func:`mkdir` for creating the leaf " "directory; see :ref:`the mkdir() description ` for how it is " @@ -2284,27 +2293,27 @@ msgid "" "file permission bits of existing parent directories are not changed." msgstr "" -#: ../../library/os.rst:2085 +#: ../../library/os.rst:2093 msgid "" "If *exist_ok* is ``False`` (the default), an :exc:`FileExistsError` is " "raised if the target directory already exists." msgstr "" -#: ../../library/os.rst:2090 +#: ../../library/os.rst:2098 msgid "" ":func:`makedirs` will become confused if the path elements to create " "include :data:`pardir` (eg. \"..\" on UNIX systems)." msgstr "" -#: ../../library/os.rst:2093 +#: ../../library/os.rst:2101 msgid "This function handles UNC paths correctly." msgstr "" -#: ../../library/os.rst:2097 +#: ../../library/os.rst:2105 msgid "The *exist_ok* parameter." msgstr "*exist_ok* 參數。" -#: ../../library/os.rst:2102 +#: ../../library/os.rst:2110 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 " @@ -2312,19 +2321,19 @@ msgid "" "safely, it was removed in Python 3.4.1. See :issue:`21082`." msgstr "" -#: ../../library/os.rst:2110 +#: ../../library/os.rst:2118 msgid "" "The *mode* argument no longer affects the file permission bits of newly-" "created intermediate-level directories." msgstr "" -#: ../../library/os.rst:2117 +#: ../../library/os.rst:2125 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:2123 +#: ../../library/os.rst:2131 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 " @@ -2334,7 +2343,7 @@ msgid "" "rendezvous point." msgstr "" -#: ../../library/os.rst:2140 +#: ../../library/os.rst:2148 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 " @@ -2345,23 +2354,23 @@ msgid "" "`os.makedev`), otherwise it is ignored." msgstr "" -#: ../../library/os.rst:2162 +#: ../../library/os.rst:2170 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:2168 +#: ../../library/os.rst:2176 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:2174 +#: ../../library/os.rst:2182 msgid "Compose a raw device number from the major and minor device numbers." msgstr "" -#: ../../library/os.rst:2179 +#: ../../library/os.rst:2187 msgid "" "Return system configuration information relevant to a named file. *name* " "specifies the configuration value to retrieve; it may be a string which is " @@ -2372,20 +2381,20 @@ msgid "" "included in that mapping, passing an integer for *name* is also accepted." msgstr "" -#: ../../library/os.rst:2192 ../../library/os.rst:2881 -#: ../../library/os.rst:3047 +#: ../../library/os.rst:2200 ../../library/os.rst:2889 +#: ../../library/os.rst:3055 msgid "" "This function can support :ref:`specifying a file descriptor `." msgstr "" -#: ../../library/os.rst:2203 +#: ../../library/os.rst:2211 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:2212 +#: ../../library/os.rst:2220 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 " @@ -2393,7 +2402,7 @@ msgid "" "join(os.path.dirname(path), result)``." msgstr "" -#: ../../library/os.rst:2217 +#: ../../library/os.rst:2225 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 " @@ -2401,42 +2410,42 @@ msgid "" "indirectly), the result will be a bytes object." msgstr "" -#: ../../library/os.rst:2225 +#: ../../library/os.rst:2233 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:2237 +#: ../../library/os.rst:2245 msgid "Accepts a :term:`path-like object` on Unix." msgstr "" -#: ../../library/os.rst:2240 +#: ../../library/os.rst:2248 msgid "Accepts a :term:`path-like object` and a bytes object on Windows." msgstr "" -#: ../../library/os.rst:2243 +#: ../../library/os.rst:2251 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:2250 +#: ../../library/os.rst:2258 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." msgstr "" -#: ../../library/os.rst:2254 ../../library/os.rst:2365 -#: ../../library/os.rst:3001 +#: ../../library/os.rst:2262 ../../library/os.rst:2373 +#: ../../library/os.rst:3009 msgid "" "This function can support :ref:`paths relative to directory descriptors " "`." msgstr "" -#: ../../library/os.rst:2257 +#: ../../library/os.rst:2265 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 " @@ -2444,18 +2453,18 @@ msgid "" "longer in use." msgstr "" -#: ../../library/os.rst:2261 +#: ../../library/os.rst:2269 msgid "This function is semantically identical to :func:`unlink`." msgstr "" -#: ../../library/os.rst:2263 ../../library/os.rst:2285 -#: ../../library/os.rst:3069 +#: ../../library/os.rst:2271 ../../library/os.rst:2293 +#: ../../library/os.rst:3077 msgid "" "Raises an :ref:`auditing event ` ``os.remove`` with arguments " "``path``, ``dir_fd``." msgstr "" -#: ../../library/os.rst:2276 +#: ../../library/os.rst:2284 msgid "" "Remove directories recursively. Works like :func:`rmdir` except that, if " "the leaf directory is successfully removed, :func:`removedirs` tries to " @@ -2467,17 +2476,17 @@ msgid "" "could not be successfully removed." msgstr "" -#: ../../library/os.rst:2293 +#: ../../library/os.rst:2301 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:2296 +#: ../../library/os.rst:2304 msgid "On Windows, if *dst* exists a :exc:`FileExistsError` is always raised." msgstr "" -#: ../../library/os.rst:2298 +#: ../../library/os.rst:2306 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 " @@ -2489,30 +2498,30 @@ msgid "" "atomic operation (this is a POSIX requirement)." msgstr "" -#: ../../library/os.rst:2307 ../../library/os.rst:2347 +#: ../../library/os.rst:2315 ../../library/os.rst:2355 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:2310 +#: ../../library/os.rst:2318 msgid "" "If you want cross-platform overwriting of the destination, use :func:" "`replace`." msgstr "" -#: ../../library/os.rst:2312 ../../library/os.rst:2333 -#: ../../library/os.rst:2350 +#: ../../library/os.rst:2320 ../../library/os.rst:2341 +#: ../../library/os.rst:2358 msgid "" "Raises an :ref:`auditing event ` ``os.rename`` with arguments " "``src``, ``dst``, ``src_dir_fd``, ``dst_dir_fd``." msgstr "" -#: ../../library/os.rst:2314 +#: ../../library/os.rst:2322 msgid "The *src_dir_fd* and *dst_dir_fd* arguments." msgstr "" -#: ../../library/os.rst:2323 +#: ../../library/os.rst:2331 msgid "" "Recursive directory or file renaming function. Works like :func:`rename`, " "except creation of any intermediate directories needed to make the new " @@ -2521,26 +2530,26 @@ msgid "" "using :func:`removedirs`." msgstr "" -#: ../../library/os.rst:2330 +#: ../../library/os.rst:2338 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:2335 +#: ../../library/os.rst:2343 msgid "Accepts a :term:`path-like object` for *old* and *new*." msgstr "" -#: ../../library/os.rst:2341 +#: ../../library/os.rst:2349 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 " -"replaced silently if the user has permission. The operation may fail if " -"*src* and *dst* are on different filesystems. If successful, the renaming " -"will be an atomic operation (this is a POSIX requirement)." +"Rename the file or directory *src* to *dst*. If *dst* is a non-empty " +"directory, :exc:`OSError` will be raised. If *dst* exists and is a file, it " +"will be replaced silently if the user has permission. The operation may " +"fail if *src* and *dst* are on different filesystems. If successful, the " +"renaming will be an atomic operation (this is a POSIX requirement)." msgstr "" -#: ../../library/os.rst:2360 +#: ../../library/os.rst:2368 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 " @@ -2548,17 +2557,17 @@ msgid "" "rmtree` can be used." msgstr "" -#: ../../library/os.rst:2368 +#: ../../library/os.rst:2376 msgid "" "Raises an :ref:`auditing event ` ``os.rmdir`` with arguments " "``path``, ``dir_fd``." msgstr "" -#: ../../library/os.rst:2370 ../../library/os.rst:3071 +#: ../../library/os.rst:2378 ../../library/os.rst:3079 msgid "The *dir_fd* parameter." msgstr "*dir_fd* 參數。" -#: ../../library/os.rst:2379 +#: ../../library/os.rst:2387 msgid "" "Return an iterator of :class:`os.DirEntry` objects corresponding to the " "entries in the directory given by *path*. The entries are yielded in " @@ -2568,7 +2577,7 @@ msgid "" "unspecified." msgstr "" -#: ../../library/os.rst:2386 +#: ../../library/os.rst:2394 msgid "" "Using :func:`scandir` instead of :func:`listdir` can significantly increase " "the performance of code that also needs file type or file attribute " @@ -2580,7 +2589,7 @@ msgid "" "Unix but only requires one for symbolic links on Windows." msgstr "" -#: ../../library/os.rst:2396 +#: ../../library/os.rst:2404 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 " @@ -2589,30 +2598,30 @@ msgid "" "they will be of type ``str``." msgstr "" -#: ../../library/os.rst:2405 +#: ../../library/os.rst:2413 msgid "" "Raises an :ref:`auditing event ` ``os.scandir`` with argument " "``path``." msgstr "" -#: ../../library/os.rst:2407 +#: ../../library/os.rst:2415 msgid "" "The :func:`scandir` iterator supports the :term:`context manager` protocol " "and has the following method:" msgstr "" -#: ../../library/os.rst:2412 +#: ../../library/os.rst:2420 msgid "Close the iterator and free acquired resources." msgstr "" -#: ../../library/os.rst:2414 +#: ../../library/os.rst:2422 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:2421 +#: ../../library/os.rst:2429 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 " @@ -2620,7 +2629,7 @@ msgid "" "system call::" msgstr "" -#: ../../library/os.rst:2433 +#: ../../library/os.rst:2441 msgid "" "On Unix-based systems, :func:`scandir` uses the system's `opendir() `_ and " @@ -2631,7 +2640,7 @@ msgid "" "desktop/aa364428(v=vs.85).aspx>`_ functions." msgstr "" -#: ../../library/os.rst:2445 +#: ../../library/os.rst:2453 msgid "" "Added support for the :term:`context manager` protocol and the :func:" "`~scandir.close()` method. If a :func:`scandir` iterator is neither " @@ -2639,28 +2648,28 @@ msgid "" "its destructor." msgstr "" -#: ../../library/os.rst:2451 +#: ../../library/os.rst:2459 msgid "The function accepts a :term:`path-like object`." msgstr "" -#: ../../library/os.rst:2453 +#: ../../library/os.rst:2461 msgid "Added support for :ref:`file descriptors ` on Unix." msgstr "" -#: ../../library/os.rst:2459 +#: ../../library/os.rst:2467 msgid "" "Object yielded by :func:`scandir` to expose the file path and other file " "attributes of a directory entry." msgstr "" -#: ../../library/os.rst:2462 +#: ../../library/os.rst:2470 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:2466 +#: ../../library/os.rst:2474 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 " @@ -2668,7 +2677,7 @@ msgid "" "up-to-date information." msgstr "" -#: ../../library/os.rst:2471 +#: ../../library/os.rst:2479 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 " @@ -2676,29 +2685,29 @@ msgid "" "methods and handle as appropriate." msgstr "" -#: ../../library/os.rst:2476 +#: ../../library/os.rst:2484 msgid "" "To be directly usable as a :term:`path-like object`, ``os.DirEntry`` " "implements the :class:`PathLike` interface." msgstr "" -#: ../../library/os.rst:2479 +#: ../../library/os.rst:2487 msgid "Attributes and methods on a ``os.DirEntry`` instance are as follows:" msgstr "" -#: ../../library/os.rst:2483 +#: ../../library/os.rst:2491 msgid "" "The entry's base filename, relative to the :func:`scandir` *path* argument." msgstr "" -#: ../../library/os.rst:2486 +#: ../../library/os.rst:2494 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:2492 +#: ../../library/os.rst:2500 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 " @@ -2708,51 +2717,51 @@ msgid "" "attribute." msgstr "" -#: ../../library/os.rst:2499 +#: ../../library/os.rst:2507 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:2505 +#: ../../library/os.rst:2513 msgid "Return the inode number of the entry." msgstr "" -#: ../../library/os.rst:2507 +#: ../../library/os.rst:2515 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:2511 +#: ../../library/os.rst:2519 msgid "" "On the first, uncached call, a system call is required on Windows but not on " "Unix." msgstr "" -#: ../../library/os.rst:2516 +#: ../../library/os.rst:2524 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:2520 +#: ../../library/os.rst:2528 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:2524 +#: ../../library/os.rst:2532 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:2528 +#: ../../library/os.rst:2536 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 " @@ -2762,46 +2771,46 @@ msgid "" "is ``False``." msgstr "" -#: ../../library/os.rst:2535 ../../library/os.rst:2565 +#: ../../library/os.rst:2543 ../../library/os.rst:2573 msgid "" "This method can raise :exc:`OSError`, such as :exc:`PermissionError`, but :" "exc:`FileNotFoundError` is caught and not raised." msgstr "" -#: ../../library/os.rst:2540 +#: ../../library/os.rst:2548 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:2544 +#: ../../library/os.rst:2552 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:2548 +#: ../../library/os.rst:2556 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:2553 +#: ../../library/os.rst:2561 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:2557 +#: ../../library/os.rst:2565 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:2560 +#: ../../library/os.rst:2568 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 " @@ -2809,35 +2818,35 @@ msgid "" "``dirent.d_type == DT_UNKNOWN``." msgstr "" -#: ../../library/os.rst:2570 +#: ../../library/os.rst:2578 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:2574 +#: ../../library/os.rst:2582 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:2579 +#: ../../library/os.rst:2587 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:2583 +#: ../../library/os.rst:2591 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:2587 +#: ../../library/os.rst:2595 msgid "" "Note that there is a nice correspondence between several attributes and " "methods of ``os.DirEntry`` and of :class:`pathlib.Path`. In particular, the " @@ -2845,13 +2854,13 @@ msgid "" "``is_file()``, ``is_symlink()`` and ``stat()`` methods." msgstr "" -#: ../../library/os.rst:2595 +#: ../../library/os.rst:2603 msgid "" "Added support for the :class:`~os.PathLike` interface. Added support for :" "class:`bytes` paths on Windows." msgstr "" -#: ../../library/os.rst:2602 +#: ../../library/os.rst:2610 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 " @@ -2860,21 +2869,21 @@ msgid "" "`stat_result` object." msgstr "" -#: ../../library/os.rst:2608 +#: ../../library/os.rst:2616 msgid "" "This function normally follows symlinks; to stat a symlink add the argument " "``follow_symlinks=False``, or use :func:`lstat`." msgstr "" -#: ../../library/os.rst:2611 ../../library/os.rst:3435 -#: ../../library/os.rst:3451 ../../library/os.rst:3467 -#: ../../library/os.rst:3487 +#: ../../library/os.rst:2619 ../../library/os.rst:3443 +#: ../../library/os.rst:3459 ../../library/os.rst:3475 +#: ../../library/os.rst:3495 msgid "" "This function can support :ref:`specifying a file descriptor ` and :" "ref:`not following symlinks `." msgstr "" -#: ../../library/os.rst:2614 +#: ../../library/os.rst:2622 msgid "" "On Windows, passing ``follow_symlinks=False`` will disable following all " "name-surrogate reparse points, which includes symlinks and directory " @@ -2888,24 +2897,24 @@ msgid "" "junction points, which will raise the usual exceptions." msgstr "" -#: ../../library/os.rst:2627 ../../library/os.rst:3355 +#: ../../library/os.rst:2635 ../../library/os.rst:3363 msgid "Example::" msgstr "" "範例:\n" "\n" "::" -#: ../../library/os.rst:2640 +#: ../../library/os.rst:2648 msgid ":func:`fstat` and :func:`lstat` functions." msgstr ":func:`fstat` 和 :func:`lstat` 函式。" -#: ../../library/os.rst:2642 +#: ../../library/os.rst:2650 msgid "" "Added the *dir_fd* and *follow_symlinks* arguments, specifying a file " "descriptor instead of a path." msgstr "" -#: ../../library/os.rst:2649 +#: ../../library/os.rst:2657 msgid "" "On Windows, all reparse points that can be resolved by the operating system " "are now followed, and passing ``follow_symlinks=False`` disables following " @@ -2915,100 +2924,100 @@ msgid "" "of raising an error." msgstr "" -#: ../../library/os.rst:2660 +#: ../../library/os.rst:2668 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:2664 +#: ../../library/os.rst:2672 msgid "Attributes:" msgstr "" -#: ../../library/os.rst:2668 +#: ../../library/os.rst:2676 msgid "File mode: file type and file mode bits (permissions)." msgstr "" -#: ../../library/os.rst:2672 +#: ../../library/os.rst:2680 msgid "" "Platform dependent, but if non-zero, uniquely identifies the file for a " "given value of ``st_dev``. Typically:" msgstr "" -#: ../../library/os.rst:2675 +#: ../../library/os.rst:2683 msgid "the inode number on Unix," msgstr "" -#: ../../library/os.rst:2676 +#: ../../library/os.rst:2684 msgid "" "the `file index `_ on " "Windows" msgstr "" -#: ../../library/os.rst:2682 +#: ../../library/os.rst:2690 msgid "Identifier of the device on which this file resides." msgstr "" -#: ../../library/os.rst:2686 +#: ../../library/os.rst:2694 msgid "Number of hard links." msgstr "" -#: ../../library/os.rst:2690 +#: ../../library/os.rst:2698 msgid "User identifier of the file owner." msgstr "" -#: ../../library/os.rst:2694 +#: ../../library/os.rst:2702 msgid "Group identifier of the file owner." msgstr "" -#: ../../library/os.rst:2698 +#: ../../library/os.rst:2706 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:2702 +#: ../../library/os.rst:2710 msgid "Timestamps:" msgstr "" -#: ../../library/os.rst:2706 +#: ../../library/os.rst:2714 msgid "Time of most recent access expressed in seconds." msgstr "" -#: ../../library/os.rst:2710 +#: ../../library/os.rst:2718 msgid "Time of most recent content modification expressed in seconds." msgstr "" -#: ../../library/os.rst:2714 ../../library/os.rst:2730 +#: ../../library/os.rst:2722 ../../library/os.rst:2738 msgid "Platform dependent:" msgstr "" -#: ../../library/os.rst:2716 ../../library/os.rst:2732 +#: ../../library/os.rst:2724 ../../library/os.rst:2740 msgid "the time of most recent metadata change on Unix," msgstr "" -#: ../../library/os.rst:2717 +#: ../../library/os.rst:2725 msgid "the time of creation on Windows, expressed in seconds." msgstr "" -#: ../../library/os.rst:2721 +#: ../../library/os.rst:2729 msgid "Time of most recent access expressed in nanoseconds as an integer." msgstr "" -#: ../../library/os.rst:2725 +#: ../../library/os.rst:2733 msgid "" "Time of most recent content modification expressed in nanoseconds as an " "integer." msgstr "" -#: ../../library/os.rst:2733 +#: ../../library/os.rst:2741 msgid "" "the time of creation on Windows, expressed in nanoseconds as an integer." msgstr "" -#: ../../library/os.rst:2738 +#: ../../library/os.rst:2746 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 " @@ -3017,7 +3026,7 @@ msgid "" "only 1-day resolution. See your operating system documentation for details." msgstr "" -#: ../../library/os.rst:2745 +#: ../../library/os.rst:2753 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 " @@ -3028,78 +3037,78 @@ msgid "" "attr:`st_atime_ns`, :attr:`st_mtime_ns`, and :attr:`st_ctime_ns`." msgstr "" -#: ../../library/os.rst:2754 +#: ../../library/os.rst:2762 msgid "" "On some Unix systems (such as Linux), the following attributes may also be " "available:" msgstr "" -#: ../../library/os.rst:2759 +#: ../../library/os.rst:2767 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:2764 +#: ../../library/os.rst:2772 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:2769 +#: ../../library/os.rst:2777 msgid "Type of device if an inode device." msgstr "" -#: ../../library/os.rst:2773 +#: ../../library/os.rst:2781 msgid "User defined flags for file." msgstr "" -#: ../../library/os.rst:2775 +#: ../../library/os.rst:2783 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:2780 +#: ../../library/os.rst:2788 msgid "File generation number." msgstr "" -#: ../../library/os.rst:2784 +#: ../../library/os.rst:2792 msgid "Time of file creation." msgstr "" -#: ../../library/os.rst:2786 +#: ../../library/os.rst:2794 msgid "" "On Solaris and derivatives, the following attributes may also be available:" msgstr "" -#: ../../library/os.rst:2791 +#: ../../library/os.rst:2799 msgid "" "String that uniquely identifies the type of the filesystem that contains the " "file." msgstr "" -#: ../../library/os.rst:2794 +#: ../../library/os.rst:2802 msgid "On macOS systems, the following attributes may also be available:" msgstr "" -#: ../../library/os.rst:2798 +#: ../../library/os.rst:2806 msgid "Real size of the file." msgstr "" -#: ../../library/os.rst:2802 +#: ../../library/os.rst:2810 msgid "Creator of the file." msgstr "" -#: ../../library/os.rst:2806 +#: ../../library/os.rst:2814 msgid "File type." msgstr "" -#: ../../library/os.rst:2808 +#: ../../library/os.rst:2816 msgid "On Windows systems, the following attributes are also available:" msgstr "" -#: ../../library/os.rst:2812 +#: ../../library/os.rst:2820 msgid "" "Windows file attributes: ``dwFileAttributes`` member of the " "``BY_HANDLE_FILE_INFORMATION`` structure returned by :c:func:" @@ -3107,21 +3116,21 @@ msgid "" "mod:`stat` module." msgstr "" -#: ../../library/os.rst:2819 +#: ../../library/os.rst:2827 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:2823 +#: ../../library/os.rst:2831 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:2827 +#: ../../library/os.rst:2835 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 " @@ -3133,35 +3142,35 @@ msgid "" "class:`stat_result` as a tuple always returns integers." msgstr "" -#: ../../library/os.rst:2836 +#: ../../library/os.rst:2844 msgid "" "Added the :attr:`st_atime_ns`, :attr:`st_mtime_ns`, and :attr:`st_ctime_ns` " "members." msgstr "" -#: ../../library/os.rst:2840 +#: ../../library/os.rst:2848 msgid "Added the :attr:`st_file_attributes` member on Windows." msgstr "" -#: ../../library/os.rst:2843 +#: ../../library/os.rst:2851 msgid "Windows now returns the file index as :attr:`st_ino` when available." msgstr "" -#: ../../library/os.rst:2847 +#: ../../library/os.rst:2855 msgid "Added the :attr:`st_fstype` member to Solaris/derivatives." msgstr "" -#: ../../library/os.rst:2850 +#: ../../library/os.rst:2858 msgid "Added the :attr:`st_reparse_tag` member on Windows." msgstr "" -#: ../../library/os.rst:2853 +#: ../../library/os.rst:2861 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:2860 +#: ../../library/os.rst:2868 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 " @@ -3171,7 +3180,7 @@ msgid "" "`f_flag`, :attr:`f_namemax`, :attr:`f_fsid`." msgstr "" -#: ../../library/os.rst:2867 +#: ../../library/os.rst:2875 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-" @@ -3179,7 +3188,7 @@ msgid "" "are disabled or not supported." msgstr "" -#: ../../library/os.rst:2872 +#: ../../library/os.rst:2880 msgid "" "Additional module-level constants are defined for GNU/glibc based systems. " "These are :const:`ST_NODEV` (disallow access to device special files), :" @@ -3192,11 +3201,11 @@ msgid "" "relative to mtime/ctime)." msgstr "" -#: ../../library/os.rst:2885 +#: ../../library/os.rst:2893 msgid "The :const:`ST_RDONLY` and :const:`ST_NOSUID` constants were added." msgstr "新增 :const:`ST_RDONLY` 與 :const:`ST_NOSUID` 常數。" -#: ../../library/os.rst:2891 +#: ../../library/os.rst:2899 msgid "" "The :const:`ST_NODEV`, :const:`ST_NOEXEC`, :const:`ST_SYNCHRONOUS`, :const:" "`ST_MANDLOCK`, :const:`ST_WRITE`, :const:`ST_APPEND`, :const:" @@ -3204,11 +3213,11 @@ msgid "" "`ST_RELATIME` constants were added." msgstr "" -#: ../../library/os.rst:2900 +#: ../../library/os.rst:2908 msgid "Added :attr:`f_fsid`." msgstr "新增 :attr:`f_fsid`\\ 。" -#: ../../library/os.rst:2906 +#: ../../library/os.rst:2914 msgid "" "A :class:`set` object indicating which functions in the :mod:`os` module " "accept an open file descriptor for their *dir_fd* parameter. Different " @@ -3220,7 +3229,7 @@ msgid "" "(Specifying ``None`` for *dir_fd* is always supported on all platforms.)" msgstr "" -#: ../../library/os.rst:2916 +#: ../../library/os.rst:2924 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 " @@ -3228,13 +3237,13 @@ msgid "" "open file descriptors for *dir_fd* on the local platform::" msgstr "" -#: ../../library/os.rst:2923 +#: ../../library/os.rst:2931 msgid "" "Currently *dir_fd* parameters only work on Unix platforms; none of them work " "on Windows." msgstr "" -#: ../../library/os.rst:2931 +#: ../../library/os.rst:2939 msgid "" "A :class:`set` object indicating whether :func:`os.access` permits " "specifying ``True`` for its *effective_ids* parameter on the local platform. " @@ -3243,19 +3252,19 @@ msgid "" "func:`os.access`; otherwise it will be empty." msgstr "" -#: ../../library/os.rst:2937 +#: ../../library/os.rst:2945 msgid "" "This expression evaluates to ``True`` if :func:`os.access` supports " "``effective_ids=True`` on the local platform::" msgstr "" -#: ../../library/os.rst:2942 +#: ../../library/os.rst:2950 msgid "" "Currently *effective_ids* is only supported on Unix platforms; it does not " "work on Windows." msgstr "" -#: ../../library/os.rst:2950 +#: ../../library/os.rst:2958 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 " @@ -3264,7 +3273,7 @@ msgid "" "*path* arguments is not available on all platforms Python supports." msgstr "" -#: ../../library/os.rst:2957 +#: ../../library/os.rst:2965 msgid "" "To determine whether a particular function permits specifying an open file " "descriptor for its *path* parameter, use the ``in`` operator on " @@ -3273,7 +3282,7 @@ msgid "" "platform::" msgstr "" -#: ../../library/os.rst:2970 +#: ../../library/os.rst:2978 msgid "" "A :class:`set` object indicating which functions in the :mod:`os` module " "accept ``False`` for their *follow_symlinks* parameter on the local " @@ -3286,7 +3295,7 @@ msgid "" "on all platforms.)" msgstr "" -#: ../../library/os.rst:2980 +#: ../../library/os.rst:2988 msgid "" "To check whether a particular function accepts ``False`` for its " "*follow_symlinks* parameter, use the ``in`` operator on " @@ -3295,11 +3304,11 @@ msgid "" "stat` on the local platform::" msgstr "" -#: ../../library/os.rst:2993 +#: ../../library/os.rst:3001 msgid "Create a symbolic link pointing to *src* named *dst*." msgstr "" -#: ../../library/os.rst:2995 +#: ../../library/os.rst:3003 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 " @@ -3309,7 +3318,7 @@ msgid "" "ignored." msgstr "" -#: ../../library/os.rst:3006 +#: ../../library/os.rst:3014 msgid "" "On newer versions of Windows 10, unprivileged accounts can create symlinks " "if Developer Mode is enabled. When Developer Mode is not available/enabled, " @@ -3317,83 +3326,83 @@ msgid "" "must be run as an administrator." msgstr "" -#: ../../library/os.rst:3012 +#: ../../library/os.rst:3020 msgid "" ":exc:`OSError` is raised when the function is called by an unprivileged user." msgstr "" -#: ../../library/os.rst:3015 +#: ../../library/os.rst:3023 msgid "" "Raises an :ref:`auditing event ` ``os.symlink`` with arguments " "``src``, ``dst``, ``dir_fd``." msgstr "" -#: ../../library/os.rst:3022 +#: ../../library/os.rst:3030 msgid "" "Added the *dir_fd* argument, and now allow *target_is_directory* on non-" "Windows platforms." msgstr "" -#: ../../library/os.rst:3029 +#: ../../library/os.rst:3037 msgid "Added support for unelevated symlinks on Windows with Developer Mode." msgstr "" -#: ../../library/os.rst:3035 +#: ../../library/os.rst:3043 msgid "Force write of everything to disk." msgstr "" -#: ../../library/os.rst:3044 +#: ../../library/os.rst:3052 msgid "" "Truncate the file corresponding to *path*, so that it is at most *length* " "bytes in size." msgstr "" -#: ../../library/os.rst:3049 +#: ../../library/os.rst:3057 msgid "" "Raises an :ref:`auditing event ` ``os.truncate`` with arguments " "``path``, ``length``." msgstr "" -#: ../../library/os.rst:3064 +#: ../../library/os.rst:3072 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:3080 +#: ../../library/os.rst:3088 msgid "Set the access and modified times of the file specified by *path*." msgstr "" -#: ../../library/os.rst:3082 +#: ../../library/os.rst:3090 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:3085 +#: ../../library/os.rst:3093 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:3088 +#: ../../library/os.rst:3096 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:3091 +#: ../../library/os.rst:3099 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:3095 +#: ../../library/os.rst:3103 msgid "It is an error to specify tuples for both *times* and *ns*." msgstr "" -#: ../../library/os.rst:3097 +#: ../../library/os.rst:3105 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 " @@ -3403,19 +3412,19 @@ msgid "" "`utime`." msgstr "" -#: ../../library/os.rst:3108 +#: ../../library/os.rst:3116 msgid "" "Raises an :ref:`auditing event ` ``os.utime`` with arguments " "``path``, ``times``, ``ns``, ``dir_fd``." msgstr "" -#: ../../library/os.rst:3110 +#: ../../library/os.rst:3118 msgid "" "Added support for specifying *path* as an open file descriptor, and the " "*dir_fd*, *follow_symlinks*, and *ns* parameters." msgstr "" -#: ../../library/os.rst:3124 +#: ../../library/os.rst:3132 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* " @@ -3423,7 +3432,7 @@ msgid "" "filenames)``." msgstr "" -#: ../../library/os.rst:3129 +#: ../../library/os.rst:3137 msgid "" "*dirpath* is a string, the path to the directory. *dirnames* is a list of " "the names of the subdirectories in *dirpath* (excluding ``'.'`` and " @@ -3436,7 +3445,7 @@ msgid "" "file be included is unspecified." msgstr "" -#: ../../library/os.rst:3139 +#: ../../library/os.rst:3147 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 " @@ -3447,7 +3456,7 @@ msgid "" "its subdirectories are generated." msgstr "" -#: ../../library/os.rst:3147 +#: ../../library/os.rst:3155 msgid "" "When *topdown* is ``True``, the caller can modify the *dirnames* list in-" "place (perhaps using :keyword:`del` or slice assignment), and :func:`walk` " @@ -3460,7 +3469,7 @@ msgid "" "itself is generated." msgstr "" -#: ../../library/os.rst:3156 +#: ../../library/os.rst:3164 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 " @@ -3470,66 +3479,66 @@ msgid "" "object." msgstr "" -#: ../../library/os.rst:3162 +#: ../../library/os.rst:3170 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:3168 +#: ../../library/os.rst:3176 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:3174 +#: ../../library/os.rst:3182 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:3178 ../../library/os.rst:3239 +#: ../../library/os.rst:3186 ../../library/os.rst:3247 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:3191 +#: ../../library/os.rst:3199 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:3206 +#: ../../library/os.rst:3214 msgid "" "Raises an :ref:`auditing event ` ``os.walk`` with arguments " "``top``, ``topdown``, ``onerror``, ``followlinks``." msgstr "" -#: ../../library/os.rst:3208 +#: ../../library/os.rst:3216 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:3222 +#: ../../library/os.rst:3230 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:3225 +#: ../../library/os.rst:3233 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:3228 +#: ../../library/os.rst:3236 msgid "" "This function always supports :ref:`paths relative to directory descriptors " "` and :ref:`not following symlinks `. Note however " @@ -3537,30 +3546,30 @@ msgid "" "*follow_symlinks* is ``False``." msgstr "" -#: ../../library/os.rst:3235 +#: ../../library/os.rst:3243 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:3252 +#: ../../library/os.rst:3260 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:3267 +#: ../../library/os.rst:3275 msgid "" "Raises an :ref:`auditing event ` ``os.fwalk`` with arguments " "``top``, ``topdown``, ``onerror``, ``follow_symlinks``, ``dir_fd``." msgstr "" -#: ../../library/os.rst:3276 +#: ../../library/os.rst:3284 msgid "Added support for :class:`bytes` paths." msgstr "" -#: ../../library/os.rst:3282 +#: ../../library/os.rst:3290 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 " @@ -3568,7 +3577,7 @@ msgid "" "descriptor is :ref:`non-inheritable `." msgstr "" -#: ../../library/os.rst:3287 +#: ../../library/os.rst:3295 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/" @@ -3578,23 +3587,23 @@ msgid "" "side effects." msgstr "" -#: ../../library/os.rst:3295 +#: ../../library/os.rst:3303 msgid "" ":ref:`Availability `: Linux 3.17 or newer with glibc 2.27 or " "newer." msgstr "" -#: ../../library/os.rst:3317 +#: ../../library/os.rst:3325 msgid "These flags can be passed to :func:`memfd_create`." msgstr "" -#: ../../library/os.rst:3321 +#: ../../library/os.rst:3329 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:3327 +#: ../../library/os.rst:3335 msgid "" "Create and return an event file descriptor. The file descriptors supports " "raw :func:`read` and :func:`write` with a buffer size of 8, :func:`~select." @@ -3603,7 +3612,7 @@ msgid "" "ref:`non-inheritable `." msgstr "" -#: ../../library/os.rst:3333 +#: ../../library/os.rst:3341 msgid "" "*initval* is the initial value of the event counter. The initial value must " "be an 32 bit unsigned integer. Please note that the initial value is limited " @@ -3611,91 +3620,91 @@ msgid "" "integer with a maximum value of 2\\ :sup:`64`\\ -\\ 2." msgstr "" -#: ../../library/os.rst:3338 +#: ../../library/os.rst:3346 msgid "" "*flags* can be constructed from :const:`EFD_CLOEXEC`, :const:`EFD_NONBLOCK`, " "and :const:`EFD_SEMAPHORE`." msgstr "" -#: ../../library/os.rst:3341 +#: ../../library/os.rst:3349 msgid "" "If :const:`EFD_SEMAPHORE` is specified and the event counter is non-zero, :" "func:`eventfd_read` returns 1 and decrements the counter by one." msgstr "" -#: ../../library/os.rst:3344 +#: ../../library/os.rst:3352 msgid "" "If :const:`EFD_SEMAPHORE` is not specified and the event counter is non-" "zero, :func:`eventfd_read` returns the current event counter value and " "resets the counter to zero." msgstr "" -#: ../../library/os.rst:3348 +#: ../../library/os.rst:3356 msgid "" "If the event counter is zero and :const:`EFD_NONBLOCK` is not specified, :" "func:`eventfd_read` blocks." msgstr "" -#: ../../library/os.rst:3351 +#: ../../library/os.rst:3359 msgid "" ":func:`eventfd_write` increments the event counter. Write blocks if the " "write operation would increment the counter to a value larger than 2\\ :sup:" "`64`\\ -\\ 2." msgstr "" -#: ../../library/os.rst:3373 +#: ../../library/os.rst:3381 msgid "" ":ref:`Availability `: Linux 2.6.27 or newer with glibc 2.8 or " "newer." msgstr "" -#: ../../library/os.rst:3378 +#: ../../library/os.rst:3386 msgid "" "Read value from an :func:`eventfd` file descriptor and return a 64 bit " "unsigned int. The function does not verify that *fd* is an :func:`eventfd`." msgstr "" -#: ../../library/os.rst:3382 ../../library/os.rst:3391 -#: ../../library/os.rst:3399 ../../library/os.rst:3408 +#: ../../library/os.rst:3390 ../../library/os.rst:3399 +#: ../../library/os.rst:3407 ../../library/os.rst:3416 msgid ":ref:`Availability `: See :func:`eventfd`" msgstr ":ref:`適用 `:請見 :func:`eventfd`" -#: ../../library/os.rst:3387 +#: ../../library/os.rst:3395 msgid "" "Add value to an :func:`eventfd` file descriptor. *value* must be a 64 bit " "unsigned int. The function does not verify that *fd* is an :func:`eventfd`." msgstr "" -#: ../../library/os.rst:3396 +#: ../../library/os.rst:3404 msgid "Set close-on-exec flag for new :func:`eventfd` file descriptor." msgstr "" -#: ../../library/os.rst:3404 +#: ../../library/os.rst:3412 msgid "" "Set :const:`O_NONBLOCK` status flag for new :func:`eventfd` file descriptor." msgstr "" -#: ../../library/os.rst:3413 +#: ../../library/os.rst:3421 msgid "" "Provide semaphore-like semantics for reads from a :func:`eventfd` file " "descriptor. On read the internal counter is decremented by one." msgstr "" -#: ../../library/os.rst:3417 +#: ../../library/os.rst:3425 msgid "" ":ref:`Availability `: Linux 2.6.30 or newer with glibc 2.8 or " "newer." msgstr "" -#: ../../library/os.rst:3422 +#: ../../library/os.rst:3430 msgid "Linux extended attributes" msgstr "" -#: ../../library/os.rst:3426 +#: ../../library/os.rst:3434 msgid "These functions are all available on Linux only." msgstr "" -#: ../../library/os.rst:3430 +#: ../../library/os.rst:3438 msgid "" "Return the value of the extended filesystem attribute *attribute* for " "*path*. *attribute* can be bytes or str (directly or indirectly through the :" @@ -3703,18 +3712,18 @@ msgid "" "encoding." msgstr "" -#: ../../library/os.rst:3438 +#: ../../library/os.rst:3446 msgid "" "Raises an :ref:`auditing event ` ``os.getxattr`` with arguments " "``path``, ``attribute``." msgstr "" -#: ../../library/os.rst:3440 ../../library/os.rst:3472 -#: ../../library/os.rst:3497 +#: ../../library/os.rst:3448 ../../library/os.rst:3480 +#: ../../library/os.rst:3505 msgid "Accepts a :term:`path-like object` for *path* and *attribute*." msgstr "" -#: ../../library/os.rst:3446 +#: ../../library/os.rst:3454 msgid "" "Return a list of the extended filesystem attributes on *path*. The " "attributes in the list are represented as strings decoded with the " @@ -3722,13 +3731,13 @@ msgid "" "the current directory." msgstr "" -#: ../../library/os.rst:3454 +#: ../../library/os.rst:3462 msgid "" "Raises an :ref:`auditing event ` ``os.listxattr`` with argument " "``path``." msgstr "" -#: ../../library/os.rst:3462 +#: ../../library/os.rst:3470 msgid "" "Removes the extended filesystem attribute *attribute* from *path*. " "*attribute* should be bytes or str (directly or indirectly through the :" @@ -3736,13 +3745,13 @@ msgid "" "`filesystem encoding and error handler`." msgstr "" -#: ../../library/os.rst:3470 +#: ../../library/os.rst:3478 msgid "" "Raises an :ref:`auditing event ` ``os.removexattr`` with arguments " "``path``, ``attribute``." msgstr "" -#: ../../library/os.rst:3478 +#: ../../library/os.rst:3486 msgid "" "Set the extended filesystem attribute *attribute* on *path* to *value*. " "*attribute* must be a bytes or str with no embedded NULs (directly or " @@ -3754,45 +3763,45 @@ msgid "" "will not be created and ``EEXISTS`` will be raised." msgstr "" -#: ../../library/os.rst:3492 +#: ../../library/os.rst:3500 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:3495 +#: ../../library/os.rst:3503 msgid "" "Raises an :ref:`auditing event ` ``os.setxattr`` with arguments " "``path``, ``attribute``, ``value``, ``flags``." msgstr "" -#: ../../library/os.rst:3503 +#: ../../library/os.rst:3511 msgid "" "The maximum size the value of an extended attribute can be. Currently, this " "is 64 KiB on Linux." msgstr "" -#: ../../library/os.rst:3509 +#: ../../library/os.rst:3517 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:3515 +#: ../../library/os.rst:3523 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:3522 +#: ../../library/os.rst:3530 msgid "Process Management" msgstr "" -#: ../../library/os.rst:3524 +#: ../../library/os.rst:3532 msgid "These functions may be used to create and manage processes." msgstr "" -#: ../../library/os.rst:3526 +#: ../../library/os.rst:3534 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 " @@ -3803,7 +3812,7 @@ msgid "" "standard output; ``foo`` will seem to be ignored." msgstr "" -#: ../../library/os.rst:3537 +#: ../../library/os.rst:3545 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 " @@ -3812,37 +3821,37 @@ msgid "" "`SIGABRT` with :func:`signal.signal`." msgstr "" -#: ../../library/os.rst:3546 +#: ../../library/os.rst:3554 msgid "Add a path to the DLL search path." msgstr "" -#: ../../library/os.rst:3548 +#: ../../library/os.rst:3556 msgid "" "This search path is used when resolving dependencies for imported extension " "modules (the module itself is resolved through :data:`sys.path`), and also " "by :mod:`ctypes`." msgstr "" -#: ../../library/os.rst:3552 +#: ../../library/os.rst:3560 msgid "" "Remove the directory by calling **close()** on the returned object or using " "it in a :keyword:`with` statement." msgstr "" -#: ../../library/os.rst:3555 +#: ../../library/os.rst:3563 msgid "" "See the `Microsoft documentation `_ for more information about how " "DLLs are loaded." msgstr "" -#: ../../library/os.rst:3559 +#: ../../library/os.rst:3567 msgid "" "Raises an :ref:`auditing event ` ``os.add_dll_directory`` with " "argument ``path``." msgstr "" -#: ../../library/os.rst:3563 +#: ../../library/os.rst:3571 msgid "" "Previous versions of CPython would resolve DLLs using the default behavior " "for the current process. This led to inconsistencies, such as only sometimes " @@ -3850,14 +3859,14 @@ msgid "" "such as ``AddDllDirectory`` having no effect." msgstr "" -#: ../../library/os.rst:3570 +#: ../../library/os.rst:3578 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:3585 +#: ../../library/os.rst:3593 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 " @@ -3865,7 +3874,7 @@ msgid "" "reported as :exc:`OSError` exceptions." msgstr "" -#: ../../library/os.rst:3590 +#: ../../library/os.rst:3598 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 " @@ -3873,7 +3882,7 @@ msgid "" "fsync` before calling an :func:`exec\\* ` function." msgstr "" -#: ../../library/os.rst:3596 +#: ../../library/os.rst:3604 msgid "" "The \"l\" and \"v\" variants of the :func:`exec\\* ` functions differ " "in how command-line arguments are passed. The \"l\" variants are perhaps " @@ -3886,7 +3895,7 @@ msgid "" "enforced." msgstr "" -#: ../../library/os.rst:3605 +#: ../../library/os.rst:3613 msgid "" "The variants which include a \"p\" near the end (:func:`execlp`, :func:" "`execlpe`, :func:`execvp`, and :func:`execvpe`) will use the :envvar:`PATH` " @@ -3899,7 +3908,7 @@ msgid "" "absolute or relative path." msgstr "" -#: ../../library/os.rst:3615 +#: ../../library/os.rst:3623 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 " @@ -3909,7 +3918,7 @@ msgid "" "process to inherit the environment of the current process." msgstr "" -#: ../../library/os.rst:3622 +#: ../../library/os.rst:3630 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 " @@ -3918,31 +3927,31 @@ msgid "" "`NotImplementedError`." msgstr "" -#: ../../library/os.rst:3627 +#: ../../library/os.rst:3635 msgid "" "Raises an :ref:`auditing event ` ``os.exec`` with arguments " "``path``, ``args``, ``env``." msgstr "" -#: ../../library/os.rst:3631 +#: ../../library/os.rst:3639 msgid "" "Added support for specifying *path* as an open file descriptor for :func:" "`execve`." msgstr "" -#: ../../library/os.rst:3640 +#: ../../library/os.rst:3648 msgid "" "Exit the process with status *n*, without calling cleanup handlers, flushing " "stdio buffers, etc." msgstr "" -#: ../../library/os.rst:3645 +#: ../../library/os.rst:3653 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:3648 +#: ../../library/os.rst:3656 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 " @@ -3950,123 +3959,123 @@ msgid "" "delivery program." msgstr "" -#: ../../library/os.rst:3654 +#: ../../library/os.rst:3662 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:3661 +#: ../../library/os.rst:3669 msgid "Exit code that means no error occurred." msgstr "" -#: ../../library/os.rst:3668 +#: ../../library/os.rst:3676 msgid "" "Exit code that means the command was used incorrectly, such as when the " "wrong number of arguments are given." msgstr "" -#: ../../library/os.rst:3676 +#: ../../library/os.rst:3684 msgid "Exit code that means the input data was incorrect." msgstr "" -#: ../../library/os.rst:3683 +#: ../../library/os.rst:3691 msgid "Exit code that means an input file did not exist or was not readable." msgstr "" -#: ../../library/os.rst:3690 +#: ../../library/os.rst:3698 msgid "Exit code that means a specified user did not exist." msgstr "" -#: ../../library/os.rst:3697 +#: ../../library/os.rst:3705 msgid "Exit code that means a specified host did not exist." msgstr "" -#: ../../library/os.rst:3704 +#: ../../library/os.rst:3712 msgid "Exit code that means that a required service is unavailable." msgstr "" -#: ../../library/os.rst:3711 +#: ../../library/os.rst:3719 msgid "Exit code that means an internal software error was detected." msgstr "" -#: ../../library/os.rst:3718 +#: ../../library/os.rst:3726 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:3726 +#: ../../library/os.rst:3734 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:3734 +#: ../../library/os.rst:3742 msgid "Exit code that means a user specified output file could not be created." msgstr "" -#: ../../library/os.rst:3741 +#: ../../library/os.rst:3749 msgid "" "Exit code that means that an error occurred while doing I/O on some file." msgstr "" -#: ../../library/os.rst:3748 +#: ../../library/os.rst:3756 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:3757 +#: ../../library/os.rst:3765 msgid "" "Exit code that means that a protocol exchange was illegal, invalid, or not " "understood." msgstr "" -#: ../../library/os.rst:3765 +#: ../../library/os.rst:3773 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:3773 +#: ../../library/os.rst:3781 msgid "Exit code that means that some kind of configuration error occurred." msgstr "" -#: ../../library/os.rst:3780 +#: ../../library/os.rst:3788 msgid "Exit code that means something like \"an entry was not found\"." msgstr "" -#: ../../library/os.rst:3787 +#: ../../library/os.rst:3795 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:3790 +#: ../../library/os.rst:3798 msgid "" "Note that some platforms including FreeBSD <= 6.3 and Cygwin have known " "issues when using ``fork()`` from a thread." msgstr "" -#: ../../library/os.rst:3793 +#: ../../library/os.rst:3801 msgid "" "Raises an :ref:`auditing event ` ``os.fork`` with no arguments." msgstr "" -#: ../../library/os.rst:3795 +#: ../../library/os.rst:3803 msgid "" "Calling ``fork()`` in a subinterpreter is no longer supported (:exc:" "`RuntimeError` is raised)." msgstr "" -#: ../../library/os.rst:3801 +#: ../../library/os.rst:3809 msgid "See :mod:`ssl` for applications that use the SSL module with fork()." msgstr "" -#: ../../library/os.rst:3808 +#: ../../library/os.rst:3816 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, " @@ -4075,24 +4084,24 @@ msgid "" "the :mod:`pty` module. If an error occurs :exc:`OSError` is raised." msgstr "" -#: ../../library/os.rst:3814 +#: ../../library/os.rst:3822 msgid "" "Raises an :ref:`auditing event ` ``os.forkpty`` with no arguments." msgstr "" -#: ../../library/os.rst:3816 +#: ../../library/os.rst:3824 msgid "" "Calling ``forkpty()`` in a subinterpreter is no longer supported (:exc:" "`RuntimeError` is raised)." msgstr "" -#: ../../library/os.rst:3829 +#: ../../library/os.rst:3837 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:3832 +#: ../../library/os.rst:3840 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 " @@ -4102,36 +4111,36 @@ msgid "" "version of :func:`kill` additionally takes process handles to be killed." msgstr "" -#: ../../library/os.rst:3840 +#: ../../library/os.rst:3848 msgid "See also :func:`signal.pthread_kill`." msgstr "另請參閱 :func:`signal.pthread_kill`\\ 。" -#: ../../library/os.rst:3842 +#: ../../library/os.rst:3850 msgid "" "Raises an :ref:`auditing event ` ``os.kill`` with arguments " "``pid``, ``sig``." msgstr "" -#: ../../library/os.rst:3844 +#: ../../library/os.rst:3852 msgid "Windows support." msgstr "" -#: ../../library/os.rst:3854 +#: ../../library/os.rst:3862 msgid "Send the signal *sig* to the process group *pgid*." msgstr "" -#: ../../library/os.rst:3856 +#: ../../library/os.rst:3864 msgid "" "Raises an :ref:`auditing event ` ``os.killpg`` with arguments " "``pgid``, ``sig``." msgstr "" -#: ../../library/os.rst:3863 +#: ../../library/os.rst:3871 msgid "" "Add *increment* to the process's \"niceness\". Return the new niceness." msgstr "" -#: ../../library/os.rst:3870 +#: ../../library/os.rst:3878 msgid "" "Return a file descriptor referring to the process *pid*. This descriptor " "can be used to perform process management without races and signals. The " @@ -4139,21 +4148,21 @@ msgid "" "currently defined." msgstr "" -#: ../../library/os.rst:3875 +#: ../../library/os.rst:3883 msgid "See the :manpage:`pidfd_open(2)` man page for more details." msgstr "更多細節請見 :manpage:`pidfd_open(2)` 手冊頁。" -#: ../../library/os.rst:3877 +#: ../../library/os.rst:3885 msgid ":ref:`Availability `: Linux 5.3+" msgstr ":ref:`適用 `:Linux 5.3+" -#: ../../library/os.rst:3883 +#: ../../library/os.rst:3891 msgid "" "Lock program segments into memory. The value of *op* (defined in ````) determines which segments are locked." msgstr "" -#: ../../library/os.rst:3891 +#: ../../library/os.rst:3899 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 " @@ -4163,7 +4172,7 @@ msgid "" "bytes." msgstr "" -#: ../../library/os.rst:3898 +#: ../../library/os.rst:3906 msgid "" "The ``close`` method returns :const:`None` if the subprocess exited " "successfully, or the subprocess's return code if there was an error. On " @@ -4175,43 +4184,43 @@ msgid "" "contains the signed integer return code from the child process." msgstr "" -#: ../../library/os.rst:3908 +#: ../../library/os.rst:3916 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:3913 +#: ../../library/os.rst:3921 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:3922 +#: ../../library/os.rst:3930 msgid "Wraps the :c:func:`posix_spawn` C library API for use from Python." msgstr "" -#: ../../library/os.rst:3924 +#: ../../library/os.rst:3932 msgid "" "Most users should use :func:`subprocess.run` instead of :func:`posix_spawn`." msgstr "" -#: ../../library/os.rst:3926 +#: ../../library/os.rst:3934 msgid "" "The positional-only arguments *path*, *args*, and *env* are similar to :func:" "`execve`." msgstr "" -#: ../../library/os.rst:3929 +#: ../../library/os.rst:3937 msgid "" "The *path* parameter is the path to the executable file. The *path* should " "contain a directory. Use :func:`posix_spawnp` to pass an executable file " "without directory." msgstr "" -#: ../../library/os.rst:3933 +#: ../../library/os.rst:3941 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 " @@ -4220,31 +4229,31 @@ msgid "" "describing the remaining tuple elements:" msgstr "" -#: ../../library/os.rst:3941 +#: ../../library/os.rst:3949 msgid "(``os.POSIX_SPAWN_OPEN``, *fd*, *path*, *flags*, *mode*)" msgstr "(``os.POSIX_SPAWN_OPEN``, *fd*, *path*, *flags*, *mode*)" -#: ../../library/os.rst:3943 +#: ../../library/os.rst:3951 msgid "Performs ``os.dup2(os.open(path, flags, mode), fd)``." msgstr "" -#: ../../library/os.rst:3947 +#: ../../library/os.rst:3955 msgid "(``os.POSIX_SPAWN_CLOSE``, *fd*)" msgstr "(``os.POSIX_SPAWN_CLOSE``, *fd*)" -#: ../../library/os.rst:3949 +#: ../../library/os.rst:3957 msgid "Performs ``os.close(fd)``." msgstr "" -#: ../../library/os.rst:3953 +#: ../../library/os.rst:3961 msgid "(``os.POSIX_SPAWN_DUP2``, *fd*, *new_fd*)" msgstr "(``os.POSIX_SPAWN_DUP2``, *fd*, *new_fd*)" -#: ../../library/os.rst:3955 +#: ../../library/os.rst:3963 msgid "Performs ``os.dup2(fd, new_fd)``." msgstr "" -#: ../../library/os.rst:3957 +#: ../../library/os.rst:3965 msgid "" "These tuples correspond to the C library :c:func:" "`posix_spawn_file_actions_addopen`, :c:func:" @@ -4253,7 +4262,7 @@ msgid "" "`posix_spawn` call itself." msgstr "" -#: ../../library/os.rst:3963 +#: ../../library/os.rst:3971 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 " @@ -4262,7 +4271,7 @@ msgid "" "corresponds to the C library :c:data:`POSIX_SPAWN_SETPGROUP` flag." msgstr "" -#: ../../library/os.rst:3969 +#: ../../library/os.rst:3977 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 " @@ -4273,7 +4282,7 @@ msgid "" "library :c:data:`POSIX_SPAWN_RESETIDS` flag." msgstr "" -#: ../../library/os.rst:3977 +#: ../../library/os.rst:3985 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:" @@ -4281,7 +4290,7 @@ msgid "" "raised." msgstr "" -#: ../../library/os.rst:3982 +#: ../../library/os.rst:3990 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 " @@ -4289,14 +4298,14 @@ msgid "" "`POSIX_SPAWN_SETSIGMASK` flag." msgstr "" -#: ../../library/os.rst:3987 +#: ../../library/os.rst:3995 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:3991 +#: ../../library/os.rst:3999 msgid "" "The *scheduler* argument must be a tuple containing the (optional) scheduler " "policy and an instance of :class:`sched_param` with the scheduler " @@ -4306,79 +4315,79 @@ msgid "" "`POSIX_SPAWN_SETSCHEDULER` flags." msgstr "" -#: ../../library/os.rst:3998 ../../library/os.rst:4014 +#: ../../library/os.rst:4006 ../../library/os.rst:4022 msgid "" "Raises an :ref:`auditing event ` ``os.posix_spawn`` with arguments " "``path``, ``argv``, ``env``." msgstr "" -#: ../../library/os.rst:4008 +#: ../../library/os.rst:4016 msgid "Wraps the :c:func:`posix_spawnp` C library API for use from Python." msgstr "" -#: ../../library/os.rst:4010 +#: ../../library/os.rst:4018 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:4018 +#: ../../library/os.rst:4026 msgid "" ":ref:`Availability `: See :func:`posix_spawn` documentation." msgstr "" -#: ../../library/os.rst:4024 +#: ../../library/os.rst:4032 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:4029 +#: ../../library/os.rst:4037 msgid "*before* is a function called before forking a child process." msgstr "" -#: ../../library/os.rst:4030 +#: ../../library/os.rst:4038 msgid "" "*after_in_parent* is a function called from the parent process after forking " "a child process." msgstr "" -#: ../../library/os.rst:4032 +#: ../../library/os.rst:4040 msgid "*after_in_child* is a function called from the child process." msgstr "" -#: ../../library/os.rst:4034 +#: ../../library/os.rst:4042 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:4038 +#: ../../library/os.rst:4046 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:4043 +#: ../../library/os.rst:4051 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:4047 +#: ../../library/os.rst:4055 msgid "There is no way to unregister a function." msgstr "" -#: ../../library/os.rst:4063 +#: ../../library/os.rst:4071 msgid "Execute the program *path* in a new process." msgstr "" -#: ../../library/os.rst:4065 +#: ../../library/os.rst:4073 msgid "" "(Note that the :mod:`subprocess` module provides more powerful facilities " "for spawning new processes and retrieving their results; using that module " @@ -4386,7 +4395,7 @@ msgid "" "`subprocess-replacements` section.)" msgstr "" -#: ../../library/os.rst:4070 +#: ../../library/os.rst:4078 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 " @@ -4395,13 +4404,13 @@ msgid "" "handle, so can be used with the :func:`waitpid` function." msgstr "" -#: ../../library/os.rst:4076 +#: ../../library/os.rst:4084 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:4079 +#: ../../library/os.rst:4087 msgid "" "The \"l\" and \"v\" variants of the :func:`spawn\\* ` functions " "differ in how command-line arguments are passed. The \"l\" variants are " @@ -4413,7 +4422,7 @@ msgid "" "to the child process must start with the name of the command being run." msgstr "" -#: ../../library/os.rst:4088 +#: ../../library/os.rst:4096 msgid "" "The variants which include a second \"p\" near the end (:func:`spawnlp`, :" "func:`spawnlpe`, :func:`spawnvp`, and :func:`spawnvpe`) will use the :envvar:" @@ -4426,7 +4435,7 @@ msgid "" "appropriate absolute or relative path." msgstr "" -#: ../../library/os.rst:4098 +#: ../../library/os.rst:4106 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 " @@ -4438,19 +4447,19 @@ msgid "" "values will cause the function to fail, with a return value of ``127``." msgstr "" -#: ../../library/os.rst:4107 +#: ../../library/os.rst:4115 msgid "" "As an example, the following calls to :func:`spawnlp` and :func:`spawnvpe` " "are equivalent::" msgstr "" -#: ../../library/os.rst:4116 +#: ../../library/os.rst:4124 msgid "" "Raises an :ref:`auditing event ` ``os.spawn`` with arguments " "``mode``, ``path``, ``args``, ``env``." msgstr "" -#: ../../library/os.rst:4122 +#: ../../library/os.rst:4130 msgid "" ":ref:`Availability `: Unix, Windows. :func:`spawnlp`, :func:" "`spawnlpe`, :func:`spawnvp` and :func:`spawnvpe` are not available on " @@ -4458,7 +4467,7 @@ msgid "" "Windows; we advise you to use the :mod:`subprocess` module instead." msgstr "" -#: ../../library/os.rst:4130 +#: ../../library/os.rst:4138 msgid "" "Possible values for the *mode* parameter to the :func:`spawn\\* ` " "family of functions. If either of these values is given, the :func:`spawn" @@ -4466,7 +4475,7 @@ msgid "" "the process id as the return value." msgstr "" -#: ../../library/os.rst:4140 +#: ../../library/os.rst:4148 msgid "" "Possible value for the *mode* parameter to the :func:`spawn\\* ` " "family of functions. If this is given as *mode*, the :func:`spawn\\*` " @@ -4475,7 +4484,7 @@ msgid "" "signal`` if a signal kills the process." msgstr "" -#: ../../library/os.rst:4152 +#: ../../library/os.rst:4160 msgid "" "Possible values for the *mode* parameter to the :func:`spawn\\* ` " "family of functions. These are less portable than those listed above. :" @@ -4485,11 +4494,11 @@ msgid "" "function will not return." msgstr "" -#: ../../library/os.rst:4163 +#: ../../library/os.rst:4171 msgid "Start a file with its associated application." msgstr "" -#: ../../library/os.rst:4165 +#: ../../library/os.rst:4173 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 " @@ -4498,7 +4507,7 @@ msgid "" "associated." msgstr "" -#: ../../library/os.rst:4170 +#: ../../library/os.rst:4178 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 " @@ -4506,28 +4515,28 @@ msgid "" "``'explore'`` and ``'find'`` (to be used on directories)." msgstr "" -#: ../../library/os.rst:4175 +#: ../../library/os.rst:4183 msgid "" "When launching an application, specify *arguments* to be passed as a single " "string. This argument may have no effect when using this function to launch " "a document." msgstr "" -#: ../../library/os.rst:4179 +#: ../../library/os.rst:4187 msgid "" "The default working directory is inherited, but may be overridden by the " "*cwd* argument. This should be an absolute path. A relative *path* will be " "resolved against this argument." msgstr "" -#: ../../library/os.rst:4183 +#: ../../library/os.rst:4191 msgid "" "Use *show_cmd* to override the default window style. Whether this has any " "effect will depend on the application being launched. Values are integers as " "supported by the Win32 :c:func:`ShellExecute` function." msgstr "" -#: ../../library/os.rst:4187 +#: ../../library/os.rst:4195 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 " @@ -4538,32 +4547,32 @@ msgid "" "encoded for Win32." msgstr "" -#: ../../library/os.rst:4195 +#: ../../library/os.rst:4203 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:4199 +#: ../../library/os.rst:4207 msgid "" "Raises an :ref:`auditing event ` ``os.startfile`` with arguments " "``path``, ``operation``." msgstr "" -#: ../../library/os.rst:4201 +#: ../../library/os.rst:4209 msgid "" "Raises an :ref:`auditing event ` ``os.startfile/2`` with arguments " "``path``, ``operation``, ``arguments``, ``cwd``, ``show_cmd``." msgstr "" -#: ../../library/os.rst:4205 +#: ../../library/os.rst:4213 msgid "" "Added the *arguments*, *cwd* and *show_cmd* arguments, and the ``os." "startfile/2`` audit event." msgstr "" -#: ../../library/os.rst:4212 +#: ../../library/os.rst:4220 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 " @@ -4574,13 +4583,13 @@ msgid "" "value of the Python function is system-dependent." msgstr "" -#: ../../library/os.rst:4220 +#: ../../library/os.rst:4228 msgid "" "On Unix, the return value is the exit status of the process encoded in the " "format specified for :func:`wait`." msgstr "" -#: ../../library/os.rst:4223 +#: ../../library/os.rst:4231 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 :" @@ -4589,7 +4598,7 @@ msgid "" "shell documentation." msgstr "" -#: ../../library/os.rst:4229 +#: ../../library/os.rst:4237 msgid "" "The :mod:`subprocess` module provides more powerful facilities for spawning " "new processes and retrieving their results; using that module is preferable " @@ -4597,53 +4606,53 @@ msgid "" "the :mod:`subprocess` documentation for some helpful recipes." msgstr "" -#: ../../library/os.rst:4234 +#: ../../library/os.rst:4242 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:4238 +#: ../../library/os.rst:4246 msgid "" "Raises an :ref:`auditing event ` ``os.system`` with argument " "``command``." msgstr "" -#: ../../library/os.rst:4245 +#: ../../library/os.rst:4253 msgid "" "Returns the current global process times. The return value is an object with " "five attributes:" msgstr "" -#: ../../library/os.rst:4248 +#: ../../library/os.rst:4256 msgid ":attr:`!user` - user time" msgstr "" -#: ../../library/os.rst:4249 +#: ../../library/os.rst:4257 msgid ":attr:`!system` - system time" msgstr ":attr:`!system` - 系統時間" -#: ../../library/os.rst:4250 +#: ../../library/os.rst:4258 msgid ":attr:`!children_user` - user time of all child processes" msgstr "" -#: ../../library/os.rst:4251 +#: ../../library/os.rst:4259 msgid ":attr:`!children_system` - system time of all child processes" msgstr "" -#: ../../library/os.rst:4252 +#: ../../library/os.rst:4260 msgid ":attr:`!elapsed` - elapsed real time since a fixed point in the past" msgstr "" -#: ../../library/os.rst:4254 +#: ../../library/os.rst:4262 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:4258 +#: ../../library/os.rst:4266 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 ":ref:`適用 `:Linux 5.4+" -#: ../../library/os.rst:4330 +#: ../../library/os.rst:4338 msgid "" "Flags that can be used in *options* in :func:`waitid` that specify what " "child signal to wait for." msgstr "" -#: ../../library/os.rst:4345 +#: ../../library/os.rst:4353 msgid "" "These are the possible values for :attr:`si_code` in the result returned by :" "func:`waitid`." msgstr "" -#: ../../library/os.rst:4352 +#: ../../library/os.rst:4360 msgid "Added :data:`CLD_KILLED` and :data:`CLD_STOPPED` values." msgstr "" -#: ../../library/os.rst:4358 +#: ../../library/os.rst:4366 msgid "The details of this function differ on Unix and Windows." msgstr "" -#: ../../library/os.rst:4360 +#: ../../library/os.rst:4368 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 " @@ -4731,7 +4740,7 @@ msgid "" "operation." msgstr "" -#: ../../library/os.rst:4365 +#: ../../library/os.rst:4373 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 " @@ -4741,13 +4750,13 @@ msgid "" "group ``-pid`` (the absolute value of *pid*)." msgstr "" -#: ../../library/os.rst:4372 +#: ../../library/os.rst:4380 msgid "" "An :exc:`OSError` is raised with the value of errno when the syscall returns " "-1." msgstr "" -#: ../../library/os.rst:4375 +#: ../../library/os.rst:4383 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 " @@ -4759,7 +4768,7 @@ msgid "" "process handles." msgstr "" -#: ../../library/os.rst:4394 +#: ../../library/os.rst:4402 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 " @@ -4768,13 +4777,13 @@ msgid "" "argument is the same as that provided to :func:`waitpid` and :func:`wait4`." msgstr "" -#: ../../library/os.rst:4401 ../../library/os.rst:4415 +#: ../../library/os.rst:4409 ../../library/os.rst:4423 msgid "" ":func:`waitstatus_to_exitcode` can be used to convert the exit status into " "an exitcode." msgstr "" -#: ../../library/os.rst:4409 +#: ../../library/os.rst:4417 msgid "" "Similar to :func:`waitpid`, except a 3-element tuple, containing the child's " "process id, exit status indication, and resource usage information is " @@ -4783,22 +4792,22 @@ msgid "" "the same as those provided to :func:`waitpid`." msgstr "" -#: ../../library/os.rst:4423 +#: ../../library/os.rst:4431 msgid "Convert a wait status to an exit code." msgstr "" -#: ../../library/os.rst:4425 +#: ../../library/os.rst:4433 msgid "On Unix:" msgstr "" -#: ../../library/os.rst:4427 +#: ../../library/os.rst:4435 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:4430 +#: ../../library/os.rst:4438 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 " @@ -4806,15 +4815,15 @@ msgid "" "than 0." msgstr "" -#: ../../library/os.rst:4434 +#: ../../library/os.rst:4442 msgid "Otherwise, raise a :exc:`ValueError`." msgstr "" -#: ../../library/os.rst:4436 +#: ../../library/os.rst:4444 msgid "On Windows, return *status* shifted right by 8 bits." msgstr "" -#: ../../library/os.rst:4438 +#: ../../library/os.rst:4446 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 " @@ -4822,240 +4831,240 @@ msgid "" "``WIFSTOPPED(status)`` is true." msgstr "" -#: ../../library/os.rst:4445 +#: ../../library/os.rst:4453 msgid "" ":func:`WIFEXITED`, :func:`WEXITSTATUS`, :func:`WIFSIGNALED`, :func:" "`WTERMSIG`, :func:`WIFSTOPPED`, :func:`WSTOPSIG` functions." msgstr "" -#: ../../library/os.rst:4453 +#: ../../library/os.rst:4461 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:4461 +#: ../../library/os.rst:4469 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:4464 +#: ../../library/os.rst:4472 msgid ":ref:`Availability `: some Unix systems." msgstr ":ref:`適用 `:部分 Unix 系統。" -#: ../../library/os.rst:4469 +#: ../../library/os.rst:4477 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:4475 +#: ../../library/os.rst:4483 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:4481 +#: ../../library/os.rst:4489 msgid "" "Return ``True`` if a core dump was generated for the process, otherwise " "return ``False``." msgstr "" -#: ../../library/os.rst:4484 ../../library/os.rst:4550 +#: ../../library/os.rst:4492 ../../library/os.rst:4558 msgid "This function should be employed only if :func:`WIFSIGNALED` is true." msgstr "" -#: ../../library/os.rst:4491 +#: ../../library/os.rst:4499 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:4495 +#: ../../library/os.rst:4503 msgid "See :data:`WCONTINUED` option." msgstr "參閱 :data:`WCONTINUED` 選項。" -#: ../../library/os.rst:4502 +#: ../../library/os.rst:4510 msgid "" "Return ``True`` if the process was stopped by delivery of a signal, " "otherwise return ``False``." msgstr "" -#: ../../library/os.rst:4505 +#: ../../library/os.rst:4513 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:4513 +#: ../../library/os.rst:4521 msgid "" "Return ``True`` if the process was terminated by a signal, otherwise return " "``False``." msgstr "" -#: ../../library/os.rst:4521 +#: ../../library/os.rst:4529 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:4530 +#: ../../library/os.rst:4538 msgid "Return the process exit status." msgstr "" -#: ../../library/os.rst:4532 +#: ../../library/os.rst:4540 msgid "This function should be employed only if :func:`WIFEXITED` is true." msgstr "" -#: ../../library/os.rst:4539 +#: ../../library/os.rst:4547 msgid "Return the signal which caused the process to stop." msgstr "" -#: ../../library/os.rst:4541 +#: ../../library/os.rst:4549 msgid "This function should be employed only if :func:`WIFSTOPPED` is true." msgstr "" -#: ../../library/os.rst:4548 +#: ../../library/os.rst:4556 msgid "Return the number of the signal that caused the process to terminate." msgstr "" -#: ../../library/os.rst:4556 +#: ../../library/os.rst:4564 msgid "Interface to the scheduler" msgstr "" -#: ../../library/os.rst:4558 +#: ../../library/os.rst:4566 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:4564 +#: ../../library/os.rst:4572 msgid "" "The following scheduling policies are exposed if they are supported by the " "operating system." msgstr "" -#: ../../library/os.rst:4569 +#: ../../library/os.rst:4577 msgid "The default scheduling policy." msgstr "" -#: ../../library/os.rst:4573 +#: ../../library/os.rst:4581 msgid "" "Scheduling policy for CPU-intensive processes that tries to preserve " "interactivity on the rest of the computer." msgstr "" -#: ../../library/os.rst:4578 +#: ../../library/os.rst:4586 msgid "Scheduling policy for extremely low priority background tasks." msgstr "" -#: ../../library/os.rst:4582 +#: ../../library/os.rst:4590 msgid "Scheduling policy for sporadic server programs." msgstr "" -#: ../../library/os.rst:4586 +#: ../../library/os.rst:4594 msgid "A First In First Out scheduling policy." msgstr "" -#: ../../library/os.rst:4590 +#: ../../library/os.rst:4598 msgid "A round-robin scheduling policy." msgstr "" -#: ../../library/os.rst:4594 +#: ../../library/os.rst:4602 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:4601 +#: ../../library/os.rst:4609 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:4605 +#: ../../library/os.rst:4613 msgid "At the moment, there is only one possible parameter:" msgstr "" -#: ../../library/os.rst:4609 +#: ../../library/os.rst:4617 msgid "The scheduling priority for a scheduling policy." msgstr "" -#: ../../library/os.rst:4614 +#: ../../library/os.rst:4622 msgid "" "Get the minimum priority value for *policy*. *policy* is one of the " "scheduling policy constants above." msgstr "" -#: ../../library/os.rst:4620 +#: ../../library/os.rst:4628 msgid "" "Get the maximum priority value for *policy*. *policy* is one of the " "scheduling policy constants above." msgstr "" -#: ../../library/os.rst:4626 +#: ../../library/os.rst:4634 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:4633 +#: ../../library/os.rst:4641 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:4640 +#: ../../library/os.rst:4648 msgid "" "Set the scheduling parameters for the process with PID *pid*. A *pid* of 0 " "means the calling process. *param* is a :class:`sched_param` instance." msgstr "" -#: ../../library/os.rst:4646 +#: ../../library/os.rst:4654 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:4652 +#: ../../library/os.rst:4660 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:4658 +#: ../../library/os.rst:4666 msgid "Voluntarily relinquish the CPU." msgstr "" -#: ../../library/os.rst:4663 +#: ../../library/os.rst:4671 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:4670 +#: ../../library/os.rst:4678 msgid "" "Return the set of CPUs the process with PID *pid* (or the current process if " "zero) is restricted to." msgstr "" -#: ../../library/os.rst:4677 +#: ../../library/os.rst:4685 msgid "Miscellaneous System Information" msgstr "" -#: ../../library/os.rst:4682 +#: ../../library/os.rst:4690 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 " @@ -5066,13 +5075,13 @@ msgid "" "included in that mapping, passing an integer for *name* is also accepted." msgstr "" -#: ../../library/os.rst:4690 +#: ../../library/os.rst:4698 msgid "" "If the configuration value specified by *name* isn't defined, ``None`` is " "returned." msgstr "" -#: ../../library/os.rst:4693 +#: ../../library/os.rst:4701 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 " @@ -5080,33 +5089,33 @@ msgid "" "`errno.EINVAL` for the error number." msgstr "" -#: ../../library/os.rst:4703 +#: ../../library/os.rst:4711 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:4712 +#: ../../library/os.rst:4720 msgid "" "Return the number of CPUs in the system. Returns ``None`` if undetermined." msgstr "" -#: ../../library/os.rst:4714 +#: ../../library/os.rst:4722 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:4724 +#: ../../library/os.rst:4732 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:4733 +#: ../../library/os.rst:4741 msgid "" "Return integer-valued system configuration values. If the configuration " "value specified by *name* isn't defined, ``-1`` is returned. The comments " @@ -5115,40 +5124,40 @@ msgid "" "``sysconf_names``." msgstr "" -#: ../../library/os.rst:4743 +#: ../../library/os.rst:4751 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:4749 +#: ../../library/os.rst:4757 msgid "" "The following data values are used to support path manipulation operations. " "These are defined for all platforms." msgstr "" -#: ../../library/os.rst:4752 +#: ../../library/os.rst:4760 msgid "" "Higher-level operations on pathnames are defined in the :mod:`os.path` " "module." msgstr "" -#: ../../library/os.rst:4758 +#: ../../library/os.rst:4766 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:4766 +#: ../../library/os.rst:4774 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:4775 +#: ../../library/os.rst:4783 msgid "" "The character used by the operating system to separate pathname components. " "This is ``'/'`` for POSIX and ``'\\\\'`` for Windows. Note that knowing " @@ -5157,7 +5166,7 @@ msgid "" "useful. Also available via :mod:`os.path`." msgstr "" -#: ../../library/os.rst:4785 +#: ../../library/os.rst:4793 msgid "" "An alternative character used by the operating system to separate pathname " "components, or ``None`` if only one separator character exists. This is set " @@ -5165,27 +5174,27 @@ msgid "" "via :mod:`os.path`." msgstr "" -#: ../../library/os.rst:4794 +#: ../../library/os.rst:4802 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:4802 +#: ../../library/os.rst:4810 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:4809 +#: ../../library/os.rst:4817 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:4816 +#: ../../library/os.rst:4824 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 " @@ -5194,36 +5203,36 @@ msgid "" "default); use a single ``'\\n'`` instead, on all platforms." msgstr "" -#: ../../library/os.rst:4825 +#: ../../library/os.rst:4833 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:4836 +#: ../../library/os.rst:4844 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:4844 +#: ../../library/os.rst:4852 msgid "Random numbers" msgstr "" -#: ../../library/os.rst:4849 +#: ../../library/os.rst:4857 msgid "" "Get up to *size* random bytes. The function can return less bytes than " "requested." msgstr "" -#: ../../library/os.rst:4852 +#: ../../library/os.rst:4860 msgid "" "These bytes can be used to seed user-space random number generators or for " "cryptographic purposes." msgstr "" -#: ../../library/os.rst:4855 +#: ../../library/os.rst:4863 msgid "" "``getrandom()`` relies on entropy gathered from device drivers and other " "sources of environmental noise. Unnecessarily reading large quantities of " @@ -5231,36 +5240,36 @@ msgid "" "``/dev/urandom`` devices." msgstr "" -#: ../../library/os.rst:4860 +#: ../../library/os.rst:4868 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:4864 +#: ../../library/os.rst:4872 msgid "" "See also the `Linux getrandom() manual page `_." msgstr "" -#: ../../library/os.rst:4868 +#: ../../library/os.rst:4876 msgid ":ref:`Availability `: Linux 3.17 and newer." msgstr ":ref:`適用 `:Linux 3.17 以上。" -#: ../../library/os.rst:4873 +#: ../../library/os.rst:4881 msgid "" "Return a bytestring of *size* random bytes suitable for cryptographic use." msgstr "" -#: ../../library/os.rst:4875 +#: ../../library/os.rst:4883 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:4879 +#: ../../library/os.rst:4887 msgid "" "On Linux, if the ``getrandom()`` syscall is available, it is used in " "blocking mode: block until the system urandom entropy pool is initialized " @@ -5270,57 +5279,57 @@ msgid "" "to poll until the system urandom entropy pool is initialized." msgstr "" -#: ../../library/os.rst:4886 +#: ../../library/os.rst:4894 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:4890 +#: ../../library/os.rst:4898 msgid "On Windows, it will use ``CryptGenRandom()``." msgstr "" -#: ../../library/os.rst:4893 +#: ../../library/os.rst:4901 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:4897 +#: ../../library/os.rst:4905 msgid "" "On Linux, ``getrandom()`` is now used in blocking mode to increase the " "security." msgstr "" -#: ../../library/os.rst:4901 +#: ../../library/os.rst:4909 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:4905 +#: ../../library/os.rst:4913 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:4913 +#: ../../library/os.rst:4921 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:4917 +#: ../../library/os.rst:4925 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:4924 +#: ../../library/os.rst:4932 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/ossaudiodev.po b/library/ossaudiodev.po index 56d7052102..4ab30cf68f 100644 --- a/library/ossaudiodev.po +++ b/library/ossaudiodev.po @@ -7,8 +7,8 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.10\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2022-03-23 00:14+0000\n" -"PO-Revision-Date: 2017-09-22 18:27+0000\n" +"POT-Creation-Date: 2022-05-21 17:35+0000\n" +"PO-Revision-Date: 2022-05-22 02:10+0800\n" "Last-Translator: Liang-Bo Wang \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" "tw)\n" @@ -17,6 +17,7 @@ msgstr "" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" "Plural-Forms: nplurals=1; plural=0;\n" +"X-Generator: Poedit 3.0.1\n" #: ../../library/ossaudiodev.rst:2 msgid ":mod:`ossaudiodev` --- Access to OSS-compatible audio devices" @@ -24,10 +25,13 @@ msgstr ":mod:`ossaudiodev` --- 對 OSS 相容聲音裝置的存取" #: ../../library/ossaudiodev.rst:9 msgid "" -"The :mod:`ossaudiodev` module is deprecated (see :pep:`594` for details)." -msgstr ":mod:`ossaudiodev` 模組 (module) 即將被棄用(詳見 :pep:`594`\\ )。" +"The :mod:`ossaudiodev` module is deprecated (see :pep:`PEP 594 " +"<594#ossaudiodev>` for details)." +msgstr "" +":mod:`ossaudiodev` 模組 (module) 即將被棄用(詳見 :pep:`PEP 594 " +"<594#ossaudiodev>`\\ )。" -#: ../../library/ossaudiodev.rst:14 +#: ../../library/ossaudiodev.rst:15 msgid "" "This module allows you to access the OSS (Open Sound System) audio " "interface. OSS is available for a wide range of open-source and commercial " @@ -35,39 +39,39 @@ msgid "" "FreeBSD." msgstr "" -#: ../../library/ossaudiodev.rst:46 +#: ../../library/ossaudiodev.rst:47 msgid "" "Operations in this module now raise :exc:`OSError` where :exc:`IOError` was " "raised." msgstr "" -#: ../../library/ossaudiodev.rst:54 +#: ../../library/ossaudiodev.rst:55 msgid "" "`Open Sound System Programmer's Guide `_" msgstr "" -#: ../../library/ossaudiodev.rst:54 +#: ../../library/ossaudiodev.rst:55 msgid "the official documentation for the OSS C API" msgstr "" -#: ../../library/ossaudiodev.rst:56 +#: ../../library/ossaudiodev.rst:57 msgid "" "The module defines a large number of constants supplied by the OSS device " "driver; see ```` on either Linux or FreeBSD for a listing." msgstr "" -#: ../../library/ossaudiodev.rst:59 +#: ../../library/ossaudiodev.rst:60 msgid ":mod:`ossaudiodev` defines the following variables and functions:" msgstr "" -#: ../../library/ossaudiodev.rst:64 +#: ../../library/ossaudiodev.rst:65 msgid "" "This exception is raised on certain errors. The argument is a string " "describing what went wrong." msgstr "" -#: ../../library/ossaudiodev.rst:67 +#: ../../library/ossaudiodev.rst:68 msgid "" "(If :mod:`ossaudiodev` receives an error from a system call such as :c:func:" "`open`, :c:func:`write`, or :c:func:`ioctl`, it raises :exc:`OSError`. " @@ -75,13 +79,13 @@ msgid "" "`OSSAudioError`.)" msgstr "" -#: ../../library/ossaudiodev.rst:71 +#: ../../library/ossaudiodev.rst:72 msgid "" "(For backwards compatibility, the exception class is also available as " "``ossaudiodev.error``.)" msgstr "" -#: ../../library/ossaudiodev.rst:78 +#: ../../library/ossaudiodev.rst:79 msgid "" "Open an audio device and return an OSS audio device object. This object " "supports many file-like methods, such as :meth:`read`, :meth:`write`, and :" @@ -91,14 +95,14 @@ msgid "" "methods." msgstr "" -#: ../../library/ossaudiodev.rst:84 +#: ../../library/ossaudiodev.rst:85 msgid "" "*device* is the audio device filename to use. If it is not specified, this " "module first looks in the environment variable :envvar:`AUDIODEV` for a " "device to use. If not found, it falls back to :file:`/dev/dsp`." msgstr "" -#: ../../library/ossaudiodev.rst:88 +#: ../../library/ossaudiodev.rst:89 msgid "" "*mode* is one of ``'r'`` for read-only (record) access, ``'w'`` for write-" "only (playback) access and ``'rw'`` for both. Since many sound cards only " @@ -108,14 +112,14 @@ msgid "" "not both at once." msgstr "" -#: ../../library/ossaudiodev.rst:95 +#: ../../library/ossaudiodev.rst:96 msgid "" "Note the unusual calling syntax: the *first* argument is optional, and the " "second is required. This is a historical artifact for compatibility with " "the older :mod:`linuxaudiodev` module which :mod:`ossaudiodev` supersedes." msgstr "" -#: ../../library/ossaudiodev.rst:106 +#: ../../library/ossaudiodev.rst:107 msgid "" "Open a mixer device and return an OSS mixer device object. *device* is the " "mixer device filename to use. If it is not specified, this module first " @@ -123,53 +127,53 @@ msgid "" "If not found, it falls back to :file:`/dev/mixer`." msgstr "" -#: ../../library/ossaudiodev.rst:115 +#: ../../library/ossaudiodev.rst:116 msgid "Audio Device Objects" msgstr "" -#: ../../library/ossaudiodev.rst:117 +#: ../../library/ossaudiodev.rst:118 msgid "" "Before you can write to or read from an audio device, you must call three " "methods in the correct order:" msgstr "" -#: ../../library/ossaudiodev.rst:120 +#: ../../library/ossaudiodev.rst:121 msgid ":meth:`setfmt` to set the output format" msgstr "" -#: ../../library/ossaudiodev.rst:122 +#: ../../library/ossaudiodev.rst:123 msgid ":meth:`channels` to set the number of channels" msgstr "" -#: ../../library/ossaudiodev.rst:124 +#: ../../library/ossaudiodev.rst:125 msgid ":meth:`speed` to set the sample rate" msgstr "" -#: ../../library/ossaudiodev.rst:126 +#: ../../library/ossaudiodev.rst:127 msgid "" "Alternately, you can use the :meth:`setparameters` method to set all three " "audio parameters at once. This is more convenient, but may not be as " "flexible in all cases." msgstr "" -#: ../../library/ossaudiodev.rst:130 +#: ../../library/ossaudiodev.rst:131 msgid "" "The audio device objects returned by :func:`.open` define the following " "methods and (read-only) attributes:" msgstr "" -#: ../../library/ossaudiodev.rst:136 +#: ../../library/ossaudiodev.rst:137 msgid "" "Explicitly close the audio device. When you are done writing to or reading " "from an audio device, you should explicitly close it. A closed device " "cannot be used again." msgstr "" -#: ../../library/ossaudiodev.rst:143 +#: ../../library/ossaudiodev.rst:144 msgid "Return the file descriptor associated with the device." msgstr "" -#: ../../library/ossaudiodev.rst:148 +#: ../../library/ossaudiodev.rst:149 msgid "" "Read *size* bytes from the audio input and return them as a Python string. " "Unlike most Unix device drivers, OSS audio devices in blocking mode (the " @@ -177,7 +181,7 @@ msgid "" "is available." msgstr "" -#: ../../library/ossaudiodev.rst:156 +#: ../../library/ossaudiodev.rst:157 msgid "" "Write a :term:`bytes-like object` *data* to the audio device and return the " "number of bytes written. If the audio device is in blocking mode (the " @@ -186,11 +190,11 @@ msgid "" "data may not be written---see :meth:`writeall`." msgstr "" -#: ../../library/ossaudiodev.rst:162 ../../library/ossaudiodev.rst:176 +#: ../../library/ossaudiodev.rst:163 ../../library/ossaudiodev.rst:177 msgid "Writable :term:`bytes-like object` is now accepted." msgstr "" -#: ../../library/ossaudiodev.rst:168 +#: ../../library/ossaudiodev.rst:169 msgid "" "Write a :term:`bytes-like object` *data* to the audio device: waits until " "the audio device is able to accept data, writes as much data as it will " @@ -201,13 +205,13 @@ msgid "" "of data supplied." msgstr "" -#: ../../library/ossaudiodev.rst:180 +#: ../../library/ossaudiodev.rst:181 msgid "" "Audio device objects also support the context management protocol, i.e. they " "can be used in a :keyword:`with` statement." msgstr "" -#: ../../library/ossaudiodev.rst:185 +#: ../../library/ossaudiodev.rst:186 msgid "" "The following methods each map to exactly one :c:func:`ioctl` system call. " "The correspondence is obvious: for example, :meth:`setfmt` corresponds to " @@ -216,103 +220,103 @@ msgid "" "underlying :c:func:`ioctl` fails, they all raise :exc:`OSError`." msgstr "" -#: ../../library/ossaudiodev.rst:194 +#: ../../library/ossaudiodev.rst:195 msgid "" "Put the device into non-blocking mode. Once in non-blocking mode, there is " "no way to return it to blocking mode." msgstr "" -#: ../../library/ossaudiodev.rst:200 +#: ../../library/ossaudiodev.rst:201 msgid "" "Return a bitmask of the audio output formats supported by the soundcard. " "Some of the formats supported by OSS are:" msgstr "" -#: ../../library/ossaudiodev.rst:204 +#: ../../library/ossaudiodev.rst:205 msgid "Format" msgstr "格式" -#: ../../library/ossaudiodev.rst:204 ../../library/ossaudiodev.rst:258 +#: ../../library/ossaudiodev.rst:205 ../../library/ossaudiodev.rst:259 msgid "Description" msgstr "描述" -#: ../../library/ossaudiodev.rst:206 +#: ../../library/ossaudiodev.rst:207 msgid ":const:`AFMT_MU_LAW`" msgstr ":const:`AFMT_MU_LAW`" -#: ../../library/ossaudiodev.rst:206 +#: ../../library/ossaudiodev.rst:207 msgid "" "a logarithmic encoding (used by Sun ``.au`` files and :file:`/dev/audio`)" msgstr "" -#: ../../library/ossaudiodev.rst:209 +#: ../../library/ossaudiodev.rst:210 msgid ":const:`AFMT_A_LAW`" msgstr ":const:`AFMT_A_LAW`" -#: ../../library/ossaudiodev.rst:209 +#: ../../library/ossaudiodev.rst:210 msgid "a logarithmic encoding" msgstr "" -#: ../../library/ossaudiodev.rst:211 +#: ../../library/ossaudiodev.rst:212 msgid ":const:`AFMT_IMA_ADPCM`" msgstr ":const:`AFMT_IMA_ADPCM`" -#: ../../library/ossaudiodev.rst:211 +#: ../../library/ossaudiodev.rst:212 msgid "" "a 4:1 compressed format defined by the Interactive Multimedia Association" msgstr "" -#: ../../library/ossaudiodev.rst:214 +#: ../../library/ossaudiodev.rst:215 msgid ":const:`AFMT_U8`" msgstr ":const:`AFMT_U8`" -#: ../../library/ossaudiodev.rst:214 +#: ../../library/ossaudiodev.rst:215 msgid "Unsigned, 8-bit audio" msgstr "" -#: ../../library/ossaudiodev.rst:216 +#: ../../library/ossaudiodev.rst:217 msgid ":const:`AFMT_S16_LE`" msgstr ":const:`AFMT_S16_LE`" -#: ../../library/ossaudiodev.rst:216 +#: ../../library/ossaudiodev.rst:217 msgid "" "Signed, 16-bit audio, little-endian byte order (as used by Intel processors)" msgstr "" -#: ../../library/ossaudiodev.rst:219 +#: ../../library/ossaudiodev.rst:220 msgid ":const:`AFMT_S16_BE`" msgstr ":const:`AFMT_S16_BE`" -#: ../../library/ossaudiodev.rst:219 +#: ../../library/ossaudiodev.rst:220 msgid "" "Signed, 16-bit audio, big-endian byte order (as used by 68k, PowerPC, Sparc)" msgstr "" -#: ../../library/ossaudiodev.rst:222 +#: ../../library/ossaudiodev.rst:223 msgid ":const:`AFMT_S8`" msgstr ":const:`AFMT_S8`" -#: ../../library/ossaudiodev.rst:222 +#: ../../library/ossaudiodev.rst:223 msgid "Signed, 8 bit audio" msgstr "" -#: ../../library/ossaudiodev.rst:224 +#: ../../library/ossaudiodev.rst:225 msgid ":const:`AFMT_U16_LE`" msgstr ":const:`AFMT_U16_LE`" -#: ../../library/ossaudiodev.rst:224 +#: ../../library/ossaudiodev.rst:225 msgid "Unsigned, 16-bit little-endian audio" msgstr "" -#: ../../library/ossaudiodev.rst:226 +#: ../../library/ossaudiodev.rst:227 msgid ":const:`AFMT_U16_BE`" msgstr ":const:`AFMT_U16_BE`" -#: ../../library/ossaudiodev.rst:226 +#: ../../library/ossaudiodev.rst:227 msgid "Unsigned, 16-bit big-endian audio" msgstr "" -#: ../../library/ossaudiodev.rst:229 +#: ../../library/ossaudiodev.rst:230 msgid "" "Consult the OSS documentation for a full list of audio formats, and note " "that most devices support only a subset of these formats. Some older " @@ -320,7 +324,7 @@ msgid "" "const:`AFMT_S16_LE`." msgstr "" -#: ../../library/ossaudiodev.rst:237 +#: ../../library/ossaudiodev.rst:238 msgid "" "Try to set the current audio format to *format*---see :meth:`getfmts` for a " "list. Returns the audio format that the device was set to, which may not be " @@ -328,7 +332,7 @@ msgid "" "do this by passing an \"audio format\" of :const:`AFMT_QUERY`." msgstr "" -#: ../../library/ossaudiodev.rst:245 +#: ../../library/ossaudiodev.rst:246 msgid "" "Set the number of output channels to *nchannels*. A value of 1 indicates " "monophonic sound, 2 stereophonic. Some devices may have more than 2 " @@ -336,68 +340,68 @@ msgid "" "of channels the device was set to." msgstr "" -#: ../../library/ossaudiodev.rst:253 +#: ../../library/ossaudiodev.rst:254 msgid "" "Try to set the audio sampling rate to *samplerate* samples per second. " "Returns the rate actually set. Most sound devices don't support arbitrary " "sampling rates. Common rates are:" msgstr "" -#: ../../library/ossaudiodev.rst:258 +#: ../../library/ossaudiodev.rst:259 msgid "Rate" msgstr "" -#: ../../library/ossaudiodev.rst:260 +#: ../../library/ossaudiodev.rst:261 msgid "8000" msgstr "8000" -#: ../../library/ossaudiodev.rst:260 +#: ../../library/ossaudiodev.rst:261 msgid "default rate for :file:`/dev/audio`" msgstr "" -#: ../../library/ossaudiodev.rst:262 +#: ../../library/ossaudiodev.rst:263 msgid "11025" msgstr "11025" -#: ../../library/ossaudiodev.rst:262 +#: ../../library/ossaudiodev.rst:263 msgid "speech recording" msgstr "" -#: ../../library/ossaudiodev.rst:264 +#: ../../library/ossaudiodev.rst:265 msgid "22050" msgstr "22050" -#: ../../library/ossaudiodev.rst:266 +#: ../../library/ossaudiodev.rst:267 msgid "44100" msgstr "44100" -#: ../../library/ossaudiodev.rst:266 +#: ../../library/ossaudiodev.rst:267 msgid "CD quality audio (at 16 bits/sample and 2 channels)" msgstr "" -#: ../../library/ossaudiodev.rst:269 +#: ../../library/ossaudiodev.rst:270 msgid "96000" msgstr "96000" -#: ../../library/ossaudiodev.rst:269 +#: ../../library/ossaudiodev.rst:270 msgid "DVD quality audio (at 24 bits/sample)" msgstr "" -#: ../../library/ossaudiodev.rst:275 +#: ../../library/ossaudiodev.rst:276 msgid "" "Wait until the sound device has played every byte in its buffer. (This " "happens implicitly when the device is closed.) The OSS documentation " "recommends closing and re-opening the device rather than using :meth:`sync`." msgstr "" -#: ../../library/ossaudiodev.rst:282 +#: ../../library/ossaudiodev.rst:283 msgid "" "Immediately stop playing or recording and return the device to a state where " "it can accept commands. The OSS documentation recommends closing and re-" "opening the device after calling :meth:`reset`." msgstr "" -#: ../../library/ossaudiodev.rst:289 +#: ../../library/ossaudiodev.rst:290 msgid "" "Tell the driver that there is likely to be a pause in the output, making it " "possible for the device to handle the pause more intelligently. You might " @@ -405,13 +409,13 @@ msgid "" "or before doing disk I/O." msgstr "" -#: ../../library/ossaudiodev.rst:294 +#: ../../library/ossaudiodev.rst:295 msgid "" "The following convenience methods combine several ioctls, or one ioctl and " "some simple calculations." msgstr "" -#: ../../library/ossaudiodev.rst:300 +#: ../../library/ossaudiodev.rst:301 msgid "" "Set the key audio sampling parameters---sample format, number of channels, " "and sampling rate---in one method call. *format*, *nchannels*, and " @@ -424,79 +428,79 @@ msgid "" "`channels`, and :meth:`speed`)." msgstr "" -#: ../../library/ossaudiodev.rst:310 +#: ../../library/ossaudiodev.rst:311 msgid "For example, ::" msgstr "" "舉例來說:\n" "\n" "::" -#: ../../library/ossaudiodev.rst:314 +#: ../../library/ossaudiodev.rst:315 msgid "is equivalent to ::" msgstr "" "等價於:\n" "\n" "::" -#: ../../library/ossaudiodev.rst:323 +#: ../../library/ossaudiodev.rst:324 msgid "Returns the size of the hardware buffer, in samples." msgstr "" -#: ../../library/ossaudiodev.rst:328 +#: ../../library/ossaudiodev.rst:329 msgid "" "Returns the number of samples that are in the hardware buffer yet to be " "played." msgstr "" -#: ../../library/ossaudiodev.rst:333 +#: ../../library/ossaudiodev.rst:334 msgid "" "Returns the number of samples that could be queued into the hardware buffer " "to be played without blocking." msgstr "" -#: ../../library/ossaudiodev.rst:336 +#: ../../library/ossaudiodev.rst:337 msgid "Audio device objects also support several read-only attributes:" msgstr "" -#: ../../library/ossaudiodev.rst:341 +#: ../../library/ossaudiodev.rst:342 msgid "Boolean indicating whether the device has been closed." msgstr "" -#: ../../library/ossaudiodev.rst:346 +#: ../../library/ossaudiodev.rst:347 msgid "String containing the name of the device file." msgstr "" -#: ../../library/ossaudiodev.rst:351 +#: ../../library/ossaudiodev.rst:352 msgid "The I/O mode for the file, either ``\"r\"``, ``\"rw\"``, or ``\"w\"``." msgstr "" -#: ../../library/ossaudiodev.rst:357 +#: ../../library/ossaudiodev.rst:358 msgid "Mixer Device Objects" msgstr "" -#: ../../library/ossaudiodev.rst:359 +#: ../../library/ossaudiodev.rst:360 msgid "The mixer object provides two file-like methods:" msgstr "" -#: ../../library/ossaudiodev.rst:364 +#: ../../library/ossaudiodev.rst:365 msgid "" "This method closes the open mixer device file. Any further attempts to use " "the mixer after this file is closed will raise an :exc:`OSError`." msgstr "" -#: ../../library/ossaudiodev.rst:370 +#: ../../library/ossaudiodev.rst:371 msgid "Returns the file handle number of the open mixer device file." msgstr "" -#: ../../library/ossaudiodev.rst:372 +#: ../../library/ossaudiodev.rst:373 msgid "Mixer objects also support the context management protocol." msgstr "" -#: ../../library/ossaudiodev.rst:376 +#: ../../library/ossaudiodev.rst:377 msgid "The remaining methods are specific to audio mixing:" msgstr "" -#: ../../library/ossaudiodev.rst:381 +#: ../../library/ossaudiodev.rst:382 msgid "" "This method returns a bitmask specifying the available mixer controls " "(\"Control\" being a specific mixable \"channel\", such as :const:" @@ -506,7 +510,7 @@ msgid "" "mixer object supports a PCM mixer, use the following Python code::" msgstr "" -#: ../../library/ossaudiodev.rst:393 +#: ../../library/ossaudiodev.rst:394 msgid "" "For most purposes, the :const:`SOUND_MIXER_VOLUME` (master volume) and :" "const:`SOUND_MIXER_PCM` controls should suffice---but code that uses the " @@ -514,7 +518,7 @@ msgid "" "Gravis Ultrasound, for example, :const:`SOUND_MIXER_VOLUME` does not exist." msgstr "" -#: ../../library/ossaudiodev.rst:401 +#: ../../library/ossaudiodev.rst:402 msgid "" "Returns a bitmask indicating stereo mixer controls. If a bit is set, the " "corresponding control is stereo; if it is unset, the control is either " @@ -522,20 +526,20 @@ msgid "" "`controls` to determine which)." msgstr "" -#: ../../library/ossaudiodev.rst:406 +#: ../../library/ossaudiodev.rst:407 msgid "" "See the code example for the :meth:`controls` function for an example of " "getting data from a bitmask." msgstr "" -#: ../../library/ossaudiodev.rst:412 +#: ../../library/ossaudiodev.rst:413 msgid "" "Returns a bitmask specifying the mixer controls that may be used to record. " "See the code example for :meth:`controls` for an example of reading from a " "bitmask." msgstr "" -#: ../../library/ossaudiodev.rst:418 +#: ../../library/ossaudiodev.rst:419 msgid "" "Returns the volume of a given mixer control. The returned volume is a 2-" "tuple ``(left_volume,right_volume)``. Volumes are specified as numbers from " @@ -543,13 +547,13 @@ msgid "" "still returned, but both volumes are the same." msgstr "" -#: ../../library/ossaudiodev.rst:423 +#: ../../library/ossaudiodev.rst:424 msgid "" "Raises :exc:`OSSAudioError` if an invalid control is specified, or :exc:" "`OSError` if an unsupported control is specified." msgstr "" -#: ../../library/ossaudiodev.rst:429 +#: ../../library/ossaudiodev.rst:430 msgid "" "Sets the volume for a given mixer control to ``(left,right)``. ``left`` and " "``right`` must be ints and between 0 (silent) and 100 (full volume). On " @@ -558,19 +562,19 @@ msgid "" "of some soundcard's mixers." msgstr "" -#: ../../library/ossaudiodev.rst:435 +#: ../../library/ossaudiodev.rst:436 msgid "" "Raises :exc:`OSSAudioError` if an invalid mixer control was specified, or if " "the specified volumes were out-of-range." msgstr "" -#: ../../library/ossaudiodev.rst:441 +#: ../../library/ossaudiodev.rst:442 msgid "" "This method returns a bitmask indicating which control(s) are currently " "being used as a recording source." msgstr "" -#: ../../library/ossaudiodev.rst:447 +#: ../../library/ossaudiodev.rst:448 msgid "" "Call this function to specify a recording source. Returns a bitmask " "indicating the new recording source (or sources) if successful; raises :exc:" diff --git a/library/pathlib.po b/library/pathlib.po index 1d75b7ec50..dd37321283 100644 --- a/library/pathlib.po +++ b/library/pathlib.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.10\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2022-03-23 08:26+0000\n" +"POT-Creation-Date: 2022-05-21 17:35+0000\n" "PO-Revision-Date: 2018-05-23 16:07+0000\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -740,41 +740,42 @@ msgstr "" 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, " -"it will be replaced silently if the user has permission. *target* can be " +"it will be replaced silently if the user has permission. On Windows, if " +"*target* exists, :exc:`FileExistsError` will be raised. *target* can be " "either a string or another path object::" msgstr "" -#: ../../library/pathlib.rst:1033 ../../library/pathlib.rst:1047 +#: ../../library/pathlib.rst:1034 ../../library/pathlib.rst:1048 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:1037 ../../library/pathlib.rst:1051 +#: ../../library/pathlib.rst:1038 ../../library/pathlib.rst:1052 msgid "Added return value, return the new Path instance." msgstr "" -#: ../../library/pathlib.rst:1043 +#: ../../library/pathlib.rst:1044 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." +"empty directory, it will be unconditionally replaced." msgstr "" -#: ../../library/pathlib.rst:1057 +#: ../../library/pathlib.rst:1058 msgid "" "Make the path absolute, resolving any symlinks. A new path object is " "returned::" msgstr "" -#: ../../library/pathlib.rst:1066 +#: ../../library/pathlib.rst:1067 msgid "" "\"``..``\" components are also eliminated (this is the only method to do " "so)::" msgstr "" -#: ../../library/pathlib.rst:1072 +#: ../../library/pathlib.rst:1073 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 " @@ -783,65 +784,65 @@ msgid "" "`RuntimeError` is raised." msgstr "" -#: ../../library/pathlib.rst:1078 +#: ../../library/pathlib.rst:1079 msgid "The *strict* argument (pre-3.6 behavior is strict)." msgstr "" -#: ../../library/pathlib.rst:1083 +#: ../../library/pathlib.rst:1084 msgid "" "This is like calling :func:`Path.glob` with \"``**/``\" added in front of " "the given relative *pattern*::" msgstr "" -#: ../../library/pathlib.rst:1093 +#: ../../library/pathlib.rst:1094 msgid "" "Raises an :ref:`auditing event ` ``pathlib.Path.rglob`` with " "arguments ``self``, ``pattern``." msgstr "" -#: ../../library/pathlib.rst:1098 +#: ../../library/pathlib.rst:1099 msgid "Remove this directory. The directory must be empty." msgstr "" -#: ../../library/pathlib.rst:1103 +#: ../../library/pathlib.rst:1104 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:1107 +#: ../../library/pathlib.rst:1108 msgid "" "An :exc:`OSError` can be raised if either file cannot be accessed for some " "reason." msgstr "" -#: ../../library/pathlib.rst:1124 +#: ../../library/pathlib.rst:1125 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:1140 +#: ../../library/pathlib.rst:1141 msgid "" "The order of arguments (link, target) is the reverse of :func:`os.symlink`'s." msgstr "" -#: ../../library/pathlib.rst:1145 +#: ../../library/pathlib.rst:1146 msgid "Make this path a hard link to the same file as *target*." msgstr "" -#: ../../library/pathlib.rst:1148 +#: ../../library/pathlib.rst:1149 msgid "" "The order of arguments (link, target) is the reverse of :func:`os.link`'s." msgstr "" -#: ../../library/pathlib.rst:1155 +#: ../../library/pathlib.rst:1156 msgid "Make *target* a hard link to this path." msgstr "" -#: ../../library/pathlib.rst:1159 +#: ../../library/pathlib.rst:1160 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, " @@ -849,14 +850,14 @@ msgid "" "hardlink_to`, but matches that of :func:`os.link`." msgstr "" -#: ../../library/pathlib.rst:1168 +#: ../../library/pathlib.rst:1169 msgid "" "This method is deprecated in favor of :meth:`Path.hardlink_to`, as the " "argument order of :meth:`Path.link_to` does not match that of :meth:`Path." "symlink_to`." msgstr "" -#: ../../library/pathlib.rst:1175 +#: ../../library/pathlib.rst:1176 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. " @@ -865,65 +866,65 @@ msgid "" "`FileExistsError` is raised." msgstr "" -#: ../../library/pathlib.rst:1184 +#: ../../library/pathlib.rst:1185 msgid "" "Remove this file or symbolic link. If the path points to a directory, use :" "func:`Path.rmdir` instead." msgstr "" -#: ../../library/pathlib.rst:1187 +#: ../../library/pathlib.rst:1188 msgid "" "If *missing_ok* is false (the default), :exc:`FileNotFoundError` is raised " "if the path does not exist." msgstr "" -#: ../../library/pathlib.rst:1190 +#: ../../library/pathlib.rst:1191 msgid "" "If *missing_ok* is true, :exc:`FileNotFoundError` exceptions will be ignored " "(same behavior as the POSIX ``rm -f`` command)." msgstr "" -#: ../../library/pathlib.rst:1193 +#: ../../library/pathlib.rst:1194 msgid "The *missing_ok* parameter was added." msgstr "新增 *missing_ok* 參數。" -#: ../../library/pathlib.rst:1199 +#: ../../library/pathlib.rst:1200 msgid "" "Open the file pointed to in bytes mode, write *data* to it, and close the " "file::" msgstr "" -#: ../../library/pathlib.rst:1208 +#: ../../library/pathlib.rst:1209 msgid "An existing file of the same name is overwritten." msgstr "" -#: ../../library/pathlib.rst:1215 +#: ../../library/pathlib.rst:1216 msgid "" "Open the file pointed to in text mode, write *data* to it, and close the " "file::" msgstr "" -#: ../../library/pathlib.rst:1224 +#: ../../library/pathlib.rst:1225 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:1229 +#: ../../library/pathlib.rst:1230 msgid "The *newline* parameter was added." msgstr "新增 *newline* 參數。" -#: ../../library/pathlib.rst:1233 +#: ../../library/pathlib.rst:1234 msgid "Correspondence to tools in the :mod:`os` module" msgstr "" -#: ../../library/pathlib.rst:1235 +#: ../../library/pathlib.rst:1236 msgid "" "Below is a table mapping various :mod:`os` functions to their corresponding :" "class:`PurePath`/:class:`Path` equivalent." msgstr "" -#: ../../library/pathlib.rst:1240 +#: ../../library/pathlib.rst:1241 msgid "" "Not all pairs of functions/methods below are equivalent. Some of them, " "despite having some overlapping use-cases, have different semantics. They " @@ -931,229 +932,229 @@ msgid "" "relpath` and :meth:`PurePath.relative_to`." msgstr "" -#: ../../library/pathlib.rst:1246 +#: ../../library/pathlib.rst:1247 msgid ":mod:`os` and :mod:`os.path`" msgstr ":mod:`os` 和 :mod:`os.path`" -#: ../../library/pathlib.rst:1246 +#: ../../library/pathlib.rst:1247 msgid ":mod:`pathlib`" msgstr ":mod:`pathlib`" -#: ../../library/pathlib.rst:1248 +#: ../../library/pathlib.rst:1249 msgid ":func:`os.path.abspath`" msgstr ":func:`os.path.abspath`" -#: ../../library/pathlib.rst:1248 +#: ../../library/pathlib.rst:1249 msgid ":meth:`Path.resolve` [#]_" msgstr ":meth:`Path.resolve` [#]_" -#: ../../library/pathlib.rst:1249 +#: ../../library/pathlib.rst:1250 msgid ":func:`os.chmod`" msgstr ":func:`os.chmod`" -#: ../../library/pathlib.rst:1249 +#: ../../library/pathlib.rst:1250 msgid ":meth:`Path.chmod`" msgstr ":meth:`Path.chmod`" -#: ../../library/pathlib.rst:1250 +#: ../../library/pathlib.rst:1251 msgid ":func:`os.mkdir`" msgstr ":func:`os.mkdir`" -#: ../../library/pathlib.rst:1250 ../../library/pathlib.rst:1251 +#: ../../library/pathlib.rst:1251 ../../library/pathlib.rst:1252 msgid ":meth:`Path.mkdir`" msgstr ":meth:`Path.mkdir`" -#: ../../library/pathlib.rst:1251 +#: ../../library/pathlib.rst:1252 msgid ":func:`os.makedirs`" msgstr ":func:`os.makedirs`" -#: ../../library/pathlib.rst:1252 +#: ../../library/pathlib.rst:1253 msgid ":func:`os.rename`" msgstr ":func:`os.rename`" -#: ../../library/pathlib.rst:1252 +#: ../../library/pathlib.rst:1253 msgid ":meth:`Path.rename`" msgstr ":meth:`Path.rename`" -#: ../../library/pathlib.rst:1253 +#: ../../library/pathlib.rst:1254 msgid ":func:`os.replace`" msgstr ":func:`os.replace`" -#: ../../library/pathlib.rst:1253 +#: ../../library/pathlib.rst:1254 msgid ":meth:`Path.replace`" msgstr ":meth:`Path.replace`" -#: ../../library/pathlib.rst:1254 +#: ../../library/pathlib.rst:1255 msgid ":func:`os.rmdir`" msgstr ":func:`os.rmdir`" -#: ../../library/pathlib.rst:1254 +#: ../../library/pathlib.rst:1255 msgid ":meth:`Path.rmdir`" msgstr ":meth:`Path.rmdir`" -#: ../../library/pathlib.rst:1255 +#: ../../library/pathlib.rst:1256 msgid ":func:`os.remove`, :func:`os.unlink`" msgstr ":func:`os.remove`, :func:`os.unlink`" -#: ../../library/pathlib.rst:1255 +#: ../../library/pathlib.rst:1256 msgid ":meth:`Path.unlink`" msgstr ":meth:`Path.unlink`" -#: ../../library/pathlib.rst:1256 +#: ../../library/pathlib.rst:1257 msgid ":func:`os.getcwd`" msgstr ":func:`os.getcwd`" -#: ../../library/pathlib.rst:1256 +#: ../../library/pathlib.rst:1257 msgid ":func:`Path.cwd`" msgstr ":func:`Path.cwd`" -#: ../../library/pathlib.rst:1257 +#: ../../library/pathlib.rst:1258 msgid ":func:`os.path.exists`" msgstr ":func:`os.path.exists`" -#: ../../library/pathlib.rst:1257 +#: ../../library/pathlib.rst:1258 msgid ":meth:`Path.exists`" msgstr ":meth:`Path.exists`" -#: ../../library/pathlib.rst:1258 +#: ../../library/pathlib.rst:1259 msgid ":func:`os.path.expanduser`" msgstr ":func:`os.path.expanduser`" -#: ../../library/pathlib.rst:1258 +#: ../../library/pathlib.rst:1259 msgid ":meth:`Path.expanduser` and :meth:`Path.home`" msgstr ":meth:`Path.expanduser` 和 :meth:`Path.home`" -#: ../../library/pathlib.rst:1260 +#: ../../library/pathlib.rst:1261 msgid ":func:`os.listdir`" msgstr ":func:`os.listdir`" -#: ../../library/pathlib.rst:1260 +#: ../../library/pathlib.rst:1261 msgid ":meth:`Path.iterdir`" msgstr ":meth:`Path.iterdir`" -#: ../../library/pathlib.rst:1261 +#: ../../library/pathlib.rst:1262 msgid ":func:`os.path.isdir`" msgstr ":func:`os.path.isdir`" -#: ../../library/pathlib.rst:1261 +#: ../../library/pathlib.rst:1262 msgid ":meth:`Path.is_dir`" msgstr ":meth:`Path.is_dir`" -#: ../../library/pathlib.rst:1262 +#: ../../library/pathlib.rst:1263 msgid ":func:`os.path.isfile`" msgstr ":func:`os.path.isfile`" -#: ../../library/pathlib.rst:1262 +#: ../../library/pathlib.rst:1263 msgid ":meth:`Path.is_file`" msgstr ":meth:`Path.is_file`" -#: ../../library/pathlib.rst:1263 +#: ../../library/pathlib.rst:1264 msgid ":func:`os.path.islink`" msgstr ":func:`os.path.islink`" -#: ../../library/pathlib.rst:1263 +#: ../../library/pathlib.rst:1264 msgid ":meth:`Path.is_symlink`" msgstr ":meth:`Path.is_symlink`" -#: ../../library/pathlib.rst:1264 +#: ../../library/pathlib.rst:1265 msgid ":func:`os.link`" msgstr ":func:`os.link`" -#: ../../library/pathlib.rst:1264 +#: ../../library/pathlib.rst:1265 msgid ":meth:`Path.hardlink_to`" msgstr ":meth:`Path.hardlink_to`" -#: ../../library/pathlib.rst:1265 +#: ../../library/pathlib.rst:1266 msgid ":func:`os.symlink`" msgstr ":func:`os.symlink`" -#: ../../library/pathlib.rst:1265 +#: ../../library/pathlib.rst:1266 msgid ":meth:`Path.symlink_to`" msgstr ":meth:`Path.symlink_to`" -#: ../../library/pathlib.rst:1266 +#: ../../library/pathlib.rst:1267 msgid ":func:`os.readlink`" msgstr ":func:`os.readlink`" -#: ../../library/pathlib.rst:1266 +#: ../../library/pathlib.rst:1267 msgid ":meth:`Path.readlink`" msgstr ":meth:`Path.readlink`" -#: ../../library/pathlib.rst:1267 +#: ../../library/pathlib.rst:1268 msgid ":func:`os.path.relpath`" msgstr ":func:`os.path.relpath`" -#: ../../library/pathlib.rst:1267 +#: ../../library/pathlib.rst:1268 msgid ":meth:`Path.relative_to` [#]_" msgstr ":meth:`Path.relative_to` [#]_" -#: ../../library/pathlib.rst:1268 +#: ../../library/pathlib.rst:1269 msgid ":func:`os.stat`" msgstr ":func:`os.stat`" -#: ../../library/pathlib.rst:1268 +#: ../../library/pathlib.rst:1269 msgid ":meth:`Path.stat`, :meth:`Path.owner`, :meth:`Path.group`" msgstr ":meth:`Path.stat`, :meth:`Path.owner`, :meth:`Path.group`" -#: ../../library/pathlib.rst:1271 +#: ../../library/pathlib.rst:1272 msgid ":func:`os.path.isabs`" msgstr ":func:`os.path.isabs`" -#: ../../library/pathlib.rst:1271 +#: ../../library/pathlib.rst:1272 msgid ":meth:`PurePath.is_absolute`" msgstr ":meth:`PurePath.is_absolute`" -#: ../../library/pathlib.rst:1272 +#: ../../library/pathlib.rst:1273 msgid ":func:`os.path.join`" msgstr ":func:`os.path.join`" -#: ../../library/pathlib.rst:1272 +#: ../../library/pathlib.rst:1273 msgid ":func:`PurePath.joinpath`" msgstr ":func:`PurePath.joinpath`" -#: ../../library/pathlib.rst:1273 +#: ../../library/pathlib.rst:1274 msgid ":func:`os.path.basename`" msgstr ":func:`os.path.basename`" -#: ../../library/pathlib.rst:1273 +#: ../../library/pathlib.rst:1274 msgid ":data:`PurePath.name`" msgstr ":data:`PurePath.name`" -#: ../../library/pathlib.rst:1274 +#: ../../library/pathlib.rst:1275 msgid ":func:`os.path.dirname`" msgstr ":func:`os.path.dirname`" -#: ../../library/pathlib.rst:1274 +#: ../../library/pathlib.rst:1275 msgid ":data:`PurePath.parent`" msgstr ":data:`PurePath.parent`" -#: ../../library/pathlib.rst:1275 +#: ../../library/pathlib.rst:1276 msgid ":func:`os.path.samefile`" msgstr ":func:`os.path.samefile`" -#: ../../library/pathlib.rst:1275 +#: ../../library/pathlib.rst:1276 msgid ":meth:`Path.samefile`" msgstr ":meth:`Path.samefile`" -#: ../../library/pathlib.rst:1276 +#: ../../library/pathlib.rst:1277 msgid ":func:`os.path.splitext`" msgstr ":func:`os.path.splitext`" -#: ../../library/pathlib.rst:1276 +#: ../../library/pathlib.rst:1277 msgid ":data:`PurePath.suffix`" msgstr ":data:`PurePath.suffix`" -#: ../../library/pathlib.rst:1280 +#: ../../library/pathlib.rst:1281 msgid "Footnotes" msgstr "註解" -#: ../../library/pathlib.rst:1281 +#: ../../library/pathlib.rst:1282 msgid "" ":func:`os.path.abspath` does not resolve symbolic links while :meth:`Path." "resolve` does." msgstr "" -#: ../../library/pathlib.rst:1282 +#: ../../library/pathlib.rst:1283 msgid "" ":meth:`Path.relative_to` requires ``self`` to be the subpath of the " "argument, but :func:`os.path.relpath` does not." diff --git a/library/pdb.po b/library/pdb.po index 714a36023c..d240a8bf20 100644 --- a/library/pdb.po +++ b/library/pdb.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.10\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2022-01-08 00:09+0000\n" +"POT-Creation-Date: 2022-05-21 17:35+0000\n" "PO-Revision-Date: 2018-05-23 16:07+0000\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -275,10 +275,12 @@ msgid "" "single ``;`` is not used as it is the separator for multiple commands in a " "line that is passed to the Python parser.) No intelligence is applied to " "separating the commands; the input is split at the first ``;;`` pair, even " -"if it is in the middle of a quoted string." +"if it is in the middle of a quoted string. A workaround for strings with " +"double semicolons is to use implicit string concatenation ``';'';'`` or ``\";" +"\"\";\"``." msgstr "" -#: ../../library/pdb.rst:242 +#: ../../library/pdb.rst:243 msgid "" "If a file :file:`.pdbrc` exists in the user's home directory or in the " "current directory, it is read in and executed as if it had been typed at the " @@ -287,14 +289,14 @@ msgid "" "can be overridden by the local file." msgstr "" -#: ../../library/pdb.rst:248 +#: ../../library/pdb.rst:249 msgid "" ":file:`.pdbrc` can now contain commands that continue debugging, such as :" "pdbcmd:`continue` or :pdbcmd:`next`. Previously, these commands had no " "effect." msgstr "" -#: ../../library/pdb.rst:256 +#: ../../library/pdb.rst:257 msgid "" "Without argument, print the list of available commands. With a *command* as " "argument, print help about that command. ``help pdb`` displays the full " @@ -303,25 +305,25 @@ msgid "" "the ``!`` command." msgstr "" -#: ../../library/pdb.rst:264 +#: ../../library/pdb.rst:265 msgid "" "Print a stack trace, with the most recent frame at the bottom. An arrow " "indicates the current frame, which determines the context of most commands." msgstr "" -#: ../../library/pdb.rst:269 +#: ../../library/pdb.rst:270 msgid "" "Move the current frame *count* (default one) levels down in the stack trace " "(to a newer frame)." msgstr "" -#: ../../library/pdb.rst:274 +#: ../../library/pdb.rst:275 msgid "" "Move the current frame *count* (default one) levels up in the stack trace " "(to an older frame)." msgstr "" -#: ../../library/pdb.rst:279 +#: ../../library/pdb.rst:280 msgid "" "With a *lineno* argument, set a break there in the current file. With a " "*function* argument, set a break at the first executable statement within " @@ -332,33 +334,33 @@ msgid "" "refer." msgstr "" -#: ../../library/pdb.rst:286 +#: ../../library/pdb.rst:287 msgid "" "If a second argument is present, it is an expression which must evaluate to " "true before the breakpoint is honored." msgstr "" -#: ../../library/pdb.rst:289 +#: ../../library/pdb.rst:290 msgid "" "Without argument, list all breaks, including for each breakpoint, the number " "of times that breakpoint has been hit, the current ignore count, and the " "associated condition if any." msgstr "" -#: ../../library/pdb.rst:295 +#: ../../library/pdb.rst:296 msgid "" "Temporary breakpoint, which is removed automatically when it is first hit. " "The arguments are the same as for :pdbcmd:`break`." msgstr "" -#: ../../library/pdb.rst:300 +#: ../../library/pdb.rst:301 msgid "" "With a *filename:lineno* argument, clear all the breakpoints at this line. " "With a space separated list of breakpoint numbers, clear those breakpoints. " "Without argument, clear all breaks (but first ask confirmation)." msgstr "" -#: ../../library/pdb.rst:306 +#: ../../library/pdb.rst:307 msgid "" "Disable the breakpoints given as a space separated list of breakpoint " "numbers. Disabling a breakpoint means it cannot cause the program to stop " @@ -366,11 +368,11 @@ msgid "" "breakpoints and can be (re-)enabled." msgstr "" -#: ../../library/pdb.rst:313 +#: ../../library/pdb.rst:314 msgid "Enable the breakpoints specified." msgstr "" -#: ../../library/pdb.rst:317 +#: ../../library/pdb.rst:318 msgid "" "Set the ignore count for the given breakpoint number. If count is omitted, " "the ignore count is set to 0. A breakpoint becomes active when the ignore " @@ -379,39 +381,39 @@ msgid "" "condition evaluates to true." msgstr "" -#: ../../library/pdb.rst:325 +#: ../../library/pdb.rst:326 msgid "" "Set a new *condition* for the breakpoint, an expression which must evaluate " "to true before the breakpoint is honored. If *condition* is absent, any " "existing condition is removed; i.e., the breakpoint is made unconditional." msgstr "" -#: ../../library/pdb.rst:331 +#: ../../library/pdb.rst:332 msgid "" "Specify a list of commands for breakpoint number *bpnumber*. The commands " "themselves appear on the following lines. Type a line containing just " "``end`` to terminate the commands. An example::" msgstr "" -#: ../../library/pdb.rst:340 +#: ../../library/pdb.rst:341 msgid "" "To remove all commands from a breakpoint, type ``commands`` and follow it " "immediately with ``end``; that is, give no commands." msgstr "" -#: ../../library/pdb.rst:343 +#: ../../library/pdb.rst:344 msgid "" "With no *bpnumber* argument, ``commands`` refers to the last breakpoint set." msgstr "" -#: ../../library/pdb.rst:345 +#: ../../library/pdb.rst:346 msgid "" "You can use breakpoint commands to start your program up again. Simply use " "the :pdbcmd:`continue` command, or :pdbcmd:`step`, or any other command that " "resumes execution." msgstr "" -#: ../../library/pdb.rst:349 +#: ../../library/pdb.rst:350 msgid "" "Specifying any command resuming execution (currently :pdbcmd:`continue`, :" "pdbcmd:`step`, :pdbcmd:`next`, :pdbcmd:`return`, :pdbcmd:`jump`, :pdbcmd:" @@ -422,7 +424,7 @@ msgid "" "ambiguities about which list to execute." msgstr "" -#: ../../library/pdb.rst:358 +#: ../../library/pdb.rst:359 msgid "" "If you use the 'silent' command in the command list, the usual message about " "stopping at a breakpoint is not printed. This may be desirable for " @@ -431,13 +433,13 @@ msgid "" "was reached." msgstr "" -#: ../../library/pdb.rst:365 +#: ../../library/pdb.rst:366 msgid "" "Execute the current line, stop at the first possible occasion (either in a " "function that is called or on the next line in the current function)." msgstr "" -#: ../../library/pdb.rst:370 +#: ../../library/pdb.rst:371 msgid "" "Continue execution until the next line in the current function is reached or " "it returns. (The difference between :pdbcmd:`next` and :pdbcmd:`step` is " @@ -446,46 +448,46 @@ msgid "" "line in the current function.)" msgstr "" -#: ../../library/pdb.rst:378 +#: ../../library/pdb.rst:379 msgid "" "Without argument, continue execution until the line with a number greater " "than the current one is reached." msgstr "" -#: ../../library/pdb.rst:381 +#: ../../library/pdb.rst:382 msgid "" "With a line number, continue execution until a line with a number greater or " "equal to that is reached. In both cases, also stop when the current frame " "returns." msgstr "" -#: ../../library/pdb.rst:385 +#: ../../library/pdb.rst:386 msgid "Allow giving an explicit line number." msgstr "" -#: ../../library/pdb.rst:390 +#: ../../library/pdb.rst:391 msgid "Continue execution until the current function returns." msgstr "" -#: ../../library/pdb.rst:394 +#: ../../library/pdb.rst:395 msgid "Continue execution, only stop when a breakpoint is encountered." msgstr "" -#: ../../library/pdb.rst:398 +#: ../../library/pdb.rst:399 msgid "" "Set the next line that will be executed. Only available in the bottom-most " "frame. This lets you jump back and execute code again, or jump forward to " "skip code that you don't want to run." msgstr "" -#: ../../library/pdb.rst:402 +#: ../../library/pdb.rst:403 msgid "" "It should be noted that not all jumps are allowed -- for instance it is not " "possible to jump into the middle of a :keyword:`for` loop or out of a :" "keyword:`finally` clause." msgstr "" -#: ../../library/pdb.rst:408 +#: ../../library/pdb.rst:409 msgid "" "List source code for the current file. Without arguments, list 11 lines " "around the current line or continue the previous listing. With ``.`` as " @@ -494,7 +496,7 @@ msgid "" "second argument is less than the first, it is interpreted as a count." msgstr "" -#: ../../library/pdb.rst:414 +#: ../../library/pdb.rst:415 msgid "" "The current line in the current frame is indicated by ``->``. If an " "exception is being debugged, the line where the exception was originally " @@ -502,68 +504,68 @@ msgid "" "line." msgstr "" -#: ../../library/pdb.rst:419 +#: ../../library/pdb.rst:420 msgid "The ``>>`` marker." msgstr "" -#: ../../library/pdb.rst:424 +#: ../../library/pdb.rst:425 msgid "" "List all source code for the current function or frame. Interesting lines " "are marked as for :pdbcmd:`list`." msgstr "" -#: ../../library/pdb.rst:431 +#: ../../library/pdb.rst:432 msgid "Print the argument list of the current function." msgstr "" -#: ../../library/pdb.rst:435 +#: ../../library/pdb.rst:436 msgid "Evaluate the *expression* in the current context and print its value." msgstr "" -#: ../../library/pdb.rst:439 +#: ../../library/pdb.rst:440 msgid "" "``print()`` can also be used, but is not a debugger command --- this " "executes the Python :func:`print` function." msgstr "" -#: ../../library/pdb.rst:445 +#: ../../library/pdb.rst:446 msgid "" "Like the :pdbcmd:`p` command, except the value of the expression is pretty-" "printed using the :mod:`pprint` module." msgstr "" -#: ../../library/pdb.rst:450 +#: ../../library/pdb.rst:451 msgid "Print the type of the *expression*." msgstr "" -#: ../../library/pdb.rst:454 +#: ../../library/pdb.rst:455 msgid "Try to get source code for the given object and display it." msgstr "" -#: ../../library/pdb.rst:460 +#: ../../library/pdb.rst:461 msgid "" "Display the value of the expression if it changed, each time execution stops " "in the current frame." msgstr "" -#: ../../library/pdb.rst:463 +#: ../../library/pdb.rst:464 msgid "Without expression, list all display expressions for the current frame." msgstr "" -#: ../../library/pdb.rst:469 +#: ../../library/pdb.rst:470 msgid "" "Do not display the expression any more in the current frame. Without " "expression, clear all display expressions for the current frame." msgstr "" -#: ../../library/pdb.rst:476 +#: ../../library/pdb.rst:477 msgid "" "Start an interactive interpreter (using the :mod:`code` module) whose global " "namespace contains all the (global and local) names found in the current " "scope." msgstr "" -#: ../../library/pdb.rst:486 +#: ../../library/pdb.rst:487 msgid "" "Create an alias called *name* that executes *command*. The command must " "*not* be enclosed in quotes. Replaceable parameters can be indicated by ``" @@ -572,7 +574,7 @@ msgid "" "are given, all aliases are listed." msgstr "" -#: ../../library/pdb.rst:492 +#: ../../library/pdb.rst:493 msgid "" "Aliases may be nested and can contain anything that can be legally typed at " "the pdb prompt. Note that internal pdb commands *can* be overridden by " @@ -581,17 +583,17 @@ msgid "" "other words in the line are left alone." msgstr "" -#: ../../library/pdb.rst:498 +#: ../../library/pdb.rst:499 msgid "" "As an example, here are two useful aliases (especially when placed in the :" "file:`.pdbrc` file)::" msgstr "" -#: ../../library/pdb.rst:508 +#: ../../library/pdb.rst:509 msgid "Delete the specified alias." msgstr "" -#: ../../library/pdb.rst:512 +#: ../../library/pdb.rst:513 msgid "" "Execute the (one-line) *statement* in the context of the current stack " "frame. The exclamation point can be omitted unless the first word of the " @@ -600,7 +602,7 @@ msgid "" "line, e.g.::" msgstr "" -#: ../../library/pdb.rst:524 +#: ../../library/pdb.rst:525 msgid "" "Restart the debugged Python program. If an argument is supplied, it is " "split with :mod:`shlex` and the result is used as the new :data:`sys.argv`. " @@ -608,25 +610,25 @@ msgid "" "`restart` is an alias for :pdbcmd:`run`." msgstr "" -#: ../../library/pdb.rst:531 +#: ../../library/pdb.rst:532 msgid "Quit from the debugger. The program being executed is aborted." msgstr "" -#: ../../library/pdb.rst:535 +#: ../../library/pdb.rst:536 msgid "" "Enter a recursive debugger that steps through the code argument (which is an " "arbitrary expression or statement to be executed in the current environment)." msgstr "" -#: ../../library/pdb.rst:541 +#: ../../library/pdb.rst:542 msgid "Print the return value for the last return of a function." msgstr "" -#: ../../library/pdb.rst:544 +#: ../../library/pdb.rst:545 msgid "Footnotes" msgstr "註解" -#: ../../library/pdb.rst:545 +#: ../../library/pdb.rst:546 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/pickle.po b/library/pickle.po index 74b20c82fe..3418c64d68 100644 --- a/library/pickle.po +++ b/library/pickle.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.10\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2022-04-08 18:32+0000\n" +"POT-Creation-Date: 2022-05-21 17:35+0000\n" "PO-Revision-Date: 2018-05-23 16:07+0000\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -682,12 +682,12 @@ msgstr "" #: ../../library/pickle.rst:505 msgid "" -"functions (built-in and user-defined) defined at the top level of a module " -"(using :keyword:`def`, not :keyword:`lambda`);" +"functions (built-in and user-defined) accessible from the top level of a " +"module (using :keyword:`def`, not :keyword:`lambda`);" msgstr "" #: ../../library/pickle.rst:508 -msgid "classes defined at the top level of a module;" +msgid "classes accessible from the top level of a module;" msgstr "" #: ../../library/pickle.rst:510 @@ -709,9 +709,9 @@ msgstr "" #: ../../library/pickle.rst:521 msgid "" -"Note that functions (built-in and user-defined) are pickled by fully " -"qualified name, not by value. [#]_ This means that only the function name " -"is pickled, along with the name of the module the function is defined in. " +"Note that functions (built-in and user-defined) are pickled by fully :term:" +"`qualified name`, not by value. [#]_ This means that only the function name " +"is pickled, along with the name of the containing module and classes. " "Neither the function's code, nor any of its function attributes are " "pickled. Thus the defining module must be importable in the unpickling " "environment, and the module must contain the named object, otherwise an " diff --git a/library/pipes.po b/library/pipes.po index 8f0b27ceb2..1a94699a66 100644 --- a/library/pipes.po +++ b/library/pipes.po @@ -7,8 +7,8 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.10\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2022-03-23 00:14+0000\n" -"PO-Revision-Date: 2015-12-09 17:51+0000\n" +"POT-Creation-Date: 2022-05-21 17:35+0000\n" +"PO-Revision-Date: 2022-05-22 02:11+0800\n" "Last-Translator: Liang-Bo Wang \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" "tw)\n" @@ -17,6 +17,7 @@ msgstr "" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" "Plural-Forms: nplurals=1; plural=0;\n" +"X-Generator: Poedit 3.0.1\n" #: ../../library/pipes.rst:2 msgid ":mod:`pipes` --- Interface to shell pipelines" @@ -27,70 +28,74 @@ msgid "**Source code:** :source:`Lib/pipes.py`" msgstr "**原始碼:**\\ :source:`Lib/pipes.py`" #: ../../library/pipes.rst:13 -msgid "The :mod:`pipes` module is deprecated (see :pep:`594` for details)." -msgstr ":mod:`pipes` 模組 (module) 即將被棄用(詳見 :pep:`594`\\ )。" +msgid "" +"The :mod:`pipes` module is deprecated (see :pep:`PEP 594 <594#pipes>` for " +"details). Please use the :mod:`subprocess` module instead." +msgstr "" +":mod:`pipes` 模組 (module) 即將被棄用(詳見 :pep:`PEP 594 <594#pipes>`\\ )。" +"請改用 :mod:`subprocess`\\ 。" -#: ../../library/pipes.rst:18 +#: ../../library/pipes.rst:20 msgid "" "The :mod:`pipes` module defines a class to abstract the concept of a " "*pipeline* --- a sequence of converters from one file to another." msgstr "" -#: ../../library/pipes.rst:21 +#: ../../library/pipes.rst:23 msgid "" "Because the module uses :program:`/bin/sh` command lines, a POSIX or " "compatible shell for :func:`os.system` and :func:`os.popen` is required." msgstr "" -#: ../../library/pipes.rst:25 +#: ../../library/pipes.rst:27 msgid ":ref:`Availability `: Unix. Not available on VxWorks." msgstr ":ref:`適用 `:Unix,VxWorks 上不支援。" -#: ../../library/pipes.rst:26 +#: ../../library/pipes.rst:28 msgid "The :mod:`pipes` module defines the following class:" msgstr "" -#: ../../library/pipes.rst:31 +#: ../../library/pipes.rst:33 msgid "An abstraction of a pipeline." msgstr "" -#: ../../library/pipes.rst:33 +#: ../../library/pipes.rst:35 msgid "Example::" msgstr "" "範例:\n" "\n" "::" -#: ../../library/pipes.rst:48 +#: ../../library/pipes.rst:50 msgid "Template Objects" msgstr "" -#: ../../library/pipes.rst:50 +#: ../../library/pipes.rst:52 msgid "Template objects following methods:" msgstr "" -#: ../../library/pipes.rst:55 +#: ../../library/pipes.rst:57 msgid "Restore a pipeline template to its initial state." msgstr "" -#: ../../library/pipes.rst:60 +#: ../../library/pipes.rst:62 msgid "Return a new, equivalent, pipeline template." msgstr "" -#: ../../library/pipes.rst:65 +#: ../../library/pipes.rst:67 msgid "" "If *flag* is true, turn debugging on. Otherwise, turn debugging off. When " "debugging is on, commands to be executed are printed, and the shell is given " "``set -x`` command to be more verbose." msgstr "" -#: ../../library/pipes.rst:72 +#: ../../library/pipes.rst:74 msgid "" "Append a new action at the end. The *cmd* variable must be a valid bourne " "shell command. The *kind* variable consists of two letters." msgstr "" -#: ../../library/pipes.rst:75 +#: ../../library/pipes.rst:77 msgid "" "The first letter can be either of ``'-'`` (which means the command reads its " "standard input), ``'f'`` (which means the commands reads a given file on the " @@ -98,7 +103,7 @@ msgid "" "must be first.)" msgstr "" -#: ../../library/pipes.rst:80 +#: ../../library/pipes.rst:82 msgid "" "Similarly, the second letter can be either of ``'-'`` (which means the " "command writes to standard output), ``'f'`` (which means the command writes " @@ -106,18 +111,18 @@ msgid "" "write anything, and hence must be last.)" msgstr "" -#: ../../library/pipes.rst:88 +#: ../../library/pipes.rst:90 msgid "" "Add a new action at the beginning. See :meth:`append` for explanations of " "the arguments." msgstr "" -#: ../../library/pipes.rst:94 +#: ../../library/pipes.rst:96 msgid "" "Return a file-like object, open to *file*, but read from or written to by " "the pipeline. Note that only one of ``'r'``, ``'w'`` may be given." msgstr "" -#: ../../library/pipes.rst:100 +#: ../../library/pipes.rst:102 msgid "Copy *infile* to *outfile* through the pipe." msgstr "" diff --git a/library/shutil.po b/library/shutil.po index 828d5380f3..8ecca2dc41 100644 --- a/library/shutil.po +++ b/library/shutil.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.10\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2022-04-16 00:14+0000\n" +"POT-Creation-Date: 2022-05-21 17:35+0000\n" "PO-Revision-Date: 2018-05-23 16:10+0000\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -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:70 ../../library/shutil.rst:177 +#: ../../library/shutil.rst:208 msgid "" "Raises an :ref:`auditing event ` ``shutil.copyfile`` with " "arguments ``src``, ``dst``." @@ -111,9 +111,9 @@ msgid "" "subclass of the latter, this change is backward compatible." msgstr "" -#: ../../library/shutil.rst:81 ../../library/shutil.rst:184 -#: ../../library/shutil.rst:216 ../../library/shutil.rst:286 -#: ../../library/shutil.rst:374 +#: ../../library/shutil.rst:81 ../../library/shutil.rst:185 +#: ../../library/shutil.rst:217 ../../library/shutil.rst:287 +#: ../../library/shutil.rst:375 msgid "" "Platform-specific fast-copy syscalls may be used internally in order to copy " "the file more efficiently. See :ref:`shutil-platform-dependent-efficient-" @@ -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:106 ../../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 "更多資訊請見 :data:`os.supports_follow_symlinks`\\ 。" -#: ../../library/shutil.rst:153 ../../library/shutil.rst:209 +#: ../../library/shutil.rst:153 ../../library/shutil.rst:210 msgid "" "Raises an :ref:`auditing event ` ``shutil.copystat`` with " "arguments ``src``, ``dst``." @@ -217,17 +217,18 @@ 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." +"filename from *src*. If *dst* specifies a file that already exists, it will " +"be replaced. Returns the path to the newly created file." msgstr "" -#: ../../library/shutil.rst:165 +#: ../../library/shutil.rst:166 msgid "" "If *follow_symlinks* is false, and *src* is a symbolic link, *dst* will be " "created as a symbolic link. If *follow_symlinks* is true and *src* is a " "symbolic link, *dst* will be a copy of the file *src* refers to." msgstr "" -#: ../../library/shutil.rst:170 +#: ../../library/shutil.rst:171 msgid "" ":func:`~shutil.copy` copies the file data and the file's permission mode " "(see :func:`os.chmod`). Other metadata, like the file's creation and " @@ -235,18 +236,18 @@ msgid "" "original, use :func:`~shutil.copy2` instead." msgstr "" -#: ../../library/shutil.rst:180 +#: ../../library/shutil.rst:181 msgid "" "Added *follow_symlinks* argument. Now returns path to the newly created file." msgstr "" -#: ../../library/shutil.rst:191 +#: ../../library/shutil.rst:192 msgid "" "Identical to :func:`~shutil.copy` except that :func:`copy2` also attempts to " "preserve file metadata." msgstr "" -#: ../../library/shutil.rst:194 +#: ../../library/shutil.rst:195 msgid "" "When *follow_symlinks* is false, and *src* is a symbolic link, :func:`copy2` " "attempts to copy all metadata from the *src* symbolic link to the newly-" @@ -256,41 +257,41 @@ msgid "" "`copy2` never raises an exception because it cannot preserve file metadata." msgstr "" -#: ../../library/shutil.rst:203 +#: ../../library/shutil.rst:204 msgid "" ":func:`copy2` uses :func:`copystat` to copy the file metadata. Please see :" "func:`copystat` for more information about platform support for modifying " "symbolic link metadata." msgstr "" -#: ../../library/shutil.rst:211 +#: ../../library/shutil.rst:212 msgid "" "Added *follow_symlinks* argument, try to copy extended file system " "attributes too (currently Linux only). Now returns path to the newly created " "file." msgstr "" -#: ../../library/shutil.rst:223 +#: ../../library/shutil.rst:224 msgid "" "This factory function creates a function that can be used as a callable for :" "func:`copytree`\\'s *ignore* argument, ignoring files and directories that " "match one of the glob-style *patterns* provided. See the example below." msgstr "" -#: ../../library/shutil.rst:232 +#: ../../library/shutil.rst:233 msgid "" "Recursively copy an entire directory tree rooted at *src* to a directory " "named *dst* and return the destination directory. All intermediate " "directories needed to contain *dst* will also be created by default." msgstr "" -#: ../../library/shutil.rst:236 +#: ../../library/shutil.rst:237 msgid "" "Permissions and times of directories are copied with :func:`copystat`, " "individual files are copied using :func:`~shutil.copy2`." msgstr "" -#: ../../library/shutil.rst:239 +#: ../../library/shutil.rst:240 msgid "" "If *symlinks* is true, symbolic links in the source tree are represented as " "symbolic links in the new tree and the metadata of the original links will " @@ -298,7 +299,7 @@ msgid "" "and metadata of the linked files are copied to the new tree." msgstr "" -#: ../../library/shutil.rst:244 +#: ../../library/shutil.rst:245 msgid "" "When *symlinks* is false, if the file pointed by the symlink doesn't exist, " "an exception will be added in the list of errors raised in an :exc:`Error` " @@ -308,7 +309,7 @@ msgid "" "support :func:`os.symlink`." msgstr "" -#: ../../library/shutil.rst:251 +#: ../../library/shutil.rst:252 msgid "" "If *ignore* is given, it must be a callable that will receive as its " "arguments the directory being visited by :func:`copytree`, and a list of its " @@ -321,12 +322,12 @@ msgid "" "ignores names based on glob-style patterns." msgstr "" -#: ../../library/shutil.rst:261 +#: ../../library/shutil.rst:262 msgid "" "If exception(s) occur, an :exc:`Error` is raised with a list of reasons." msgstr "" -#: ../../library/shutil.rst:263 +#: ../../library/shutil.rst:264 msgid "" "If *copy_function* is given, it must be a callable that will be used to copy " "each file. It will be called with the source path and the destination path " @@ -334,7 +335,7 @@ msgid "" "that supports the same signature (like :func:`~shutil.copy`) can be used." msgstr "" -#: ../../library/shutil.rst:268 +#: ../../library/shutil.rst:269 msgid "" "If *dirs_exist_ok* is false (the default) and *dst* already exists, a :exc:" "`FileExistsError` is raised. If *dirs_exist_ok* is true, the copying " @@ -343,28 +344,28 @@ msgid "" "*src* tree." msgstr "" -#: ../../library/shutil.rst:274 +#: ../../library/shutil.rst:275 msgid "" "Raises an :ref:`auditing event ` ``shutil.copytree`` with " "arguments ``src``, ``dst``." msgstr "" -#: ../../library/shutil.rst:276 +#: ../../library/shutil.rst:277 msgid "Copy metadata when *symlinks* is false. Now returns *dst*." msgstr "" -#: ../../library/shutil.rst:280 +#: ../../library/shutil.rst:281 msgid "" "Added the *copy_function* argument to be able to provide a custom copy " "function. Added the *ignore_dangling_symlinks* argument to silence dangling " "symlinks errors when *symlinks* is false." msgstr "" -#: ../../library/shutil.rst:291 +#: ../../library/shutil.rst:292 msgid "The *dirs_exist_ok* parameter." msgstr "*dirs_exist_ok* 參數。" -#: ../../library/shutil.rst:298 +#: ../../library/shutil.rst:299 msgid "" "Delete an entire directory tree; *path* must point to a directory (but not a " "symbolic link to a directory). If *ignore_errors* is true, errors resulting " @@ -373,7 +374,7 @@ msgid "" "they raise an exception." msgstr "" -#: ../../library/shutil.rst:306 +#: ../../library/shutil.rst:307 msgid "" "On platforms that support the necessary fd-based functions a symlink attack " "resistant version of :func:`rmtree` is used by default. On other platforms, " @@ -384,13 +385,13 @@ msgid "" "attribute to determine which case applies." msgstr "" -#: ../../library/shutil.rst:314 +#: ../../library/shutil.rst:315 msgid "" "If *onerror* is provided, it must be a callable that accepts three " "parameters: *function*, *path*, and *excinfo*." msgstr "" -#: ../../library/shutil.rst:317 +#: ../../library/shutil.rst:318 msgid "" "The first parameter, *function*, is the function which raised the exception; " "it depends on the platform and implementation. The second parameter, " @@ -399,45 +400,45 @@ msgid "" "exc_info`. Exceptions raised by *onerror* will not be caught." msgstr "" -#: ../../library/shutil.rst:323 +#: ../../library/shutil.rst:324 msgid "" "Raises an :ref:`auditing event ` ``shutil.rmtree`` with argument " "``path``." msgstr "" -#: ../../library/shutil.rst:325 +#: ../../library/shutil.rst:326 msgid "" "Added a symlink attack resistant version that is used automatically if " "platform supports fd-based functions." msgstr "" -#: ../../library/shutil.rst:329 +#: ../../library/shutil.rst:330 msgid "" "On Windows, will no longer delete the contents of a directory junction " "before removing the junction." msgstr "" -#: ../../library/shutil.rst:335 +#: ../../library/shutil.rst:336 msgid "" "Indicates whether the current platform and implementation provides a symlink " "attack resistant version of :func:`rmtree`. Currently this is only true for " "platforms supporting fd-based directory access functions." msgstr "" -#: ../../library/shutil.rst:344 +#: ../../library/shutil.rst:345 msgid "" "Recursively move a file or directory (*src*) to another location (*dst*) and " "return the destination." msgstr "" -#: ../../library/shutil.rst:347 +#: ../../library/shutil.rst:348 msgid "" "If the destination is an existing directory, then *src* is moved inside that " "directory. If the destination already exists but is not a directory, it may " "be overwritten depending on :func:`os.rename` semantics." msgstr "" -#: ../../library/shutil.rst:351 +#: ../../library/shutil.rst:352 msgid "" "If the destination is on the current filesystem, then :func:`os.rename` is " "used. Otherwise, *src* is copied to *dst* using *copy_function* and then " @@ -445,7 +446,7 @@ msgid "" "will be created in or as *dst* and *src* will be removed." msgstr "" -#: ../../library/shutil.rst:356 +#: ../../library/shutil.rst:357 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." @@ -456,84 +457,84 @@ msgid "" "the expense of not copying any of the metadata." msgstr "" -#: ../../library/shutil.rst:364 +#: ../../library/shutil.rst:365 msgid "" "Raises an :ref:`auditing event ` ``shutil.move`` with arguments " "``src``, ``dst``." msgstr "" -#: ../../library/shutil.rst:366 +#: ../../library/shutil.rst:367 msgid "" "Added explicit symlink handling for foreign filesystems, thus adapting it to " "the behavior of GNU's :program:`mv`. Now returns *dst*." msgstr "" -#: ../../library/shutil.rst:371 +#: ../../library/shutil.rst:372 msgid "Added the *copy_function* keyword argument." msgstr "新增 *copy_function* 關鍵字引數。" -#: ../../library/shutil.rst:379 +#: ../../library/shutil.rst:380 msgid "Accepts a :term:`path-like object` for both *src* and *dst*." msgstr "" -#: ../../library/shutil.rst:384 +#: ../../library/shutil.rst:385 msgid "" "Return disk usage statistics about the given path as a :term:`named tuple` " "with the attributes *total*, *used* and *free*, which are the amount of " "total, used and free space, in bytes. *path* may be a file or a directory." msgstr "" -#: ../../library/shutil.rst:391 +#: ../../library/shutil.rst:392 msgid "On Windows, *path* can now be a file or directory." msgstr "" -#: ../../library/shutil.rst:394 +#: ../../library/shutil.rst:395 msgid ":ref:`Availability `: Unix, Windows." msgstr ":ref:`適用 `:Unix、Windows。" -#: ../../library/shutil.rst:398 +#: ../../library/shutil.rst:399 msgid "Change owner *user* and/or *group* of the given *path*." msgstr "" -#: ../../library/shutil.rst:400 +#: ../../library/shutil.rst:401 msgid "" "*user* can be a system user name or a uid; the same applies to *group*. At " "least one argument is required." msgstr "" -#: ../../library/shutil.rst:403 +#: ../../library/shutil.rst:404 msgid "See also :func:`os.chown`, the underlying function." msgstr "" -#: ../../library/shutil.rst:405 +#: ../../library/shutil.rst:406 msgid "" "Raises an :ref:`auditing event ` ``shutil.chown`` with arguments " "``path``, ``user``, ``group``." msgstr "" -#: ../../library/shutil.rst:408 +#: ../../library/shutil.rst:409 msgid ":ref:`Availability `: Unix." msgstr ":ref:`適用 `:Unix。" -#: ../../library/shutil.rst:414 +#: ../../library/shutil.rst:415 msgid "" "Return the path to an executable which would be run if the given *cmd* was " "called. If no *cmd* would be called, return ``None``." msgstr "" -#: ../../library/shutil.rst:417 +#: ../../library/shutil.rst:418 msgid "" "*mode* is a permission mask passed to :func:`os.access`, by default " "determining if the file exists and executable." msgstr "" -#: ../../library/shutil.rst:420 +#: ../../library/shutil.rst:421 msgid "" "When no *path* is specified, the results of :func:`os.environ` are used, " "returning either the \"PATH\" value or a fallback of :attr:`os.defpath`." msgstr "" -#: ../../library/shutil.rst:423 +#: ../../library/shutil.rst:424 msgid "" "On Windows, the current directory is always prepended to the *path* whether " "or not you use the default or provide your own, which is the behavior the " @@ -544,24 +545,24 @@ msgid "" "directories. For example, on Windows::" msgstr "" -#: ../../library/shutil.rst:436 +#: ../../library/shutil.rst:437 msgid "" "The :class:`bytes` type is now accepted. If *cmd* type is :class:`bytes`, " "the result type is also :class:`bytes`." msgstr "" -#: ../../library/shutil.rst:442 +#: ../../library/shutil.rst:443 msgid "" "This exception collects exceptions that are raised during a multi-file " "operation. For :func:`copytree`, the exception argument is a list of 3-" "tuples (*srcname*, *dstname*, *exception*)." msgstr "" -#: ../../library/shutil.rst:449 +#: ../../library/shutil.rst:450 msgid "Platform-dependent efficient copy operations" msgstr "" -#: ../../library/shutil.rst:451 +#: ../../library/shutil.rst:452 msgid "" "Starting from Python 3.8, all functions involving a file copy (:func:" "`copyfile`, :func:`~shutil.copy`, :func:`copy2`, :func:`copytree`, and :func:" @@ -571,51 +572,51 @@ msgid "" "buffers in Python as in \"``outfd.write(infd.read())``\"." msgstr "" -#: ../../library/shutil.rst:459 +#: ../../library/shutil.rst:460 msgid "On macOS `fcopyfile`_ is used to copy the file content (not metadata)." msgstr "" -#: ../../library/shutil.rst:461 +#: ../../library/shutil.rst:462 msgid "On Linux :func:`os.sendfile` is used." msgstr "" -#: ../../library/shutil.rst:463 +#: ../../library/shutil.rst:464 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:467 +#: ../../library/shutil.rst:468 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:476 +#: ../../library/shutil.rst:477 msgid "copytree example" msgstr "" -#: ../../library/shutil.rst:478 +#: ../../library/shutil.rst:479 msgid "An example that uses the :func:`ignore_patterns` helper::" msgstr "" -#: ../../library/shutil.rst:484 +#: ../../library/shutil.rst:485 msgid "" "This will copy everything except ``.pyc`` files and files or directories " "whose name starts with ``tmp``." msgstr "" -#: ../../library/shutil.rst:487 +#: ../../library/shutil.rst:488 msgid "Another example that uses the *ignore* argument to add a logging call::" msgstr "" -#: ../../library/shutil.rst:502 +#: ../../library/shutil.rst:503 msgid "rmtree example" msgstr "rmtree 範例" -#: ../../library/shutil.rst:504 +#: ../../library/shutil.rst:505 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 " @@ -623,25 +624,25 @@ msgid "" "propagate. ::" msgstr "" -#: ../../library/shutil.rst:522 +#: ../../library/shutil.rst:523 msgid "Archiving operations" msgstr "" -#: ../../library/shutil.rst:526 +#: ../../library/shutil.rst:527 msgid "Added support for the *xztar* format." msgstr "新增 *xztar* 格式的支援。" -#: ../../library/shutil.rst:530 +#: ../../library/shutil.rst:531 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:535 +#: ../../library/shutil.rst:536 msgid "Create an archive file (such as zip or tar) and return its name." msgstr "" -#: ../../library/shutil.rst:537 +#: ../../library/shutil.rst:538 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" @@ -650,14 +651,14 @@ msgid "" "available), or \"xztar\" (if the :mod:`lzma` module is available)." msgstr "" -#: ../../library/shutil.rst:543 +#: ../../library/shutil.rst:544 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:547 +#: ../../library/shutil.rst:548 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. " @@ -665,90 +666,90 @@ msgid "" "example-with-basedir` for how to use *base_dir* and *root_dir* together." msgstr "" -#: ../../library/shutil.rst:553 +#: ../../library/shutil.rst:554 msgid "*root_dir* and *base_dir* both default to the current directory." msgstr "" -#: ../../library/shutil.rst:555 +#: ../../library/shutil.rst:556 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:558 +#: ../../library/shutil.rst:559 msgid "" "*owner* and *group* are used when creating a tar archive. By default, uses " "the current owner and group." msgstr "" -#: ../../library/shutil.rst:561 +#: ../../library/shutil.rst:562 msgid "" "*logger* must be an object compatible with :pep:`282`, usually an instance " "of :class:`logging.Logger`." msgstr "" -#: ../../library/shutil.rst:564 +#: ../../library/shutil.rst:565 msgid "The *verbose* argument is unused and deprecated." msgstr "" -#: ../../library/shutil.rst:566 +#: ../../library/shutil.rst:567 msgid "" "Raises an :ref:`auditing event ` ``shutil.make_archive`` with " "arguments ``base_name``, ``format``, ``root_dir``, ``base_dir``." msgstr "" -#: ../../library/shutil.rst:570 +#: ../../library/shutil.rst:571 msgid "This function is not thread-safe." msgstr "" -#: ../../library/shutil.rst:572 +#: ../../library/shutil.rst:573 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:579 +#: ../../library/shutil.rst:580 msgid "" "Return a list of supported formats for archiving. Each element of the " "returned sequence is a tuple ``(name, description)``." msgstr "" -#: ../../library/shutil.rst:582 ../../library/shutil.rst:664 +#: ../../library/shutil.rst:583 ../../library/shutil.rst:671 msgid "By default :mod:`shutil` provides these formats:" msgstr "" -#: ../../library/shutil.rst:584 +#: ../../library/shutil.rst:585 msgid "*zip*: ZIP file (if the :mod:`zlib` module is available)." msgstr "" -#: ../../library/shutil.rst:585 +#: ../../library/shutil.rst:586 msgid "" "*tar*: Uncompressed tar file. Uses POSIX.1-2001 pax format for new archives." msgstr "" -#: ../../library/shutil.rst:586 ../../library/shutil.rst:669 +#: ../../library/shutil.rst:587 ../../library/shutil.rst:676 msgid "*gztar*: gzip'ed tar-file (if the :mod:`zlib` module is available)." msgstr "" -#: ../../library/shutil.rst:587 ../../library/shutil.rst:670 +#: ../../library/shutil.rst:588 ../../library/shutil.rst:677 msgid "*bztar*: bzip2'ed tar-file (if the :mod:`bz2` module is available)." msgstr "" -#: ../../library/shutil.rst:588 ../../library/shutil.rst:671 +#: ../../library/shutil.rst:589 ../../library/shutil.rst:678 msgid "*xztar*: xz'ed tar-file (if the :mod:`lzma` module is available)." msgstr "" -#: ../../library/shutil.rst:590 +#: ../../library/shutil.rst:591 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:596 +#: ../../library/shutil.rst:597 msgid "Register an archiver for the format *name*." msgstr "" -#: ../../library/shutil.rst:598 +#: ../../library/shutil.rst:599 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 " @@ -757,33 +758,33 @@ msgid "" "*dry_run* and *logger* (as passed in :func:`make_archive`)." msgstr "" -#: ../../library/shutil.rst:604 +#: ../../library/shutil.rst:605 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:607 +#: ../../library/shutil.rst:608 msgid "" "*description* is used by :func:`get_archive_formats` which returns the list " "of archivers. Defaults to an empty string." msgstr "" -#: ../../library/shutil.rst:613 +#: ../../library/shutil.rst:614 msgid "Remove the archive format *name* from the list of supported formats." msgstr "" -#: ../../library/shutil.rst:618 +#: ../../library/shutil.rst:619 msgid "Unpack an archive. *filename* is the full path of the archive." msgstr "" -#: ../../library/shutil.rst:620 +#: ../../library/shutil.rst:621 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:623 +#: ../../library/shutil.rst:624 msgid "" "*format* is the archive format: one of \"zip\", \"tar\", \"gztar\", \"bztar" "\", or \"xztar\". Or any other format registered with :func:" @@ -792,126 +793,134 @@ msgid "" "that extension. In case none is found, a :exc:`ValueError` is raised." msgstr "" -#: ../../library/shutil.rst:630 +#: ../../library/shutil.rst:631 msgid "" "Raises an :ref:`auditing event ` ``shutil.unpack_archive`` with " "arguments ``filename``, ``extract_dir``, ``format``." msgstr "" -#: ../../library/shutil.rst:632 +#: ../../library/shutil.rst:635 +msgid "" +"Never extract archives from untrusted sources without prior inspection. It " +"is possible that files are created outside of the path specified in the " +"*extract_dir* argument, e.g. members that have absolute filenames starting " +"with \"/\" or filenames with two dots \"..\"." +msgstr "" + +#: ../../library/shutil.rst:640 msgid "Accepts a :term:`path-like object` for *filename* and *extract_dir*." msgstr "" -#: ../../library/shutil.rst:638 +#: ../../library/shutil.rst:645 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:642 +#: ../../library/shutil.rst:649 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:646 +#: ../../library/shutil.rst:653 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:649 +#: ../../library/shutil.rst:656 msgid "" "*description* can be provided to describe the format, and will be returned " "by the :func:`get_unpack_formats` function." msgstr "" -#: ../../library/shutil.rst:655 +#: ../../library/shutil.rst:662 msgid "Unregister an unpack format. *name* is the name of the format." msgstr "" -#: ../../library/shutil.rst:660 +#: ../../library/shutil.rst:667 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:666 +#: ../../library/shutil.rst:673 msgid "" "*zip*: ZIP file (unpacking compressed files works only if the corresponding " "module is available)." msgstr "" -#: ../../library/shutil.rst:668 +#: ../../library/shutil.rst:675 msgid "*tar*: uncompressed tar file." msgstr "" -#: ../../library/shutil.rst:673 +#: ../../library/shutil.rst:680 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:680 +#: ../../library/shutil.rst:687 msgid "Archiving example" msgstr "" -#: ../../library/shutil.rst:682 +#: ../../library/shutil.rst:689 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:692 +#: ../../library/shutil.rst:699 msgid "The resulting archive contains:" msgstr "" -#: ../../library/shutil.rst:710 +#: ../../library/shutil.rst:717 msgid "Archiving example with *base_dir*" msgstr "" -#: ../../library/shutil.rst:712 +#: ../../library/shutil.rst:719 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:726 +#: ../../library/shutil.rst:733 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:740 +#: ../../library/shutil.rst:747 msgid "Listing the files in the resulting archive gives us:" msgstr "" -#: ../../library/shutil.rst:750 +#: ../../library/shutil.rst:757 msgid "Querying the size of the output terminal" msgstr "" -#: ../../library/shutil.rst:754 +#: ../../library/shutil.rst:761 msgid "Get the size of the terminal window." msgstr "" -#: ../../library/shutil.rst:756 +#: ../../library/shutil.rst:763 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:760 +#: ../../library/shutil.rst:767 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:764 +#: ../../library/shutil.rst:771 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 " @@ -920,11 +929,11 @@ msgid "" "emulators." msgstr "" -#: ../../library/shutil.rst:770 +#: ../../library/shutil.rst:777 msgid "The value returned is a named tuple of type :class:`os.terminal_size`." msgstr "" -#: ../../library/shutil.rst:772 +#: ../../library/shutil.rst:779 msgid "" "See also: The Single UNIX Specification, Version 2, `Other Environment " "Variables`_." diff --git a/library/smtpd.po b/library/smtpd.po index 7425e64cb0..64f477a397 100644 --- a/library/smtpd.po +++ b/library/smtpd.po @@ -7,8 +7,8 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.10\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2022-03-21 00:13+0000\n" -"PO-Revision-Date: 2022-03-23 15:56+0800\n" +"POT-Creation-Date: 2022-05-21 17:35+0000\n" +"PO-Revision-Date: 2022-05-22 02:12+0800\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" "tw)\n" @@ -33,39 +33,39 @@ msgstr "" #: ../../library/smtpd.rst:17 msgid "" -":mod:`smtpd` will be removed in Python 3.12 (:pep:`594`). The `aiosmtpd " -"`_ package is a recommended replacement " -"for this module. It is based on :mod:`asyncio` and provides a more " -"straightforward API." +":mod:`smtpd` will be removed in Python 3.12 (see :pep:`PEP 594 <594#smtpd>` " +"for details). The `aiosmtpd `_ package is " +"a recommended replacement for this module. It is based on :mod:`asyncio` " +"and provides a more straightforward API." msgstr "" -":mod:`smtpd` 將於 Python 3.12 中移除(\\ :pep:`594`\\ )。基於 :mod:" -"`asyncio` 且提供了更簡單易用 API 的 `aiosmtpd `_ 套件是個推薦的替代模組 (module)。" +":mod:`smtpd` 將於 Python 3.12 中移除(詳見 :pep:`PEP 594 <594#smtpd>`\\ )。" +"基於 :mod:`asyncio` 且提供了更簡單易用 API 的 `aiosmtpd `_ 套件是個推薦的替代模組 (module)。" -#: ../../library/smtpd.rst:23 +#: ../../library/smtpd.rst:24 msgid "" "Several server implementations are present; one is a generic do-nothing " "implementation, which can be overridden, while the other two offer specific " "mail-sending strategies." msgstr "" -#: ../../library/smtpd.rst:27 +#: ../../library/smtpd.rst:28 msgid "" "Additionally the SMTPChannel may be extended to implement very specific " "interaction behaviour with SMTP clients." msgstr "" -#: ../../library/smtpd.rst:30 +#: ../../library/smtpd.rst:31 msgid "" "The code supports :RFC:`5321`, plus the :rfc:`1870` SIZE and :rfc:`6531` " "SMTPUTF8 extensions." msgstr "" -#: ../../library/smtpd.rst:35 +#: ../../library/smtpd.rst:36 msgid "SMTPServer Objects" msgstr "SMTPServer 物件" -#: ../../library/smtpd.rst:41 +#: ../../library/smtpd.rst:42 msgid "" "Create a new :class:`SMTPServer` object, which binds to local address " "*localaddr*. It will treat *remoteaddr* as an upstream SMTP relayer. Both " @@ -74,20 +74,20 @@ msgid "" "insert itself into :mod:`asyncore`'s event loop on instantiation." msgstr "" -#: ../../library/smtpd.rst:47 ../../library/smtpd.rst:175 +#: ../../library/smtpd.rst:48 ../../library/smtpd.rst:176 msgid "" "*data_size_limit* specifies the maximum number of bytes that will be " "accepted in a ``DATA`` command. A value of ``None`` or ``0`` means no limit." msgstr "" -#: ../../library/smtpd.rst:51 +#: ../../library/smtpd.rst:52 msgid "" "*map* is the socket map to use for connections (an initially empty " "dictionary is a suitable value). If not specified the :mod:`asyncore` " "global socket map is used." msgstr "" -#: ../../library/smtpd.rst:55 +#: ../../library/smtpd.rst:56 msgid "" "*enable_SMTPUTF8* determines whether the ``SMTPUTF8`` extension (as defined " "in :RFC:`6531`) should be enabled. The default is ``False``. When ``True``, " @@ -97,7 +97,7 @@ msgid "" "be set to ``True`` at the same time." msgstr "" -#: ../../library/smtpd.rst:62 +#: ../../library/smtpd.rst:63 msgid "" "*decode_data* specifies whether the data portion of the SMTP transaction " "should be decoded using UTF-8. When *decode_data* is ``False`` (the " @@ -108,7 +108,7 @@ msgid "" "be set to ``True`` at the same time." msgstr "" -#: ../../library/smtpd.rst:72 +#: ../../library/smtpd.rst:73 msgid "" "Raise a :exc:`NotImplementedError` exception. Override this in subclasses to " "do something useful with this message. Whatever was passed in the " @@ -119,110 +119,110 @@ msgid "" "format)." msgstr "" -#: ../../library/smtpd.rst:80 +#: ../../library/smtpd.rst:81 msgid "" "If the *decode_data* constructor keyword is set to ``True``, the *data* " "argument will be a unicode string. If it is set to ``False``, it will be a " "bytes object." msgstr "" -#: ../../library/smtpd.rst:84 +#: ../../library/smtpd.rst:85 msgid "" "*kwargs* is a dictionary containing additional information. It is empty if " "``decode_data=True`` was given as an init argument, otherwise it contains " "the following keys:" msgstr "" -#: ../../library/smtpd.rst:91 +#: ../../library/smtpd.rst:92 msgid "*mail_options*:" msgstr "" -#: ../../library/smtpd.rst:89 +#: ../../library/smtpd.rst:90 msgid "" "a list of all received parameters to the ``MAIL`` command (the elements are " "uppercase strings; example: ``['BODY=8BITMIME', 'SMTPUTF8']``)." msgstr "" -#: ../../library/smtpd.rst:96 +#: ../../library/smtpd.rst:97 msgid "*rcpt_options*:" msgstr "" -#: ../../library/smtpd.rst:94 +#: ../../library/smtpd.rst:95 msgid "" "same as *mail_options* but for the ``RCPT`` command. Currently no ``RCPT " "TO`` options are supported, so for now this will always be an empty list." msgstr "" -#: ../../library/smtpd.rst:98 +#: ../../library/smtpd.rst:99 msgid "" "Implementations of ``process_message`` should use the ``**kwargs`` signature " "to accept arbitrary keyword arguments, since future feature enhancements may " "add keys to the kwargs dictionary." msgstr "" -#: ../../library/smtpd.rst:102 +#: ../../library/smtpd.rst:103 msgid "" "Return ``None`` to request a normal ``250 Ok`` response; otherwise return " "the desired response string in :RFC:`5321` format." msgstr "" -#: ../../library/smtpd.rst:107 +#: ../../library/smtpd.rst:108 msgid "" "Override this in subclasses to use a custom :class:`SMTPChannel` for " "managing SMTP clients." msgstr "" -#: ../../library/smtpd.rst:110 +#: ../../library/smtpd.rst:111 msgid "The *map* constructor argument." msgstr "" -#: ../../library/smtpd.rst:113 +#: ../../library/smtpd.rst:114 msgid "*localaddr* and *remoteaddr* may now contain IPv6 addresses." msgstr "" -#: ../../library/smtpd.rst:116 +#: ../../library/smtpd.rst:117 msgid "" "The *decode_data* and *enable_SMTPUTF8* constructor parameters, and the " "*kwargs* parameter to :meth:`process_message` when *decode_data* is " "``False``." msgstr "" -#: ../../library/smtpd.rst:121 ../../library/smtpd.rst:197 +#: ../../library/smtpd.rst:122 ../../library/smtpd.rst:198 msgid "*decode_data* is now ``False`` by default." msgstr "" -#: ../../library/smtpd.rst:126 +#: ../../library/smtpd.rst:127 msgid "DebuggingServer Objects" msgstr "DebuggingServer 物件" -#: ../../library/smtpd.rst:131 +#: ../../library/smtpd.rst:132 msgid "" "Create a new debugging server. Arguments are as per :class:`SMTPServer`. " "Messages will be discarded, and printed on stdout." msgstr "" -#: ../../library/smtpd.rst:136 +#: ../../library/smtpd.rst:137 msgid "PureProxy Objects" msgstr "PureProxy 物件" -#: ../../library/smtpd.rst:141 +#: ../../library/smtpd.rst:142 msgid "" "Create a new pure proxy server. Arguments are as per :class:`SMTPServer`. " "Everything will be relayed to *remoteaddr*. Note that running this has a " "good chance to make you into an open relay, so please be careful." msgstr "" -#: ../../library/smtpd.rst:147 +#: ../../library/smtpd.rst:148 msgid "MailmanProxy Objects" msgstr "MailmanProxy 物件" -#: ../../library/smtpd.rst:154 +#: ../../library/smtpd.rst:155 msgid "" ":class:`MailmanProxy` is deprecated, it depends on a ``Mailman`` module " "which no longer exists and therefore is already broken." msgstr "" -#: ../../library/smtpd.rst:158 +#: ../../library/smtpd.rst:159 msgid "" "Create a new pure proxy server. Arguments are as per :class:`SMTPServer`. " "Everything will be relayed to *remoteaddr*, unless local mailman " @@ -231,116 +231,116 @@ msgid "" "relay, so please be careful." msgstr "" -#: ../../library/smtpd.rst:165 +#: ../../library/smtpd.rst:166 msgid "SMTPChannel Objects" msgstr "SMTPChannel 物件" -#: ../../library/smtpd.rst:170 +#: ../../library/smtpd.rst:171 msgid "" "Create a new :class:`SMTPChannel` object which manages the communication " "between the server and a single SMTP client." msgstr "" -#: ../../library/smtpd.rst:173 +#: ../../library/smtpd.rst:174 msgid "*conn* and *addr* are as per the instance variables described below." msgstr "" -#: ../../library/smtpd.rst:179 +#: ../../library/smtpd.rst:180 msgid "" "*enable_SMTPUTF8* determines whether the ``SMTPUTF8`` extension (as defined " "in :RFC:`6531`) should be enabled. The default is ``False``. *decode_data* " "and *enable_SMTPUTF8* cannot be set to ``True`` at the same time." msgstr "" -#: ../../library/smtpd.rst:184 +#: ../../library/smtpd.rst:185 msgid "" "A dictionary can be specified in *map* to avoid using a global socket map." msgstr "" -#: ../../library/smtpd.rst:186 +#: ../../library/smtpd.rst:187 msgid "" "*decode_data* specifies whether the data portion of the SMTP transaction " "should be decoded using UTF-8. The default is ``False``. *decode_data* and " "*enable_SMTPUTF8* cannot be set to ``True`` at the same time." msgstr "" -#: ../../library/smtpd.rst:191 +#: ../../library/smtpd.rst:192 msgid "" "To use a custom SMTPChannel implementation you need to override the :attr:" "`SMTPServer.channel_class` of your :class:`SMTPServer`." msgstr "" -#: ../../library/smtpd.rst:194 +#: ../../library/smtpd.rst:195 msgid "The *decode_data* and *enable_SMTPUTF8* parameters were added." msgstr "新增 *decode_data* 與 *enable_SMTPUTF8* 參數。" -#: ../../library/smtpd.rst:200 +#: ../../library/smtpd.rst:201 msgid "The :class:`SMTPChannel` has the following instance variables:" msgstr "" -#: ../../library/smtpd.rst:204 +#: ../../library/smtpd.rst:205 msgid "Holds the :class:`SMTPServer` that spawned this channel." msgstr "" -#: ../../library/smtpd.rst:208 +#: ../../library/smtpd.rst:209 msgid "Holds the socket object connecting to the client." msgstr "" -#: ../../library/smtpd.rst:212 +#: ../../library/smtpd.rst:213 msgid "" "Holds the address of the client, the second value returned by :func:`socket." "accept `" msgstr "" -#: ../../library/smtpd.rst:217 +#: ../../library/smtpd.rst:218 msgid "" "Holds a list of the line strings (decoded using UTF-8) received from the " "client. The lines have their ``\"\\r\\n\"`` line ending translated to ``\"\\n" "\"``." msgstr "" -#: ../../library/smtpd.rst:223 +#: ../../library/smtpd.rst:224 msgid "" "Holds the current state of the channel. This will be either :attr:`COMMAND` " "initially and then :attr:`DATA` after the client sends a \"DATA\" line." msgstr "" -#: ../../library/smtpd.rst:229 +#: ../../library/smtpd.rst:230 msgid "" "Holds a string containing the greeting sent by the client in its \"HELO\"." msgstr "" -#: ../../library/smtpd.rst:233 +#: ../../library/smtpd.rst:234 msgid "" "Holds a string containing the address identified in the \"MAIL FROM:\" line " "from the client." msgstr "" -#: ../../library/smtpd.rst:238 +#: ../../library/smtpd.rst:239 msgid "" "Holds a list of strings containing the addresses identified in the \"RCPT TO:" "\" lines from the client." msgstr "" -#: ../../library/smtpd.rst:243 +#: ../../library/smtpd.rst:244 msgid "" "Holds a string containing all of the data sent by the client during the DATA " "state, up to but not including the terminating ``\"\\r\\n.\\r\\n\"``." msgstr "" -#: ../../library/smtpd.rst:248 +#: ../../library/smtpd.rst:249 msgid "" "Holds the fully-qualified domain name of the server as returned by :func:" "`socket.getfqdn`." msgstr "" -#: ../../library/smtpd.rst:253 +#: ../../library/smtpd.rst:254 msgid "" "Holds the name of the client peer as returned by ``conn.getpeername()`` " "where ``conn`` is :attr:`conn`." msgstr "" -#: ../../library/smtpd.rst:256 +#: ../../library/smtpd.rst:257 msgid "" "The :class:`SMTPChannel` operates by invoking methods named " "``smtp_`` upon reception of a command line from the client. Built " @@ -348,112 +348,112 @@ msgid "" "following commands (and responding to them appropriately):" msgstr "" -#: ../../library/smtpd.rst:262 +#: ../../library/smtpd.rst:263 msgid "Command" msgstr "指令" -#: ../../library/smtpd.rst:262 +#: ../../library/smtpd.rst:263 msgid "Action taken" msgstr "" -#: ../../library/smtpd.rst:264 +#: ../../library/smtpd.rst:265 msgid "HELO" msgstr "HELO" -#: ../../library/smtpd.rst:264 +#: ../../library/smtpd.rst:265 msgid "" "Accepts the greeting from the client and stores it in :attr:" "`seen_greeting`. Sets server to base command mode." msgstr "" -#: ../../library/smtpd.rst:266 +#: ../../library/smtpd.rst:267 msgid "EHLO" msgstr "EHLO" -#: ../../library/smtpd.rst:266 +#: ../../library/smtpd.rst:267 msgid "" "Accepts the greeting from the client and stores it in :attr:" "`seen_greeting`. Sets server to extended command mode." msgstr "" -#: ../../library/smtpd.rst:268 +#: ../../library/smtpd.rst:269 msgid "NOOP" msgstr "NOOP" -#: ../../library/smtpd.rst:268 +#: ../../library/smtpd.rst:269 msgid "Takes no action." msgstr "" -#: ../../library/smtpd.rst:269 +#: ../../library/smtpd.rst:270 msgid "QUIT" msgstr "QUIT" -#: ../../library/smtpd.rst:269 +#: ../../library/smtpd.rst:270 msgid "Closes the connection cleanly." msgstr "" -#: ../../library/smtpd.rst:270 +#: ../../library/smtpd.rst:271 msgid "MAIL" msgstr "MAIL" -#: ../../library/smtpd.rst:270 +#: ../../library/smtpd.rst:271 msgid "" "Accepts the \"MAIL FROM:\" syntax and stores the supplied address as :attr:" "`mailfrom`. In extended command mode, accepts the :rfc:`1870` SIZE " "attribute and responds appropriately based on the value of *data_size_limit*." msgstr "" -#: ../../library/smtpd.rst:274 +#: ../../library/smtpd.rst:275 msgid "RCPT" msgstr "RCPT" -#: ../../library/smtpd.rst:274 +#: ../../library/smtpd.rst:275 msgid "" "Accepts the \"RCPT TO:\" syntax and stores the supplied addresses in the :" "attr:`rcpttos` list." msgstr "" -#: ../../library/smtpd.rst:276 +#: ../../library/smtpd.rst:277 msgid "RSET" msgstr "RSET" -#: ../../library/smtpd.rst:276 +#: ../../library/smtpd.rst:277 msgid "" "Resets the :attr:`mailfrom`, :attr:`rcpttos`, and :attr:`received_data`, but " "not the greeting." msgstr "" -#: ../../library/smtpd.rst:278 +#: ../../library/smtpd.rst:279 msgid "DATA" msgstr "DATA" -#: ../../library/smtpd.rst:278 +#: ../../library/smtpd.rst:279 msgid "" "Sets the internal state to :attr:`DATA` and stores remaining lines from the " "client in :attr:`received_data` until the terminator ``\"\\r\\n.\\r\\n\"`` " "is received." msgstr "" -#: ../../library/smtpd.rst:281 +#: ../../library/smtpd.rst:282 msgid "HELP" msgstr "HELP" -#: ../../library/smtpd.rst:281 +#: ../../library/smtpd.rst:282 msgid "Returns minimal information on command syntax" msgstr "" -#: ../../library/smtpd.rst:282 +#: ../../library/smtpd.rst:283 msgid "VRFY" msgstr "VRFY" -#: ../../library/smtpd.rst:282 +#: ../../library/smtpd.rst:283 msgid "Returns code 252 (the server doesn't know if the address is valid)" msgstr "" -#: ../../library/smtpd.rst:283 +#: ../../library/smtpd.rst:284 msgid "EXPN" msgstr "EXPN" -#: ../../library/smtpd.rst:283 +#: ../../library/smtpd.rst:284 msgid "Reports that the command is not implemented." msgstr "" diff --git a/library/sndhdr.po b/library/sndhdr.po index 117a555fd3..d94cfa8d68 100644 --- a/library/sndhdr.po +++ b/library/sndhdr.po @@ -7,8 +7,8 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.10\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2022-03-23 00:14+0000\n" -"PO-Revision-Date: 2015-12-09 17:51+0000\n" +"POT-Creation-Date: 2022-05-21 17:35+0000\n" +"PO-Revision-Date: 2022-05-22 02:13+0800\n" "Last-Translator: Liang-Bo Wang \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" "tw)\n" @@ -17,6 +17,7 @@ msgstr "" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" "Plural-Forms: nplurals=1; plural=0;\n" +"X-Generator: Poedit 3.0.1\n" #: ../../library/sndhdr.rst:2 msgid ":mod:`sndhdr` --- Determine type of sound file" @@ -27,10 +28,14 @@ msgid "**Source code:** :source:`Lib/sndhdr.py`" msgstr "**原始碼:**\\ :source:`Lib/sndhdr.py`" #: ../../library/sndhdr.rst:17 -msgid "The :mod:`sndhdr` module is deprecated (see :pep:`594` for details)." -msgstr ":mod:`sndhdr` 模組 (module) 即將被棄用(詳見 :pep:`594`\\ )。" +msgid "" +"The :mod:`sndhdr` module is deprecated (see :pep:`PEP 594 <594#sndhdr>` for " +"details and alternatives)." +msgstr "" +":mod:`sndhdr` 模組 (module) 即將被棄用(詳情與替代方案請見 :pep:`PEP 594 " +"<594#sndhdr>`\\ )。" -#: ../../library/sndhdr.rst:22 +#: ../../library/sndhdr.rst:23 msgid "" "The :mod:`sndhdr` provides utility functions which attempt to determine the " "type of sound data which is in a file. When these functions are able to " @@ -48,18 +53,18 @@ msgid "" "``'A'`` for A-LAW or ``'U'`` for u-LAW." msgstr "" -#: ../../library/sndhdr.rst:39 +#: ../../library/sndhdr.rst:40 msgid "" "Determines the type of sound data stored in the file *filename* using :func:" "`whathdr`. If it succeeds, returns a namedtuple as described above, " "otherwise ``None`` is returned." msgstr "" -#: ../../library/sndhdr.rst:43 ../../library/sndhdr.rst:53 +#: ../../library/sndhdr.rst:44 ../../library/sndhdr.rst:54 msgid "Result changed from a tuple to a namedtuple." msgstr "" -#: ../../library/sndhdr.rst:49 +#: ../../library/sndhdr.rst:50 msgid "" "Determines the type of sound data stored in a file based on the file " "header. The name of the file is given by *filename*. This function returns " diff --git a/library/socket.po b/library/socket.po index 26607bcaa4..7e858868fb 100644 --- a/library/socket.po +++ b/library/socket.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.10\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2021-10-26 16:47+0000\n" +"POT-Creation-Date: 2022-05-21 17:35+0000\n" "PO-Revision-Date: 2018-05-23 16:10+0000\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -377,9 +377,8 @@ msgstr "" #: ../../library/socket.rst:235 msgid "" "All errors raise exceptions. The normal exceptions for invalid argument " -"types and out-of-memory conditions can be raised; starting from Python 3.3, " -"errors related to socket or address semantics raise :exc:`OSError` or one of " -"its subclasses (they used to raise :exc:`socket.error`)." +"types and out-of-memory conditions can be raised. Errors related to socket " +"or address semantics raise :exc:`OSError` or one of its subclasses." msgstr "" #: ../../library/socket.rst:240 diff --git a/library/spwd.po b/library/spwd.po index cc4497a97d..b79dfd8c99 100644 --- a/library/spwd.po +++ b/library/spwd.po @@ -7,8 +7,8 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.10\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2022-03-23 00:14+0000\n" -"PO-Revision-Date: 2018-05-23 16:10+0000\n" +"POT-Creation-Date: 2022-05-21 17:35+0000\n" +"PO-Revision-Date: 2022-05-22 02:14+0800\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" "tw)\n" @@ -17,192 +17,197 @@ msgstr "" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" "Plural-Forms: nplurals=1; plural=0;\n" +"X-Generator: Poedit 3.0.1\n" #: ../../library/spwd.rst:2 msgid ":mod:`spwd` --- The shadow password database" msgstr ":mod:`spwd` --- shadow 密碼資料庫" #: ../../library/spwd.rst:9 -msgid "The :mod:`spwd` module is deprecated (see :pep:`594` for details)." -msgstr ":mod:`spwd` 模組 (module) 即將被棄用(詳見 :pep:`594`\\ )。" +msgid "" +"The :mod:`spwd` module is deprecated (see :pep:`PEP 594 <594#spwd>` for " +"details and alternatives)." +msgstr "" +":mod:`spwd` 模組 (module) 即將被棄用(詳情與替代方案請見 :pep:`PEP 594 " +"<594#spwd>`\\ )。" -#: ../../library/spwd.rst:14 +#: ../../library/spwd.rst:15 msgid "" "This module provides access to the Unix shadow password database. It is " "available on various Unix versions." msgstr "" -#: ../../library/spwd.rst:17 +#: ../../library/spwd.rst:18 msgid "" "You must have enough privileges to access the shadow password database (this " "usually means you have to be root)." msgstr "" -#: ../../library/spwd.rst:20 +#: ../../library/spwd.rst:21 msgid "" "Shadow password database entries are reported as a tuple-like object, whose " "attributes correspond to the members of the ``spwd`` structure (Attribute " "field below, see ````):" msgstr "" -#: ../../library/spwd.rst:25 +#: ../../library/spwd.rst:26 msgid "Index" msgstr "" -#: ../../library/spwd.rst:25 +#: ../../library/spwd.rst:26 msgid "Attribute" msgstr "屬性" -#: ../../library/spwd.rst:25 +#: ../../library/spwd.rst:26 msgid "Meaning" msgstr "" -#: ../../library/spwd.rst:27 +#: ../../library/spwd.rst:28 msgid "0" msgstr "0" -#: ../../library/spwd.rst:27 +#: ../../library/spwd.rst:28 msgid "``sp_namp``" msgstr "``sp_namp``" -#: ../../library/spwd.rst:27 +#: ../../library/spwd.rst:28 msgid "Login name" msgstr "" -#: ../../library/spwd.rst:29 +#: ../../library/spwd.rst:30 msgid "1" msgstr "1" -#: ../../library/spwd.rst:29 +#: ../../library/spwd.rst:30 msgid "``sp_pwdp``" msgstr "``sp_pwdp``" -#: ../../library/spwd.rst:29 +#: ../../library/spwd.rst:30 msgid "Encrypted password" msgstr "" -#: ../../library/spwd.rst:31 +#: ../../library/spwd.rst:32 msgid "2" msgstr "2" -#: ../../library/spwd.rst:31 +#: ../../library/spwd.rst:32 msgid "``sp_lstchg``" msgstr "``sp_lstchg``" -#: ../../library/spwd.rst:31 +#: ../../library/spwd.rst:32 msgid "Date of last change" msgstr "" -#: ../../library/spwd.rst:33 +#: ../../library/spwd.rst:34 msgid "3" msgstr "3" -#: ../../library/spwd.rst:33 +#: ../../library/spwd.rst:34 msgid "``sp_min``" msgstr "``sp_min``" -#: ../../library/spwd.rst:33 +#: ../../library/spwd.rst:34 msgid "Minimal number of days between changes" msgstr "" -#: ../../library/spwd.rst:36 +#: ../../library/spwd.rst:37 msgid "4" msgstr "4" -#: ../../library/spwd.rst:36 +#: ../../library/spwd.rst:37 msgid "``sp_max``" msgstr "``sp_max``" -#: ../../library/spwd.rst:36 +#: ../../library/spwd.rst:37 msgid "Maximum number of days between changes" msgstr "" -#: ../../library/spwd.rst:39 +#: ../../library/spwd.rst:40 msgid "5" msgstr "5" -#: ../../library/spwd.rst:39 +#: ../../library/spwd.rst:40 msgid "``sp_warn``" msgstr "``sp_warn``" -#: ../../library/spwd.rst:39 +#: ../../library/spwd.rst:40 msgid "Number of days before password expires to warn user about it" msgstr "" -#: ../../library/spwd.rst:42 +#: ../../library/spwd.rst:43 msgid "6" msgstr "6" -#: ../../library/spwd.rst:42 +#: ../../library/spwd.rst:43 msgid "``sp_inact``" msgstr "``sp_inact``" -#: ../../library/spwd.rst:42 +#: ../../library/spwd.rst:43 msgid "Number of days after password expires until account is disabled" msgstr "" -#: ../../library/spwd.rst:46 +#: ../../library/spwd.rst:47 msgid "7" msgstr "7" -#: ../../library/spwd.rst:46 +#: ../../library/spwd.rst:47 msgid "``sp_expire``" msgstr "``sp_expire``" -#: ../../library/spwd.rst:46 +#: ../../library/spwd.rst:47 msgid "Number of days since 1970-01-01 when account expires" msgstr "" -#: ../../library/spwd.rst:49 +#: ../../library/spwd.rst:50 msgid "8" msgstr "8" -#: ../../library/spwd.rst:49 +#: ../../library/spwd.rst:50 msgid "``sp_flag``" msgstr "``sp_flag``" -#: ../../library/spwd.rst:49 +#: ../../library/spwd.rst:50 msgid "Reserved" msgstr "" -#: ../../library/spwd.rst:52 +#: ../../library/spwd.rst:53 msgid "" "The sp_namp and sp_pwdp items are strings, all others are integers. :exc:" "`KeyError` is raised if the entry asked for cannot be found." msgstr "" -#: ../../library/spwd.rst:55 +#: ../../library/spwd.rst:56 msgid "The following functions are defined:" msgstr "" -#: ../../library/spwd.rst:60 +#: ../../library/spwd.rst:61 msgid "Return the shadow password database entry for the given user name." msgstr "" -#: ../../library/spwd.rst:62 +#: ../../library/spwd.rst:63 msgid "" "Raises a :exc:`PermissionError` instead of :exc:`KeyError` if the user " "doesn't have privileges." msgstr "" -#: ../../library/spwd.rst:68 +#: ../../library/spwd.rst:69 msgid "" "Return a list of all available shadow password database entries, in " "arbitrary order." msgstr "" -#: ../../library/spwd.rst:75 +#: ../../library/spwd.rst:76 msgid "Module :mod:`grp`" msgstr ":mod:`grp` 模組" -#: ../../library/spwd.rst:75 +#: ../../library/spwd.rst:76 msgid "An interface to the group database, similar to this." msgstr "" -#: ../../library/spwd.rst:77 +#: ../../library/spwd.rst:78 msgid "Module :mod:`pwd`" msgstr ":mod:`pwd` 模組" -#: ../../library/spwd.rst:78 +#: ../../library/spwd.rst:79 msgid "An interface to the normal password database, similar to this." msgstr "" diff --git a/library/sqlite3.po b/library/sqlite3.po index 49c297f051..f692802ef0 100644 --- a/library/sqlite3.po +++ b/library/sqlite3.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.10\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2022-04-18 00:15+0000\n" +"POT-Creation-Date: 2022-05-21 17:35+0000\n" "PO-Revision-Date: 2018-05-23 16:10+0000\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -468,7 +468,7 @@ msgid "The *deterministic* parameter was added." msgstr "新增 *deterministic* 參數。" #: ../../library/sqlite3.rst:415 ../../library/sqlite3.rst:432 -#: ../../library/sqlite3.rst:564 ../../library/sqlite3.rst:715 +#: ../../library/sqlite3.rst:561 ../../library/sqlite3.rst:712 msgid "Example:" msgstr "範例:" @@ -492,37 +492,39 @@ msgstr "" #: ../../library/sqlite3.rst:439 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 " -"ordered lower than the second, 0 if they are ordered equal and 1 if the " -"first is ordered higher than the second. Note that this controls sorting " -"(ORDER BY in SQL) so your comparisons don't affect other SQL operations." +"Create a collation named *name* using the collating function *callable*. " +"*callable* is passed two :class:`string ` arguments, and it should " +"return an :class:`integer `:" +msgstr "" + +#: ../../library/sqlite3.rst:443 +msgid "``1`` if the first is ordered higher than the second" +msgstr "" + +#: ../../library/sqlite3.rst:444 +msgid "``-1`` if the first is ordered lower than the second" msgstr "" #: ../../library/sqlite3.rst:445 -msgid "" -"Note that the callable will get its parameters as Python bytestrings, which " -"will normally be encoded in UTF-8." +msgid "``0`` if they are ordered equal" msgstr "" -#: ../../library/sqlite3.rst:448 -msgid "" -"The following example shows a custom collation that sorts \"the wrong way\":" +#: ../../library/sqlite3.rst:447 +msgid "The following example shows a reverse sorting collation:" msgstr "" -#: ../../library/sqlite3.rst:452 -msgid "" -"To remove a collation, call ``create_collation`` with ``None`` as callable::" +#: ../../library/sqlite3.rst:451 +msgid "Remove a collation function by setting *callable* to :const:`None`." msgstr "" -#: ../../library/sqlite3.rst:459 +#: ../../library/sqlite3.rst:456 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:466 +#: ../../library/sqlite3.rst:463 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 :" @@ -532,7 +534,7 @@ msgid "" "in the :mod:`sqlite3` module." msgstr "" -#: ../../library/sqlite3.rst:473 +#: ../../library/sqlite3.rst:470 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` " @@ -543,7 +545,7 @@ msgid "" "code." msgstr "" -#: ../../library/sqlite3.rst:480 +#: ../../library/sqlite3.rst:477 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 " @@ -551,7 +553,7 @@ msgid "" "module." msgstr "" -#: ../../library/sqlite3.rst:487 +#: ../../library/sqlite3.rst:484 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 " @@ -559,26 +561,26 @@ msgid "" "a GUI." msgstr "" -#: ../../library/sqlite3.rst:492 +#: ../../library/sqlite3.rst:489 msgid "" "If you want to clear any previously installed progress handler, call the " "method with :const:`None` for *handler*." msgstr "" -#: ../../library/sqlite3.rst:495 +#: ../../library/sqlite3.rst:492 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:502 +#: ../../library/sqlite3.rst:499 msgid "" "Registers *trace_callback* to be called for each SQL statement that is " "actually executed by the SQLite backend." msgstr "" -#: ../../library/sqlite3.rst:505 +#: ../../library/sqlite3.rst:502 msgid "" "The only argument passed to the callback is the statement (as :class:`str`) " "that is being executed. The return value of the callback is ignored. Note " @@ -588,19 +590,19 @@ msgid "" "of triggers defined in the current database." msgstr "" -#: ../../library/sqlite3.rst:513 +#: ../../library/sqlite3.rst:510 msgid "" "Passing :const:`None` as *trace_callback* will disable the trace callback." msgstr "" -#: ../../library/sqlite3.rst:516 +#: ../../library/sqlite3.rst:513 msgid "" "Exceptions raised in the trace callback are not propagated. As a development " "and debugging aid, use :meth:`~sqlite3.enable_callback_tracebacks` to enable " "printing tracebacks from exceptions raised in the trace callback." msgstr "" -#: ../../library/sqlite3.rst:526 +#: ../../library/sqlite3.rst:523 msgid "" "This routine allows/disallows the SQLite engine to load SQLite extensions " "from shared libraries. SQLite extensions can define new functions, " @@ -608,38 +610,38 @@ msgid "" "extension is the fulltext-search extension distributed with SQLite." msgstr "" -#: ../../library/sqlite3.rst:531 ../../library/sqlite3.rst:548 +#: ../../library/sqlite3.rst:528 ../../library/sqlite3.rst:545 msgid "Loadable extensions are disabled by default. See [#f1]_." msgstr "" -#: ../../library/sqlite3.rst:533 +#: ../../library/sqlite3.rst:530 msgid "" "Raises an :ref:`auditing event ` ``sqlite3.enable_load_extension`` " "with arguments ``connection``, ``enabled``." msgstr "" -#: ../../library/sqlite3.rst:537 +#: ../../library/sqlite3.rst:534 msgid "Added the ``sqlite3.enable_load_extension`` auditing event." msgstr "" -#: ../../library/sqlite3.rst:544 +#: ../../library/sqlite3.rst:541 msgid "" "This routine loads an 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:550 +#: ../../library/sqlite3.rst:547 msgid "" "Raises an :ref:`auditing event ` ``sqlite3.load_extension`` with " "arguments ``connection``, ``path``." msgstr "" -#: ../../library/sqlite3.rst:554 +#: ../../library/sqlite3.rst:551 msgid "Added the ``sqlite3.load_extension`` auditing event." msgstr "" -#: ../../library/sqlite3.rst:559 +#: ../../library/sqlite3.rst:556 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 " @@ -647,7 +649,7 @@ msgid "" "object that can also access columns by name." msgstr "" -#: ../../library/sqlite3.rst:568 +#: ../../library/sqlite3.rst:565 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-" @@ -657,7 +659,7 @@ msgid "" "approach or even a db_row based solution." msgstr "" -#: ../../library/sqlite3.rst:580 +#: ../../library/sqlite3.rst:577 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 " @@ -665,23 +667,23 @@ msgid "" "you want to return :class:`bytes` instead, you can set it to :class:`bytes`." msgstr "" -#: ../../library/sqlite3.rst:585 +#: ../../library/sqlite3.rst:582 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:588 +#: ../../library/sqlite3.rst:585 msgid "See the following example code for illustration:" msgstr "" -#: ../../library/sqlite3.rst:595 +#: ../../library/sqlite3.rst:592 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:601 +#: ../../library/sqlite3.rst:598 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 " @@ -689,14 +691,14 @@ msgid "" "shell." msgstr "" -#: ../../library/sqlite3.rst:606 +#: ../../library/sqlite3.rst:603 msgid "Example::" msgstr "" "範例:\n" "\n" "::" -#: ../../library/sqlite3.rst:620 +#: ../../library/sqlite3.rst:617 msgid "" "This method makes a backup of an SQLite database even while it's being " "accessed by other clients, or concurrently by the same connection. The copy " @@ -704,14 +706,14 @@ msgid "" "class:`Connection` instance." msgstr "" -#: ../../library/sqlite3.rst:625 +#: ../../library/sqlite3.rst:622 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:629 +#: ../../library/sqlite3.rst:626 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, " @@ -719,7 +721,7 @@ msgid "" "pages still to be copied and the *total* number of pages." msgstr "" -#: ../../library/sqlite3.rst:634 +#: ../../library/sqlite3.rst:631 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 " @@ -728,36 +730,36 @@ msgid "" "an attached database." msgstr "" -#: ../../library/sqlite3.rst:640 +#: ../../library/sqlite3.rst:637 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:644 +#: ../../library/sqlite3.rst:641 msgid "Example 1, copy an existing database into another::" msgstr "" -#: ../../library/sqlite3.rst:658 +#: ../../library/sqlite3.rst:655 msgid "Example 2, copy an existing database into a transient copy::" msgstr "" -#: ../../library/sqlite3.rst:672 +#: ../../library/sqlite3.rst:669 msgid "Cursor Objects" msgstr "" -#: ../../library/sqlite3.rst:676 +#: ../../library/sqlite3.rst:673 msgid "A :class:`Cursor` instance has the following attributes and methods." msgstr "" -#: ../../library/sqlite3.rst:683 +#: ../../library/sqlite3.rst:680 msgid "" "Executes an SQL statement. Values may be bound to the statement using :ref:" "`placeholders `." msgstr "" -#: ../../library/sqlite3.rst:686 +#: ../../library/sqlite3.rst:683 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`. " @@ -765,7 +767,7 @@ msgid "" "with one call." msgstr "" -#: ../../library/sqlite3.rst:694 +#: ../../library/sqlite3.rst:691 msgid "" "Executes a :ref:`parameterized ` SQL command against " "all parameter sequences or mappings found in the sequence " @@ -773,11 +775,11 @@ msgid "" "`iterator` yielding parameters instead of a sequence." msgstr "" -#: ../../library/sqlite3.rst:701 +#: ../../library/sqlite3.rst:698 msgid "Here's a shorter example using a :term:`generator`:" msgstr "" -#: ../../library/sqlite3.rst:708 +#: ../../library/sqlite3.rst:705 msgid "" "This is a nonstandard convenience method for executing multiple SQL " "statements at once. It issues a ``COMMIT`` statement first, then executes " @@ -785,23 +787,23 @@ msgid "" "`isolation_level`; any transaction control must be added to *sql_script*." msgstr "" -#: ../../library/sqlite3.rst:713 +#: ../../library/sqlite3.rst:710 msgid "*sql_script* can be an instance of :class:`str`." msgstr "" -#: ../../library/sqlite3.rst:722 +#: ../../library/sqlite3.rst:719 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:728 +#: ../../library/sqlite3.rst:725 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:731 +#: ../../library/sqlite3.rst:728 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 " @@ -810,7 +812,7 @@ msgid "" "not being available, fewer rows may be returned." msgstr "" -#: ../../library/sqlite3.rst:737 +#: ../../library/sqlite3.rst:734 msgid "" "Note there are performance considerations involved with the *size* " "parameter. For optimal performance, it is usually best to use the arraysize " @@ -818,42 +820,42 @@ msgid "" "the same value from one :meth:`fetchmany` call to the next." msgstr "" -#: ../../library/sqlite3.rst:744 +#: ../../library/sqlite3.rst:741 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:750 +#: ../../library/sqlite3.rst:747 msgid "Close the cursor now (rather than whenever ``__del__`` is called)." msgstr "" -#: ../../library/sqlite3.rst:752 +#: ../../library/sqlite3.rst:749 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:757 ../../library/sqlite3.rst:761 +#: ../../library/sqlite3.rst:754 ../../library/sqlite3.rst:758 msgid "Required by the DB-API. Does nothing in :mod:`sqlite3`." msgstr "" -#: ../../library/sqlite3.rst:765 +#: ../../library/sqlite3.rst:762 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:769 +#: ../../library/sqlite3.rst:766 msgid "" "For :meth:`executemany` statements, the number of modifications are summed " "up into :attr:`rowcount`." msgstr "" -#: ../../library/sqlite3.rst:772 +#: ../../library/sqlite3.rst:769 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 " @@ -862,7 +864,7 @@ msgid "" "rows a query produced until all rows were fetched." msgstr "" -#: ../../library/sqlite3.rst:780 +#: ../../library/sqlite3.rst:777 msgid "" "This read-only attribute provides the row id of the last inserted row. It is " "only updated after successful ``INSERT`` or ``REPLACE`` statements using " @@ -872,33 +874,33 @@ msgid "" "const:`None`." msgstr "" -#: ../../library/sqlite3.rst:788 +#: ../../library/sqlite3.rst:785 msgid "Inserts into ``WITHOUT ROWID`` tables are not recorded." msgstr "" -#: ../../library/sqlite3.rst:790 +#: ../../library/sqlite3.rst:787 msgid "Added support for the ``REPLACE`` statement." msgstr "新增 ``REPLACE`` 陳述式的支援。" -#: ../../library/sqlite3.rst:795 +#: ../../library/sqlite3.rst:792 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:800 +#: ../../library/sqlite3.rst:797 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:804 +#: ../../library/sqlite3.rst:801 msgid "It is set for ``SELECT`` statements without any matching rows as well." msgstr "" -#: ../../library/sqlite3.rst:808 +#: ../../library/sqlite3.rst:805 msgid "" "This read-only attribute provides the SQLite database :class:`Connection` " "used by the :class:`Cursor` object. A :class:`Cursor` object created by " @@ -906,79 +908,79 @@ msgid "" "`connection` attribute that refers to *con*::" msgstr "" -#: ../../library/sqlite3.rst:821 +#: ../../library/sqlite3.rst:818 msgid "Row Objects" msgstr "" -#: ../../library/sqlite3.rst:825 +#: ../../library/sqlite3.rst:822 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:829 +#: ../../library/sqlite3.rst:826 msgid "" "It supports mapping access by column name and index, iteration, " "representation, equality testing and :func:`len`." msgstr "" -#: ../../library/sqlite3.rst:832 +#: ../../library/sqlite3.rst:829 msgid "" "If two :class:`Row` objects have exactly the same columns and their members " "are equal, they compare equal." msgstr "" -#: ../../library/sqlite3.rst:837 +#: ../../library/sqlite3.rst:834 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:840 +#: ../../library/sqlite3.rst:837 msgid "Added support of slicing." msgstr "" -#: ../../library/sqlite3.rst:843 +#: ../../library/sqlite3.rst:840 msgid "Let's assume we initialize a table as in the example given above::" msgstr "" -#: ../../library/sqlite3.rst:855 +#: ../../library/sqlite3.rst:852 msgid "Now we plug :class:`Row` in::" msgstr "" -#: ../../library/sqlite3.rst:887 +#: ../../library/sqlite3.rst:884 msgid "Exceptions" msgstr "例外" -#: ../../library/sqlite3.rst:891 +#: ../../library/sqlite3.rst:888 msgid "A subclass of :exc:`Exception`." msgstr "" -#: ../../library/sqlite3.rst:895 +#: ../../library/sqlite3.rst:892 msgid "" "The base class of the other exceptions in this module. It is a subclass of :" "exc:`Exception`." msgstr "" -#: ../../library/sqlite3.rst:900 +#: ../../library/sqlite3.rst:897 msgid "Exception raised for errors that are related to the database." msgstr "" -#: ../../library/sqlite3.rst:904 +#: ../../library/sqlite3.rst:901 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:909 +#: ../../library/sqlite3.rst:906 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:915 +#: ../../library/sqlite3.rst:912 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 " @@ -986,7 +988,7 @@ msgid "" "not be processed, etc. It is a subclass of :exc:`DatabaseError`." msgstr "" -#: ../../library/sqlite3.rst:922 +#: ../../library/sqlite3.rst:919 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` " @@ -994,82 +996,82 @@ msgid "" "turned off. It is a subclass of :exc:`DatabaseError`." msgstr "" -#: ../../library/sqlite3.rst:931 +#: ../../library/sqlite3.rst:928 msgid "SQLite and Python types" msgstr "" -#: ../../library/sqlite3.rst:935 +#: ../../library/sqlite3.rst:932 msgid "Introduction" msgstr "簡介" -#: ../../library/sqlite3.rst:937 +#: ../../library/sqlite3.rst:934 msgid "" "SQLite natively supports the following types: ``NULL``, ``INTEGER``, " "``REAL``, ``TEXT``, ``BLOB``." msgstr "" -#: ../../library/sqlite3.rst:940 +#: ../../library/sqlite3.rst:937 msgid "" "The following Python types can thus be sent to SQLite without any problem:" msgstr "" -#: ../../library/sqlite3.rst:943 ../../library/sqlite3.rst:960 +#: ../../library/sqlite3.rst:940 ../../library/sqlite3.rst:957 msgid "Python type" msgstr "" -#: ../../library/sqlite3.rst:943 ../../library/sqlite3.rst:960 +#: ../../library/sqlite3.rst:940 ../../library/sqlite3.rst:957 msgid "SQLite type" msgstr "" -#: ../../library/sqlite3.rst:945 ../../library/sqlite3.rst:962 +#: ../../library/sqlite3.rst:942 ../../library/sqlite3.rst:959 msgid ":const:`None`" msgstr ":const:`None`" -#: ../../library/sqlite3.rst:945 ../../library/sqlite3.rst:962 +#: ../../library/sqlite3.rst:942 ../../library/sqlite3.rst:959 msgid "``NULL``" msgstr "``NULL``" -#: ../../library/sqlite3.rst:947 ../../library/sqlite3.rst:964 +#: ../../library/sqlite3.rst:944 ../../library/sqlite3.rst:961 msgid ":class:`int`" msgstr ":class:`int`" -#: ../../library/sqlite3.rst:947 ../../library/sqlite3.rst:964 +#: ../../library/sqlite3.rst:944 ../../library/sqlite3.rst:961 msgid "``INTEGER``" msgstr "``INTEGER``" -#: ../../library/sqlite3.rst:949 ../../library/sqlite3.rst:966 +#: ../../library/sqlite3.rst:946 ../../library/sqlite3.rst:963 msgid ":class:`float`" msgstr ":class:`float`" -#: ../../library/sqlite3.rst:949 ../../library/sqlite3.rst:966 +#: ../../library/sqlite3.rst:946 ../../library/sqlite3.rst:963 msgid "``REAL``" msgstr "``REAL``" -#: ../../library/sqlite3.rst:951 +#: ../../library/sqlite3.rst:948 msgid ":class:`str`" msgstr ":class:`str`" -#: ../../library/sqlite3.rst:951 ../../library/sqlite3.rst:968 +#: ../../library/sqlite3.rst:948 ../../library/sqlite3.rst:965 msgid "``TEXT``" msgstr "``TEXT``" -#: ../../library/sqlite3.rst:953 ../../library/sqlite3.rst:971 +#: ../../library/sqlite3.rst:950 ../../library/sqlite3.rst:968 msgid ":class:`bytes`" msgstr ":class:`bytes`" -#: ../../library/sqlite3.rst:953 ../../library/sqlite3.rst:971 +#: ../../library/sqlite3.rst:950 ../../library/sqlite3.rst:968 msgid "``BLOB``" msgstr "``BLOB``" -#: ../../library/sqlite3.rst:957 +#: ../../library/sqlite3.rst:954 msgid "This is how SQLite types are converted to Python types by default:" msgstr "" -#: ../../library/sqlite3.rst:968 +#: ../../library/sqlite3.rst:965 msgid "depends on :attr:`~Connection.text_factory`, :class:`str` by default" msgstr "" -#: ../../library/sqlite3.rst:974 +#: ../../library/sqlite3.rst:971 msgid "" "The type system of the :mod:`sqlite3` module is extensible in two ways: you " "can store additional Python types in an SQLite database via object " @@ -1077,11 +1079,11 @@ msgid "" "to different Python types via converters." msgstr "" -#: ../../library/sqlite3.rst:981 +#: ../../library/sqlite3.rst:978 msgid "Using adapters to store additional Python types in SQLite databases" msgstr "" -#: ../../library/sqlite3.rst:983 +#: ../../library/sqlite3.rst:980 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 " @@ -1089,23 +1091,23 @@ msgid "" "str, bytes." msgstr "" -#: ../../library/sqlite3.rst:988 +#: ../../library/sqlite3.rst:985 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:993 +#: ../../library/sqlite3.rst:990 msgid "Letting your object adapt itself" msgstr "" -#: ../../library/sqlite3.rst:995 +#: ../../library/sqlite3.rst:992 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:1002 +#: ../../library/sqlite3.rst:999 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 " @@ -1115,18 +1117,18 @@ msgid "" "class:`PrepareProtocol`." msgstr "" -#: ../../library/sqlite3.rst:1012 +#: ../../library/sqlite3.rst:1009 msgid "Registering an adapter callable" msgstr "" -#: ../../library/sqlite3.rst:1014 +#: ../../library/sqlite3.rst:1011 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:1019 +#: ../../library/sqlite3.rst:1016 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 " @@ -1134,100 +1136,100 @@ msgid "" "representation, but as a Unix timestamp." msgstr "" -#: ../../library/sqlite3.rst:1028 +#: ../../library/sqlite3.rst:1025 msgid "Converting SQLite values to custom Python types" msgstr "" -#: ../../library/sqlite3.rst:1030 +#: ../../library/sqlite3.rst:1027 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:1033 +#: ../../library/sqlite3.rst:1030 msgid "Enter converters." msgstr "" -#: ../../library/sqlite3.rst:1035 +#: ../../library/sqlite3.rst:1032 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:1038 +#: ../../library/sqlite3.rst:1035 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:1043 +#: ../../library/sqlite3.rst:1040 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:1052 +#: ../../library/sqlite3.rst:1049 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:1055 +#: ../../library/sqlite3.rst:1052 msgid "Implicitly via the declared type" msgstr "" -#: ../../library/sqlite3.rst:1057 +#: ../../library/sqlite3.rst:1054 msgid "Explicitly via the column name" msgstr "" -#: ../../library/sqlite3.rst:1059 +#: ../../library/sqlite3.rst:1056 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:1062 +#: ../../library/sqlite3.rst:1059 msgid "The following example illustrates both approaches." msgstr "" -#: ../../library/sqlite3.rst:1068 +#: ../../library/sqlite3.rst:1065 msgid "Default adapters and converters" msgstr "" -#: ../../library/sqlite3.rst:1070 +#: ../../library/sqlite3.rst:1067 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:1073 +#: ../../library/sqlite3.rst:1070 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:1077 +#: ../../library/sqlite3.rst:1074 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:1081 +#: ../../library/sqlite3.rst:1078 msgid "The following example demonstrates this." msgstr "" -#: ../../library/sqlite3.rst:1085 +#: ../../library/sqlite3.rst:1082 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:1091 +#: ../../library/sqlite3.rst:1088 msgid "" "The default \"timestamp\" converter ignores UTC offsets in the database and " "always returns a naive :class:`datetime.datetime` object. To preserve UTC " @@ -1235,17 +1237,17 @@ msgid "" "offset-aware converter with :func:`register_converter`." msgstr "" -#: ../../library/sqlite3.rst:1099 +#: ../../library/sqlite3.rst:1096 msgid "Controlling Transactions" msgstr "" -#: ../../library/sqlite3.rst:1101 +#: ../../library/sqlite3.rst:1098 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:1104 +#: ../../library/sqlite3.rst:1101 msgid "" "``autocommit`` mode means that statements that modify the database take " "effect immediately. A ``BEGIN`` or ``SAVEPOINT`` statement disables " @@ -1253,14 +1255,14 @@ msgid "" "ends the outermost transaction, turns ``autocommit`` mode back on." msgstr "" -#: ../../library/sqlite3.rst:1109 +#: ../../library/sqlite3.rst:1106 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:1113 +#: ../../library/sqlite3.rst:1110 msgid "" "You can control which kind of ``BEGIN`` statements :mod:`sqlite3` implicitly " "executes via the *isolation_level* parameter to the :func:`connect` call, or " @@ -1270,7 +1272,7 @@ msgid "" "``EXCLUSIVE``." msgstr "" -#: ../../library/sqlite3.rst:1120 +#: ../../library/sqlite3.rst:1117 msgid "" "You can disable the :mod:`sqlite3` module's implicit transaction management " "by setting :attr:`isolation_level` to ``None``. This will leave the " @@ -1280,27 +1282,27 @@ msgid "" "code." msgstr "" -#: ../../library/sqlite3.rst:1126 +#: ../../library/sqlite3.rst:1123 msgid "" "Note that :meth:`~Cursor.executescript` disregards :attr:`isolation_level`; " "any transaction control must be added explicitly." msgstr "" -#: ../../library/sqlite3.rst:1129 +#: ../../library/sqlite3.rst:1126 msgid "" ":mod:`sqlite3` used to implicitly commit an open transaction before DDL " "statements. This is no longer the case." msgstr "" -#: ../../library/sqlite3.rst:1135 +#: ../../library/sqlite3.rst:1132 msgid "Using :mod:`sqlite3` efficiently" msgstr "" -#: ../../library/sqlite3.rst:1139 +#: ../../library/sqlite3.rst:1136 msgid "Using shortcut methods" msgstr "" -#: ../../library/sqlite3.rst:1141 +#: ../../library/sqlite3.rst:1138 msgid "" "Using the nonstandard :meth:`execute`, :meth:`executemany` and :meth:" "`executescript` methods of the :class:`Connection` object, your code can be " @@ -1312,38 +1314,38 @@ msgid "" "object." msgstr "" -#: ../../library/sqlite3.rst:1153 +#: ../../library/sqlite3.rst:1150 msgid "Accessing columns by name instead of by index" msgstr "" -#: ../../library/sqlite3.rst:1155 +#: ../../library/sqlite3.rst:1152 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:1158 +#: ../../library/sqlite3.rst:1155 msgid "" "Rows wrapped with this class can be accessed both by index (like tuples) and " "case-insensitively by name:" msgstr "" -#: ../../library/sqlite3.rst:1165 +#: ../../library/sqlite3.rst:1162 msgid "Using the connection as a context manager" msgstr "" -#: ../../library/sqlite3.rst:1167 +#: ../../library/sqlite3.rst:1164 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:1176 +#: ../../library/sqlite3.rst:1173 msgid "Footnotes" msgstr "註解" -#: ../../library/sqlite3.rst:1177 +#: ../../library/sqlite3.rst:1174 msgid "" "The sqlite3 module is not built with loadable extension support by default, " "because some platforms (notably macOS) have SQLite libraries which are " diff --git a/library/ssl.po b/library/ssl.po index 42fd28c7ec..a40bd66db1 100644 --- a/library/ssl.po +++ b/library/ssl.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.10\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2022-04-08 00:15+0000\n" +"POT-Creation-Date: 2022-05-21 17:35+0000\n" "PO-Revision-Date: 2018-05-23 16:10+0000\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -771,8 +771,8 @@ msgstr "" #: ../../library/ssl.rst:716 msgid "" -"This protocol is not available if OpenSSL is compiled with the " -"``OPENSSL_NO_SSL2`` flag." +"This protocol is not available if OpenSSL is compiled with the ``no-ssl2`` " +"option." msgstr "" #: ../../library/ssl.rst:721 @@ -789,8 +789,8 @@ msgstr "" #: ../../library/ssl.rst:731 msgid "" -"This protocol is not be available if OpenSSL is compiled with the " -"``OPENSSL_NO_SSLv3`` flag." +"This protocol is not available if OpenSSL is compiled with the ``no-ssl3`` " +"option." msgstr "" #: ../../library/ssl.rst:736 diff --git a/library/stdtypes.po b/library/stdtypes.po index cc8b1f145c..a382c176f2 100644 --- a/library/stdtypes.po +++ b/library/stdtypes.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.10\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2022-04-19 00:13+0000\n" +"POT-Creation-Date: 2022-05-21 17:35+0000\n" "PO-Revision-Date: 2018-05-23 16:11+0000\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -117,7 +117,7 @@ msgstr "結果" #: ../../library/stdtypes.rst:85 ../../library/stdtypes.rst:275 #: ../../library/stdtypes.rst:414 ../../library/stdtypes.rst:883 #: ../../library/stdtypes.rst:1088 ../../library/stdtypes.rst:2325 -#: ../../library/stdtypes.rst:3546 +#: ../../library/stdtypes.rst:3536 msgid "Notes" msgstr "註解" @@ -132,7 +132,7 @@ msgstr "" #: ../../library/stdtypes.rst:87 ../../library/stdtypes.rst:285 #: ../../library/stdtypes.rst:885 ../../library/stdtypes.rst:888 #: ../../library/stdtypes.rst:1099 ../../library/stdtypes.rst:2331 -#: ../../library/stdtypes.rst:3552 +#: ../../library/stdtypes.rst:3542 msgid "\\(1)" msgstr "\\(1)" @@ -147,7 +147,7 @@ msgstr "" #: ../../library/stdtypes.rst:90 ../../library/stdtypes.rst:288 #: ../../library/stdtypes.rst:308 ../../library/stdtypes.rst:1127 #: ../../library/stdtypes.rst:2335 ../../library/stdtypes.rst:2337 -#: ../../library/stdtypes.rst:3556 ../../library/stdtypes.rst:3558 +#: ../../library/stdtypes.rst:3546 ../../library/stdtypes.rst:3548 msgid "\\(2)" msgstr "\\(2)" @@ -162,16 +162,16 @@ msgstr "" #: ../../library/stdtypes.rst:93 ../../library/stdtypes.rst:897 #: ../../library/stdtypes.rst:1130 ../../library/stdtypes.rst:2339 #: ../../library/stdtypes.rst:2341 ../../library/stdtypes.rst:2343 -#: ../../library/stdtypes.rst:2345 ../../library/stdtypes.rst:3560 -#: ../../library/stdtypes.rst:3562 ../../library/stdtypes.rst:3564 -#: ../../library/stdtypes.rst:3566 +#: ../../library/stdtypes.rst:2345 ../../library/stdtypes.rst:3550 +#: ../../library/stdtypes.rst:3552 ../../library/stdtypes.rst:3554 +#: ../../library/stdtypes.rst:3556 msgid "\\(3)" msgstr "\\(3)" #: ../../library/stdtypes.rst:102 ../../library/stdtypes.rst:319 #: ../../library/stdtypes.rst:432 ../../library/stdtypes.rst:934 #: ../../library/stdtypes.rst:1138 ../../library/stdtypes.rst:2371 -#: ../../library/stdtypes.rst:3596 +#: ../../library/stdtypes.rst:3586 msgid "Notes:" msgstr "註解:" @@ -211,8 +211,8 @@ msgid "This table summarizes the comparison operations:" msgstr "" #: ../../library/stdtypes.rst:143 ../../library/stdtypes.rst:2302 -#: ../../library/stdtypes.rst:2325 ../../library/stdtypes.rst:3523 -#: ../../library/stdtypes.rst:3546 +#: ../../library/stdtypes.rst:2325 ../../library/stdtypes.rst:3513 +#: ../../library/stdtypes.rst:3536 msgid "Meaning" msgstr "" @@ -495,7 +495,7 @@ msgid "" msgstr "" #: ../../library/stdtypes.rst:301 ../../library/stdtypes.rst:1120 -#: ../../library/stdtypes.rst:2333 ../../library/stdtypes.rst:3583 +#: ../../library/stdtypes.rst:2333 ../../library/stdtypes.rst:3573 msgid "\\(6)" msgstr "\\(6)" @@ -534,8 +534,8 @@ msgstr "" #: ../../library/stdtypes.rst:310 ../../library/stdtypes.rst:312 #: ../../library/stdtypes.rst:1109 ../../library/stdtypes.rst:1112 #: ../../library/stdtypes.rst:2358 ../../library/stdtypes.rst:2361 -#: ../../library/stdtypes.rst:2364 ../../library/stdtypes.rst:3579 -#: ../../library/stdtypes.rst:3586 +#: ../../library/stdtypes.rst:2364 ../../library/stdtypes.rst:3569 +#: ../../library/stdtypes.rst:3576 msgid "\\(5)" msgstr "\\(5)" @@ -672,7 +672,7 @@ msgstr "" #: ../../library/stdtypes.rst:416 ../../library/stdtypes.rst:419 #: ../../library/stdtypes.rst:422 ../../library/stdtypes.rst:1133 #: ../../library/stdtypes.rst:2347 ../../library/stdtypes.rst:2351 -#: ../../library/stdtypes.rst:3568 ../../library/stdtypes.rst:3572 +#: ../../library/stdtypes.rst:3558 ../../library/stdtypes.rst:3562 msgid "\\(4)" msgstr "\\(4)" @@ -1222,7 +1222,7 @@ msgid "" "before index *j*)" msgstr "" -#: ../../library/stdtypes.rst:910 ../../library/stdtypes.rst:3554 +#: ../../library/stdtypes.rst:910 ../../library/stdtypes.rst:3544 msgid "\\(8)" msgstr "\\(8)" @@ -2087,7 +2087,7 @@ msgstr "" msgid "Support for keyword arguments added." msgstr "" -#: ../../library/stdtypes.rst:1602 ../../library/stdtypes.rst:2742 +#: ../../library/stdtypes.rst:1602 ../../library/stdtypes.rst:2732 msgid "" "The *errors* is now checked in development mode and in :ref:`debug mode " "`." @@ -2458,14 +2458,14 @@ msgstr "" #: ../../library/stdtypes.rst:2005 ../../library/stdtypes.rst:2021 #: ../../library/stdtypes.rst:2073 ../../library/stdtypes.rst:2141 -#: ../../library/stdtypes.rst:2208 ../../library/stdtypes.rst:3058 -#: ../../library/stdtypes.rst:3074 ../../library/stdtypes.rst:3165 -#: ../../library/stdtypes.rst:3181 ../../library/stdtypes.rst:3206 -#: ../../library/stdtypes.rst:3220 ../../library/stdtypes.rst:3248 -#: ../../library/stdtypes.rst:3262 ../../library/stdtypes.rst:3280 -#: ../../library/stdtypes.rst:3307 ../../library/stdtypes.rst:3330 -#: ../../library/stdtypes.rst:3357 ../../library/stdtypes.rst:3399 -#: ../../library/stdtypes.rst:3423 +#: ../../library/stdtypes.rst:2208 ../../library/stdtypes.rst:3048 +#: ../../library/stdtypes.rst:3064 ../../library/stdtypes.rst:3155 +#: ../../library/stdtypes.rst:3171 ../../library/stdtypes.rst:3196 +#: ../../library/stdtypes.rst:3210 ../../library/stdtypes.rst:3238 +#: ../../library/stdtypes.rst:3252 ../../library/stdtypes.rst:3270 +#: ../../library/stdtypes.rst:3297 ../../library/stdtypes.rst:3320 +#: ../../library/stdtypes.rst:3347 ../../library/stdtypes.rst:3389 +#: ../../library/stdtypes.rst:3413 msgid "For example::" msgstr "" "舉例來說:\n" @@ -2644,7 +2644,7 @@ msgid "" "uppercase character and the remaining characters are lowercase." msgstr "" -#: ../../library/stdtypes.rst:2146 ../../library/stdtypes.rst:3367 +#: ../../library/stdtypes.rst:2146 ../../library/stdtypes.rst:3357 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 " @@ -2744,36 +2744,36 @@ msgid "" "example, a dictionary)." msgstr "" -#: ../../library/stdtypes.rst:2257 ../../library/stdtypes.rst:3478 +#: ../../library/stdtypes.rst:2257 ../../library/stdtypes.rst:3468 msgid "" "A conversion specifier contains two or more characters and has the following " "components, which must occur in this order:" msgstr "" -#: ../../library/stdtypes.rst:2260 ../../library/stdtypes.rst:3481 +#: ../../library/stdtypes.rst:2260 ../../library/stdtypes.rst:3471 msgid "The ``'%'`` character, which marks the start of the specifier." msgstr "" -#: ../../library/stdtypes.rst:2262 ../../library/stdtypes.rst:3483 +#: ../../library/stdtypes.rst:2262 ../../library/stdtypes.rst:3473 msgid "" "Mapping key (optional), consisting of a parenthesised sequence of characters " "(for example, ``(somename)``)." msgstr "" -#: ../../library/stdtypes.rst:2265 ../../library/stdtypes.rst:3486 +#: ../../library/stdtypes.rst:2265 ../../library/stdtypes.rst:3476 msgid "" "Conversion flags (optional), which affect the result of some conversion " "types." msgstr "" -#: ../../library/stdtypes.rst:2268 ../../library/stdtypes.rst:3489 +#: ../../library/stdtypes.rst:2268 ../../library/stdtypes.rst:3479 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:2272 ../../library/stdtypes.rst:3493 +#: ../../library/stdtypes.rst:2272 ../../library/stdtypes.rst:3483 msgid "" "Precision (optional), given as a ``'.'`` (dot) followed by the precision. " "If specified as ``'*'`` (an asterisk), the actual precision is read from the " @@ -2781,11 +2781,11 @@ msgid "" "the precision." msgstr "" -#: ../../library/stdtypes.rst:2277 ../../library/stdtypes.rst:3498 +#: ../../library/stdtypes.rst:2277 ../../library/stdtypes.rst:3488 msgid "Length modifier (optional)." msgstr "" -#: ../../library/stdtypes.rst:2279 ../../library/stdtypes.rst:3500 +#: ../../library/stdtypes.rst:2279 ../../library/stdtypes.rst:3490 msgid "Conversion type." msgstr "" @@ -2797,176 +2797,176 @@ msgid "" "selects the value to be formatted from the mapping. For example:" msgstr "" -#: ../../library/stdtypes.rst:2290 ../../library/stdtypes.rst:3511 +#: ../../library/stdtypes.rst:2290 ../../library/stdtypes.rst:3501 msgid "" "In this case no ``*`` specifiers may occur in a format (since they require a " "sequential parameter list)." msgstr "" -#: ../../library/stdtypes.rst:2293 ../../library/stdtypes.rst:3514 +#: ../../library/stdtypes.rst:2293 ../../library/stdtypes.rst:3504 msgid "The conversion flag characters are:" msgstr "" -#: ../../library/stdtypes.rst:2302 ../../library/stdtypes.rst:3523 +#: ../../library/stdtypes.rst:2302 ../../library/stdtypes.rst:3513 msgid "Flag" msgstr "" -#: ../../library/stdtypes.rst:2304 ../../library/stdtypes.rst:3525 +#: ../../library/stdtypes.rst:2304 ../../library/stdtypes.rst:3515 msgid "``'#'``" msgstr "``'#'``" -#: ../../library/stdtypes.rst:2304 ../../library/stdtypes.rst:3525 +#: ../../library/stdtypes.rst:2304 ../../library/stdtypes.rst:3515 msgid "" "The value conversion will use the \"alternate form\" (where defined below)." msgstr "" -#: ../../library/stdtypes.rst:2307 ../../library/stdtypes.rst:3528 +#: ../../library/stdtypes.rst:2307 ../../library/stdtypes.rst:3518 msgid "``'0'``" msgstr "``'0'``" -#: ../../library/stdtypes.rst:2307 ../../library/stdtypes.rst:3528 +#: ../../library/stdtypes.rst:2307 ../../library/stdtypes.rst:3518 msgid "The conversion will be zero padded for numeric values." msgstr "" -#: ../../library/stdtypes.rst:2309 ../../library/stdtypes.rst:3530 +#: ../../library/stdtypes.rst:2309 ../../library/stdtypes.rst:3520 msgid "``'-'``" msgstr "``'-'``" -#: ../../library/stdtypes.rst:2309 ../../library/stdtypes.rst:3530 +#: ../../library/stdtypes.rst:2309 ../../library/stdtypes.rst:3520 msgid "" "The converted value is left adjusted (overrides the ``'0'`` conversion if " "both are given)." msgstr "" -#: ../../library/stdtypes.rst:2312 ../../library/stdtypes.rst:3533 +#: ../../library/stdtypes.rst:2312 ../../library/stdtypes.rst:3523 msgid "``' '``" msgstr "``' '``" -#: ../../library/stdtypes.rst:2312 ../../library/stdtypes.rst:3533 +#: ../../library/stdtypes.rst:2312 ../../library/stdtypes.rst:3523 msgid "" "(a space) A blank should be left before a positive number (or empty string) " "produced by a signed conversion." msgstr "" -#: ../../library/stdtypes.rst:2315 ../../library/stdtypes.rst:3536 +#: ../../library/stdtypes.rst:2315 ../../library/stdtypes.rst:3526 msgid "``'+'``" msgstr "``'+'``" -#: ../../library/stdtypes.rst:2315 ../../library/stdtypes.rst:3536 +#: ../../library/stdtypes.rst:2315 ../../library/stdtypes.rst:3526 msgid "" "A sign character (``'+'`` or ``'-'``) will precede the conversion (overrides " "a \"space\" flag)." msgstr "" -#: ../../library/stdtypes.rst:2319 ../../library/stdtypes.rst:3540 +#: ../../library/stdtypes.rst:2319 ../../library/stdtypes.rst:3530 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:2322 ../../library/stdtypes.rst:3543 +#: ../../library/stdtypes.rst:2322 ../../library/stdtypes.rst:3533 msgid "The conversion types are:" msgstr "" -#: ../../library/stdtypes.rst:2325 ../../library/stdtypes.rst:3546 +#: ../../library/stdtypes.rst:2325 ../../library/stdtypes.rst:3536 msgid "Conversion" msgstr "" -#: ../../library/stdtypes.rst:2327 ../../library/stdtypes.rst:3548 +#: ../../library/stdtypes.rst:2327 ../../library/stdtypes.rst:3538 msgid "``'d'``" msgstr "``'d'``" #: ../../library/stdtypes.rst:2327 ../../library/stdtypes.rst:2329 -#: ../../library/stdtypes.rst:3548 ../../library/stdtypes.rst:3550 +#: ../../library/stdtypes.rst:3538 ../../library/stdtypes.rst:3540 msgid "Signed integer decimal." msgstr "" -#: ../../library/stdtypes.rst:2329 ../../library/stdtypes.rst:3550 +#: ../../library/stdtypes.rst:2329 ../../library/stdtypes.rst:3540 msgid "``'i'``" msgstr "``'i'``" -#: ../../library/stdtypes.rst:2331 ../../library/stdtypes.rst:3552 +#: ../../library/stdtypes.rst:2331 ../../library/stdtypes.rst:3542 msgid "``'o'``" msgstr "``'o'``" -#: ../../library/stdtypes.rst:2331 ../../library/stdtypes.rst:3552 +#: ../../library/stdtypes.rst:2331 ../../library/stdtypes.rst:3542 msgid "Signed octal value." msgstr "" -#: ../../library/stdtypes.rst:2333 ../../library/stdtypes.rst:3554 +#: ../../library/stdtypes.rst:2333 ../../library/stdtypes.rst:3544 msgid "``'u'``" msgstr "``'u'``" -#: ../../library/stdtypes.rst:2333 ../../library/stdtypes.rst:3554 +#: ../../library/stdtypes.rst:2333 ../../library/stdtypes.rst:3544 msgid "Obsolete type -- it is identical to ``'d'``." msgstr "" -#: ../../library/stdtypes.rst:2335 ../../library/stdtypes.rst:3556 +#: ../../library/stdtypes.rst:2335 ../../library/stdtypes.rst:3546 msgid "``'x'``" msgstr "``'x'``" -#: ../../library/stdtypes.rst:2335 ../../library/stdtypes.rst:3556 +#: ../../library/stdtypes.rst:2335 ../../library/stdtypes.rst:3546 msgid "Signed hexadecimal (lowercase)." msgstr "" -#: ../../library/stdtypes.rst:2337 ../../library/stdtypes.rst:3558 +#: ../../library/stdtypes.rst:2337 ../../library/stdtypes.rst:3548 msgid "``'X'``" msgstr "``'X'``" -#: ../../library/stdtypes.rst:2337 ../../library/stdtypes.rst:3558 +#: ../../library/stdtypes.rst:2337 ../../library/stdtypes.rst:3548 msgid "Signed hexadecimal (uppercase)." msgstr "" -#: ../../library/stdtypes.rst:2339 ../../library/stdtypes.rst:3560 +#: ../../library/stdtypes.rst:2339 ../../library/stdtypes.rst:3550 msgid "``'e'``" msgstr "``'e'``" -#: ../../library/stdtypes.rst:2339 ../../library/stdtypes.rst:3560 +#: ../../library/stdtypes.rst:2339 ../../library/stdtypes.rst:3550 msgid "Floating point exponential format (lowercase)." msgstr "" -#: ../../library/stdtypes.rst:2341 ../../library/stdtypes.rst:3562 +#: ../../library/stdtypes.rst:2341 ../../library/stdtypes.rst:3552 msgid "``'E'``" msgstr "``'E'``" -#: ../../library/stdtypes.rst:2341 ../../library/stdtypes.rst:3562 +#: ../../library/stdtypes.rst:2341 ../../library/stdtypes.rst:3552 msgid "Floating point exponential format (uppercase)." msgstr "" -#: ../../library/stdtypes.rst:2343 ../../library/stdtypes.rst:3564 +#: ../../library/stdtypes.rst:2343 ../../library/stdtypes.rst:3554 msgid "``'f'``" msgstr "``'f'``" #: ../../library/stdtypes.rst:2343 ../../library/stdtypes.rst:2345 -#: ../../library/stdtypes.rst:3564 ../../library/stdtypes.rst:3566 +#: ../../library/stdtypes.rst:3554 ../../library/stdtypes.rst:3556 msgid "Floating point decimal format." msgstr "" -#: ../../library/stdtypes.rst:2345 ../../library/stdtypes.rst:3566 +#: ../../library/stdtypes.rst:2345 ../../library/stdtypes.rst:3556 msgid "``'F'``" msgstr "``'F'``" -#: ../../library/stdtypes.rst:2347 ../../library/stdtypes.rst:3568 +#: ../../library/stdtypes.rst:2347 ../../library/stdtypes.rst:3558 msgid "``'g'``" msgstr "``'g'``" -#: ../../library/stdtypes.rst:2347 ../../library/stdtypes.rst:3568 +#: ../../library/stdtypes.rst:2347 ../../library/stdtypes.rst:3558 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:2351 ../../library/stdtypes.rst:3572 +#: ../../library/stdtypes.rst:2351 ../../library/stdtypes.rst:3562 msgid "``'G'``" msgstr "``'G'``" -#: ../../library/stdtypes.rst:2351 ../../library/stdtypes.rst:3572 +#: ../../library/stdtypes.rst:2351 ../../library/stdtypes.rst:3562 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:2355 ../../library/stdtypes.rst:3576 +#: ../../library/stdtypes.rst:2355 ../../library/stdtypes.rst:3566 msgid "``'c'``" msgstr "``'c'``" @@ -2974,7 +2974,7 @@ msgstr "``'c'``" msgid "Single character (accepts integer or single character string)." msgstr "" -#: ../../library/stdtypes.rst:2358 ../../library/stdtypes.rst:3589 +#: ../../library/stdtypes.rst:2358 ../../library/stdtypes.rst:3579 msgid "``'r'``" msgstr "``'r'``" @@ -2982,7 +2982,7 @@ msgstr "``'r'``" msgid "String (converts any Python object using :func:`repr`)." msgstr "" -#: ../../library/stdtypes.rst:2361 ../../library/stdtypes.rst:3583 +#: ../../library/stdtypes.rst:2361 ../../library/stdtypes.rst:3573 msgid "``'s'``" msgstr "``'s'``" @@ -2990,7 +2990,7 @@ msgstr "``'s'``" msgid "String (converts any Python object using :func:`str`)." msgstr "" -#: ../../library/stdtypes.rst:2364 ../../library/stdtypes.rst:3586 +#: ../../library/stdtypes.rst:2364 ../../library/stdtypes.rst:3576 msgid "``'a'``" msgstr "``'a'``" @@ -2998,56 +2998,56 @@ msgstr "``'a'``" msgid "String (converts any Python object using :func:`ascii`)." msgstr "" -#: ../../library/stdtypes.rst:2367 ../../library/stdtypes.rst:3592 +#: ../../library/stdtypes.rst:2367 ../../library/stdtypes.rst:3582 msgid "``'%'``" msgstr "``'%'``" -#: ../../library/stdtypes.rst:2367 ../../library/stdtypes.rst:3592 +#: ../../library/stdtypes.rst:2367 ../../library/stdtypes.rst:3582 msgid "No argument is converted, results in a ``'%'`` character in the result." msgstr "" -#: ../../library/stdtypes.rst:2374 ../../library/stdtypes.rst:3599 +#: ../../library/stdtypes.rst:2374 ../../library/stdtypes.rst:3589 msgid "" "The alternate form causes a leading octal specifier (``'0o'``) to be " "inserted before the first digit." msgstr "" -#: ../../library/stdtypes.rst:2378 ../../library/stdtypes.rst:3603 +#: ../../library/stdtypes.rst:2378 ../../library/stdtypes.rst:3593 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:2382 ../../library/stdtypes.rst:3607 +#: ../../library/stdtypes.rst:2382 ../../library/stdtypes.rst:3597 msgid "" "The alternate form causes the result to always contain a decimal point, even " "if no digits follow it." msgstr "" -#: ../../library/stdtypes.rst:2385 ../../library/stdtypes.rst:3610 +#: ../../library/stdtypes.rst:2385 ../../library/stdtypes.rst:3600 msgid "" "The precision determines the number of digits after the decimal point and " "defaults to 6." msgstr "" -#: ../../library/stdtypes.rst:2389 ../../library/stdtypes.rst:3614 +#: ../../library/stdtypes.rst:2389 ../../library/stdtypes.rst:3604 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:2392 ../../library/stdtypes.rst:3617 +#: ../../library/stdtypes.rst:2392 ../../library/stdtypes.rst:3607 msgid "" "The precision determines the number of significant digits before and after " "the decimal point and defaults to 6." msgstr "" -#: ../../library/stdtypes.rst:2396 ../../library/stdtypes.rst:3621 +#: ../../library/stdtypes.rst:2396 ../../library/stdtypes.rst:3611 msgid "If precision is ``N``, the output is truncated to ``N`` characters." msgstr "" -#: ../../library/stdtypes.rst:2399 ../../library/stdtypes.rst:3630 +#: ../../library/stdtypes.rst:2399 ../../library/stdtypes.rst:3620 msgid "See :pep:`237`." msgstr "參閱 :pep:`237`\\ 。" @@ -3190,7 +3190,7 @@ msgid "" "hexadecimal representation." msgstr "" -#: ../../library/stdtypes.rst:2503 ../../library/stdtypes.rst:2597 +#: ../../library/stdtypes.rst:2503 ../../library/stdtypes.rst:2587 msgid "" "Return a string object containing two hexadecimal digits for each byte in " "the instance." @@ -3226,63 +3226,51 @@ msgid "" "always convert a bytes object into a list of integers using ``list(b)``." msgstr "" -#: ../../library/stdtypes.rst:2539 -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-" -"in binary data type) and Unicode strings were permitted. This was a " -"backwards compatibility workaround to account for the fact that Python " -"originally only supported 8-bit text, and Unicode text was a later addition. " -"In Python 3.x, those implicit conversions are gone - conversions between 8-" -"bit binary data and Unicode text must be explicit, and bytes and string " -"objects will always compare unequal." -msgstr "" - -#: ../../library/stdtypes.rst:2552 +#: ../../library/stdtypes.rst:2542 msgid "Bytearray Objects" msgstr "" -#: ../../library/stdtypes.rst:2556 +#: ../../library/stdtypes.rst:2546 msgid "" ":class:`bytearray` objects are a mutable counterpart to :class:`bytes` " "objects." msgstr "" -#: ../../library/stdtypes.rst:2561 +#: ../../library/stdtypes.rst:2551 msgid "" "There is no dedicated literal syntax for bytearray objects, instead they are " "always created by calling the constructor:" msgstr "" -#: ../../library/stdtypes.rst:2564 +#: ../../library/stdtypes.rst:2554 msgid "Creating an empty instance: ``bytearray()``" msgstr "" -#: ../../library/stdtypes.rst:2565 +#: ../../library/stdtypes.rst:2555 msgid "Creating a zero-filled instance with a given length: ``bytearray(10)``" msgstr "" -#: ../../library/stdtypes.rst:2566 +#: ../../library/stdtypes.rst:2556 msgid "From an iterable of integers: ``bytearray(range(20))``" msgstr "" -#: ../../library/stdtypes.rst:2567 +#: ../../library/stdtypes.rst:2557 msgid "" "Copying existing binary data via the buffer protocol: ``bytearray(b'Hi!')``" msgstr "" -#: ../../library/stdtypes.rst:2569 +#: ../../library/stdtypes.rst:2559 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:2573 +#: ../../library/stdtypes.rst:2563 msgid "Also see the :ref:`bytearray ` built-in." msgstr "" -#: ../../library/stdtypes.rst:2575 +#: ../../library/stdtypes.rst:2565 msgid "" "Since 2 hexadecimal digits correspond precisely to a single byte, " "hexadecimal numbers are a commonly used format for describing binary data. " @@ -3290,33 +3278,33 @@ msgid "" "in that format:" msgstr "" -#: ../../library/stdtypes.rst:2581 +#: ../../library/stdtypes.rst:2571 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:2588 +#: ../../library/stdtypes.rst:2578 msgid "" ":meth:`bytearray.fromhex` now skips all ASCII whitespace in the string, not " "just spaces." msgstr "" -#: ../../library/stdtypes.rst:2592 +#: ../../library/stdtypes.rst:2582 msgid "" "A reverse conversion function exists to transform a bytearray object into " "its hexadecimal representation." msgstr "" -#: ../../library/stdtypes.rst:2605 +#: ../../library/stdtypes.rst:2595 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:2610 +#: ../../library/stdtypes.rst:2600 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 " @@ -3324,7 +3312,7 @@ msgid "" "both indexing and slicing will produce a string of length 1)" msgstr "" -#: ../../library/stdtypes.rst:2615 +#: ../../library/stdtypes.rst:2605 msgid "" "The representation of bytearray objects uses the bytes literal format " "(``bytearray(b'...')``) since it is often more useful than e.g. " @@ -3332,11 +3320,11 @@ msgid "" "a list of integers using ``list(b)``." msgstr "" -#: ../../library/stdtypes.rst:2624 +#: ../../library/stdtypes.rst:2614 msgid "Bytes and Bytearray Operations" msgstr "" -#: ../../library/stdtypes.rst:2629 +#: ../../library/stdtypes.rst:2619 msgid "" "Both bytes and bytearray objects support the :ref:`common ` " "sequence operations. They interoperate not just with operands of the same " @@ -3345,97 +3333,97 @@ msgid "" "return type of the result may depend on the order of operands." msgstr "" -#: ../../library/stdtypes.rst:2637 +#: ../../library/stdtypes.rst:2627 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:2644 +#: ../../library/stdtypes.rst:2634 msgid "and::" msgstr "" "和:\n" "\n" "::" -#: ../../library/stdtypes.rst:2649 +#: ../../library/stdtypes.rst:2639 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:2654 +#: ../../library/stdtypes.rst:2644 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:2657 +#: ../../library/stdtypes.rst:2647 msgid "" "The following methods on bytes and bytearray objects can be used with " "arbitrary binary data." msgstr "" -#: ../../library/stdtypes.rst:2663 +#: ../../library/stdtypes.rst:2653 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:2667 ../../library/stdtypes.rst:2766 -#: ../../library/stdtypes.rst:2788 ../../library/stdtypes.rst:2854 -#: ../../library/stdtypes.rst:2867 +#: ../../library/stdtypes.rst:2657 ../../library/stdtypes.rst:2756 +#: ../../library/stdtypes.rst:2778 ../../library/stdtypes.rst:2844 +#: ../../library/stdtypes.rst:2857 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:2670 ../../library/stdtypes.rst:2778 -#: ../../library/stdtypes.rst:2791 ../../library/stdtypes.rst:2857 -#: ../../library/stdtypes.rst:2870 +#: ../../library/stdtypes.rst:2660 ../../library/stdtypes.rst:2768 +#: ../../library/stdtypes.rst:2781 ../../library/stdtypes.rst:2847 +#: ../../library/stdtypes.rst:2860 msgid "Also accept an integer in the range 0 to 255 as the subsequence." msgstr "" -#: ../../library/stdtypes.rst:2677 +#: ../../library/stdtypes.rst:2667 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:2686 +#: ../../library/stdtypes.rst:2676 msgid "The *prefix* may be any :term:`bytes-like object`." msgstr "" -#: ../../library/stdtypes.rst:2690 ../../library/stdtypes.rst:2712 -#: ../../library/stdtypes.rst:2842 ../../library/stdtypes.rst:2935 -#: ../../library/stdtypes.rst:2949 ../../library/stdtypes.rst:2980 -#: ../../library/stdtypes.rst:2994 ../../library/stdtypes.rst:3036 -#: ../../library/stdtypes.rst:3106 ../../library/stdtypes.rst:3124 -#: ../../library/stdtypes.rst:3152 ../../library/stdtypes.rst:3291 -#: ../../library/stdtypes.rst:3346 ../../library/stdtypes.rst:3389 -#: ../../library/stdtypes.rst:3410 ../../library/stdtypes.rst:3432 -#: ../../library/stdtypes.rst:3634 +#: ../../library/stdtypes.rst:2680 ../../library/stdtypes.rst:2702 +#: ../../library/stdtypes.rst:2832 ../../library/stdtypes.rst:2925 +#: ../../library/stdtypes.rst:2939 ../../library/stdtypes.rst:2970 +#: ../../library/stdtypes.rst:2984 ../../library/stdtypes.rst:3026 +#: ../../library/stdtypes.rst:3096 ../../library/stdtypes.rst:3114 +#: ../../library/stdtypes.rst:3142 ../../library/stdtypes.rst:3281 +#: ../../library/stdtypes.rst:3336 ../../library/stdtypes.rst:3379 +#: ../../library/stdtypes.rst:3400 ../../library/stdtypes.rst:3422 +#: ../../library/stdtypes.rst:3624 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:2699 +#: ../../library/stdtypes.rst:2689 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:2708 +#: ../../library/stdtypes.rst:2698 msgid "The *suffix* may be any :term:`bytes-like object`." msgstr "" -#: ../../library/stdtypes.rst:2721 +#: ../../library/stdtypes.rst:2711 msgid "" "Return a string decoded from the given bytes. Default encoding is " "``'utf-8'``. *errors* may be given to set a different error handling " @@ -3446,25 +3434,25 @@ msgid "" "encodings, see section :ref:`standard-encodings`." msgstr "" -#: ../../library/stdtypes.rst:2729 +#: ../../library/stdtypes.rst:2719 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 :ref:`debug build ` to check *errors*." msgstr "" -#: ../../library/stdtypes.rst:2735 +#: ../../library/stdtypes.rst:2725 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:2739 +#: ../../library/stdtypes.rst:2729 msgid "Added support for keyword arguments." msgstr "新增關鍵字引數的支援。" -#: ../../library/stdtypes.rst:2750 +#: ../../library/stdtypes.rst:2740 msgid "" "Return ``True`` if the binary data ends with the specified *suffix*, " "otherwise return ``False``. *suffix* can also be a tuple of suffixes to " @@ -3472,11 +3460,11 @@ msgid "" "optional *end*, stop comparing at that position." msgstr "" -#: ../../library/stdtypes.rst:2755 +#: ../../library/stdtypes.rst:2745 msgid "The suffix(es) to search for may be any :term:`bytes-like object`." msgstr "" -#: ../../library/stdtypes.rst:2761 +#: ../../library/stdtypes.rst:2751 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 " @@ -3484,20 +3472,20 @@ msgid "" "``-1`` if *sub* is not found." msgstr "" -#: ../../library/stdtypes.rst:2771 +#: ../../library/stdtypes.rst:2761 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:2785 +#: ../../library/stdtypes.rst:2775 msgid "" "Like :meth:`~bytes.find`, but raise :exc:`ValueError` when the subsequence " "is not found." msgstr "" -#: ../../library/stdtypes.rst:2798 +#: ../../library/stdtypes.rst:2788 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 " @@ -3507,7 +3495,7 @@ msgid "" "method." msgstr "" -#: ../../library/stdtypes.rst:2809 +#: ../../library/stdtypes.rst:2799 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 " @@ -3515,7 +3503,7 @@ msgid "" "objects ` and have the same length." msgstr "" -#: ../../library/stdtypes.rst:2820 +#: ../../library/stdtypes.rst:2810 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 " @@ -3524,24 +3512,24 @@ msgid "" "by two empty bytes or bytearray objects." msgstr "" -#: ../../library/stdtypes.rst:2827 ../../library/stdtypes.rst:2884 +#: ../../library/stdtypes.rst:2817 ../../library/stdtypes.rst:2874 msgid "The separator to search for may be any :term:`bytes-like object`." msgstr "" -#: ../../library/stdtypes.rst:2833 +#: ../../library/stdtypes.rst:2823 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:2837 +#: ../../library/stdtypes.rst:2827 msgid "" "The subsequence to search for and its replacement may be any :term:`bytes-" "like object`." msgstr "" -#: ../../library/stdtypes.rst:2849 +#: ../../library/stdtypes.rst:2839 msgid "" "Return the highest index in the sequence where the subsequence *sub* is " "found, such that *sub* is contained within ``s[start:end]``. Optional " @@ -3549,13 +3537,13 @@ msgid "" "``-1`` on failure." msgstr "" -#: ../../library/stdtypes.rst:2864 +#: ../../library/stdtypes.rst:2854 msgid "" "Like :meth:`~bytes.rfind` but raises :exc:`ValueError` when the subsequence " "*sub* is not found." msgstr "" -#: ../../library/stdtypes.rst:2877 +#: ../../library/stdtypes.rst:2867 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 " @@ -3564,7 +3552,7 @@ msgid "" "followed by a copy of the original sequence." msgstr "" -#: ../../library/stdtypes.rst:2890 +#: ../../library/stdtypes.rst:2880 msgid "" "Return ``True`` if the binary data starts with the specified *prefix*, " "otherwise return ``False``. *prefix* can also be a tuple of prefixes to " @@ -3572,11 +3560,11 @@ msgid "" "optional *end*, stop comparing at that position." msgstr "" -#: ../../library/stdtypes.rst:2895 +#: ../../library/stdtypes.rst:2885 msgid "The prefix(es) to search for may be any :term:`bytes-like object`." msgstr "" -#: ../../library/stdtypes.rst:2901 +#: ../../library/stdtypes.rst:2891 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 " @@ -3584,22 +3572,22 @@ msgid "" "object of length 256." msgstr "" -#: ../../library/stdtypes.rst:2906 +#: ../../library/stdtypes.rst:2896 msgid "" "You can use the :func:`bytes.maketrans` method to create a translation table." msgstr "" -#: ../../library/stdtypes.rst:2909 +#: ../../library/stdtypes.rst:2899 msgid "" "Set the *table* argument to ``None`` for translations that only delete " "characters::" msgstr "" -#: ../../library/stdtypes.rst:2915 +#: ../../library/stdtypes.rst:2905 msgid "*delete* is now supported as a keyword argument." msgstr "" -#: ../../library/stdtypes.rst:2919 +#: ../../library/stdtypes.rst:2909 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 " @@ -3608,7 +3596,7 @@ msgid "" "instead produce new objects." msgstr "" -#: ../../library/stdtypes.rst:2928 +#: ../../library/stdtypes.rst:2918 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). " @@ -3616,7 +3604,7 @@ msgid "" "less than or equal to ``len(s)``." msgstr "" -#: ../../library/stdtypes.rst:2942 +#: ../../library/stdtypes.rst:2932 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). " @@ -3624,7 +3612,7 @@ msgid "" "less than or equal to ``len(s)``." msgstr "" -#: ../../library/stdtypes.rst:2956 +#: ../../library/stdtypes.rst:2946 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 " @@ -3634,14 +3622,14 @@ msgid "" "all combinations of its values are stripped::" msgstr "" -#: ../../library/stdtypes.rst:2968 +#: ../../library/stdtypes.rst:2958 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:2987 +#: ../../library/stdtypes.rst:2977 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). " @@ -3649,7 +3637,7 @@ msgid "" "less than or equal to ``len(s)``." msgstr "" -#: ../../library/stdtypes.rst:3001 +#: ../../library/stdtypes.rst:2991 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 " @@ -3659,7 +3647,7 @@ msgid "" "described in detail below." msgstr "" -#: ../../library/stdtypes.rst:3012 +#: ../../library/stdtypes.rst:3002 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 " @@ -3669,14 +3657,14 @@ msgid "" "all combinations of its values are stripped::" msgstr "" -#: ../../library/stdtypes.rst:3024 +#: ../../library/stdtypes.rst:3014 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:3043 +#: ../../library/stdtypes.rst:3033 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 " @@ -3685,7 +3673,7 @@ msgid "" "limit on the number of splits (all possible splits are made)." msgstr "" -#: ../../library/stdtypes.rst:3049 +#: ../../library/stdtypes.rst:3039 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',')`` " @@ -3696,7 +3684,7 @@ msgid "" "object being split. The *sep* argument may be any :term:`bytes-like object`." msgstr "" -#: ../../library/stdtypes.rst:3067 +#: ../../library/stdtypes.rst:3057 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 " @@ -3706,7 +3694,7 @@ msgid "" "without a specified separator returns ``[]``." msgstr "" -#: ../../library/stdtypes.rst:3088 +#: ../../library/stdtypes.rst:3078 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 " @@ -3716,13 +3704,13 @@ msgid "" "a prefix or suffix; rather, all combinations of its values are stripped::" msgstr "" -#: ../../library/stdtypes.rst:3101 +#: ../../library/stdtypes.rst:3091 msgid "" "The binary sequence of byte values to remove may be any :term:`bytes-like " "object`." msgstr "" -#: ../../library/stdtypes.rst:3110 +#: ../../library/stdtypes.rst:3100 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 " @@ -3730,14 +3718,14 @@ msgid "" "operate in place, and instead produce new objects." msgstr "" -#: ../../library/stdtypes.rst:3118 +#: ../../library/stdtypes.rst:3108 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:3131 +#: ../../library/stdtypes.rst:3121 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 " @@ -3753,7 +3741,7 @@ msgid "" "by one regardless of how the byte value is represented when printed::" msgstr "" -#: ../../library/stdtypes.rst:3159 +#: ../../library/stdtypes.rst:3149 msgid "" "Return ``True`` if all bytes in the sequence are alphabetical ASCII " "characters or ASCII decimal digits and the sequence is not empty, ``False`` " @@ -3762,7 +3750,7 @@ msgid "" "digits are those byte values in the sequence ``b'0123456789'``." msgstr "" -#: ../../library/stdtypes.rst:3176 +#: ../../library/stdtypes.rst:3166 msgid "" "Return ``True`` if all bytes in the sequence are alphabetic ASCII characters " "and the sequence is not empty, ``False`` otherwise. Alphabetic ASCII " @@ -3770,35 +3758,35 @@ msgid "" "``b'abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ'``." msgstr "" -#: ../../library/stdtypes.rst:3192 +#: ../../library/stdtypes.rst:3182 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:3202 +#: ../../library/stdtypes.rst:3192 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:3217 +#: ../../library/stdtypes.rst:3207 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:3227 ../../library/stdtypes.rst:3269 -#: ../../library/stdtypes.rst:3285 ../../library/stdtypes.rst:3335 -#: ../../library/stdtypes.rst:3404 +#: ../../library/stdtypes.rst:3217 ../../library/stdtypes.rst:3259 +#: ../../library/stdtypes.rst:3275 ../../library/stdtypes.rst:3325 +#: ../../library/stdtypes.rst:3394 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:3235 +#: ../../library/stdtypes.rst:3225 msgid "" "Return ``True`` if all bytes in the sequence are ASCII whitespace and the " "sequence is not empty, ``False`` otherwise. ASCII whitespace characters are " @@ -3806,27 +3794,27 @@ msgid "" "newline, carriage return, vertical tab, form feed)." msgstr "" -#: ../../library/stdtypes.rst:3244 +#: ../../library/stdtypes.rst:3234 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:3259 +#: ../../library/stdtypes.rst:3249 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:3277 +#: ../../library/stdtypes.rst:3267 msgid "" "Return a copy of the sequence with all the uppercase ASCII characters " "converted to their corresponding lowercase counterpart." msgstr "" -#: ../../library/stdtypes.rst:3302 +#: ../../library/stdtypes.rst:3292 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 " @@ -3834,20 +3822,20 @@ msgid "" "*keepends* is given and true." msgstr "" -#: ../../library/stdtypes.rst:3314 +#: ../../library/stdtypes.rst:3304 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:3327 +#: ../../library/stdtypes.rst:3317 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:3339 +#: ../../library/stdtypes.rst:3329 msgid "" "Unlike :func:`str.swapcase()`, it is always the case that ``bin.swapcase()." "swapcase() == bin`` for the binary versions. Case conversions are " @@ -3855,14 +3843,14 @@ msgid "" "Unicode code points." msgstr "" -#: ../../library/stdtypes.rst:3353 +#: ../../library/stdtypes.rst:3343 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:3362 +#: ../../library/stdtypes.rst:3352 msgid "" "Lowercase ASCII characters are those byte values in the sequence " "``b'abcdefghijklmnopqrstuvwxyz'``. Uppercase ASCII characters are those byte " @@ -3870,18 +3858,18 @@ msgid "" "values are uncased." msgstr "" -#: ../../library/stdtypes.rst:3375 +#: ../../library/stdtypes.rst:3365 msgid "" "A workaround for apostrophes can be constructed using regular expressions::" msgstr "" -#: ../../library/stdtypes.rst:3396 +#: ../../library/stdtypes.rst:3386 msgid "" "Return a copy of the sequence with all the lowercase ASCII characters " "converted to their corresponding uppercase counterpart." msgstr "" -#: ../../library/stdtypes.rst:3417 +#: ../../library/stdtypes.rst:3407 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 " @@ -3890,11 +3878,11 @@ msgid "" "*width* is less than or equal to ``len(seq)``." msgstr "" -#: ../../library/stdtypes.rst:3439 +#: ../../library/stdtypes.rst:3429 msgid "``printf``-style Bytes Formatting" msgstr "" -#: ../../library/stdtypes.rst:3456 +#: ../../library/stdtypes.rst:3446 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 " @@ -3902,7 +3890,7 @@ msgid "" "dictionary, wrap it in a tuple." msgstr "" -#: ../../library/stdtypes.rst:3461 +#: ../../library/stdtypes.rst:3451 msgid "" "Bytes objects (``bytes``/``bytearray``) have one unique built-in operation: " "the ``%`` operator (modulo). This is also known as the bytes *formatting* or " @@ -3912,7 +3900,7 @@ msgid "" "func:`sprintf` in the C language." msgstr "" -#: ../../library/stdtypes.rst:3468 +#: ../../library/stdtypes.rst:3458 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 " @@ -3920,7 +3908,7 @@ msgid "" "example, a dictionary)." msgstr "" -#: ../../library/stdtypes.rst:3502 +#: ../../library/stdtypes.rst:3492 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 " @@ -3928,73 +3916,73 @@ msgid "" "mapping key selects the value to be formatted from the mapping. For example:" msgstr "" -#: ../../library/stdtypes.rst:3576 +#: ../../library/stdtypes.rst:3566 msgid "Single byte (accepts integer or single byte objects)." msgstr "" -#: ../../library/stdtypes.rst:3579 +#: ../../library/stdtypes.rst:3569 msgid "``'b'``" msgstr "``'b'``" -#: ../../library/stdtypes.rst:3579 +#: ../../library/stdtypes.rst:3569 msgid "" "Bytes (any object that follows the :ref:`buffer protocol ` or " "has :meth:`__bytes__`)." msgstr "" -#: ../../library/stdtypes.rst:3583 +#: ../../library/stdtypes.rst:3573 msgid "" "``'s'`` is an alias for ``'b'`` and should only be used for Python2/3 code " "bases." msgstr "" -#: ../../library/stdtypes.rst:3586 +#: ../../library/stdtypes.rst:3576 msgid "" "Bytes (converts any Python object using ``repr(obj).encode('ascii', " "'backslashreplace')``)." msgstr "" -#: ../../library/stdtypes.rst:3589 +#: ../../library/stdtypes.rst:3579 msgid "" "``'r'`` is an alias for ``'a'`` and should only be used for Python2/3 code " "bases." msgstr "" -#: ../../library/stdtypes.rst:3589 +#: ../../library/stdtypes.rst:3579 msgid "\\(7)" msgstr "\\(7)" -#: ../../library/stdtypes.rst:3624 +#: ../../library/stdtypes.rst:3614 msgid "``b'%s'`` is deprecated, but will not be removed during the 3.x series." msgstr "" -#: ../../library/stdtypes.rst:3627 +#: ../../library/stdtypes.rst:3617 msgid "``b'%r'`` is deprecated, but will not be removed during the 3.x series." msgstr "" -#: ../../library/stdtypes.rst:3639 +#: ../../library/stdtypes.rst:3629 msgid ":pep:`461` - Adding % formatting to bytes and bytearray" msgstr "" -#: ../../library/stdtypes.rst:3646 +#: ../../library/stdtypes.rst:3636 msgid "Memory Views" msgstr "" -#: ../../library/stdtypes.rst:3648 +#: ../../library/stdtypes.rst:3638 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:3654 +#: ../../library/stdtypes.rst:3644 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`." msgstr "" -#: ../../library/stdtypes.rst:3658 +#: ../../library/stdtypes.rst:3648 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 " @@ -4002,7 +3990,7 @@ msgid "" "other types such as :class:`array.array` may have bigger elements." msgstr "" -#: ../../library/stdtypes.rst:3663 +#: ../../library/stdtypes.rst:3653 msgid "" "``len(view)`` is equal to the length of :class:`~memoryview.tolist`. If " "``view.ndim = 0``, the length is 1. If ``view.ndim = 1``, the length is " @@ -4012,13 +4000,13 @@ msgid "" "bytes in a single element." msgstr "" -#: ../../library/stdtypes.rst:3670 +#: ../../library/stdtypes.rst:3660 msgid "" "A :class:`memoryview` supports slicing and indexing to expose its data. One-" "dimensional slicing will result in a subview::" msgstr "" -#: ../../library/stdtypes.rst:3683 +#: ../../library/stdtypes.rst:3673 msgid "" "If :class:`~memoryview.format` is one of the native format specifiers from " "the :mod:`struct` module, indexing with an integer or a tuple of integers is " @@ -4029,82 +4017,82 @@ msgid "" "memoryviews can be indexed with the empty tuple." msgstr "" -#: ../../library/stdtypes.rst:3692 +#: ../../library/stdtypes.rst:3682 msgid "Here is an example with a non-byte format::" msgstr "" -#: ../../library/stdtypes.rst:3704 +#: ../../library/stdtypes.rst:3694 msgid "" "If the underlying object is writable, the memoryview supports one-" "dimensional slice assignment. Resizing is not allowed::" msgstr "" -#: ../../library/stdtypes.rst:3725 +#: ../../library/stdtypes.rst:3715 msgid "" "One-dimensional memoryviews of hashable (read-only) types with formats 'B', " "'b' or 'c' are also hashable. The hash is defined as ``hash(m) == hash(m." "tobytes())``::" msgstr "" -#: ../../library/stdtypes.rst:3737 +#: ../../library/stdtypes.rst:3727 msgid "" "One-dimensional memoryviews can now be sliced. One-dimensional memoryviews " "with formats 'B', 'b' or 'c' are now hashable." msgstr "" -#: ../../library/stdtypes.rst:3741 +#: ../../library/stdtypes.rst:3731 msgid "" "memoryview is now registered automatically with :class:`collections.abc." "Sequence`" msgstr "" -#: ../../library/stdtypes.rst:3745 +#: ../../library/stdtypes.rst:3735 msgid "memoryviews can now be indexed with tuple of integers." msgstr "" -#: ../../library/stdtypes.rst:3748 +#: ../../library/stdtypes.rst:3738 msgid ":class:`memoryview` has several methods:" msgstr "" -#: ../../library/stdtypes.rst:3752 +#: ../../library/stdtypes.rst:3742 msgid "" "A memoryview and a :pep:`3118` exporter are equal if their shapes are " "equivalent and if all corresponding values are equal when the operands' " "respective format codes are interpreted using :mod:`struct` syntax." msgstr "" -#: ../../library/stdtypes.rst:3756 +#: ../../library/stdtypes.rst:3746 msgid "" "For the subset of :mod:`struct` format strings currently supported by :meth:" "`tolist`, ``v`` and ``w`` are equal if ``v.tolist() == w.tolist()``::" msgstr "" -#: ../../library/stdtypes.rst:3775 +#: ../../library/stdtypes.rst:3765 msgid "" "If either format string is not supported by the :mod:`struct` module, then " "the objects will always compare as unequal (even if the format strings and " "buffer contents are identical)::" msgstr "" -#: ../../library/stdtypes.rst:3791 +#: ../../library/stdtypes.rst:3781 msgid "" "Note that, as with floating point numbers, ``v is w`` does *not* imply ``v " "== w`` for memoryview objects." msgstr "" -#: ../../library/stdtypes.rst:3794 +#: ../../library/stdtypes.rst:3784 msgid "" "Previous versions compared the raw memory disregarding the item format and " "the logical array structure." msgstr "" -#: ../../library/stdtypes.rst:3800 +#: ../../library/stdtypes.rst:3790 msgid "" "Return the data in the buffer as a bytestring. This is equivalent to " "calling the :class:`bytes` constructor on the memoryview. ::" msgstr "" -#: ../../library/stdtypes.rst:3809 +#: ../../library/stdtypes.rst:3799 msgid "" "For non-contiguous arrays the result is equal to the flattened list " "representation with all elements converted to bytes. :meth:`tobytes` " @@ -4112,7 +4100,7 @@ msgid "" "module syntax." msgstr "" -#: ../../library/stdtypes.rst:3814 +#: ../../library/stdtypes.rst:3804 msgid "" "*order* can be {'C', 'F', 'A'}. When *order* is 'C' or 'F', the data of the " "original array is converted to C or Fortran order. For contiguous views, 'A' " @@ -4121,36 +4109,36 @@ msgid "" "to C first. *order=None* is the same as *order='C'*." msgstr "" -#: ../../library/stdtypes.rst:3823 +#: ../../library/stdtypes.rst:3813 msgid "" "Return a string object containing two hexadecimal digits for each byte in " "the buffer. ::" msgstr "" -#: ../../library/stdtypes.rst:3832 +#: ../../library/stdtypes.rst:3822 msgid "" "Similar to :meth:`bytes.hex`, :meth:`memoryview.hex` now supports optional " "*sep* and *bytes_per_sep* parameters to insert separators between bytes in " "the hex output." msgstr "" -#: ../../library/stdtypes.rst:3839 +#: ../../library/stdtypes.rst:3829 msgid "Return the data in the buffer as a list of elements. ::" msgstr "" -#: ../../library/stdtypes.rst:3849 +#: ../../library/stdtypes.rst:3839 msgid "" ":meth:`tolist` now supports all single character native formats in :mod:" "`struct` module syntax as well as multi-dimensional representations." msgstr "" -#: ../../library/stdtypes.rst:3856 +#: ../../library/stdtypes.rst:3846 msgid "" "Return a readonly version of the memoryview object. The original memoryview " "object is unchanged. ::" msgstr "" -#: ../../library/stdtypes.rst:3875 +#: ../../library/stdtypes.rst:3865 msgid "" "Release the underlying buffer exposed by the memoryview object. Many " "objects take special actions when a view is held on them (for example, a :" @@ -4159,20 +4147,20 @@ msgid "" "resources) as soon as possible." msgstr "" -#: ../../library/stdtypes.rst:3881 +#: ../../library/stdtypes.rst:3871 msgid "" "After this method has been called, any further operation on the view raises " "a :class:`ValueError` (except :meth:`release()` itself which can be called " "multiple times)::" msgstr "" -#: ../../library/stdtypes.rst:3892 +#: ../../library/stdtypes.rst:3882 msgid "" "The context management protocol can be used for a similar effect, using the " "``with`` statement::" msgstr "" -#: ../../library/stdtypes.rst:3908 +#: ../../library/stdtypes.rst:3898 msgid "" "Cast a memoryview to a new format or shape. *shape* defaults to " "``[byte_length//new_itemsize]``, which means that the result view will be " @@ -4181,57 +4169,57 @@ msgid "" "contiguous -> 1D." msgstr "" -#: ../../library/stdtypes.rst:3914 +#: ../../library/stdtypes.rst:3904 msgid "" "The destination format is restricted to a single element native format in :" "mod:`struct` syntax. One of the formats must be a byte format ('B', 'b' or " "'c'). The byte length of the result must be the same as the original length." msgstr "" -#: ../../library/stdtypes.rst:3919 +#: ../../library/stdtypes.rst:3909 msgid "Cast 1D/long to 1D/unsigned bytes::" msgstr "" -#: ../../library/stdtypes.rst:3942 +#: ../../library/stdtypes.rst:3932 msgid "Cast 1D/unsigned bytes to 1D/char::" msgstr "" -#: ../../library/stdtypes.rst:3955 +#: ../../library/stdtypes.rst:3945 msgid "Cast 1D/bytes to 3D/ints to 1D/signed char::" msgstr "" -#: ../../library/stdtypes.rst:3981 +#: ../../library/stdtypes.rst:3971 msgid "Cast 1D/unsigned long to 2D/unsigned long::" msgstr "" -#: ../../library/stdtypes.rst:3995 +#: ../../library/stdtypes.rst:3985 msgid "The source format is no longer restricted when casting to a byte view." msgstr "" -#: ../../library/stdtypes.rst:3998 +#: ../../library/stdtypes.rst:3988 msgid "There are also several readonly attributes available:" msgstr "" -#: ../../library/stdtypes.rst:4002 +#: ../../library/stdtypes.rst:3992 msgid "The underlying object of the memoryview::" msgstr "" -#: ../../library/stdtypes.rst:4013 +#: ../../library/stdtypes.rst:4003 msgid "" "``nbytes == product(shape) * itemsize == len(m.tobytes())``. This is the " "amount of space in bytes that the array would use in a contiguous " "representation. It is not necessarily equal to ``len(m)``::" msgstr "" -#: ../../library/stdtypes.rst:4032 +#: ../../library/stdtypes.rst:4022 msgid "Multi-dimensional arrays::" msgstr "" -#: ../../library/stdtypes.rst:4049 +#: ../../library/stdtypes.rst:4039 msgid "A bool indicating whether the memory is read only." msgstr "" -#: ../../library/stdtypes.rst:4053 +#: ../../library/stdtypes.rst:4043 msgid "" "A string containing the format (in :mod:`struct` module style) for each " "element in the view. A memoryview can be created from exporters with " @@ -4239,59 +4227,59 @@ msgid "" "restricted to native single element formats." msgstr "" -#: ../../library/stdtypes.rst:4058 +#: ../../library/stdtypes.rst:4048 msgid "" "format ``'B'`` is now handled according to the struct module syntax. This " "means that ``memoryview(b'abc')[0] == b'abc'[0] == 97``." msgstr "" -#: ../../library/stdtypes.rst:4064 +#: ../../library/stdtypes.rst:4054 msgid "The size in bytes of each element of the memoryview::" msgstr "" -#: ../../library/stdtypes.rst:4077 +#: ../../library/stdtypes.rst:4067 msgid "" "An integer indicating how many dimensions of a multi-dimensional array the " "memory represents." msgstr "" -#: ../../library/stdtypes.rst:4082 +#: ../../library/stdtypes.rst:4072 msgid "" "A tuple of integers the length of :attr:`ndim` giving the shape of the " "memory as an N-dimensional array." msgstr "" -#: ../../library/stdtypes.rst:4085 ../../library/stdtypes.rst:4093 +#: ../../library/stdtypes.rst:4075 ../../library/stdtypes.rst:4083 msgid "An empty tuple instead of ``None`` when ndim = 0." msgstr "" -#: ../../library/stdtypes.rst:4090 +#: ../../library/stdtypes.rst:4080 msgid "" "A tuple of integers the length of :attr:`ndim` giving the size in bytes to " "access each element for each dimension of the array." msgstr "" -#: ../../library/stdtypes.rst:4098 +#: ../../library/stdtypes.rst:4088 msgid "Used internally for PIL-style arrays. The value is informational only." msgstr "" -#: ../../library/stdtypes.rst:4102 +#: ../../library/stdtypes.rst:4092 msgid "A bool indicating whether the memory is C-:term:`contiguous`." msgstr "" -#: ../../library/stdtypes.rst:4108 +#: ../../library/stdtypes.rst:4098 msgid "A bool indicating whether the memory is Fortran :term:`contiguous`." msgstr "" -#: ../../library/stdtypes.rst:4114 +#: ../../library/stdtypes.rst:4104 msgid "A bool indicating whether the memory is :term:`contiguous`." msgstr "" -#: ../../library/stdtypes.rst:4122 +#: ../../library/stdtypes.rst:4112 msgid "Set Types --- :class:`set`, :class:`frozenset`" msgstr "" -#: ../../library/stdtypes.rst:4126 +#: ../../library/stdtypes.rst:4116 msgid "" "A :dfn:`set` object is an unordered collection of distinct :term:`hashable` " "objects. Common uses include membership testing, removing duplicates from a " @@ -4301,7 +4289,7 @@ msgid "" "`collections` module.)" msgstr "" -#: ../../library/stdtypes.rst:4133 +#: ../../library/stdtypes.rst:4123 msgid "" "Like other collections, sets support ``x in set``, ``len(set)``, and ``for x " "in set``. Being an unordered collection, sets do not record element " @@ -4309,7 +4297,7 @@ msgid "" "slicing, or other sequence-like behavior." msgstr "" -#: ../../library/stdtypes.rst:4138 +#: ../../library/stdtypes.rst:4128 msgid "" "There are currently two built-in set types, :class:`set` and :class:" "`frozenset`. The :class:`set` type is mutable --- the contents can be " @@ -4321,18 +4309,18 @@ msgid "" "of another set." msgstr "" -#: ../../library/stdtypes.rst:4146 +#: ../../library/stdtypes.rst:4136 msgid "" "Non-empty sets (not frozensets) can be created by placing a comma-separated " "list of elements within braces, for example: ``{'jack', 'sjoerd'}``, in " "addition to the :class:`set` constructor." msgstr "" -#: ../../library/stdtypes.rst:4150 +#: ../../library/stdtypes.rst:4140 msgid "The constructors for both classes work the same:" msgstr "" -#: ../../library/stdtypes.rst:4155 +#: ../../library/stdtypes.rst:4145 msgid "" "Return a new set or frozenset object whose elements are taken from " "*iterable*. The elements of a set must be :term:`hashable`. To represent " @@ -4340,92 +4328,92 @@ msgid "" "*iterable* is not specified, a new empty set is returned." msgstr "" -#: ../../library/stdtypes.rst:4161 +#: ../../library/stdtypes.rst:4151 msgid "Sets can be created by several means:" msgstr "" -#: ../../library/stdtypes.rst:4163 +#: ../../library/stdtypes.rst:4153 msgid "" "Use a comma-separated list of elements within braces: ``{'jack', 'sjoerd'}``" msgstr "" -#: ../../library/stdtypes.rst:4164 +#: ../../library/stdtypes.rst:4154 msgid "" "Use a set comprehension: ``{c for c in 'abracadabra' if c not in 'abc'}``" msgstr "" -#: ../../library/stdtypes.rst:4165 +#: ../../library/stdtypes.rst:4155 msgid "" "Use the type constructor: ``set()``, ``set('foobar')``, ``set(['a', 'b', " "'foo'])``" msgstr "" -#: ../../library/stdtypes.rst:4167 +#: ../../library/stdtypes.rst:4157 msgid "" "Instances of :class:`set` and :class:`frozenset` provide the following " "operations:" msgstr "" -#: ../../library/stdtypes.rst:4172 +#: ../../library/stdtypes.rst:4162 msgid "Return the number of elements in set *s* (cardinality of *s*)." msgstr "" -#: ../../library/stdtypes.rst:4176 +#: ../../library/stdtypes.rst:4166 msgid "Test *x* for membership in *s*." msgstr "" -#: ../../library/stdtypes.rst:4180 +#: ../../library/stdtypes.rst:4170 msgid "Test *x* for non-membership in *s*." msgstr "" -#: ../../library/stdtypes.rst:4184 +#: ../../library/stdtypes.rst:4174 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:4190 +#: ../../library/stdtypes.rst:4180 msgid "Test whether every element in the set is in *other*." msgstr "" -#: ../../library/stdtypes.rst:4194 +#: ../../library/stdtypes.rst:4184 msgid "" "Test whether the set is a proper subset of *other*, that is, ``set <= other " "and set != other``." msgstr "" -#: ../../library/stdtypes.rst:4200 +#: ../../library/stdtypes.rst:4190 msgid "Test whether every element in *other* is in the set." msgstr "" -#: ../../library/stdtypes.rst:4204 +#: ../../library/stdtypes.rst:4194 msgid "" "Test whether the set is a proper superset of *other*, that is, ``set >= " "other and set != other``." msgstr "" -#: ../../library/stdtypes.rst:4210 +#: ../../library/stdtypes.rst:4200 msgid "Return a new set with elements from the set and all others." msgstr "" -#: ../../library/stdtypes.rst:4215 +#: ../../library/stdtypes.rst:4205 msgid "Return a new set with elements common to the set and all others." msgstr "" -#: ../../library/stdtypes.rst:4220 +#: ../../library/stdtypes.rst:4210 msgid "Return a new set with elements in the set that are not in the others." msgstr "" -#: ../../library/stdtypes.rst:4225 +#: ../../library/stdtypes.rst:4215 msgid "" "Return a new set with elements in either the set or *other* but not both." msgstr "" -#: ../../library/stdtypes.rst:4229 +#: ../../library/stdtypes.rst:4219 msgid "Return a shallow copy of the set." msgstr "" -#: ../../library/stdtypes.rst:4232 +#: ../../library/stdtypes.rst:4222 msgid "" "Note, the non-operator versions of :meth:`union`, :meth:`intersection`, :" "meth:`difference`, :meth:`symmetric_difference`, :meth:`issubset`, and :meth:" @@ -4435,7 +4423,7 @@ msgid "" "the more readable ``set('abc').intersection('cbs')``." msgstr "" -#: ../../library/stdtypes.rst:4239 +#: ../../library/stdtypes.rst:4229 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 " @@ -4445,14 +4433,14 @@ msgid "" "set is a proper superset of the second set (is a superset, but is not equal)." msgstr "" -#: ../../library/stdtypes.rst:4246 +#: ../../library/stdtypes.rst:4236 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:4250 +#: ../../library/stdtypes.rst:4240 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 " @@ -4460,71 +4448,71 @@ msgid "" "``ab``." msgstr "" -#: ../../library/stdtypes.rst:4255 +#: ../../library/stdtypes.rst:4245 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:4258 +#: ../../library/stdtypes.rst:4248 msgid "Set elements, like dictionary keys, must be :term:`hashable`." msgstr "" -#: ../../library/stdtypes.rst:4260 +#: ../../library/stdtypes.rst:4250 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:4264 +#: ../../library/stdtypes.rst:4254 msgid "" "The following table lists operations available for :class:`set` that do not " "apply to immutable instances of :class:`frozenset`:" msgstr "" -#: ../../library/stdtypes.rst:4270 +#: ../../library/stdtypes.rst:4260 msgid "Update the set, adding elements from all others." msgstr "" -#: ../../library/stdtypes.rst:4275 +#: ../../library/stdtypes.rst:4265 msgid "Update the set, keeping only elements found in it and all others." msgstr "" -#: ../../library/stdtypes.rst:4280 +#: ../../library/stdtypes.rst:4270 msgid "Update the set, removing elements found in others." msgstr "" -#: ../../library/stdtypes.rst:4285 +#: ../../library/stdtypes.rst:4275 msgid "" "Update the set, keeping only elements found in either set, but not in both." msgstr "" -#: ../../library/stdtypes.rst:4289 +#: ../../library/stdtypes.rst:4279 msgid "Add element *elem* to the set." msgstr "" -#: ../../library/stdtypes.rst:4293 +#: ../../library/stdtypes.rst:4283 msgid "" "Remove element *elem* from the set. Raises :exc:`KeyError` if *elem* is not " "contained in the set." msgstr "" -#: ../../library/stdtypes.rst:4298 +#: ../../library/stdtypes.rst:4288 msgid "Remove element *elem* from the set if it is present." msgstr "" -#: ../../library/stdtypes.rst:4302 +#: ../../library/stdtypes.rst:4292 msgid "" "Remove and return an arbitrary element from the set. Raises :exc:`KeyError` " "if the set is empty." msgstr "" -#: ../../library/stdtypes.rst:4307 +#: ../../library/stdtypes.rst:4297 msgid "Remove all elements from the set." msgstr "" -#: ../../library/stdtypes.rst:4310 +#: ../../library/stdtypes.rst:4300 msgid "" "Note, the non-operator versions of the :meth:`update`, :meth:" "`intersection_update`, :meth:`difference_update`, and :meth:" @@ -4532,18 +4520,18 @@ msgid "" "argument." msgstr "" -#: ../../library/stdtypes.rst:4315 +#: ../../library/stdtypes.rst:4305 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:4323 +#: ../../library/stdtypes.rst:4313 msgid "Mapping Types --- :class:`dict`" msgstr "" -#: ../../library/stdtypes.rst:4333 +#: ../../library/stdtypes.rst:4323 msgid "" "A :term:`mapping` object maps :term:`hashable` values to arbitrary objects. " "Mappings are mutable objects. There is currently only one standard mapping " @@ -4552,7 +4540,7 @@ msgid "" "module.)" msgstr "" -#: ../../library/stdtypes.rst:4339 +#: ../../library/stdtypes.rst:4329 msgid "" "A dictionary's keys are *almost* arbitrary values. Values that are not :" "term:`hashable`, that is, values containing lists, dictionaries or other " @@ -4564,33 +4552,33 @@ msgid "" "approximations it is usually unwise to use them as dictionary keys.)" msgstr "" -#: ../../library/stdtypes.rst:4352 +#: ../../library/stdtypes.rst:4342 msgid "" "Return a new dictionary initialized from an optional positional argument and " "a possibly empty set of keyword arguments." msgstr "" -#: ../../library/stdtypes.rst:4355 +#: ../../library/stdtypes.rst:4345 msgid "Dictionaries can be created by several means:" msgstr "" -#: ../../library/stdtypes.rst:4357 +#: ../../library/stdtypes.rst:4347 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:4359 +#: ../../library/stdtypes.rst:4349 msgid "Use a dict comprehension: ``{}``, ``{x: x ** 2 for x in range(10)}``" msgstr "" -#: ../../library/stdtypes.rst:4360 +#: ../../library/stdtypes.rst:4350 msgid "" "Use the type constructor: ``dict()``, ``dict([('foo', 100), ('bar', " "200)])``, ``dict(foo=100, bar=200)``" msgstr "" -#: ../../library/stdtypes.rst:4363 +#: ../../library/stdtypes.rst:4353 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 " @@ -4602,7 +4590,7 @@ msgid "" "value for that key becomes the corresponding value in the new dictionary." msgstr "" -#: ../../library/stdtypes.rst:4373 +#: ../../library/stdtypes.rst:4363 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 " @@ -4610,39 +4598,39 @@ msgid "" "the value from the positional argument." msgstr "" -#: ../../library/stdtypes.rst:4378 +#: ../../library/stdtypes.rst:4368 msgid "" "To illustrate, the following examples all return a dictionary equal to " "``{\"one\": 1, \"two\": 2, \"three\": 3}``::" msgstr "" -#: ../../library/stdtypes.rst:4390 +#: ../../library/stdtypes.rst:4380 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:4394 +#: ../../library/stdtypes.rst:4384 msgid "" "These are the operations that dictionaries support (and therefore, custom " "mapping types should support too):" msgstr "" -#: ../../library/stdtypes.rst:4399 +#: ../../library/stdtypes.rst:4389 msgid "Return a list of all the keys used in the dictionary *d*." msgstr "" -#: ../../library/stdtypes.rst:4403 +#: ../../library/stdtypes.rst:4393 msgid "Return the number of items in the dictionary *d*." msgstr "" -#: ../../library/stdtypes.rst:4407 +#: ../../library/stdtypes.rst:4397 msgid "" "Return the item of *d* with key *key*. Raises a :exc:`KeyError` if *key* is " "not in the map." msgstr "" -#: ../../library/stdtypes.rst:4412 +#: ../../library/stdtypes.rst:4402 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 " @@ -4653,51 +4641,51 @@ msgid "" "an instance variable::" msgstr "" -#: ../../library/stdtypes.rst:4430 +#: ../../library/stdtypes.rst:4420 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:4436 +#: ../../library/stdtypes.rst:4426 msgid "Set ``d[key]`` to *value*." msgstr "" -#: ../../library/stdtypes.rst:4440 +#: ../../library/stdtypes.rst:4430 msgid "" "Remove ``d[key]`` from *d*. Raises a :exc:`KeyError` if *key* is not in the " "map." msgstr "" -#: ../../library/stdtypes.rst:4445 +#: ../../library/stdtypes.rst:4435 msgid "Return ``True`` if *d* has a key *key*, else ``False``." msgstr "" -#: ../../library/stdtypes.rst:4449 +#: ../../library/stdtypes.rst:4439 msgid "Equivalent to ``not key in d``." msgstr "" -#: ../../library/stdtypes.rst:4453 +#: ../../library/stdtypes.rst:4443 msgid "" "Return an iterator over the keys of the dictionary. This is a shortcut for " "``iter(d.keys())``." msgstr "" -#: ../../library/stdtypes.rst:4458 +#: ../../library/stdtypes.rst:4448 msgid "Remove all items from the dictionary." msgstr "" -#: ../../library/stdtypes.rst:4462 +#: ../../library/stdtypes.rst:4452 msgid "Return a shallow copy of the dictionary." msgstr "" -#: ../../library/stdtypes.rst:4466 +#: ../../library/stdtypes.rst:4456 msgid "" "Create a new dictionary with keys from *iterable* and values set to *value*." msgstr "" -#: ../../library/stdtypes.rst:4468 +#: ../../library/stdtypes.rst:4458 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 " @@ -4706,70 +4694,70 @@ msgid "" "` instead." msgstr "" -#: ../../library/stdtypes.rst:4476 +#: ../../library/stdtypes.rst:4466 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:4482 +#: ../../library/stdtypes.rst:4472 msgid "" "Return a new view of the dictionary's items (``(key, value)`` pairs). See " "the :ref:`documentation of view objects `." msgstr "" -#: ../../library/stdtypes.rst:4487 +#: ../../library/stdtypes.rst:4477 msgid "" "Return a new view of the dictionary's keys. See the :ref:`documentation of " "view objects `." msgstr "" -#: ../../library/stdtypes.rst:4492 +#: ../../library/stdtypes.rst:4482 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:4498 +#: ../../library/stdtypes.rst:4488 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:4501 +#: ../../library/stdtypes.rst:4491 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:4505 +#: ../../library/stdtypes.rst:4495 msgid "" "LIFO order is now guaranteed. In prior versions, :meth:`popitem` would " "return an arbitrary key/value pair." msgstr "" -#: ../../library/stdtypes.rst:4511 +#: ../../library/stdtypes.rst:4501 msgid "" "Return a reverse iterator over the keys of the dictionary. This is a " "shortcut for ``reversed(d.keys())``." msgstr "" -#: ../../library/stdtypes.rst:4518 +#: ../../library/stdtypes.rst:4508 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:4524 +#: ../../library/stdtypes.rst:4514 msgid "" "Update the dictionary with the key/value pairs from *other*, overwriting " "existing keys. Return ``None``." msgstr "" -#: ../../library/stdtypes.rst:4527 +#: ../../library/stdtypes.rst:4517 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 " @@ -4777,71 +4765,71 @@ msgid "" "pairs: ``d.update(red=1, blue=2)``." msgstr "" -#: ../../library/stdtypes.rst:4534 +#: ../../library/stdtypes.rst:4524 msgid "" "Return a new view of the dictionary's values. See the :ref:`documentation " "of view objects `." msgstr "" -#: ../../library/stdtypes.rst:4537 +#: ../../library/stdtypes.rst:4527 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:4547 +#: ../../library/stdtypes.rst:4537 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:4555 +#: ../../library/stdtypes.rst:4545 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:4561 +#: ../../library/stdtypes.rst:4551 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:4565 +#: ../../library/stdtypes.rst:4555 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:4583 +#: ../../library/stdtypes.rst:4573 msgid "" "Dictionary order is guaranteed to be insertion order. This behavior was an " "implementation detail of CPython from 3.6." msgstr "" -#: ../../library/stdtypes.rst:4587 +#: ../../library/stdtypes.rst:4577 msgid "Dictionaries and dictionary views are reversible. ::" msgstr "" -#: ../../library/stdtypes.rst:4599 +#: ../../library/stdtypes.rst:4589 msgid "Dictionaries are now reversible." msgstr "" -#: ../../library/stdtypes.rst:4604 +#: ../../library/stdtypes.rst:4594 msgid "" ":class:`types.MappingProxyType` can be used to create a read-only view of a :" "class:`dict`." msgstr "" -#: ../../library/stdtypes.rst:4611 +#: ../../library/stdtypes.rst:4601 msgid "Dictionary view objects" msgstr "字典視圖物件" -#: ../../library/stdtypes.rst:4613 +#: ../../library/stdtypes.rst:4603 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 " @@ -4849,23 +4837,23 @@ msgid "" "reflects these changes." msgstr "" -#: ../../library/stdtypes.rst:4618 +#: ../../library/stdtypes.rst:4608 msgid "" "Dictionary views can be iterated over to yield their respective data, and " "support membership tests:" msgstr "" -#: ../../library/stdtypes.rst:4623 +#: ../../library/stdtypes.rst:4613 msgid "Return the number of entries in the dictionary." msgstr "" -#: ../../library/stdtypes.rst:4627 +#: ../../library/stdtypes.rst:4617 msgid "" "Return an iterator over the keys, values or items (represented as tuples of " "``(key, value)``) in the dictionary." msgstr "" -#: ../../library/stdtypes.rst:4630 +#: ../../library/stdtypes.rst:4620 msgid "" "Keys and values are iterated over in insertion order. This allows the " "creation of ``(value, key)`` pairs using :func:`zip`: ``pairs = zip(d." @@ -4873,39 +4861,39 @@ msgid "" "[(v, k) for (k, v) in d.items()]``." msgstr "" -#: ../../library/stdtypes.rst:4635 +#: ../../library/stdtypes.rst:4625 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:4638 +#: ../../library/stdtypes.rst:4628 msgid "Dictionary order is guaranteed to be insertion order." msgstr "" -#: ../../library/stdtypes.rst:4643 +#: ../../library/stdtypes.rst:4633 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:4648 +#: ../../library/stdtypes.rst:4638 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:4651 +#: ../../library/stdtypes.rst:4641 msgid "Dictionary views are now reversible." msgstr "" -#: ../../library/stdtypes.rst:4656 +#: ../../library/stdtypes.rst:4646 msgid "" "Return a :class:`types.MappingProxyType` that wraps the original dictionary " "to which the view refers." msgstr "" -#: ../../library/stdtypes.rst:4661 +#: ../../library/stdtypes.rst:4651 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, " @@ -4915,15 +4903,15 @@ msgid "" "abc.Set` are available (for example, ``==``, ``<``, or ``^``)." msgstr "" -#: ../../library/stdtypes.rst:4668 +#: ../../library/stdtypes.rst:4658 msgid "An example of dictionary view usage::" msgstr "" -#: ../../library/stdtypes.rst:4709 +#: ../../library/stdtypes.rst:4699 msgid "Context Manager Types" msgstr "" -#: ../../library/stdtypes.rst:4716 +#: ../../library/stdtypes.rst:4706 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 " @@ -4931,7 +4919,7 @@ msgid "" "before the statement body is executed and exited when the statement ends:" msgstr "" -#: ../../library/stdtypes.rst:4724 +#: ../../library/stdtypes.rst:4714 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 " @@ -4939,14 +4927,14 @@ msgid "" "using this context manager." msgstr "" -#: ../../library/stdtypes.rst:4729 +#: ../../library/stdtypes.rst:4719 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:4733 +#: ../../library/stdtypes.rst:4723 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 " @@ -4956,7 +4944,7 @@ msgid "" "the :keyword:`!with` statement." msgstr "" -#: ../../library/stdtypes.rst:4743 +#: ../../library/stdtypes.rst:4733 msgid "" "Exit the runtime context and return a Boolean flag indicating if any " "exception that occurred should be suppressed. If an exception occurred while " @@ -4965,7 +4953,7 @@ msgid "" "arguments are ``None``." msgstr "" -#: ../../library/stdtypes.rst:4748 +#: ../../library/stdtypes.rst:4738 msgid "" "Returning a true value from this method will cause the :keyword:`with` " "statement to suppress the exception and continue execution with the " @@ -4976,7 +4964,7 @@ msgid "" "statement." msgstr "" -#: ../../library/stdtypes.rst:4755 +#: ../../library/stdtypes.rst:4745 msgid "" "The exception passed in should never be reraised explicitly - instead, this " "method should return a false value to indicate that the method completed " @@ -4985,7 +4973,7 @@ msgid "" "method has actually failed." msgstr "" -#: ../../library/stdtypes.rst:4761 +#: ../../library/stdtypes.rst:4751 msgid "" "Python defines several context managers to support easy thread " "synchronisation, prompt closure of files or other objects, and simpler " @@ -4994,7 +4982,7 @@ msgid "" "management protocol. See the :mod:`contextlib` module for some examples." msgstr "" -#: ../../library/stdtypes.rst:4767 +#: ../../library/stdtypes.rst:4757 msgid "" "Python's :term:`generator`\\s and the :class:`contextlib.contextmanager` " "decorator provide a convenient way to implement these protocols. If a " @@ -5004,7 +4992,7 @@ msgid "" "rather than the iterator produced by an undecorated generator function." msgstr "" -#: ../../library/stdtypes.rst:4774 +#: ../../library/stdtypes.rst:4764 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 " @@ -5013,23 +5001,23 @@ msgid "" "a single class dictionary lookup is negligible." msgstr "" -#: ../../library/stdtypes.rst:4782 +#: ../../library/stdtypes.rst:4772 msgid "" "Type Annotation Types --- :ref:`Generic Alias `, :ref:" "`Union `" msgstr "" -#: ../../library/stdtypes.rst:4787 +#: ../../library/stdtypes.rst:4777 msgid "" "The core built-in types for :term:`type annotations ` are :ref:" "`Generic Alias ` and :ref:`Union `." msgstr "" -#: ../../library/stdtypes.rst:4794 +#: ../../library/stdtypes.rst:4784 msgid "Generic Alias Type" msgstr "" -#: ../../library/stdtypes.rst:4800 +#: ../../library/stdtypes.rst:4790 msgid "" "``GenericAlias`` objects are generally created by :ref:`subscripting " "` a class. They are most often used with :ref:`container " @@ -5039,19 +5027,19 @@ msgid "" "are intended primarily for use with :term:`type annotations `." msgstr "" -#: ../../library/stdtypes.rst:4810 +#: ../../library/stdtypes.rst:4800 msgid "" "It is generally only possible to subscript a class if the class implements " "the special method :meth:`~object.__class_getitem__`." msgstr "" -#: ../../library/stdtypes.rst:4813 +#: ../../library/stdtypes.rst:4803 msgid "" "A ``GenericAlias`` object acts as a proxy for a :term:`generic type`, " "implementing *parameterized generics*." msgstr "" -#: ../../library/stdtypes.rst:4816 +#: ../../library/stdtypes.rst:4806 msgid "" "For a container class, the argument(s) supplied to a :ref:`subscription " "` of the class may indicate the type(s) of the elements an " @@ -5060,7 +5048,7 @@ msgid "" "`bytes`." msgstr "" -#: ../../library/stdtypes.rst:4822 +#: ../../library/stdtypes.rst:4812 msgid "" "For a class which defines :meth:`~object.__class_getitem__` but is not a " "container, the argument(s) supplied to a subscription of the class will " @@ -5069,7 +5057,7 @@ msgid "" "the :class:`str` data type and the :class:`bytes` data type:" msgstr "" -#: ../../library/stdtypes.rst:4828 +#: ../../library/stdtypes.rst:4818 msgid "" "If ``x = re.search('foo', 'foo')``, ``x`` will be a :ref:`re.Match ` object where the return values of ``x.group(0)`` and ``x[0]`` will " @@ -5077,7 +5065,7 @@ msgid "" "annotations with the ``GenericAlias`` ``re.Match[str]``." msgstr "" -#: ../../library/stdtypes.rst:4834 +#: ../../library/stdtypes.rst:4824 msgid "" "If ``y = re.search(b'bar', b'bar')``, (note the ``b`` for :class:`bytes`), " "``y`` will also be an instance of ``re.Match``, but the return values of ``y." @@ -5086,21 +5074,21 @@ msgid "" "objects>` objects with ``re.Match[bytes]``." msgstr "" -#: ../../library/stdtypes.rst:4840 +#: ../../library/stdtypes.rst:4830 msgid "" "``GenericAlias`` objects are instances of the class :class:`types." "GenericAlias`, which can also be used to create ``GenericAlias`` objects " "directly." msgstr "" -#: ../../library/stdtypes.rst:4846 +#: ../../library/stdtypes.rst:4836 msgid "" "Creates a ``GenericAlias`` representing a type ``T`` parameterized by 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:4854 +#: ../../library/stdtypes.rst:4844 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 " @@ -5108,13 +5096,13 @@ msgid "" "of type :class:`str` and values of type :class:`int`::" msgstr "" -#: ../../library/stdtypes.rst:4862 +#: ../../library/stdtypes.rst:4852 msgid "" "The builtin functions :func:`isinstance` and :func:`issubclass` do not " "accept ``GenericAlias`` types for their second argument::" msgstr "" -#: ../../library/stdtypes.rst:4870 +#: ../../library/stdtypes.rst:4860 msgid "" "The Python runtime does not enforce :term:`type annotations `. " "This extends to generic types and their type parameters. When creating a " @@ -5123,325 +5111,325 @@ msgid "" "discouraged, but will run without errors::" msgstr "" -#: ../../library/stdtypes.rst:4880 +#: ../../library/stdtypes.rst:4870 msgid "" "Furthermore, parameterized generics erase type parameters during object " "creation::" msgstr "" -#: ../../library/stdtypes.rst:4891 +#: ../../library/stdtypes.rst:4881 msgid "" "Calling :func:`repr` or :func:`str` on a generic shows the parameterized " "type::" msgstr "" -#: ../../library/stdtypes.rst:4899 +#: ../../library/stdtypes.rst:4889 msgid "" "The :meth:`~object.__getitem__` method of generic containers will raise an " "exception to disallow mistakes like ``dict[str][str]``::" msgstr "" -#: ../../library/stdtypes.rst:4907 +#: ../../library/stdtypes.rst:4897 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:`~genericalias.__args__`. ::" msgstr "" -#: ../../library/stdtypes.rst:4918 +#: ../../library/stdtypes.rst:4908 msgid "Standard Generic Classes" msgstr "" -#: ../../library/stdtypes.rst:4920 +#: ../../library/stdtypes.rst:4910 msgid "" "The following standard library classes support parameterized generics. This " "list is non-exhaustive." msgstr "" -#: ../../library/stdtypes.rst:4923 +#: ../../library/stdtypes.rst:4913 msgid ":class:`tuple`" msgstr ":class:`tuple`" -#: ../../library/stdtypes.rst:4924 +#: ../../library/stdtypes.rst:4914 msgid ":class:`list`" msgstr ":class:`list`" -#: ../../library/stdtypes.rst:4925 +#: ../../library/stdtypes.rst:4915 msgid ":class:`dict`" msgstr ":class:`dict`" -#: ../../library/stdtypes.rst:4926 +#: ../../library/stdtypes.rst:4916 msgid ":class:`set`" msgstr ":class:`set`" -#: ../../library/stdtypes.rst:4927 +#: ../../library/stdtypes.rst:4917 msgid ":class:`frozenset`" msgstr ":class:`frozenset`" -#: ../../library/stdtypes.rst:4928 +#: ../../library/stdtypes.rst:4918 msgid ":class:`type`" msgstr ":class:`type`" -#: ../../library/stdtypes.rst:4929 +#: ../../library/stdtypes.rst:4919 msgid ":class:`collections.deque`" msgstr ":class:`collections.deque`" -#: ../../library/stdtypes.rst:4930 +#: ../../library/stdtypes.rst:4920 msgid ":class:`collections.defaultdict`" msgstr ":class:`collections.defaultdict`" -#: ../../library/stdtypes.rst:4931 +#: ../../library/stdtypes.rst:4921 msgid ":class:`collections.OrderedDict`" msgstr ":class:`collections.OrderedDict`" -#: ../../library/stdtypes.rst:4932 +#: ../../library/stdtypes.rst:4922 msgid ":class:`collections.Counter`" msgstr ":class:`collections.Counter`" -#: ../../library/stdtypes.rst:4933 +#: ../../library/stdtypes.rst:4923 msgid ":class:`collections.ChainMap`" msgstr ":class:`collections.ChainMap`" -#: ../../library/stdtypes.rst:4934 +#: ../../library/stdtypes.rst:4924 msgid ":class:`collections.abc.Awaitable`" msgstr ":class:`collections.abc.Awaitable`" -#: ../../library/stdtypes.rst:4935 +#: ../../library/stdtypes.rst:4925 msgid ":class:`collections.abc.Coroutine`" msgstr ":class:`collections.abc.Coroutine`" -#: ../../library/stdtypes.rst:4936 +#: ../../library/stdtypes.rst:4926 msgid ":class:`collections.abc.AsyncIterable`" msgstr ":class:`collections.abc.AsyncIterable`" -#: ../../library/stdtypes.rst:4937 +#: ../../library/stdtypes.rst:4927 msgid ":class:`collections.abc.AsyncIterator`" msgstr ":class:`collections.abc.AsyncIterator`" -#: ../../library/stdtypes.rst:4938 +#: ../../library/stdtypes.rst:4928 msgid ":class:`collections.abc.AsyncGenerator`" msgstr ":class:`collections.abc.AsyncGenerator`" -#: ../../library/stdtypes.rst:4939 +#: ../../library/stdtypes.rst:4929 msgid ":class:`collections.abc.Iterable`" msgstr ":class:`collections.abc.Iterable`" -#: ../../library/stdtypes.rst:4940 +#: ../../library/stdtypes.rst:4930 msgid ":class:`collections.abc.Iterator`" msgstr ":class:`collections.abc.Iterator`" -#: ../../library/stdtypes.rst:4941 +#: ../../library/stdtypes.rst:4931 msgid ":class:`collections.abc.Generator`" msgstr ":class:`collections.abc.Generator`" -#: ../../library/stdtypes.rst:4942 +#: ../../library/stdtypes.rst:4932 msgid ":class:`collections.abc.Reversible`" msgstr ":class:`collections.abc.Reversible`" -#: ../../library/stdtypes.rst:4943 +#: ../../library/stdtypes.rst:4933 msgid ":class:`collections.abc.Container`" msgstr ":class:`collections.abc.Container`" -#: ../../library/stdtypes.rst:4944 +#: ../../library/stdtypes.rst:4934 msgid ":class:`collections.abc.Collection`" msgstr ":class:`collections.abc.Collection`" -#: ../../library/stdtypes.rst:4945 +#: ../../library/stdtypes.rst:4935 msgid ":class:`collections.abc.Callable`" msgstr ":class:`collections.abc.Callable`" -#: ../../library/stdtypes.rst:4946 +#: ../../library/stdtypes.rst:4936 msgid ":class:`collections.abc.Set`" msgstr ":class:`collections.abc.Set`" -#: ../../library/stdtypes.rst:4947 +#: ../../library/stdtypes.rst:4937 msgid ":class:`collections.abc.MutableSet`" msgstr ":class:`collections.abc.MutableSet`" -#: ../../library/stdtypes.rst:4948 +#: ../../library/stdtypes.rst:4938 msgid ":class:`collections.abc.Mapping`" msgstr ":class:`collections.abc.Mapping`" -#: ../../library/stdtypes.rst:4949 +#: ../../library/stdtypes.rst:4939 msgid ":class:`collections.abc.MutableMapping`" msgstr ":class:`collections.abc.MutableMapping`" -#: ../../library/stdtypes.rst:4950 +#: ../../library/stdtypes.rst:4940 msgid ":class:`collections.abc.Sequence`" msgstr ":class:`collections.abc.Sequence`" -#: ../../library/stdtypes.rst:4951 +#: ../../library/stdtypes.rst:4941 msgid ":class:`collections.abc.MutableSequence`" msgstr ":class:`collections.abc.MutableSequence`" -#: ../../library/stdtypes.rst:4952 +#: ../../library/stdtypes.rst:4942 msgid ":class:`collections.abc.ByteString`" msgstr ":class:`collections.abc.ByteString`" -#: ../../library/stdtypes.rst:4953 +#: ../../library/stdtypes.rst:4943 msgid ":class:`collections.abc.MappingView`" msgstr ":class:`collections.abc.MappingView`" -#: ../../library/stdtypes.rst:4954 +#: ../../library/stdtypes.rst:4944 msgid ":class:`collections.abc.KeysView`" msgstr ":class:`collections.abc.KeysView`" -#: ../../library/stdtypes.rst:4955 +#: ../../library/stdtypes.rst:4945 msgid ":class:`collections.abc.ItemsView`" msgstr ":class:`collections.abc.ItemsView`" -#: ../../library/stdtypes.rst:4956 +#: ../../library/stdtypes.rst:4946 msgid ":class:`collections.abc.ValuesView`" msgstr ":class:`collections.abc.ValuesView`" -#: ../../library/stdtypes.rst:4957 +#: ../../library/stdtypes.rst:4947 msgid ":class:`contextlib.AbstractContextManager`" msgstr ":class:`contextlib.AbstractContextManager`" -#: ../../library/stdtypes.rst:4958 +#: ../../library/stdtypes.rst:4948 msgid ":class:`contextlib.AbstractAsyncContextManager`" msgstr ":class:`contextlib.AbstractAsyncContextManager`" -#: ../../library/stdtypes.rst:4959 +#: ../../library/stdtypes.rst:4949 msgid ":class:`dataclasses.Field`" msgstr ":class:`dataclasses.Field`" -#: ../../library/stdtypes.rst:4960 +#: ../../library/stdtypes.rst:4950 msgid ":class:`functools.cached_property`" msgstr ":class:`functools.cached_property`" -#: ../../library/stdtypes.rst:4961 +#: ../../library/stdtypes.rst:4951 msgid ":class:`functools.partialmethod`" msgstr ":class:`functools.partialmethod`" -#: ../../library/stdtypes.rst:4962 +#: ../../library/stdtypes.rst:4952 msgid ":class:`os.PathLike`" msgstr ":class:`os.PathLike`" -#: ../../library/stdtypes.rst:4963 +#: ../../library/stdtypes.rst:4953 msgid ":class:`queue.LifoQueue`" msgstr ":class:`queue.LifoQueue`" -#: ../../library/stdtypes.rst:4964 +#: ../../library/stdtypes.rst:4954 msgid ":class:`queue.Queue`" msgstr ":class:`queue.Queue`" -#: ../../library/stdtypes.rst:4965 +#: ../../library/stdtypes.rst:4955 msgid ":class:`queue.PriorityQueue`" msgstr ":class:`queue.PriorityQueue`" -#: ../../library/stdtypes.rst:4966 +#: ../../library/stdtypes.rst:4956 msgid ":class:`queue.SimpleQueue`" msgstr ":class:`queue.SimpleQueue`" -#: ../../library/stdtypes.rst:4967 +#: ../../library/stdtypes.rst:4957 msgid ":ref:`re.Pattern `" msgstr ":ref:`re.Pattern `" -#: ../../library/stdtypes.rst:4968 +#: ../../library/stdtypes.rst:4958 msgid ":ref:`re.Match `" msgstr ":ref:`re.Match `" -#: ../../library/stdtypes.rst:4969 +#: ../../library/stdtypes.rst:4959 msgid ":class:`shelve.BsdDbShelf`" msgstr ":class:`shelve.BsdDbShelf`" -#: ../../library/stdtypes.rst:4970 +#: ../../library/stdtypes.rst:4960 msgid ":class:`shelve.DbfilenameShelf`" msgstr ":class:`shelve.DbfilenameShelf`" -#: ../../library/stdtypes.rst:4971 +#: ../../library/stdtypes.rst:4961 msgid ":class:`shelve.Shelf`" msgstr ":class:`shelve.Shelf`" -#: ../../library/stdtypes.rst:4972 +#: ../../library/stdtypes.rst:4962 msgid ":class:`types.MappingProxyType`" msgstr ":class:`types.MappingProxyType`" -#: ../../library/stdtypes.rst:4973 +#: ../../library/stdtypes.rst:4963 msgid ":class:`weakref.WeakKeyDictionary`" msgstr ":class:`weakref.WeakKeyDictionary`" -#: ../../library/stdtypes.rst:4974 +#: ../../library/stdtypes.rst:4964 msgid ":class:`weakref.WeakMethod`" msgstr ":class:`weakref.WeakMethod`" -#: ../../library/stdtypes.rst:4975 +#: ../../library/stdtypes.rst:4965 msgid ":class:`weakref.WeakSet`" msgstr ":class:`weakref.WeakSet`" -#: ../../library/stdtypes.rst:4976 +#: ../../library/stdtypes.rst:4966 msgid ":class:`weakref.WeakValueDictionary`" msgstr ":class:`weakref.WeakValueDictionary`" -#: ../../library/stdtypes.rst:4981 +#: ../../library/stdtypes.rst:4971 msgid "Special Attributes of ``GenericAlias`` objects" msgstr "" -#: ../../library/stdtypes.rst:4983 +#: ../../library/stdtypes.rst:4973 msgid "All parameterized generics implement special read-only attributes." msgstr "" -#: ../../library/stdtypes.rst:4987 +#: ../../library/stdtypes.rst:4977 msgid "This attribute points at the non-parameterized generic class::" msgstr "" -#: ../../library/stdtypes.rst:4995 +#: ../../library/stdtypes.rst:4985 msgid "" "This attribute is a :class:`tuple` (possibly of length 1) of generic types " "passed to the original :meth:`~object.__class_getitem__` of the generic " "class::" msgstr "" -#: ../../library/stdtypes.rst:5005 +#: ../../library/stdtypes.rst:4995 msgid "" "This attribute is a lazily computed tuple (possibly empty) of unique type " "variables found in ``__args__``::" msgstr "" -#: ../../library/stdtypes.rst:5016 +#: ../../library/stdtypes.rst:5006 msgid "" "A ``GenericAlias`` object with :class:`typing.ParamSpec` parameters may not " "have correct ``__parameters__`` after substitution because :class:`typing." "ParamSpec` is intended primarily for static type checking." msgstr "" -#: ../../library/stdtypes.rst:5023 +#: ../../library/stdtypes.rst:5013 msgid ":pep:`484` - Type Hints" msgstr "" -#: ../../library/stdtypes.rst:5023 +#: ../../library/stdtypes.rst:5013 msgid "Introducing Python's framework for type annotations." msgstr "" -#: ../../library/stdtypes.rst:5028 +#: ../../library/stdtypes.rst:5018 msgid ":pep:`585` - Type Hinting Generics In Standard Collections" msgstr "" -#: ../../library/stdtypes.rst:5026 +#: ../../library/stdtypes.rst:5016 msgid "" "Introducing the ability to natively parameterize standard-library classes, " "provided they implement the special class method :meth:`~object." "__class_getitem__`." msgstr "" -#: ../../library/stdtypes.rst:5031 +#: ../../library/stdtypes.rst:5021 msgid "" ":ref:`Generics`, :ref:`user-defined generics ` and :" "class:`typing.Generic`" msgstr "" -#: ../../library/stdtypes.rst:5031 +#: ../../library/stdtypes.rst:5021 msgid "" "Documentation on how to implement generic classes that can be parameterized " "at runtime and understood by static type-checkers." msgstr "" -#: ../../library/stdtypes.rst:5040 +#: ../../library/stdtypes.rst:5030 msgid "Union Type" msgstr "" -#: ../../library/stdtypes.rst:5046 +#: ../../library/stdtypes.rst:5036 msgid "" "A union object holds the value of the ``|`` (bitwise or) operation on " "multiple :ref:`type objects `. These types are intended " @@ -5450,7 +5438,7 @@ msgid "" "Union`." msgstr "" -#: ../../library/stdtypes.rst:5053 +#: ../../library/stdtypes.rst:5043 msgid "" "Defines a union object which holds types *X*, *Y*, and so forth. ``X | Y`` " "means either X or Y. It is equivalent to ``typing.Union[X, Y]``. For " @@ -5458,76 +5446,76 @@ msgid "" "class:`float`::" msgstr "" -#: ../../library/stdtypes.rst:5063 +#: ../../library/stdtypes.rst:5053 msgid "" "Union objects can be tested for equality with other union objects. Details:" msgstr "" -#: ../../library/stdtypes.rst:5065 +#: ../../library/stdtypes.rst:5055 msgid "Unions of unions are flattened::" msgstr "" -#: ../../library/stdtypes.rst:5069 +#: ../../library/stdtypes.rst:5059 msgid "Redundant types are removed::" msgstr "" -#: ../../library/stdtypes.rst:5073 +#: ../../library/stdtypes.rst:5063 msgid "When comparing unions, the order is ignored::" msgstr "" -#: ../../library/stdtypes.rst:5077 +#: ../../library/stdtypes.rst:5067 msgid "It is compatible with :data:`typing.Union`::" msgstr "" -#: ../../library/stdtypes.rst:5081 +#: ../../library/stdtypes.rst:5071 msgid "Optional types can be spelled as a union with ``None``::" msgstr "" -#: ../../library/stdtypes.rst:5088 +#: ../../library/stdtypes.rst:5078 msgid "" "Calls to :func:`isinstance` and :func:`issubclass` are also supported with a " "union object::" msgstr "" -#: ../../library/stdtypes.rst:5094 +#: ../../library/stdtypes.rst:5084 msgid "" "However, union objects containing :ref:`parameterized generics ` cannot be used::" msgstr "" -#: ../../library/stdtypes.rst:5102 +#: ../../library/stdtypes.rst:5092 msgid "" "The user-exposed type for the union object can be accessed from :data:`types." "UnionType` and used for :func:`isinstance` checks. An object cannot be " "instantiated from the type::" msgstr "" -#: ../../library/stdtypes.rst:5115 +#: ../../library/stdtypes.rst:5105 msgid "" "The :meth:`__or__` method for type objects was added to support the syntax " "``X | Y``. If a metaclass implements :meth:`__or__`, the Union may override " "it::" msgstr "" -#: ../../library/stdtypes.rst:5133 +#: ../../library/stdtypes.rst:5123 msgid ":pep:`604` -- PEP proposing the ``X | Y`` syntax and the Union type." msgstr "" -#: ../../library/stdtypes.rst:5141 +#: ../../library/stdtypes.rst:5131 msgid "Other Built-in Types" msgstr "" -#: ../../library/stdtypes.rst:5143 +#: ../../library/stdtypes.rst:5133 msgid "" "The interpreter supports several other kinds of objects. Most of these " "support only one or two operations." msgstr "" -#: ../../library/stdtypes.rst:5150 +#: ../../library/stdtypes.rst:5140 msgid "Modules" msgstr "模組" -#: ../../library/stdtypes.rst:5152 +#: ../../library/stdtypes.rst:5142 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 " @@ -5538,7 +5526,7 @@ msgid "" "*foo* somewhere.)" msgstr "" -#: ../../library/stdtypes.rst:5159 +#: ../../library/stdtypes.rst:5149 msgid "" "A special attribute of every module is :attr:`~object.__dict__`. This is the " "dictionary containing the module's symbol table. Modifying this dictionary " @@ -5549,32 +5537,32 @@ msgid "" "recommended." msgstr "" -#: ../../library/stdtypes.rst:5167 +#: ../../library/stdtypes.rst:5157 msgid "" "Modules built into the interpreter are written like this: ````. If loaded from a file, they are written as ````." msgstr "" -#: ../../library/stdtypes.rst:5175 +#: ../../library/stdtypes.rst:5165 msgid "Classes and Class Instances" msgstr "" -#: ../../library/stdtypes.rst:5177 +#: ../../library/stdtypes.rst:5167 msgid "See :ref:`objects` and :ref:`class` for these." msgstr "" -#: ../../library/stdtypes.rst:5183 +#: ../../library/stdtypes.rst:5173 msgid "Functions" msgstr "函式" -#: ../../library/stdtypes.rst:5185 +#: ../../library/stdtypes.rst:5175 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:5188 +#: ../../library/stdtypes.rst:5178 msgid "" "There are really two flavors of function objects: built-in functions and " "user-defined functions. Both support the same operation (to call the " @@ -5582,15 +5570,15 @@ msgid "" "types." msgstr "" -#: ../../library/stdtypes.rst:5192 +#: ../../library/stdtypes.rst:5182 msgid "See :ref:`function` for more information." msgstr "更多資訊請見 :ref:`function`\\ 。" -#: ../../library/stdtypes.rst:5198 +#: ../../library/stdtypes.rst:5188 msgid "Methods" msgstr "" -#: ../../library/stdtypes.rst:5202 +#: ../../library/stdtypes.rst:5192 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 " @@ -5598,7 +5586,7 @@ msgid "" "support them." msgstr "" -#: ../../library/stdtypes.rst:5207 +#: ../../library/stdtypes.rst:5197 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:" @@ -5610,7 +5598,7 @@ msgid "" "arg-2, ..., arg-n)``." msgstr "" -#: ../../library/stdtypes.rst:5216 +#: ../../library/stdtypes.rst:5206 msgid "" "Like function objects, bound method objects support getting arbitrary " "attributes. However, since method attributes are actually stored on the " @@ -5620,15 +5608,15 @@ msgid "" "attribute, you need to explicitly set it on the underlying function object::" msgstr "" -#: ../../library/stdtypes.rst:5236 ../../library/stdtypes.rst:5267 +#: ../../library/stdtypes.rst:5226 ../../library/stdtypes.rst:5257 msgid "See :ref:`types` for more information." msgstr "更多資訊請見 :ref:`types`\\ 。" -#: ../../library/stdtypes.rst:5244 +#: ../../library/stdtypes.rst:5234 msgid "Code Objects" msgstr "" -#: ../../library/stdtypes.rst:5250 +#: ../../library/stdtypes.rst:5240 msgid "" "Code objects are used by the implementation to represent \"pseudo-compiled\" " "executable Python code such as a function body. They differ from function " @@ -5638,23 +5626,23 @@ msgid "" "`__code__` attribute. See also the :mod:`code` module." msgstr "" -#: ../../library/stdtypes.rst:5257 +#: ../../library/stdtypes.rst:5247 msgid "" "Accessing ``__code__`` raises an :ref:`auditing event ` ``object." "__getattr__`` with arguments ``obj`` and ``\"__code__\"``." msgstr "" -#: ../../library/stdtypes.rst:5264 +#: ../../library/stdtypes.rst:5254 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:5273 +#: ../../library/stdtypes.rst:5263 msgid "Type Objects" msgstr "" -#: ../../library/stdtypes.rst:5279 +#: ../../library/stdtypes.rst:5269 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 " @@ -5662,30 +5650,30 @@ msgid "" "standard built-in types." msgstr "" -#: ../../library/stdtypes.rst:5284 +#: ../../library/stdtypes.rst:5274 msgid "Types are written like this: ````." msgstr "" -#: ../../library/stdtypes.rst:5290 +#: ../../library/stdtypes.rst:5280 msgid "The Null Object" msgstr "" -#: ../../library/stdtypes.rst:5292 +#: ../../library/stdtypes.rst:5282 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:5296 +#: ../../library/stdtypes.rst:5286 msgid "It is written as ``None``." msgstr "" -#: ../../library/stdtypes.rst:5303 +#: ../../library/stdtypes.rst:5293 msgid "The Ellipsis Object" msgstr "" -#: ../../library/stdtypes.rst:5305 +#: ../../library/stdtypes.rst:5295 msgid "" "This object is commonly used by slicing (see :ref:`slicings`). It supports " "no special operations. There is exactly one ellipsis object, named :const:" @@ -5693,15 +5681,15 @@ msgid "" "`Ellipsis` singleton." msgstr "" -#: ../../library/stdtypes.rst:5310 +#: ../../library/stdtypes.rst:5300 msgid "It is written as ``Ellipsis`` or ``...``." msgstr "" -#: ../../library/stdtypes.rst:5316 +#: ../../library/stdtypes.rst:5306 msgid "The NotImplemented Object" msgstr "" -#: ../../library/stdtypes.rst:5318 +#: ../../library/stdtypes.rst:5308 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 " @@ -5709,15 +5697,15 @@ msgid "" "``type(NotImplemented)()`` produces the singleton instance." msgstr "" -#: ../../library/stdtypes.rst:5323 +#: ../../library/stdtypes.rst:5313 msgid "It is written as ``NotImplemented``." msgstr "" -#: ../../library/stdtypes.rst:5329 +#: ../../library/stdtypes.rst:5319 msgid "Boolean Values" msgstr "" -#: ../../library/stdtypes.rst:5331 +#: ../../library/stdtypes.rst:5321 msgid "" "Boolean values are the two constant objects ``False`` and ``True``. They " "are used to represent truth values (although other values can also be " @@ -5728,104 +5716,104 @@ msgid "" "(see section :ref:`truth` above)." msgstr "" -#: ../../library/stdtypes.rst:5344 +#: ../../library/stdtypes.rst:5334 msgid "They are written as ``False`` and ``True``, respectively." msgstr "" -#: ../../library/stdtypes.rst:5350 +#: ../../library/stdtypes.rst:5340 msgid "Internal Objects" msgstr "" -#: ../../library/stdtypes.rst:5352 +#: ../../library/stdtypes.rst:5342 msgid "" "See :ref:`types` for this information. It describes stack frame objects, " "traceback objects, and slice objects." msgstr "" -#: ../../library/stdtypes.rst:5359 +#: ../../library/stdtypes.rst:5349 msgid "Special Attributes" msgstr "" -#: ../../library/stdtypes.rst:5361 +#: ../../library/stdtypes.rst:5351 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:5368 +#: ../../library/stdtypes.rst:5358 msgid "" "A dictionary or other mapping object used to store an object's (writable) " "attributes." msgstr "" -#: ../../library/stdtypes.rst:5374 +#: ../../library/stdtypes.rst:5364 msgid "The class to which a class instance belongs." msgstr "" -#: ../../library/stdtypes.rst:5379 +#: ../../library/stdtypes.rst:5369 msgid "The tuple of base classes of a class object." msgstr "" -#: ../../library/stdtypes.rst:5384 +#: ../../library/stdtypes.rst:5374 msgid "" "The name of the class, function, method, descriptor, or generator instance." msgstr "" -#: ../../library/stdtypes.rst:5390 +#: ../../library/stdtypes.rst:5380 msgid "" "The :term:`qualified name` of the class, function, method, descriptor, or " "generator instance." msgstr "" -#: ../../library/stdtypes.rst:5398 +#: ../../library/stdtypes.rst:5388 msgid "" "This attribute is a tuple of classes that are considered when looking for " "base classes during method resolution." msgstr "" -#: ../../library/stdtypes.rst:5404 +#: ../../library/stdtypes.rst:5394 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:5411 +#: ../../library/stdtypes.rst:5401 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::" msgstr "" -#: ../../library/stdtypes.rst:5420 +#: ../../library/stdtypes.rst:5410 msgid "Footnotes" msgstr "註解" -#: ../../library/stdtypes.rst:5421 +#: ../../library/stdtypes.rst:5411 msgid "" "Additional information on these special methods may be found in the Python " "Reference Manual (:ref:`customization`)." msgstr "" -#: ../../library/stdtypes.rst:5424 +#: ../../library/stdtypes.rst:5414 msgid "" "As a consequence, the list ``[1, 2]`` is considered equal to ``[1.0, 2.0]``, " "and similarly for tuples." msgstr "" -#: ../../library/stdtypes.rst:5427 +#: ../../library/stdtypes.rst:5417 msgid "They must have since the parser can't tell the type of the operands." msgstr "" -#: ../../library/stdtypes.rst:5429 +#: ../../library/stdtypes.rst:5419 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:5432 +#: ../../library/stdtypes.rst:5422 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/subprocess.po b/library/subprocess.po index c3734b843c..666aa9b6e4 100644 --- a/library/subprocess.po +++ b/library/subprocess.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.10\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2022-02-26 00:11+0000\n" +"POT-Creation-Date: 2022-05-21 17:35+0000\n" "PO-Revision-Date: 2018-05-23 16:11+0000\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -54,19 +54,13 @@ msgid "" "underlying :class:`Popen` interface can be used directly." msgstr "" -#: ../../library/subprocess.rst:36 -msgid "" -"The :func:`run` function was added in Python 3.5; if you need to retain " -"compatibility with older versions, see the :ref:`call-function-trio` section." -msgstr "" - -#: ../../library/subprocess.rst:45 +#: ../../library/subprocess.rst:42 msgid "" "Run the command described by *args*. Wait for command to complete, then " "return a :class:`CompletedProcess` instance." msgstr "" -#: ../../library/subprocess.rst:48 +#: ../../library/subprocess.rst:45 msgid "" "The arguments shown above are merely the most common ones, described below " "in :ref:`frequently-used-arguments` (hence the use of keyword-only notation " @@ -76,7 +70,7 @@ msgid "" "*check*, and *capture_output* are not.)" msgstr "" -#: ../../library/subprocess.rst:55 +#: ../../library/subprocess.rst:52 msgid "" "If *capture_output* is true, stdout and stderr will be captured. When used, " "the internal :class:`Popen` object is automatically created with " @@ -86,7 +80,7 @@ msgid "" "``stderr=STDOUT`` instead of *capture_output*." msgstr "" -#: ../../library/subprocess.rst:62 +#: ../../library/subprocess.rst:59 msgid "" "The *timeout* argument is passed to :meth:`Popen.communicate`. If the " "timeout expires, the child process will be killed and waited for. The :exc:" @@ -94,7 +88,7 @@ msgid "" "terminated." msgstr "" -#: ../../library/subprocess.rst:67 +#: ../../library/subprocess.rst:64 msgid "" "The *input* argument is passed to :meth:`Popen.communicate` and thus to the " "subprocess's stdin. If used it must be a byte sequence, or a string if " @@ -103,7 +97,7 @@ msgid "" "and the *stdin* argument may not be used as well." msgstr "" -#: ../../library/subprocess.rst:73 +#: ../../library/subprocess.rst:70 msgid "" "If *check* is true, and the process exits with a non-zero exit code, a :exc:" "`CalledProcessError` exception will be raised. Attributes of that exception " @@ -111,7 +105,7 @@ msgid "" "captured." msgstr "" -#: ../../library/subprocess.rst:78 +#: ../../library/subprocess.rst:75 msgid "" "If *encoding* or *errors* are specified, or *text* is true, file objects for " "stdin, stdout and stderr are opened in text mode using the specified " @@ -120,7 +114,7 @@ msgid "" "backwards compatibility. By default, file objects are opened in binary mode." msgstr "" -#: ../../library/subprocess.rst:84 +#: ../../library/subprocess.rst:81 msgid "" "If *env* is not ``None``, it must be a mapping that defines the environment " "variables for the new process; these are used instead of the default " @@ -128,145 +122,146 @@ msgid "" "directly to :class:`Popen`." msgstr "" -#: ../../library/subprocess.rst:89 +#: ../../library/subprocess.rst:86 msgid "Examples::" msgstr "" "範例:\n" "\n" "::" -#: ../../library/subprocess.rst:107 +#: ../../library/subprocess.rst:104 msgid "Added *encoding* and *errors* parameters" msgstr "新增 *encoding* 與 *errors* 參數。" -#: ../../library/subprocess.rst:111 +#: ../../library/subprocess.rst:108 msgid "" "Added the *text* parameter, as a more understandable alias of " "*universal_newlines*. Added the *capture_output* parameter." msgstr "" -#: ../../library/subprocess.rst:116 +#: ../../library/subprocess.rst:113 msgid "" "The return value from :func:`run`, representing a process that has finished." msgstr "" -#: ../../library/subprocess.rst:120 +#: ../../library/subprocess.rst:117 msgid "" "The arguments used to launch the process. This may be a list or a string." msgstr "" -#: ../../library/subprocess.rst:124 +#: ../../library/subprocess.rst:121 msgid "" "Exit status of the child process. Typically, an exit status of 0 indicates " "that it ran successfully." msgstr "" -#: ../../library/subprocess.rst:127 ../../library/subprocess.rst:895 +#: ../../library/subprocess.rst:124 ../../library/subprocess.rst:894 msgid "" "A negative value ``-N`` indicates that the child was terminated by signal " "``N`` (POSIX only)." msgstr "" -#: ../../library/subprocess.rst:132 +#: ../../library/subprocess.rst:129 msgid "" "Captured stdout from the child process. A bytes sequence, or a string if :" "func:`run` was called with an encoding, errors, or text=True. ``None`` if " "stdout was not captured." msgstr "" -#: ../../library/subprocess.rst:136 +#: ../../library/subprocess.rst:133 msgid "" "If you ran the process with ``stderr=subprocess.STDOUT``, stdout and stderr " "will be combined in this attribute, and :attr:`stderr` will be ``None``." msgstr "" -#: ../../library/subprocess.rst:142 +#: ../../library/subprocess.rst:139 msgid "" "Captured stderr from the child process. A bytes sequence, or a string if :" "func:`run` was called with an encoding, errors, or text=True. ``None`` if " "stderr was not captured." msgstr "" -#: ../../library/subprocess.rst:148 +#: ../../library/subprocess.rst:145 msgid "If :attr:`returncode` is non-zero, raise a :exc:`CalledProcessError`." msgstr "" -#: ../../library/subprocess.rst:154 +#: ../../library/subprocess.rst:151 msgid "" "Special value that can be used as the *stdin*, *stdout* or *stderr* argument " "to :class:`Popen` and indicates that the special file :data:`os.devnull` " "will be used." msgstr "" -#: ../../library/subprocess.rst:163 +#: ../../library/subprocess.rst:160 msgid "" "Special value that can be used as the *stdin*, *stdout* or *stderr* argument " "to :class:`Popen` and indicates that a pipe to the standard stream should be " "opened. Most useful with :meth:`Popen.communicate`." msgstr "" -#: ../../library/subprocess.rst:170 +#: ../../library/subprocess.rst:167 msgid "" "Special value that can be used as the *stderr* argument to :class:`Popen` " "and indicates that standard error should go into the same handle as standard " "output." msgstr "" -#: ../../library/subprocess.rst:177 +#: ../../library/subprocess.rst:174 msgid "Base class for all other exceptions from this module." msgstr "" -#: ../../library/subprocess.rst:184 +#: ../../library/subprocess.rst:181 msgid "" "Subclass of :exc:`SubprocessError`, raised when a timeout expires while " "waiting for a child process." msgstr "" -#: ../../library/subprocess.rst:189 ../../library/subprocess.rst:226 +#: ../../library/subprocess.rst:186 ../../library/subprocess.rst:225 msgid "Command that was used to spawn the child process." msgstr "" -#: ../../library/subprocess.rst:193 +#: ../../library/subprocess.rst:190 msgid "Timeout in seconds." msgstr "" -#: ../../library/subprocess.rst:197 ../../library/subprocess.rst:230 +#: ../../library/subprocess.rst:194 ../../library/subprocess.rst:229 msgid "" "Output of the child process if it was captured by :func:`run` or :func:" "`check_output`. Otherwise, ``None``." msgstr "" -#: ../../library/subprocess.rst:202 ../../library/subprocess.rst:235 +#: ../../library/subprocess.rst:199 ../../library/subprocess.rst:234 msgid "Alias for output, for symmetry with :attr:`stderr`." msgstr "" -#: ../../library/subprocess.rst:206 ../../library/subprocess.rst:239 +#: ../../library/subprocess.rst:203 ../../library/subprocess.rst:238 msgid "" "Stderr output of the child process if it was captured by :func:`run`. " "Otherwise, ``None``." msgstr "" -#: ../../library/subprocess.rst:211 ../../library/subprocess.rst:242 +#: ../../library/subprocess.rst:208 ../../library/subprocess.rst:241 msgid "*stdout* and *stderr* attributes added" msgstr "" -#: ../../library/subprocess.rst:216 +#: ../../library/subprocess.rst:213 msgid "" "Subclass of :exc:`SubprocessError`, raised when a process run by :func:" -"`check_call` or :func:`check_output` returns a non-zero exit status." +"`check_call`, :func:`check_output`, or :func:`run` (with ``check=True``) " +"returns a non-zero exit status." msgstr "" -#: ../../library/subprocess.rst:221 +#: ../../library/subprocess.rst:220 msgid "" "Exit status of the child process. If the process exited due to a signal, " "this will be the negative signal number." msgstr "" -#: ../../library/subprocess.rst:249 +#: ../../library/subprocess.rst:248 msgid "Frequently Used Arguments" msgstr "" -#: ../../library/subprocess.rst:251 +#: ../../library/subprocess.rst:250 msgid "" "To support a wide variety of use cases, the :class:`Popen` constructor (and " "the convenience functions) accept a large number of optional arguments. For " @@ -274,7 +269,7 @@ msgid "" "default values. The arguments that are most commonly needed are:" msgstr "" -#: ../../library/subprocess.rst:256 +#: ../../library/subprocess.rst:255 msgid "" "*args* is required for all calls and should be a string, or a sequence of " "program arguments. Providing a sequence of arguments is generally preferred, " @@ -284,7 +279,7 @@ msgid "" "simply name the program to be executed without specifying any arguments." msgstr "" -#: ../../library/subprocess.rst:264 +#: ../../library/subprocess.rst:263 msgid "" "*stdin*, *stdout* and *stderr* specify the executed program's standard " "input, standard output and standard error file handles, respectively. Valid " @@ -299,7 +294,7 @@ msgid "" "handle as for *stdout*." msgstr "" -#: ../../library/subprocess.rst:279 +#: ../../library/subprocess.rst:278 msgid "" "If *encoding* or *errors* are specified, or *text* (also known as " "*universal_newlines*) is true, the file objects *stdin*, *stdout* and " @@ -307,7 +302,7 @@ msgid "" "specified in the call or the defaults for :class:`io.TextIOWrapper`." msgstr "" -#: ../../library/subprocess.rst:285 +#: ../../library/subprocess.rst:284 msgid "" "For *stdin*, line ending characters ``'\\n'`` in the input will be converted " "to the default line separator :data:`os.linesep`. For *stdout* and *stderr*, " @@ -316,28 +311,28 @@ msgid "" "when the *newline* argument to its constructor is ``None``." msgstr "" -#: ../../library/subprocess.rst:291 +#: ../../library/subprocess.rst:290 msgid "" "If text mode is not used, *stdin*, *stdout* and *stderr* will be opened as " "binary streams. No encoding or line ending conversion is performed." msgstr "" -#: ../../library/subprocess.rst:294 +#: ../../library/subprocess.rst:293 msgid "Added *encoding* and *errors* parameters." msgstr "新增 *encoding* 與 *errors* 參數。" -#: ../../library/subprocess.rst:297 +#: ../../library/subprocess.rst:296 msgid "Added the *text* parameter as an alias for *universal_newlines*." msgstr "" -#: ../../library/subprocess.rst:302 +#: ../../library/subprocess.rst:301 msgid "" "The newlines attribute of the file objects :attr:`Popen.stdin`, :attr:`Popen." "stdout` and :attr:`Popen.stderr` are not updated by the :meth:`Popen." "communicate` method." msgstr "" -#: ../../library/subprocess.rst:306 +#: ../../library/subprocess.rst:305 msgid "" "If *shell* is ``True``, the specified command will be executed through the " "shell. This can be useful if you are using Python primarily for the " @@ -350,7 +345,7 @@ msgid "" "expanduser`, and :mod:`shutil`)." msgstr "" -#: ../../library/subprocess.rst:316 +#: ../../library/subprocess.rst:315 msgid "" "When *universal_newlines* is ``True``, the class uses the encoding :func:" "`locale.getpreferredencoding(False) ` instead " @@ -358,22 +353,22 @@ msgid "" "class for more information on this change." msgstr "" -#: ../../library/subprocess.rst:324 ../../library/subprocess.rst:444 +#: ../../library/subprocess.rst:323 ../../library/subprocess.rst:443 msgid "" "Read the `Security Considerations`_ section before using ``shell=True``." msgstr "" -#: ../../library/subprocess.rst:326 +#: ../../library/subprocess.rst:325 msgid "" "These options, along with all of the other options, are described in more " "detail in the :class:`Popen` constructor documentation." msgstr "" -#: ../../library/subprocess.rst:331 +#: ../../library/subprocess.rst:330 msgid "Popen Constructor" msgstr "" -#: ../../library/subprocess.rst:333 +#: ../../library/subprocess.rst:332 msgid "" "The underlying process creation and management in this module is handled by " "the :class:`Popen` class. It offers a lot of flexibility so that developers " @@ -381,7 +376,7 @@ msgid "" "functions." msgstr "" -#: ../../library/subprocess.rst:347 +#: ../../library/subprocess.rst:346 msgid "" "Execute a child program in a new process. On POSIX, the class uses :meth:" "`os.execvpe`-like behavior to execute the child program. On Windows, the " @@ -389,7 +384,7 @@ msgid "" "class:`Popen` are as follows." msgstr "" -#: ../../library/subprocess.rst:352 +#: ../../library/subprocess.rst:351 msgid "" "*args* should be a sequence of program arguments or else a single string or :" "term:`path-like object`. By default, the program to execute is the first " @@ -400,7 +395,7 @@ msgid "" "sequence." msgstr "" -#: ../../library/subprocess.rst:362 +#: ../../library/subprocess.rst:361 msgid "" "For maximum reliability, use a fully-qualified path for the executable. To " "search for an unqualified name on :envvar:`PATH`, use :meth:`shutil.which`. " @@ -409,7 +404,7 @@ msgid "" "format to launch an installed module." msgstr "" -#: ../../library/subprocess.rst:368 +#: ../../library/subprocess.rst:367 msgid "" "Resolving the path of *executable* (or the first item of *args*) is platform " "dependent. For POSIX, see :meth:`os.execvpe`, and note that when resolving " @@ -423,27 +418,27 @@ msgid "" "variations." msgstr "" -#: ../../library/subprocess.rst:379 +#: ../../library/subprocess.rst:378 msgid "" "An example of passing some arguments to an external program as a sequence " "is::" msgstr "" -#: ../../library/subprocess.rst:384 +#: ../../library/subprocess.rst:383 msgid "" "On POSIX, if *args* is a string, the string is interpreted as the name or " "path of the program to execute. However, this can only be done if not " "passing arguments to the program." msgstr "" -#: ../../library/subprocess.rst:390 +#: ../../library/subprocess.rst:389 msgid "" "It may not be obvious how to break a shell command into a sequence of " "arguments, especially in complex cases. :meth:`shlex.split` can illustrate " "how to determine the correct tokenization for *args*::" msgstr "" -#: ../../library/subprocess.rst:402 +#: ../../library/subprocess.rst:401 msgid "" "Note in particular that options (such as *-input*) and arguments (such as " "*eggs.txt*) that are separated by whitespace in the shell go in separate " @@ -452,33 +447,33 @@ msgid "" "shown above) are single list elements." msgstr "" -#: ../../library/subprocess.rst:408 +#: ../../library/subprocess.rst:407 msgid "" "On Windows, if *args* is a sequence, it will be converted to a string in a " "manner described in :ref:`converting-argument-sequence`. This is because " "the underlying ``CreateProcess()`` operates on strings." msgstr "" -#: ../../library/subprocess.rst:412 +#: ../../library/subprocess.rst:411 msgid "" "*args* parameter accepts a :term:`path-like object` if *shell* is ``False`` " "and a sequence containing path-like objects on POSIX." msgstr "" -#: ../../library/subprocess.rst:416 +#: ../../library/subprocess.rst:415 msgid "" "*args* parameter accepts a :term:`path-like object` if *shell* is ``False`` " "and a sequence containing bytes and path-like objects on Windows." msgstr "" -#: ../../library/subprocess.rst:421 +#: ../../library/subprocess.rst:420 msgid "" "The *shell* argument (which defaults to ``False``) specifies whether to use " "the shell as the program to execute. If *shell* is ``True``, it is " "recommended to pass *args* as a string rather than as a sequence." msgstr "" -#: ../../library/subprocess.rst:425 +#: ../../library/subprocess.rst:424 msgid "" "On POSIX with ``shell=True``, the shell defaults to :file:`/bin/sh`. If " "*args* is a string, the string specifies the command to execute through the " @@ -490,7 +485,7 @@ msgid "" "class:`Popen` does the equivalent of::" msgstr "" -#: ../../library/subprocess.rst:436 +#: ../../library/subprocess.rst:435 msgid "" "On Windows with ``shell=True``, the :envvar:`COMSPEC` environment variable " "specifies the default shell. The only time you need to specify " @@ -499,35 +494,35 @@ msgid "" "``shell=True`` to run a batch file or console-based executable." msgstr "" -#: ../../library/subprocess.rst:446 +#: ../../library/subprocess.rst:445 msgid "" "*bufsize* will be supplied as the corresponding argument to the :func:`open` " "function when creating the stdin/stdout/stderr pipe file objects:" msgstr "" -#: ../../library/subprocess.rst:450 +#: ../../library/subprocess.rst:449 msgid "" ":const:`0` means unbuffered (read and write are one system call and can " "return short)" msgstr "" -#: ../../library/subprocess.rst:452 +#: ../../library/subprocess.rst:451 msgid "" ":const:`1` means line buffered (only usable if ``universal_newlines=True`` i." "e., in a text mode)" msgstr "" -#: ../../library/subprocess.rst:454 +#: ../../library/subprocess.rst:453 msgid "any other positive value means use a buffer of approximately that size" msgstr "" -#: ../../library/subprocess.rst:456 +#: ../../library/subprocess.rst:455 msgid "" "negative bufsize (the default) means the system default of io." "DEFAULT_BUFFER_SIZE will be used." msgstr "" -#: ../../library/subprocess.rst:459 +#: ../../library/subprocess.rst:458 msgid "" "*bufsize* now defaults to -1 to enable buffering by default to match the " "behavior that most code expects. In versions prior to Python 3.2.4 and " @@ -536,7 +531,7 @@ msgid "" "of Python 2 as most code expected." msgstr "" -#: ../../library/subprocess.rst:466 +#: ../../library/subprocess.rst:465 msgid "" "The *executable* argument specifies a replacement program to execute. It " "is very seldom needed. When ``shell=False``, *executable* replaces the " @@ -549,17 +544,17 @@ msgid "" "default :file:`/bin/sh`." msgstr "" -#: ../../library/subprocess.rst:476 +#: ../../library/subprocess.rst:475 msgid "*executable* parameter accepts a :term:`path-like object` on POSIX." msgstr "" -#: ../../library/subprocess.rst:479 +#: ../../library/subprocess.rst:478 msgid "" "*executable* parameter accepts a bytes and :term:`path-like object` on " "Windows." msgstr "" -#: ../../library/subprocess.rst:483 +#: ../../library/subprocess.rst:482 msgid "" "*stdin*, *stdout* and *stderr* specify the executed program's standard " "input, standard output and standard error file handles, respectively. Valid " @@ -574,13 +569,13 @@ msgid "" "handle as for stdout." msgstr "" -#: ../../library/subprocess.rst:495 +#: ../../library/subprocess.rst:494 msgid "" "If *preexec_fn* is set to a callable object, this object will be called in " "the child process just before the child is executed. (POSIX only)" msgstr "" -#: ../../library/subprocess.rst:501 +#: ../../library/subprocess.rst:500 msgid "" "The *preexec_fn* parameter is not safe to use in the presence of threads in " "your application. The child process could deadlock before exec is called. " @@ -588,7 +583,7 @@ msgid "" "call into." msgstr "" -#: ../../library/subprocess.rst:509 +#: ../../library/subprocess.rst:508 msgid "" "If you need to modify the environment for the child use the *env* parameter " "rather than doing it in a *preexec_fn*. The *start_new_session* parameter " @@ -596,7 +591,7 @@ msgid "" "setsid() in the child." msgstr "" -#: ../../library/subprocess.rst:516 +#: ../../library/subprocess.rst:515 msgid "" "The *preexec_fn* parameter is no longer supported in subinterpreters. The " "use of the parameter in a subinterpreter raises :exc:`RuntimeError`. The new " @@ -604,7 +599,7 @@ msgid "" "and other embedded environments." msgstr "" -#: ../../library/subprocess.rst:521 +#: ../../library/subprocess.rst:520 msgid "" "If *close_fds* is true, all file descriptors except :const:`0`, :const:`1` " "and :const:`2` will be closed before the child process is executed. " @@ -612,38 +607,38 @@ msgid "" "flag as described in :ref:`fd_inheritance`." msgstr "" -#: ../../library/subprocess.rst:526 +#: ../../library/subprocess.rst:525 msgid "" "On Windows, if *close_fds* is true then no handles will be inherited by the " "child process unless explicitly passed in the ``handle_list`` element of :" "attr:`STARTUPINFO.lpAttributeList`, or by standard handle redirection." msgstr "" -#: ../../library/subprocess.rst:530 +#: ../../library/subprocess.rst:529 msgid "" "The default for *close_fds* was changed from :const:`False` to what is " "described above." msgstr "" -#: ../../library/subprocess.rst:534 +#: ../../library/subprocess.rst:533 msgid "" "On Windows the default for *close_fds* was changed from :const:`False` to :" "const:`True` when redirecting the standard handles. It's now possible to set " "*close_fds* to :const:`True` when redirecting the standard handles." msgstr "" -#: ../../library/subprocess.rst:539 +#: ../../library/subprocess.rst:538 msgid "" "*pass_fds* is an optional sequence of file descriptors to keep open between " "the parent and child. Providing any *pass_fds* forces *close_fds* to be :" "const:`True`. (POSIX only)" msgstr "" -#: ../../library/subprocess.rst:543 +#: ../../library/subprocess.rst:542 msgid "The *pass_fds* parameter was added." msgstr "新增 *pass_fds* 參數。" -#: ../../library/subprocess.rst:546 +#: ../../library/subprocess.rst:545 msgid "" "If *cwd* is not ``None``, the function changes the working directory to " "*cwd* before executing the child. *cwd* can be a string, bytes or :term:" @@ -652,40 +647,40 @@ msgid "" "executable path is a relative path." msgstr "" -#: ../../library/subprocess.rst:552 +#: ../../library/subprocess.rst:551 msgid "*cwd* parameter accepts a :term:`path-like object` on POSIX." msgstr "" -#: ../../library/subprocess.rst:555 +#: ../../library/subprocess.rst:554 msgid "*cwd* parameter accepts a :term:`path-like object` on Windows." msgstr "" -#: ../../library/subprocess.rst:558 +#: ../../library/subprocess.rst:557 msgid "*cwd* parameter accepts a bytes object on Windows." msgstr "" -#: ../../library/subprocess.rst:561 +#: ../../library/subprocess.rst:560 msgid "" "If *restore_signals* is true (the default) all signals that Python has set " "to SIG_IGN are restored to SIG_DFL in the child process before the exec. " "Currently this includes the SIGPIPE, SIGXFZ and SIGXFSZ signals. (POSIX only)" msgstr "" -#: ../../library/subprocess.rst:566 +#: ../../library/subprocess.rst:565 msgid "*restore_signals* was added." msgstr "新增 *restore_signals*\\ 。" -#: ../../library/subprocess.rst:569 +#: ../../library/subprocess.rst:568 msgid "" "If *start_new_session* is true the setsid() system call will be made in the " "child process prior to the execution of the subprocess. (POSIX only)" msgstr "" -#: ../../library/subprocess.rst:572 +#: ../../library/subprocess.rst:571 msgid "*start_new_session* was added." msgstr "新增 *start_new_session*\\ 。" -#: ../../library/subprocess.rst:575 +#: ../../library/subprocess.rst:574 msgid "" "If *group* is not ``None``, the setregid() system call will be made in the " "child process prior to the execution of the subprocess. If the provided " @@ -694,12 +689,12 @@ msgid "" "passed verbatim. (POSIX only)" msgstr "" -#: ../../library/subprocess.rst:581 ../../library/subprocess.rst:590 -#: ../../library/subprocess.rst:599 ../../library/subprocess.rst:605 +#: ../../library/subprocess.rst:580 ../../library/subprocess.rst:589 +#: ../../library/subprocess.rst:598 ../../library/subprocess.rst:604 msgid ":ref:`Availability `: POSIX" msgstr ":ref:`適用 `:POSIX" -#: ../../library/subprocess.rst:584 +#: ../../library/subprocess.rst:583 msgid "" "If *extra_groups* is not ``None``, the setgroups() system call will be made " "in the child process prior to the execution of the subprocess. Strings " @@ -708,7 +703,7 @@ msgid "" "verbatim. (POSIX only)" msgstr "" -#: ../../library/subprocess.rst:593 +#: ../../library/subprocess.rst:592 msgid "" "If *user* is not ``None``, the setreuid() system call will be made in the " "child process prior to the execution of the subprocess. If the provided " @@ -717,27 +712,27 @@ msgid "" "passed verbatim. (POSIX only)" msgstr "" -#: ../../library/subprocess.rst:602 +#: ../../library/subprocess.rst:601 msgid "" "If *umask* is not negative, the umask() system call will be made in the " "child process prior to the execution of the subprocess." msgstr "" -#: ../../library/subprocess.rst:608 +#: ../../library/subprocess.rst:607 msgid "" "If *env* is not ``None``, it must be a mapping that defines the environment " "variables for the new process; these are used instead of the default " "behavior of inheriting the current process' environment." msgstr "" -#: ../../library/subprocess.rst:614 +#: ../../library/subprocess.rst:613 msgid "" "If specified, *env* must provide any variables required for the program to " "execute. On Windows, in order to run a `side-by-side assembly`_ the " "specified *env* **must** include a valid :envvar:`SystemRoot`." msgstr "" -#: ../../library/subprocess.rst:620 +#: ../../library/subprocess.rst:619 msgid "" "If *encoding* or *errors* are specified, or *text* is true, the file objects " "*stdin*, *stdout* and *stderr* are opened in text mode with the specified " @@ -747,70 +742,70 @@ msgid "" "in binary mode." msgstr "" -#: ../../library/subprocess.rst:626 +#: ../../library/subprocess.rst:625 msgid "*encoding* and *errors* were added." msgstr "新增 *encoding* 與 *errors*\\ 。" -#: ../../library/subprocess.rst:629 ../../library/subprocess.rst:1230 +#: ../../library/subprocess.rst:628 ../../library/subprocess.rst:1229 msgid "*text* was added as a more readable alias for *universal_newlines*." msgstr "" -#: ../../library/subprocess.rst:632 +#: ../../library/subprocess.rst:631 msgid "" "If given, *startupinfo* will be a :class:`STARTUPINFO` object, which is " "passed to the underlying ``CreateProcess`` function. *creationflags*, if " "given, can be one or more of the following flags:" msgstr "" -#: ../../library/subprocess.rst:636 +#: ../../library/subprocess.rst:635 msgid ":data:`CREATE_NEW_CONSOLE`" msgstr ":data:`CREATE_NEW_CONSOLE`" -#: ../../library/subprocess.rst:637 +#: ../../library/subprocess.rst:636 msgid ":data:`CREATE_NEW_PROCESS_GROUP`" msgstr ":data:`CREATE_NEW_PROCESS_GROUP`" -#: ../../library/subprocess.rst:638 +#: ../../library/subprocess.rst:637 msgid ":data:`ABOVE_NORMAL_PRIORITY_CLASS`" msgstr ":data:`ABOVE_NORMAL_PRIORITY_CLASS`" -#: ../../library/subprocess.rst:639 +#: ../../library/subprocess.rst:638 msgid ":data:`BELOW_NORMAL_PRIORITY_CLASS`" msgstr ":data:`BELOW_NORMAL_PRIORITY_CLASS`" -#: ../../library/subprocess.rst:640 +#: ../../library/subprocess.rst:639 msgid ":data:`HIGH_PRIORITY_CLASS`" msgstr ":data:`HIGH_PRIORITY_CLASS`" -#: ../../library/subprocess.rst:641 +#: ../../library/subprocess.rst:640 msgid ":data:`IDLE_PRIORITY_CLASS`" msgstr ":data:`IDLE_PRIORITY_CLASS`" -#: ../../library/subprocess.rst:642 +#: ../../library/subprocess.rst:641 msgid ":data:`NORMAL_PRIORITY_CLASS`" msgstr ":data:`NORMAL_PRIORITY_CLASS`" -#: ../../library/subprocess.rst:643 +#: ../../library/subprocess.rst:642 msgid ":data:`REALTIME_PRIORITY_CLASS`" msgstr ":data:`REALTIME_PRIORITY_CLASS`" -#: ../../library/subprocess.rst:644 +#: ../../library/subprocess.rst:643 msgid ":data:`CREATE_NO_WINDOW`" msgstr ":data:`CREATE_NO_WINDOW`" -#: ../../library/subprocess.rst:645 +#: ../../library/subprocess.rst:644 msgid ":data:`DETACHED_PROCESS`" msgstr ":data:`DETACHED_PROCESS`" -#: ../../library/subprocess.rst:646 +#: ../../library/subprocess.rst:645 msgid ":data:`CREATE_DEFAULT_ERROR_MODE`" msgstr ":data:`CREATE_DEFAULT_ERROR_MODE`" -#: ../../library/subprocess.rst:647 +#: ../../library/subprocess.rst:646 msgid ":data:`CREATE_BREAKAWAY_FROM_JOB`" msgstr ":data:`CREATE_BREAKAWAY_FROM_JOB`" -#: ../../library/subprocess.rst:649 +#: ../../library/subprocess.rst:648 msgid "" "*pipesize* can be used to change the size of the pipe when :data:`PIPE` is " "used for *stdin*, *stdout* or *stderr*. The size of the pipe is only changed " @@ -818,24 +813,24 @@ msgid "" "platforms will ignore this parameter." msgstr "" -#: ../../library/subprocess.rst:654 +#: ../../library/subprocess.rst:653 msgid "The ``pipesize`` parameter was added." msgstr "新增 ``pipesize`` 參數。" -#: ../../library/subprocess.rst:657 +#: ../../library/subprocess.rst:656 msgid "" "Popen objects are supported as context managers via the :keyword:`with` " "statement: on exit, standard file descriptors are closed, and the process is " "waited for. ::" msgstr "" -#: ../../library/subprocess.rst:664 +#: ../../library/subprocess.rst:663 msgid "" "Raises an :ref:`auditing event ` ``subprocess.Popen`` with " "arguments ``executable``, ``args``, ``cwd``, ``env``." msgstr "" -#: ../../library/subprocess.rst:666 +#: ../../library/subprocess.rst:665 msgid "" "Popen and the other functions in this module that use it raise an :ref:" "`auditing event ` ``subprocess.Popen`` with arguments " @@ -843,17 +838,17 @@ msgid "" "be a single string or a list of strings, depending on platform." msgstr "" -#: ../../library/subprocess.rst:671 +#: ../../library/subprocess.rst:670 msgid "Added context manager support." msgstr "" -#: ../../library/subprocess.rst:674 +#: ../../library/subprocess.rst:673 msgid "" "Popen destructor now emits a :exc:`ResourceWarning` warning if the child " "process is still running." msgstr "" -#: ../../library/subprocess.rst:678 +#: ../../library/subprocess.rst:677 msgid "" "Popen can use :func:`os.posix_spawn` in some cases for better performance. " "On Windows Subsystem for Linux and QEMU User Emulation, Popen constructor " @@ -862,17 +857,17 @@ msgid "" "returncode`." msgstr "" -#: ../../library/subprocess.rst:687 +#: ../../library/subprocess.rst:686 msgid "Exceptions" msgstr "例外" -#: ../../library/subprocess.rst:689 +#: ../../library/subprocess.rst:688 msgid "" "Exceptions raised in the child process, before the new program has started " "to execute, will be re-raised in the parent." msgstr "" -#: ../../library/subprocess.rst:692 +#: ../../library/subprocess.rst:691 msgid "" "The most common exception raised is :exc:`OSError`. This occurs, for " "example, when trying to execute a non-existent file. Applications should " @@ -883,39 +878,39 @@ msgid "" "subprocess." msgstr "" -#: ../../library/subprocess.rst:699 +#: ../../library/subprocess.rst:698 msgid "" "A :exc:`ValueError` will be raised if :class:`Popen` is called with invalid " "arguments." msgstr "" -#: ../../library/subprocess.rst:702 +#: ../../library/subprocess.rst:701 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:706 +#: ../../library/subprocess.rst:705 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:710 +#: ../../library/subprocess.rst:709 msgid "" "Exceptions defined in this module all inherit from :exc:`SubprocessError`." msgstr "" -#: ../../library/subprocess.rst:712 +#: ../../library/subprocess.rst:711 msgid "The :exc:`SubprocessError` base class was added." msgstr "" -#: ../../library/subprocess.rst:718 +#: ../../library/subprocess.rst:717 msgid "Security Considerations" msgstr "" -#: ../../library/subprocess.rst:720 +#: ../../library/subprocess.rst:719 msgid "" "Unlike some other popen functions, this implementation will never implicitly " "call a system shell. This means that all characters, including shell " @@ -928,34 +923,34 @@ msgid "" "escaping." msgstr "" -#: ../../library/subprocess.rst:732 +#: ../../library/subprocess.rst:731 msgid "Popen Objects" msgstr "" -#: ../../library/subprocess.rst:734 +#: ../../library/subprocess.rst:733 msgid "Instances of the :class:`Popen` class have the following methods:" msgstr "" -#: ../../library/subprocess.rst:739 +#: ../../library/subprocess.rst:738 msgid "" "Check if child process has terminated. Set and return :attr:`~Popen." "returncode` attribute. Otherwise, returns ``None``." msgstr "" -#: ../../library/subprocess.rst:745 +#: ../../library/subprocess.rst:744 msgid "" "Wait for child process to terminate. Set and return :attr:`~Popen." "returncode` attribute." msgstr "" -#: ../../library/subprocess.rst:748 +#: ../../library/subprocess.rst:747 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:754 +#: ../../library/subprocess.rst:753 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 " @@ -963,20 +958,20 @@ msgid "" "when using pipes to avoid that." msgstr "" -#: ../../library/subprocess.rst:761 +#: ../../library/subprocess.rst:760 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:765 ../../library/subprocess.rst:806 -#: ../../library/subprocess.rst:1143 ../../library/subprocess.rst:1175 -#: ../../library/subprocess.rst:1221 +#: ../../library/subprocess.rst:764 ../../library/subprocess.rst:805 +#: ../../library/subprocess.rst:1142 ../../library/subprocess.rst:1174 +#: ../../library/subprocess.rst:1220 msgid "*timeout* was added." msgstr "新增 *timeout*\\ 。" -#: ../../library/subprocess.rst:770 +#: ../../library/subprocess.rst:769 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 " @@ -986,13 +981,13 @@ msgid "" "must be a string. Otherwise, it must be bytes." msgstr "" -#: ../../library/subprocess.rst:777 +#: ../../library/subprocess.rst:776 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:781 +#: ../../library/subprocess.rst:780 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 " @@ -1000,65 +995,65 @@ msgid "" "and/or ``stderr=PIPE`` too." msgstr "" -#: ../../library/subprocess.rst:786 +#: ../../library/subprocess.rst:785 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:790 +#: ../../library/subprocess.rst:789 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:803 +#: ../../library/subprocess.rst:802 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:812 +#: ../../library/subprocess.rst:811 msgid "Sends the signal *signal* to the child." msgstr "" -#: ../../library/subprocess.rst:814 +#: ../../library/subprocess.rst:813 msgid "Do nothing if the process completed." msgstr "" -#: ../../library/subprocess.rst:818 +#: ../../library/subprocess.rst:817 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:825 +#: ../../library/subprocess.rst:824 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:832 +#: ../../library/subprocess.rst:831 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:836 +#: ../../library/subprocess.rst:835 msgid "The following attributes are also available:" msgstr "" -#: ../../library/subprocess.rst:840 +#: ../../library/subprocess.rst:839 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:847 +#: ../../library/subprocess.rst:846 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* " @@ -1067,7 +1062,7 @@ msgid "" "argument was not :data:`PIPE`, this attribute is ``None``." msgstr "" -#: ../../library/subprocess.rst:856 +#: ../../library/subprocess.rst:855 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 " @@ -1077,7 +1072,7 @@ msgid "" "not :data:`PIPE`, this attribute is ``None``." msgstr "" -#: ../../library/subprocess.rst:866 +#: ../../library/subprocess.rst:865 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 " @@ -1087,7 +1082,7 @@ msgid "" "was not :data:`PIPE`, this attribute is ``None``." msgstr "" -#: ../../library/subprocess.rst:875 +#: ../../library/subprocess.rst:874 msgid "" "Use :meth:`~Popen.communicate` rather than :attr:`.stdin.write `, :attr:`.stdout.read ` or :attr:`.stderr.read `__ structure is used for :class:`Popen` " @@ -1130,38 +1125,38 @@ msgid "" "only arguments." msgstr "" -#: ../../library/subprocess.rst:913 +#: ../../library/subprocess.rst:912 msgid "Keyword-only argument support was added." msgstr "" -#: ../../library/subprocess.rst:918 +#: ../../library/subprocess.rst:917 msgid "" "A bit field that determines whether certain :class:`STARTUPINFO` attributes " "are used when the process creates a window. ::" msgstr "" -#: ../../library/subprocess.rst:926 +#: ../../library/subprocess.rst:925 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:933 +#: ../../library/subprocess.rst:932 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:940 +#: ../../library/subprocess.rst:939 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:946 +#: ../../library/subprocess.rst:945 msgid "" "If :attr:`dwFlags` specifies :data:`STARTF_USESHOWWINDOW`, this attribute " "can be any of the values that can be specified in the ``nCmdShow`` parameter " @@ -1170,34 +1165,34 @@ msgid "" "Otherwise, this attribute is ignored." msgstr "" -#: ../../library/subprocess.rst:953 +#: ../../library/subprocess.rst:952 msgid "" ":data:`SW_HIDE` is provided for this attribute. It is used when :class:" "`Popen` is called with ``shell=True``." msgstr "" -#: ../../library/subprocess.rst:958 +#: ../../library/subprocess.rst:957 msgid "" "A dictionary of additional attributes for process creation as given in " "``STARTUPINFOEX``, see `UpdateProcThreadAttribute `__." msgstr "" -#: ../../library/subprocess.rst:962 +#: ../../library/subprocess.rst:961 msgid "Supported attributes:" msgstr "" -#: ../../library/subprocess.rst:980 +#: ../../library/subprocess.rst:979 msgid "**handle_list**" msgstr "**handle_list**" -#: ../../library/subprocess.rst:965 +#: ../../library/subprocess.rst:964 msgid "" "Sequence of handles that will be inherited. *close_fds* must be true if non-" "empty." msgstr "" -#: ../../library/subprocess.rst:968 +#: ../../library/subprocess.rst:967 msgid "" "The handles must be temporarily made inheritable by :func:`os." "set_handle_inheritable` when passed to the :class:`Popen` constructor, else :" @@ -1205,7 +1200,7 @@ msgid "" "``ERROR_INVALID_PARAMETER`` (87)." msgstr "" -#: ../../library/subprocess.rst:975 +#: ../../library/subprocess.rst:974 msgid "" "In a multithreaded process, use caution to avoid leaking handles that are " "marked inheritable when combining this feature with concurrent calls to " @@ -1214,97 +1209,97 @@ msgid "" "temporarily creates inheritable handles." msgstr "" -#: ../../library/subprocess.rst:985 +#: ../../library/subprocess.rst:984 msgid "Windows Constants" msgstr "" -#: ../../library/subprocess.rst:987 +#: ../../library/subprocess.rst:986 msgid "The :mod:`subprocess` module exposes the following constants." msgstr "" -#: ../../library/subprocess.rst:991 +#: ../../library/subprocess.rst:990 msgid "" "The standard input device. Initially, this is the console input buffer, " "``CONIN$``." msgstr "" -#: ../../library/subprocess.rst:996 +#: ../../library/subprocess.rst:995 msgid "" "The standard output device. Initially, this is the active console screen " "buffer, ``CONOUT$``." msgstr "" -#: ../../library/subprocess.rst:1001 +#: ../../library/subprocess.rst:1000 msgid "" "The standard error device. Initially, this is the active console screen " "buffer, ``CONOUT$``." msgstr "" -#: ../../library/subprocess.rst:1006 +#: ../../library/subprocess.rst:1005 msgid "Hides the window. Another window will be activated." msgstr "" -#: ../../library/subprocess.rst:1010 +#: ../../library/subprocess.rst:1009 msgid "" "Specifies that the :attr:`STARTUPINFO.hStdInput`, :attr:`STARTUPINFO." "hStdOutput`, and :attr:`STARTUPINFO.hStdError` attributes contain additional " "information." msgstr "" -#: ../../library/subprocess.rst:1016 +#: ../../library/subprocess.rst:1015 msgid "" "Specifies that the :attr:`STARTUPINFO.wShowWindow` attribute contains " "additional information." msgstr "" -#: ../../library/subprocess.rst:1021 +#: ../../library/subprocess.rst:1020 msgid "" "The new process has a new console, instead of inheriting its parent's " "console (the default)." msgstr "" -#: ../../library/subprocess.rst:1026 +#: ../../library/subprocess.rst:1025 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:1030 +#: ../../library/subprocess.rst:1029 msgid "This flag is ignored if :data:`CREATE_NEW_CONSOLE` is specified." msgstr "" -#: ../../library/subprocess.rst:1034 +#: ../../library/subprocess.rst:1033 msgid "" "A :class:`Popen` ``creationflags`` parameter to specify that a new process " "will have an above average priority." msgstr "" -#: ../../library/subprocess.rst:1041 +#: ../../library/subprocess.rst:1040 msgid "" "A :class:`Popen` ``creationflags`` parameter to specify that a new process " "will have a below average priority." msgstr "" -#: ../../library/subprocess.rst:1048 +#: ../../library/subprocess.rst:1047 msgid "" "A :class:`Popen` ``creationflags`` parameter to specify that a new process " "will have a high priority." msgstr "" -#: ../../library/subprocess.rst:1055 +#: ../../library/subprocess.rst:1054 msgid "" "A :class:`Popen` ``creationflags`` parameter to specify that a new process " "will have an idle (lowest) priority." msgstr "" -#: ../../library/subprocess.rst:1062 +#: ../../library/subprocess.rst:1061 msgid "" "A :class:`Popen` ``creationflags`` parameter to specify that a new process " "will have an normal priority. (default)" msgstr "" -#: ../../library/subprocess.rst:1069 +#: ../../library/subprocess.rst:1068 msgid "" "A :class:`Popen` ``creationflags`` parameter to specify that a new process " "will have realtime priority. You should almost never use " @@ -1314,20 +1309,20 @@ msgid "" "perform brief tasks that should have limited interruptions." msgstr "" -#: ../../library/subprocess.rst:1080 +#: ../../library/subprocess.rst:1079 msgid "" "A :class:`Popen` ``creationflags`` parameter to specify that a new process " "will not create a window." msgstr "" -#: ../../library/subprocess.rst:1087 +#: ../../library/subprocess.rst:1086 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:1095 +#: ../../library/subprocess.rst:1094 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 " @@ -1335,39 +1330,39 @@ msgid "" "multithreaded shell applications that run with hard errors disabled." msgstr "" -#: ../../library/subprocess.rst:1105 +#: ../../library/subprocess.rst:1104 msgid "" "A :class:`Popen` ``creationflags`` parameter to specify that a new process " "is not associated with the job." msgstr "" -#: ../../library/subprocess.rst:1113 +#: ../../library/subprocess.rst:1112 msgid "Older high-level API" msgstr "" -#: ../../library/subprocess.rst:1115 +#: ../../library/subprocess.rst:1114 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:1122 +#: ../../library/subprocess.rst:1121 msgid "" "Run the command described by *args*. Wait for command to complete, then " "return the :attr:`~Popen.returncode` attribute." msgstr "" -#: ../../library/subprocess.rst:1125 ../../library/subprocess.rst:1157 +#: ../../library/subprocess.rst:1124 ../../library/subprocess.rst:1156 msgid "" "Code needing to capture stdout or stderr should use :func:`run` instead::" msgstr "" -#: ../../library/subprocess.rst:1129 ../../library/subprocess.rst:1161 +#: ../../library/subprocess.rst:1128 ../../library/subprocess.rst:1160 msgid "To suppress stdout or stderr, supply a value of :data:`DEVNULL`." msgstr "" -#: ../../library/subprocess.rst:1131 ../../library/subprocess.rst:1163 +#: ../../library/subprocess.rst:1130 ../../library/subprocess.rst:1162 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 " @@ -1375,14 +1370,14 @@ msgid "" "to that interface." msgstr "" -#: ../../library/subprocess.rst:1138 ../../library/subprocess.rst:1170 +#: ../../library/subprocess.rst:1137 ../../library/subprocess.rst:1169 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:1150 +#: ../../library/subprocess.rst:1149 msgid "" "Run command with arguments. Wait for command to complete. If the return " "code was zero then return, otherwise raise :exc:`CalledProcessError`. The :" @@ -1391,11 +1386,11 @@ msgid "" "to start the process it will propagate the exception that was raised." msgstr "" -#: ../../library/subprocess.rst:1184 +#: ../../library/subprocess.rst:1183 msgid "Run command with arguments and return its output." msgstr "" -#: ../../library/subprocess.rst:1186 +#: ../../library/subprocess.rst:1185 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:" @@ -1403,11 +1398,11 @@ msgid "" "`~CalledProcessError.output` attribute." msgstr "" -#: ../../library/subprocess.rst:1191 +#: ../../library/subprocess.rst:1190 msgid "This is equivalent to::" msgstr "" -#: ../../library/subprocess.rst:1195 +#: ../../library/subprocess.rst:1194 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 " @@ -1417,52 +1412,52 @@ msgid "" "using the parent's standard input file handle." msgstr "" -#: ../../library/subprocess.rst:1202 +#: ../../library/subprocess.rst:1201 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:1206 +#: ../../library/subprocess.rst:1205 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:1210 +#: ../../library/subprocess.rst:1209 msgid "" "To also capture standard error in the result, use ``stderr=subprocess." "STDOUT``::" msgstr "" -#: ../../library/subprocess.rst:1224 +#: ../../library/subprocess.rst:1223 msgid "Support for the *input* keyword argument was added." msgstr "新增 *input* 關鍵字引數的支援。" -#: ../../library/subprocess.rst:1227 +#: ../../library/subprocess.rst:1226 msgid "*encoding* and *errors* were added. See :func:`run` for details." msgstr "新增 *encoding* 與 *errors*\\ 。細節請見 :func:`run`\\ 。" -#: ../../library/subprocess.rst:1237 +#: ../../library/subprocess.rst:1236 msgid "Replacing Older Functions with the :mod:`subprocess` Module" msgstr "" -#: ../../library/subprocess.rst:1239 +#: ../../library/subprocess.rst:1238 msgid "" "In this section, \"a becomes b\" means that b can be used as a replacement " "for a." msgstr "" -#: ../../library/subprocess.rst:1243 +#: ../../library/subprocess.rst:1242 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:1247 +#: ../../library/subprocess.rst:1246 msgid "" "In addition, the replacements using :func:`check_output` will fail with a :" "exc:`CalledProcessError` if the requested operation produces a non-zero " @@ -1470,143 +1465,143 @@ msgid "" "output` attribute of the raised exception." msgstr "" -#: ../../library/subprocess.rst:1252 +#: ../../library/subprocess.rst:1251 msgid "" "In the following examples, we assume that the relevant functions have " "already been imported from the :mod:`subprocess` module." msgstr "" -#: ../../library/subprocess.rst:1257 +#: ../../library/subprocess.rst:1256 msgid "Replacing :program:`/bin/sh` shell command substitution" msgstr "" -#: ../../library/subprocess.rst:1263 ../../library/subprocess.rst:1274 -#: ../../library/subprocess.rst:1291 +#: ../../library/subprocess.rst:1262 ../../library/subprocess.rst:1273 +#: ../../library/subprocess.rst:1290 msgid "becomes::" msgstr "" "變成:\n" "\n" "::" -#: ../../library/subprocess.rst:1268 +#: ../../library/subprocess.rst:1267 msgid "Replacing shell pipeline" msgstr "" -#: ../../library/subprocess.rst:1281 +#: ../../library/subprocess.rst:1280 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:1284 +#: ../../library/subprocess.rst:1283 msgid "" "Alternatively, for trusted input, the shell's own pipeline support may still " "be used directly:" msgstr "" -#: ../../library/subprocess.rst:1297 +#: ../../library/subprocess.rst:1296 msgid "Replacing :func:`os.system`" msgstr "" -#: ../../library/subprocess.rst:1305 +#: ../../library/subprocess.rst:1304 msgid "Notes:" msgstr "註解:" -#: ../../library/subprocess.rst:1307 +#: ../../library/subprocess.rst:1306 msgid "Calling the program through the shell is usually not required." msgstr "" -#: ../../library/subprocess.rst:1308 +#: ../../library/subprocess.rst:1307 msgid "" "The :func:`call` return value is encoded differently to that of :func:`os." "system`." msgstr "" -#: ../../library/subprocess.rst:1311 +#: ../../library/subprocess.rst:1310 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:1315 +#: ../../library/subprocess.rst:1314 msgid "A more realistic example would look like this::" msgstr "" -#: ../../library/subprocess.rst:1328 +#: ../../library/subprocess.rst:1327 msgid "Replacing the :func:`os.spawn ` family" msgstr "" -#: ../../library/subprocess.rst:1330 +#: ../../library/subprocess.rst:1329 msgid "P_NOWAIT example::" msgstr "" "P_NOWAIT 範例:\n" "\n" "::" -#: ../../library/subprocess.rst:1336 +#: ../../library/subprocess.rst:1335 msgid "P_WAIT example::" msgstr "" "P_WAIT 範例:\n" "\n" "::" -#: ../../library/subprocess.rst:1342 +#: ../../library/subprocess.rst:1341 msgid "Vector example::" msgstr "" -#: ../../library/subprocess.rst:1348 +#: ../../library/subprocess.rst:1347 msgid "Environment example::" msgstr "" -#: ../../library/subprocess.rst:1357 +#: ../../library/subprocess.rst:1356 msgid "Replacing :func:`os.popen`, :func:`os.popen2`, :func:`os.popen3`" msgstr "" -#: ../../library/subprocess.rst:1387 +#: ../../library/subprocess.rst:1386 msgid "Return code handling translates as follows::" msgstr "" -#: ../../library/subprocess.rst:1403 +#: ../../library/subprocess.rst:1402 msgid "Replacing functions from the :mod:`popen2` module" msgstr "" -#: ../../library/subprocess.rst:1407 +#: ../../library/subprocess.rst:1406 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:1426 +#: ../../library/subprocess.rst:1425 msgid "" ":class:`popen2.Popen3` and :class:`popen2.Popen4` basically work as :class:" "`subprocess.Popen`, except that:" msgstr "" -#: ../../library/subprocess.rst:1429 +#: ../../library/subprocess.rst:1428 msgid ":class:`Popen` raises an exception if the execution fails." msgstr "" -#: ../../library/subprocess.rst:1431 +#: ../../library/subprocess.rst:1430 msgid "The *capturestderr* argument is replaced with the *stderr* argument." msgstr "" -#: ../../library/subprocess.rst:1433 +#: ../../library/subprocess.rst:1432 msgid "``stdin=PIPE`` and ``stdout=PIPE`` must be specified." msgstr "" -#: ../../library/subprocess.rst:1435 +#: ../../library/subprocess.rst:1434 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:1441 +#: ../../library/subprocess.rst:1440 msgid "Legacy Shell Invocation Functions" msgstr "" -#: ../../library/subprocess.rst:1443 +#: ../../library/subprocess.rst:1442 msgid "" "This module also provides the following legacy functions from the 2.x " "``commands`` module. These operations implicitly invoke the system shell and " @@ -1614,92 +1609,92 @@ msgid "" "handling consistency are valid for these functions." msgstr "" -#: ../../library/subprocess.rst:1450 +#: ../../library/subprocess.rst:1449 msgid "Return ``(exitcode, output)`` of executing *cmd* in a shell." msgstr "" -#: ../../library/subprocess.rst:1452 +#: ../../library/subprocess.rst:1451 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:1456 +#: ../../library/subprocess.rst:1455 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:1470 ../../library/subprocess.rst:1490 +#: ../../library/subprocess.rst:1469 ../../library/subprocess.rst:1489 msgid ":ref:`Availability `: POSIX & Windows." msgstr ":ref:`適用 `:POSIX 和 Windows。" -#: ../../library/subprocess.rst:1471 +#: ../../library/subprocess.rst:1470 msgid "Windows support was added." msgstr "" -#: ../../library/subprocess.rst:1474 +#: ../../library/subprocess.rst:1473 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:1481 +#: ../../library/subprocess.rst:1480 msgid "Return output (stdout and stderr) of executing *cmd* in a shell." msgstr "" -#: ../../library/subprocess.rst:1483 +#: ../../library/subprocess.rst:1482 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:1491 +#: ../../library/subprocess.rst:1490 msgid "Windows support added" msgstr "" -#: ../../library/subprocess.rst:1496 +#: ../../library/subprocess.rst:1495 msgid "Notes" msgstr "註解" -#: ../../library/subprocess.rst:1501 +#: ../../library/subprocess.rst:1500 msgid "Converting an argument sequence to a string on Windows" msgstr "" -#: ../../library/subprocess.rst:1503 +#: ../../library/subprocess.rst:1502 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:1507 +#: ../../library/subprocess.rst:1506 msgid "" "Arguments are delimited by white space, which is either a space or a tab." msgstr "" -#: ../../library/subprocess.rst:1510 +#: ../../library/subprocess.rst:1509 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:1515 +#: ../../library/subprocess.rst:1514 msgid "" "A double quotation mark preceded by a backslash is interpreted as a literal " "double quotation mark." msgstr "" -#: ../../library/subprocess.rst:1518 +#: ../../library/subprocess.rst:1517 msgid "" "Backslashes are interpreted literally, unless they immediately precede a " "double quotation mark." msgstr "" -#: ../../library/subprocess.rst:1521 +#: ../../library/subprocess.rst:1520 msgid "" "If backslashes immediately precede a double quotation mark, every pair of " "backslashes is interpreted as a literal backslash. If the number of " @@ -1707,10 +1702,10 @@ msgid "" "mark as described in rule 3." msgstr "" -#: ../../library/subprocess.rst:1530 +#: ../../library/subprocess.rst:1529 msgid ":mod:`shlex`" msgstr ":mod:`shlex`" -#: ../../library/subprocess.rst:1531 +#: ../../library/subprocess.rst:1530 msgid "Module which provides function to parse and escape command lines." msgstr "" diff --git a/library/sunau.po b/library/sunau.po index 0c56b50064..9110ae5624 100644 --- a/library/sunau.po +++ b/library/sunau.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.10\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2022-03-23 00:14+0000\n" +"POT-Creation-Date: 2022-05-21 17:35+0000\n" "PO-Revision-Date: 2018-05-23 16:11+0000\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -27,328 +27,331 @@ msgid "**Source code:** :source:`Lib/sunau.py`" msgstr "**原始碼:**\\ :source:`Lib/sunau.py`" #: ../../library/sunau.rst:12 -msgid "The :mod:`sunau` module is deprecated (see :pep:`594` for details)." -msgstr ":mod:`sunau` 模組 (module) 即將被棄用(詳見 :pep:`594`\\ )。" +msgid "" +"The :mod:`sunau` module is deprecated (see :pep:`PEP 594 <594#sunau>` for " +"details)." +msgstr "" +":mod:`sunau` 模組 (module) 即將被棄用(詳見 :pep:`PEP 594 <594#sunau>`\\ )。" -#: ../../library/sunau.rst:17 +#: ../../library/sunau.rst:18 msgid "" "The :mod:`sunau` module provides a convenient interface to the Sun AU sound " "format. Note that this module is interface-compatible with the modules :mod:" "`aifc` and :mod:`wave`." msgstr "" -#: ../../library/sunau.rst:21 +#: ../../library/sunau.rst:22 msgid "" "An audio file consists of a header followed by the data. The fields of the " "header are:" msgstr "" -#: ../../library/sunau.rst:25 +#: ../../library/sunau.rst:26 msgid "Field" msgstr "欄位" -#: ../../library/sunau.rst:25 +#: ../../library/sunau.rst:26 msgid "Contents" msgstr "內容" -#: ../../library/sunau.rst:27 +#: ../../library/sunau.rst:28 msgid "magic word" msgstr "" -#: ../../library/sunau.rst:27 +#: ../../library/sunau.rst:28 msgid "The four bytes ``.snd``." msgstr "" -#: ../../library/sunau.rst:29 +#: ../../library/sunau.rst:30 msgid "header size" msgstr "" -#: ../../library/sunau.rst:29 +#: ../../library/sunau.rst:30 msgid "Size of the header, including info, in bytes." msgstr "" -#: ../../library/sunau.rst:31 +#: ../../library/sunau.rst:32 msgid "data size" msgstr "" -#: ../../library/sunau.rst:31 +#: ../../library/sunau.rst:32 msgid "Physical size of the data, in bytes." msgstr "" -#: ../../library/sunau.rst:33 +#: ../../library/sunau.rst:34 msgid "encoding" msgstr "" -#: ../../library/sunau.rst:33 +#: ../../library/sunau.rst:34 msgid "Indicates how the audio samples are encoded." msgstr "" -#: ../../library/sunau.rst:35 +#: ../../library/sunau.rst:36 msgid "sample rate" msgstr "" -#: ../../library/sunau.rst:35 +#: ../../library/sunau.rst:36 msgid "The sampling rate." msgstr "" -#: ../../library/sunau.rst:37 +#: ../../library/sunau.rst:38 msgid "# of channels" msgstr "" -#: ../../library/sunau.rst:37 +#: ../../library/sunau.rst:38 msgid "The number of channels in the samples." msgstr "" -#: ../../library/sunau.rst:39 +#: ../../library/sunau.rst:40 msgid "info" msgstr "" -#: ../../library/sunau.rst:39 +#: ../../library/sunau.rst:40 msgid "" "ASCII string giving a description of the audio file (padded with null bytes)." msgstr "" -#: ../../library/sunau.rst:43 +#: ../../library/sunau.rst:44 msgid "" "Apart from the info field, all header fields are 4 bytes in size. They are " "all 32-bit unsigned integers encoded in big-endian byte order." msgstr "" -#: ../../library/sunau.rst:46 +#: ../../library/sunau.rst:47 msgid "The :mod:`sunau` module defines the following functions:" msgstr "" -#: ../../library/sunau.rst:51 +#: ../../library/sunau.rst:52 msgid "" "If *file* is a string, open the file by that name, otherwise treat it as a " "seekable file-like object. *mode* can be any of" msgstr "" -#: ../../library/sunau.rst:55 +#: ../../library/sunau.rst:56 msgid "``'r'``" msgstr "``'r'``" -#: ../../library/sunau.rst:55 +#: ../../library/sunau.rst:56 msgid "Read only mode." msgstr "" -#: ../../library/sunau.rst:58 +#: ../../library/sunau.rst:59 msgid "``'w'``" msgstr "``'w'``" -#: ../../library/sunau.rst:58 +#: ../../library/sunau.rst:59 msgid "Write only mode." msgstr "" -#: ../../library/sunau.rst:60 +#: ../../library/sunau.rst:61 msgid "Note that it does not allow read/write files." msgstr "" -#: ../../library/sunau.rst:62 +#: ../../library/sunau.rst:63 msgid "" "A *mode* of ``'r'`` returns an :class:`AU_read` object, while a *mode* of " "``'w'`` or ``'wb'`` returns an :class:`AU_write` object." msgstr "" -#: ../../library/sunau.rst:66 +#: ../../library/sunau.rst:67 msgid "The :mod:`sunau` module defines the following exception:" msgstr ":mod:`sunau` 模組定義了以下例外:" -#: ../../library/sunau.rst:70 +#: ../../library/sunau.rst:71 msgid "" "An error raised when something is impossible because of Sun AU specs or " "implementation deficiency." msgstr "" -#: ../../library/sunau.rst:74 +#: ../../library/sunau.rst:75 msgid "The :mod:`sunau` module defines the following data items:" msgstr "" -#: ../../library/sunau.rst:78 +#: ../../library/sunau.rst:79 msgid "" "An integer every valid Sun AU file begins with, stored in big-endian form. " "This is the string ``.snd`` interpreted as an integer." msgstr "" -#: ../../library/sunau.rst:89 +#: ../../library/sunau.rst:90 msgid "" "Values of the encoding field from the AU header which are supported by this " "module." msgstr "" -#: ../../library/sunau.rst:100 +#: ../../library/sunau.rst:101 msgid "" "Additional known values of the encoding field from the AU header, but which " "are not supported by this module." msgstr "" -#: ../../library/sunau.rst:107 +#: ../../library/sunau.rst:108 msgid "AU_read Objects" msgstr "AU_read 物件" -#: ../../library/sunau.rst:109 +#: ../../library/sunau.rst:110 msgid "" "AU_read objects, as returned by :func:`.open` above, have the following " "methods:" msgstr "" -#: ../../library/sunau.rst:114 +#: ../../library/sunau.rst:115 msgid "" "Close the stream, and make the instance unusable. (This is called " "automatically on deletion.)" msgstr "" -#: ../../library/sunau.rst:120 +#: ../../library/sunau.rst:121 msgid "Returns number of audio channels (1 for mono, 2 for stereo)." msgstr "" -#: ../../library/sunau.rst:125 +#: ../../library/sunau.rst:126 msgid "Returns sample width in bytes." msgstr "" -#: ../../library/sunau.rst:130 +#: ../../library/sunau.rst:131 msgid "Returns sampling frequency." msgstr "" -#: ../../library/sunau.rst:135 +#: ../../library/sunau.rst:136 msgid "Returns number of audio frames." msgstr "" -#: ../../library/sunau.rst:140 +#: ../../library/sunau.rst:141 msgid "" "Returns compression type. Supported compression types are ``'ULAW'``, " "``'ALAW'`` and ``'NONE'``." msgstr "" -#: ../../library/sunau.rst:146 +#: ../../library/sunau.rst:147 msgid "" "Human-readable version of :meth:`getcomptype`. The supported types have the " "respective names ``'CCITT G.711 u-law'``, ``'CCITT G.711 A-law'`` and ``'not " "compressed'``." msgstr "" -#: ../../library/sunau.rst:153 +#: ../../library/sunau.rst:154 msgid "" "Returns a :func:`~collections.namedtuple` ``(nchannels, sampwidth, " "framerate, nframes, comptype, compname)``, equivalent to output of the :meth:" "`get\\*` methods." msgstr "" -#: ../../library/sunau.rst:160 +#: ../../library/sunau.rst:161 msgid "" "Reads and returns at most *n* frames of audio, as a :class:`bytes` object. " "The data will be returned in linear format. If the original data is in u-" "LAW format, it will be converted." msgstr "" -#: ../../library/sunau.rst:167 +#: ../../library/sunau.rst:168 msgid "Rewind the file pointer to the beginning of the audio stream." msgstr "" -#: ../../library/sunau.rst:169 +#: ../../library/sunau.rst:170 msgid "" "The following two methods define a term \"position\" which is compatible " "between them, and is otherwise implementation dependent." msgstr "" -#: ../../library/sunau.rst:175 +#: ../../library/sunau.rst:176 msgid "" "Set the file pointer to the specified position. Only values returned from :" "meth:`tell` should be used for *pos*." msgstr "" -#: ../../library/sunau.rst:181 +#: ../../library/sunau.rst:182 msgid "" "Return current file pointer position. Note that the returned value has " "nothing to do with the actual position in the file." msgstr "" -#: ../../library/sunau.rst:184 +#: ../../library/sunau.rst:185 msgid "" "The following two functions are defined for compatibility with the :mod:" "`aifc`, and don't do anything interesting." msgstr "" -#: ../../library/sunau.rst:190 +#: ../../library/sunau.rst:191 msgid "Returns ``None``." msgstr "" -#: ../../library/sunau.rst:195 +#: ../../library/sunau.rst:196 msgid "Raise an error." msgstr "" -#: ../../library/sunau.rst:201 +#: ../../library/sunau.rst:202 msgid "AU_write Objects" msgstr "AU_write 物件" -#: ../../library/sunau.rst:203 +#: ../../library/sunau.rst:204 msgid "" "AU_write objects, as returned by :func:`.open` above, have the following " "methods:" msgstr "" -#: ../../library/sunau.rst:208 +#: ../../library/sunau.rst:209 msgid "Set the number of channels." msgstr "" -#: ../../library/sunau.rst:213 +#: ../../library/sunau.rst:214 msgid "Set the sample width (in bytes.)" msgstr "" -#: ../../library/sunau.rst:215 +#: ../../library/sunau.rst:216 msgid "Added support for 24-bit samples." msgstr "" -#: ../../library/sunau.rst:221 +#: ../../library/sunau.rst:222 msgid "Set the frame rate." msgstr "" -#: ../../library/sunau.rst:226 +#: ../../library/sunau.rst:227 msgid "" "Set the number of frames. This can be later changed, when and if more " "frames are written." msgstr "" -#: ../../library/sunau.rst:232 +#: ../../library/sunau.rst:233 msgid "" "Set the compression type and description. Only ``'NONE'`` and ``'ULAW'`` are " "supported on output." msgstr "" -#: ../../library/sunau.rst:238 +#: ../../library/sunau.rst:239 msgid "" "The *tuple* should be ``(nchannels, sampwidth, framerate, nframes, comptype, " "compname)``, with values valid for the :meth:`set\\*` methods. Set all " "parameters." msgstr "" -#: ../../library/sunau.rst:245 +#: ../../library/sunau.rst:246 msgid "" "Return current position in the file, with the same disclaimer for the :meth:" "`AU_read.tell` and :meth:`AU_read.setpos` methods." msgstr "" -#: ../../library/sunau.rst:251 +#: ../../library/sunau.rst:252 msgid "Write audio frames, without correcting *nframes*." msgstr "" -#: ../../library/sunau.rst:253 ../../library/sunau.rst:261 +#: ../../library/sunau.rst:254 ../../library/sunau.rst:262 msgid "Any :term:`bytes-like object` is now accepted." msgstr "" -#: ../../library/sunau.rst:259 +#: ../../library/sunau.rst:260 msgid "Write audio frames and make sure *nframes* is correct." msgstr "" -#: ../../library/sunau.rst:267 +#: ../../library/sunau.rst:268 msgid "Make sure *nframes* is correct, and close the file." msgstr "" -#: ../../library/sunau.rst:269 +#: ../../library/sunau.rst:270 msgid "This method is called upon deletion." msgstr "" -#: ../../library/sunau.rst:271 +#: ../../library/sunau.rst:272 msgid "" "Note that it is invalid to set any parameters after calling :meth:" "`writeframes` or :meth:`writeframesraw`." diff --git a/library/telnetlib.po b/library/telnetlib.po index 76bc508c5c..3e298bb617 100644 --- a/library/telnetlib.po +++ b/library/telnetlib.po @@ -7,8 +7,8 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.10\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2022-03-23 00:14+0000\n" -"PO-Revision-Date: 2018-05-23 16:12+0000\n" +"POT-Creation-Date: 2022-05-21 17:35+0000\n" +"PO-Revision-Date: 2022-05-22 02:15+0800\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" "tw)\n" @@ -17,6 +17,7 @@ msgstr "" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" "Plural-Forms: nplurals=1; plural=0;\n" +"X-Generator: Poedit 3.0.1\n" #: ../../library/telnetlib.rst:2 msgid ":mod:`telnetlib` --- Telnet client" @@ -27,10 +28,14 @@ msgid "**Source code:** :source:`Lib/telnetlib.py`" msgstr "**原始碼:**\\ :source:`Lib/telnetlib.py`" #: ../../library/telnetlib.rst:14 -msgid "The :mod:`telnetlib` module is deprecated (see :pep:`594` for details)." -msgstr ":mod:`telnetlib` 模組 (module) 即將被棄用(詳見 :pep:`594`\\ )。" +msgid "" +"The :mod:`telnetlib` module is deprecated (see :pep:`PEP 594 " +"<594#telnetlib>` for details and alternatives)." +msgstr "" +":mod:`telnetlib` 模組 (module) 即將被棄用(詳情與替代方案請見 :pep:`PEP 594 " +"<594#telnetlib>`\\ )。" -#: ../../library/telnetlib.rst:19 +#: ../../library/telnetlib.rst:20 msgid "" "The :mod:`telnetlib` module provides a :class:`Telnet` class that implements " "the Telnet protocol. See :rfc:`854` for details about the protocol. In " @@ -41,7 +46,7 @@ msgid "" "in ``arpa/telnet.h``, see the module source itself." msgstr "" -#: ../../library/telnetlib.rst:27 +#: ../../library/telnetlib.rst:28 msgid "" "The symbolic constants for the telnet commands are: IAC, DONT, DO, WONT, " "WILL, SE (Subnegotiation End), NOP (No Operation), DM (Data Mark), BRK " @@ -49,7 +54,7 @@ msgid "" "(Erase Character), EL (Erase Line), GA (Go Ahead), SB (Subnegotiation Begin)." msgstr "" -#: ../../library/telnetlib.rst:35 +#: ../../library/telnetlib.rst:36 msgid "" ":class:`Telnet` represents a connection to a Telnet server. The instance is " "initially not connected by default; the :meth:`~Telnet.open` method must be " @@ -61,11 +66,11 @@ msgid "" "global default timeout setting will be used)." msgstr "" -#: ../../library/telnetlib.rst:44 +#: ../../library/telnetlib.rst:45 msgid "Do not reopen an already connected instance." msgstr "" -#: ../../library/telnetlib.rst:46 +#: ../../library/telnetlib.rst:47 msgid "" "This class has many :meth:`read_\\*` methods. Note that some of them " "raise :exc:`EOFError` when the end of the connection is read, because they " @@ -73,100 +78,100 @@ msgid "" "descriptions below." msgstr "" -#: ../../library/telnetlib.rst:50 +#: ../../library/telnetlib.rst:51 msgid "" "A :class:`Telnet` object is a context manager and can be used in a :keyword:" "`with` statement. When the :keyword:`!with` block ends, the :meth:`close` " "method is called::" msgstr "" -#: ../../library/telnetlib.rst:59 +#: ../../library/telnetlib.rst:60 msgid "Context manager support added" msgstr "" -#: ../../library/telnetlib.rst:64 +#: ../../library/telnetlib.rst:65 msgid ":rfc:`854` - Telnet Protocol Specification" msgstr "" -#: ../../library/telnetlib.rst:65 +#: ../../library/telnetlib.rst:66 msgid "Definition of the Telnet protocol." msgstr "" -#: ../../library/telnetlib.rst:71 +#: ../../library/telnetlib.rst:72 msgid "Telnet Objects" msgstr "" -#: ../../library/telnetlib.rst:73 +#: ../../library/telnetlib.rst:74 msgid ":class:`Telnet` instances have the following methods:" msgstr "" -#: ../../library/telnetlib.rst:78 +#: ../../library/telnetlib.rst:79 msgid "" "Read until a given byte string, *expected*, is encountered or until " "*timeout* seconds have passed." msgstr "" -#: ../../library/telnetlib.rst:81 +#: ../../library/telnetlib.rst:82 msgid "" "When no match is found, return whatever is available instead, possibly empty " "bytes. Raise :exc:`EOFError` if the connection is closed and no cooked data " "is available." msgstr "" -#: ../../library/telnetlib.rst:88 +#: ../../library/telnetlib.rst:89 msgid "Read all data until EOF as bytes; block until connection closed." msgstr "" -#: ../../library/telnetlib.rst:93 +#: ../../library/telnetlib.rst:94 msgid "" "Read at least one byte of cooked data unless EOF is hit. Return ``b''`` if " "EOF is hit. Block if no data is immediately available." msgstr "" -#: ../../library/telnetlib.rst:99 +#: ../../library/telnetlib.rst:100 msgid "Read everything that can be without blocking in I/O (eager)." msgstr "" -#: ../../library/telnetlib.rst:101 ../../library/telnetlib.rst:110 +#: ../../library/telnetlib.rst:102 ../../library/telnetlib.rst:111 msgid "" "Raise :exc:`EOFError` if connection closed and no cooked data available. " "Return ``b''`` if no cooked data available otherwise. Do not block unless in " "the midst of an IAC sequence." msgstr "" -#: ../../library/telnetlib.rst:108 +#: ../../library/telnetlib.rst:109 msgid "Read readily available data." msgstr "" -#: ../../library/telnetlib.rst:117 +#: ../../library/telnetlib.rst:118 msgid "Process and return data already in the queues (lazy)." msgstr "" -#: ../../library/telnetlib.rst:119 +#: ../../library/telnetlib.rst:120 msgid "" "Raise :exc:`EOFError` if connection closed and no data available. Return " "``b''`` if no cooked data available otherwise. Do not block unless in the " "midst of an IAC sequence." msgstr "" -#: ../../library/telnetlib.rst:126 +#: ../../library/telnetlib.rst:127 msgid "Return any data available in the cooked queue (very lazy)." msgstr "" -#: ../../library/telnetlib.rst:128 +#: ../../library/telnetlib.rst:129 msgid "" "Raise :exc:`EOFError` if connection closed and no data available. Return " "``b''`` if no cooked data available otherwise. This method never blocks." msgstr "" -#: ../../library/telnetlib.rst:134 +#: ../../library/telnetlib.rst:135 msgid "" "Return the data collected between a SB/SE pair (suboption begin/end). The " "callback should access these data when it was invoked with a ``SE`` command. " "This method never blocks." msgstr "" -#: ../../library/telnetlib.rst:141 +#: ../../library/telnetlib.rst:142 msgid "" "Connect to a host. The optional second argument is the port number, which " "defaults to the standard Telnet port (23). The optional *timeout* parameter " @@ -174,73 +179,73 @@ msgid "" "attempt (if not specified, the global default timeout setting will be used)." msgstr "" -#: ../../library/telnetlib.rst:146 +#: ../../library/telnetlib.rst:147 msgid "Do not try to reopen an already connected instance." msgstr "" -#: ../../library/telnetlib.rst:148 +#: ../../library/telnetlib.rst:149 msgid "" "Raises an :ref:`auditing event ` ``telnetlib.Telnet.open`` with " "arguments ``self``, ``host``, ``port``." msgstr "" -#: ../../library/telnetlib.rst:153 +#: ../../library/telnetlib.rst:154 msgid "" "Print a debug message when the debug level is ``>`` 0. If extra arguments " "are present, they are substituted in the message using the standard string " "formatting operator." msgstr "" -#: ../../library/telnetlib.rst:160 +#: ../../library/telnetlib.rst:161 msgid "" "Set the debug level. The higher the value of *debuglevel*, the more debug " "output you get (on ``sys.stdout``)." msgstr "" -#: ../../library/telnetlib.rst:166 +#: ../../library/telnetlib.rst:167 msgid "Close the connection." msgstr "" -#: ../../library/telnetlib.rst:171 +#: ../../library/telnetlib.rst:172 msgid "Return the socket object used internally." msgstr "" -#: ../../library/telnetlib.rst:176 +#: ../../library/telnetlib.rst:177 msgid "Return the file descriptor of the socket object used internally." msgstr "" -#: ../../library/telnetlib.rst:181 +#: ../../library/telnetlib.rst:182 msgid "" "Write a byte string to the socket, doubling any IAC characters. This can " "block if the connection is blocked. May raise :exc:`OSError` if the " "connection is closed." msgstr "" -#: ../../library/telnetlib.rst:185 +#: ../../library/telnetlib.rst:186 msgid "" "Raises an :ref:`auditing event ` ``telnetlib.Telnet.write`` with " "arguments ``self``, ``buffer``." msgstr "" -#: ../../library/telnetlib.rst:187 +#: ../../library/telnetlib.rst:188 msgid "" "This method used to raise :exc:`socket.error`, which is now an alias of :exc:" "`OSError`." msgstr "" -#: ../../library/telnetlib.rst:194 +#: ../../library/telnetlib.rst:195 msgid "Interaction function, emulates a very dumb Telnet client." msgstr "" -#: ../../library/telnetlib.rst:199 +#: ../../library/telnetlib.rst:200 msgid "Multithreaded version of :meth:`interact`." msgstr "" -#: ../../library/telnetlib.rst:204 +#: ../../library/telnetlib.rst:205 msgid "Read until one from a list of a regular expressions matches." msgstr "" -#: ../../library/telnetlib.rst:206 +#: ../../library/telnetlib.rst:207 msgid "" "The first argument is a list of regular expressions, either compiled (:ref:" "`regex objects `) or uncompiled (byte strings). The optional " @@ -248,28 +253,28 @@ msgid "" "indefinitely." msgstr "" -#: ../../library/telnetlib.rst:211 +#: ../../library/telnetlib.rst:212 msgid "" "Return a tuple of three items: the index in the list of the first regular " "expression that matches; the match object returned; and the bytes read up " "till and including the match." msgstr "" -#: ../../library/telnetlib.rst:215 +#: ../../library/telnetlib.rst:216 msgid "" "If end of file is found and no bytes were read, raise :exc:`EOFError`. " "Otherwise, when nothing matches, return ``(-1, None, data)`` where *data* is " "the bytes received so far (may be empty bytes if a timeout happened)." msgstr "" -#: ../../library/telnetlib.rst:219 +#: ../../library/telnetlib.rst:220 msgid "" "If a regular expression ends with a greedy match (such as ``.*``) or if more " "than one expression can match the same input, the results are non-" "deterministic, and may depend on the I/O timing." msgstr "" -#: ../../library/telnetlib.rst:226 +#: ../../library/telnetlib.rst:227 msgid "" "Each time a telnet option is read on the input flow, this *callback* (if " "set) is called with the following parameters: callback(telnet socket, " @@ -277,10 +282,10 @@ msgid "" "telnetlib." msgstr "" -#: ../../library/telnetlib.rst:234 +#: ../../library/telnetlib.rst:235 msgid "Telnet Example" msgstr "Telnet 範例" -#: ../../library/telnetlib.rst:239 +#: ../../library/telnetlib.rst:240 msgid "A simple example illustrating typical use::" msgstr "" diff --git a/library/tempfile.po b/library/tempfile.po index 3697f38e71..0c6b1e6078 100644 --- a/library/tempfile.po +++ b/library/tempfile.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.10\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2022-03-24 00:12+0000\n" +"POT-Creation-Date: 2022-05-21 17:35+0000\n" "PO-Revision-Date: 2018-05-23 16:12+0000\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -128,11 +128,10 @@ msgid "" "attr:`name` attribute of the returned file-like object. Whether the name " "can be used to open the file a second time, while the named temporary file " "is still open, varies across platforms (it can be so used on Unix; it cannot " -"on Windows NT or later). If *delete* is true (the default), the file is " -"deleted as soon as it is closed. The returned object is always a file-like " -"object whose :attr:`!file` attribute is the underlying true file object. " -"This file-like object can be used in a :keyword:`with` statement, just like " -"a normal file." +"on Windows). If *delete* is true (the default), the file is deleted as soon " +"as it is closed. The returned object is always a file-like object whose :" +"attr:`!file` attribute is the underlying true file object. This file-like " +"object can be used in a :keyword:`with` statement, just like a normal file." msgstr "" #: ../../library/tempfile.rst:101 diff --git a/library/tkinter.po b/library/tkinter.po index 5b8de29416..bae0b45eb7 100644 --- a/library/tkinter.po +++ b/library/tkinter.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.10\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2022-02-15 00:10+0000\n" +"POT-Creation-Date: 2022-05-21 17:35+0000\n" "PO-Revision-Date: 2018-05-23 16:13+0000\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -190,7 +190,7 @@ msgid "" "difference (see `Threading model`_ for details)." msgstr "" -#: ../../library/tkinter.rst:97 ../../library/tkinter.rst:851 +#: ../../library/tkinter.rst:97 ../../library/tkinter.rst:908 msgid "Tk" msgstr "Tk" @@ -244,12 +244,119 @@ msgstr "" #: ../../library/tkinter.rst:129 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." +"Construct a toplevel Tk widget, which is usually the main window of an " +"application, and initialize a Tcl interpreter for this widget. Each " +"instance has its own associated Tcl interpreter." msgstr "" -#: ../../library/tkinter.rst:138 +#: ../../library/tkinter.rst:133 +msgid "" +"The :class:`Tk` class is typically instantiated using all default values. " +"However, the following keyword arguments are currently recognized:" +msgstr "" + +#: ../../library/tkinter.rst:137 +msgid "*screenName*" +msgstr "" + +#: ../../library/tkinter.rst:137 +msgid "" +"When given (as a string), sets the :envvar:`DISPLAY` environment variable. " +"(X11 only)" +msgstr "" + +#: ../../library/tkinter.rst:140 +msgid "*baseName*" +msgstr "" + +#: ../../library/tkinter.rst:140 +msgid "" +"Name of the profile file. By default, *baseName* is derived from the " +"program name (``sys.argv[0]``)." +msgstr "" + +#: ../../library/tkinter.rst:143 +msgid "*className*" +msgstr "" + +#: ../../library/tkinter.rst:143 +msgid "" +"Name of the widget class. Used as a profile file and also as the name with " +"which Tcl is invoked (*argv0* in *interp*)." +msgstr "" + +#: ../../library/tkinter.rst:146 +msgid "*useTk*" +msgstr "" + +#: ../../library/tkinter.rst:146 +msgid "" +"If ``True``, initialize the Tk subsystem. The :func:`tkinter.Tcl() ` " +"function sets this to ``False``." +msgstr "" + +#: ../../library/tkinter.rst:149 +msgid "*sync*" +msgstr "" + +#: ../../library/tkinter.rst:149 +msgid "" +"If ``True``, execute all X server commands synchronously, so that errors are " +"reported immediately. Can be used for debugging. (X11 only)" +msgstr "" + +#: ../../library/tkinter.rst:159 +msgid "*use*" +msgstr "" + +#: ../../library/tkinter.rst:152 +msgid "" +"Specifies the *id* of the window in which to embed the application, instead " +"of it being created as an independent toplevel window. *id* must be " +"specified in the same way as the value for the -use option for toplevel " +"widgets (that is, it has a form like that returned by :meth:`winfo_id`)." +msgstr "" + +#: ../../library/tkinter.rst:158 +msgid "" +"Note that on some platforms this will only work correctly if *id* refers to " +"a Tk frame or toplevel that has its -container option enabled." +msgstr "" + +#: ../../library/tkinter.rst:161 +msgid "" +":class:`Tk` reads and interprets profile files, named :file:`.{className}." +"tcl` and :file:`.{baseName}.tcl`, into the Tcl interpreter and calls :func:" +"`exec` on the contents of :file:`.{className}.py` and :file:`.{baseName}." +"py`. The path for the profile files is the :envvar:`HOME` environment " +"variable or, if that isn't defined, then :attr:`os.curdir`." +msgstr "" + +#: ../../library/tkinter.rst:170 +msgid "" +"The Tk application object created by instantiating :class:`Tk`. This " +"provides access to the Tcl interpreter. Each widget that is attached the " +"same instance of :class:`Tk` has the same value for its :attr:`tk` attribute." +msgstr "" + +#: ../../library/tkinter.rst:177 +msgid "" +"The widget object that contains this widget. For :class:`Tk`, the *master* " +"is :const:`None` because it is the main window. The terms *master* and " +"*parent* are similar and sometimes used interchangeably as argument names; " +"however, calling :meth:`winfo_parent` returns a string of the widget name " +"whereas :attr:`master` returns the object. *parent*/*child* reflects the " +"tree-like relationship while *master*/*slave* reflects the container " +"structure." +msgstr "" + +#: ../../library/tkinter.rst:187 +msgid "" +"The immediate descendants of this widget as a :class:`dict` with the child " +"widget names as the keys and the child instance objects as the values." +msgstr "" + +#: ../../library/tkinter.rst:194 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 " @@ -261,93 +368,93 @@ msgid "" "`loadtk` method." msgstr "" -#: ../../library/tkinter.rst:147 +#: ../../library/tkinter.rst:203 msgid "The modules that provide Tk support include:" msgstr "" -#: ../../library/tkinter.rst:150 +#: ../../library/tkinter.rst:206 msgid ":mod:`tkinter`" msgstr ":mod:`tkinter`" -#: ../../library/tkinter.rst:150 +#: ../../library/tkinter.rst:206 msgid "Main Tkinter module." msgstr "" -#: ../../library/tkinter.rst:153 +#: ../../library/tkinter.rst:209 msgid ":mod:`tkinter.colorchooser`" msgstr ":mod:`tkinter.colorchooser`" -#: ../../library/tkinter.rst:153 +#: ../../library/tkinter.rst:209 msgid "Dialog to let the user choose a color." msgstr "" -#: ../../library/tkinter.rst:156 +#: ../../library/tkinter.rst:212 msgid ":mod:`tkinter.commondialog`" msgstr ":mod:`tkinter.commondialog`" -#: ../../library/tkinter.rst:156 +#: ../../library/tkinter.rst:212 msgid "Base class for the dialogs defined in the other modules listed here." msgstr "" -#: ../../library/tkinter.rst:159 +#: ../../library/tkinter.rst:215 msgid ":mod:`tkinter.filedialog`" msgstr ":mod:`tkinter.filedialog`" -#: ../../library/tkinter.rst:159 +#: ../../library/tkinter.rst:215 msgid "Common dialogs to allow the user to specify a file to open or save." msgstr "" -#: ../../library/tkinter.rst:162 +#: ../../library/tkinter.rst:218 msgid ":mod:`tkinter.font`" msgstr ":mod:`tkinter.font`" -#: ../../library/tkinter.rst:162 +#: ../../library/tkinter.rst:218 msgid "Utilities to help work with fonts." msgstr "" -#: ../../library/tkinter.rst:165 +#: ../../library/tkinter.rst:221 msgid ":mod:`tkinter.messagebox`" msgstr ":mod:`tkinter.messagebox`" -#: ../../library/tkinter.rst:165 +#: ../../library/tkinter.rst:221 msgid "Access to standard Tk dialog boxes." msgstr "" -#: ../../library/tkinter.rst:168 +#: ../../library/tkinter.rst:224 msgid ":mod:`tkinter.scrolledtext`" msgstr ":mod:`tkinter.scrolledtext`" -#: ../../library/tkinter.rst:168 +#: ../../library/tkinter.rst:224 msgid "Text widget with a vertical scroll bar built in." msgstr "" -#: ../../library/tkinter.rst:171 +#: ../../library/tkinter.rst:227 msgid ":mod:`tkinter.simpledialog`" msgstr ":mod:`tkinter.simpledialog`" -#: ../../library/tkinter.rst:171 +#: ../../library/tkinter.rst:227 msgid "Basic dialogs and convenience functions." msgstr "" -#: ../../library/tkinter.rst:175 +#: ../../library/tkinter.rst:231 msgid ":mod:`tkinter.ttk`" msgstr ":mod:`tkinter.ttk`" -#: ../../library/tkinter.rst:174 +#: ../../library/tkinter.rst:230 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:177 +#: ../../library/tkinter.rst:233 msgid "Additional modules:" msgstr "" -#: ../../library/tkinter.rst:184 +#: ../../library/tkinter.rst:240 msgid ":mod:`_tkinter`" msgstr ":mod:`_tkinter`" -#: ../../library/tkinter.rst:180 +#: ../../library/tkinter.rst:236 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 " @@ -356,60 +463,60 @@ msgid "" "interpreter." msgstr "" -#: ../../library/tkinter.rst:188 +#: ../../library/tkinter.rst:244 msgid ":mod:`idlelib`" msgstr ":mod:`idlelib`" -#: ../../library/tkinter.rst:187 +#: ../../library/tkinter.rst:243 msgid "" "Python's Integrated Development and Learning Environment (IDLE). Based on :" "mod:`tkinter`." msgstr "" -#: ../../library/tkinter.rst:193 +#: ../../library/tkinter.rst:249 msgid ":mod:`tkinter.constants`" msgstr ":mod:`tkinter.constants`" -#: ../../library/tkinter.rst:191 +#: ../../library/tkinter.rst:247 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:197 +#: ../../library/tkinter.rst:253 msgid ":mod:`tkinter.dnd`" msgstr ":mod:`tkinter.dnd`" -#: ../../library/tkinter.rst:196 +#: ../../library/tkinter.rst:252 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:201 +#: ../../library/tkinter.rst:257 msgid ":mod:`tkinter.tix`" msgstr ":mod:`tkinter.tix`" -#: ../../library/tkinter.rst:200 +#: ../../library/tkinter.rst:256 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:205 +#: ../../library/tkinter.rst:261 msgid ":mod:`turtle`" msgstr ":mod:`turtle`" -#: ../../library/tkinter.rst:204 +#: ../../library/tkinter.rst:260 msgid "Turtle graphics in a Tk window." msgstr "" -#: ../../library/tkinter.rst:208 +#: ../../library/tkinter.rst:264 msgid "Tkinter Life Preserver" msgstr "" -#: ../../library/tkinter.rst:210 +#: ../../library/tkinter.rst:266 msgid "" "This section is not designed to be an exhaustive tutorial on either Tk or " "Tkinter. For that, refer to one of the external resources noted earlier. " @@ -418,7 +525,7 @@ msgid "" "how the Tkinter wrapper is structured." msgstr "" -#: ../../library/tkinter.rst:216 +#: ../../library/tkinter.rst:272 msgid "" "The remainder of this section will help you to identify the classes, " "methods, and options you'll need in your Tkinter application, and where to " @@ -426,18 +533,18 @@ msgid "" "reference manual." msgstr "" -#: ../../library/tkinter.rst:223 +#: ../../library/tkinter.rst:279 msgid "A Hello World Program" msgstr "" -#: ../../library/tkinter.rst:225 +#: ../../library/tkinter.rst:281 msgid "" "We'll start by walking through a \"Hello World\" application in Tkinter. " "This isn't the smallest one we could write, but has enough to illustrate " "some key concepts you'll need to know." msgstr "" -#: ../../library/tkinter.rst:241 +#: ../../library/tkinter.rst:297 msgid "" "After the imports, the next line creates an instance of the :class:`Tk` " "class, which initializes Tk and creates its associated Tcl interpreter. It " @@ -445,56 +552,56 @@ msgid "" "the main window of the application." msgstr "" -#: ../../library/tkinter.rst:246 +#: ../../library/tkinter.rst:302 msgid "" "The following line creates a frame widget, which in this case will contain a " "label and a button we'll create next. The frame is fit inside the root " "window." msgstr "" -#: ../../library/tkinter.rst:250 +#: ../../library/tkinter.rst:306 msgid "" "The next line creates a label widget holding a static text string. The :meth:" "`grid` method is used to specify the relative layout (position) of the label " "within its containing frame widget, similar to how tables in HTML work." msgstr "" -#: ../../library/tkinter.rst:254 +#: ../../library/tkinter.rst:310 msgid "" "A button widget is then created, and placed to the right of the label. When " "pressed, it will call the :meth:`destroy` method of the root window." msgstr "" -#: ../../library/tkinter.rst:257 +#: ../../library/tkinter.rst:313 msgid "" "Finally, the :meth:`mainloop` method puts everything on the display, and " "responds to user input until the program terminates." msgstr "" -#: ../../library/tkinter.rst:263 +#: ../../library/tkinter.rst:319 msgid "Important Tk Concepts" msgstr "" -#: ../../library/tkinter.rst:265 +#: ../../library/tkinter.rst:321 msgid "Even this simple program illustrates the following key Tk concepts:" msgstr "" -#: ../../library/tkinter.rst:270 +#: ../../library/tkinter.rst:326 msgid "widgets" msgstr "" -#: ../../library/tkinter.rst:268 +#: ../../library/tkinter.rst:324 msgid "" "A Tkinter user interface is made up of individual *widgets*. Each widget is " "represented as a Python object, instantiated from classes like :class:`ttk." "Frame`, :class:`ttk.Label`, and :class:`ttk.Button`." msgstr "" -#: ../../library/tkinter.rst:276 +#: ../../library/tkinter.rst:332 msgid "widget hierarchy" msgstr "" -#: ../../library/tkinter.rst:273 +#: ../../library/tkinter.rst:329 msgid "" "Widgets are arranged in a *hierarchy*. The label and button were contained " "within a frame, which in turn was contained within the root window. When " @@ -502,44 +609,44 @@ msgid "" "argument to the widget constructor." msgstr "" -#: ../../library/tkinter.rst:281 +#: ../../library/tkinter.rst:337 msgid "configuration options" msgstr "" -#: ../../library/tkinter.rst:279 +#: ../../library/tkinter.rst:335 msgid "" "Widgets have *configuration options*, which modify their appearance and " "behavior, such as the text to display in a label or button. Different " "classes of widgets will have different sets of options." msgstr "" -#: ../../library/tkinter.rst:286 +#: ../../library/tkinter.rst:342 msgid "geometry management" msgstr "" -#: ../../library/tkinter.rst:284 +#: ../../library/tkinter.rst:340 msgid "" "Widgets aren't automatically added to the user interface when they are " "created. A *geometry manager* like ``grid`` controls where in the user " "interface they are placed." msgstr "" -#: ../../library/tkinter.rst:292 +#: ../../library/tkinter.rst:348 msgid "event loop" msgstr "" -#: ../../library/tkinter.rst:289 +#: ../../library/tkinter.rst:345 msgid "" "Tkinter reacts to user input, changes from your program, and even refreshes " "the display only when actively running an *event loop*. If your program " "isn't running the event loop, your user interface won't update." msgstr "" -#: ../../library/tkinter.rst:295 +#: ../../library/tkinter.rst:351 msgid "Understanding How Tkinter Wraps Tcl/Tk" msgstr "" -#: ../../library/tkinter.rst:297 +#: ../../library/tkinter.rst:353 msgid "" "When your application uses Tkinter's classes and methods, internally Tkinter " "is assembling strings representing Tcl/Tk commands, and executing those " @@ -547,7 +654,7 @@ msgid "" "instance." msgstr "" -#: ../../library/tkinter.rst:302 +#: ../../library/tkinter.rst:358 msgid "" "Whether it's trying to navigate reference documentation, trying to find the " "right method or option, adapting some existing code, or debugging your " @@ -555,13 +662,13 @@ msgid "" "what those underlying Tcl/Tk commands look like." msgstr "" -#: ../../library/tkinter.rst:307 +#: ../../library/tkinter.rst:363 msgid "" "To illustrate, here is the Tcl/Tk equivalent of the main part of the Tkinter " "script above." msgstr "" -#: ../../library/tkinter.rst:318 +#: ../../library/tkinter.rst:374 msgid "" "Tcl's syntax is similar to many shell languages, where the first word is the " "command to be executed, with arguments to that command following it, " @@ -569,25 +676,25 @@ msgid "" "following:" msgstr "" -#: ../../library/tkinter.rst:322 +#: ../../library/tkinter.rst:378 msgid "" "The commands used to create widgets (like ``ttk::frame``) correspond to " "widget classes in Tkinter." msgstr "" -#: ../../library/tkinter.rst:325 +#: ../../library/tkinter.rst:381 msgid "" "Tcl widget options (like ``-text``) correspond to keyword arguments in " "Tkinter." msgstr "" -#: ../../library/tkinter.rst:328 +#: ../../library/tkinter.rst:384 msgid "" "Widgets are referred to by a *pathname* in Tcl (like ``.frm.btn``), whereas " "Tkinter doesn't use names but object references." msgstr "" -#: ../../library/tkinter.rst:331 +#: ../../library/tkinter.rst:387 msgid "" "A widget's place in the widget hierarchy is encoded in its (hierarchical) " "pathname, which uses a ``.`` (dot) as a path separator. The pathname for the " @@ -595,7 +702,7 @@ msgid "" "pathname but by specifying the parent widget when creating each child widget." msgstr "" -#: ../../library/tkinter.rst:337 +#: ../../library/tkinter.rst:393 msgid "" "Operations which are implemented as separate *commands* in Tcl (like " "``grid`` or ``destroy``) are represented as *methods* on Tkinter widget " @@ -604,18 +711,18 @@ msgid "" "in Tkinter." msgstr "" -#: ../../library/tkinter.rst:345 +#: ../../library/tkinter.rst:401 msgid "How do I...? What option does...?" msgstr "" -#: ../../library/tkinter.rst:347 +#: ../../library/tkinter.rst:403 msgid "" "If you're not sure how to do something in Tkinter, and you can't immediately " "find it in the tutorial or reference documentation you're using, there are a " "few strategies that can be helpful." msgstr "" -#: ../../library/tkinter.rst:351 +#: ../../library/tkinter.rst:407 msgid "" "First, remember that the details of how individual widgets work may vary " "across different versions of both Tkinter and Tcl/Tk. If you're searching " @@ -623,7 +730,7 @@ msgid "" "installed on your system." msgstr "" -#: ../../library/tkinter.rst:356 +#: ../../library/tkinter.rst:412 msgid "" "When searching for how to use an API, it helps to know the exact name of the " "class, option, or method that you're using. Introspection, either in an " @@ -631,7 +738,7 @@ msgid "" "you need." msgstr "" -#: ../../library/tkinter.rst:361 +#: ../../library/tkinter.rst:417 msgid "" "To find out what configuration options are available on any widget, call " "its :meth:`configure` method, which returns a dictionary containing a " @@ -639,7 +746,7 @@ msgid "" "values. Use :meth:`keys` to get just the names of each option." msgstr "" -#: ../../library/tkinter.rst:371 +#: ../../library/tkinter.rst:427 msgid "" "As most widgets have many configuration options in common, it can be useful " "to find out which are specific to a particular widget class. Comparing the " @@ -647,7 +754,7 @@ msgid "" "that." msgstr "" -#: ../../library/tkinter.rst:380 +#: ../../library/tkinter.rst:436 msgid "" "Similarly, you can find the available methods for a widget object using the " "standard :func:`dir` function. If you try it, you'll see there are over 200 " @@ -655,11 +762,11 @@ msgid "" "is helpful." msgstr "" -#: ../../library/tkinter.rst:392 +#: ../../library/tkinter.rst:448 msgid "Navigating the Tcl/Tk Reference Manual" msgstr "" -#: ../../library/tkinter.rst:394 +#: ../../library/tkinter.rst:450 msgid "" "As noted, the official `Tk commands `_ reference manual (man pages) is often the most accurate " @@ -668,7 +775,7 @@ msgid "" "places to look." msgstr "" -#: ../../library/tkinter.rst:399 +#: ../../library/tkinter.rst:455 msgid "" "While all operations in Tkinter are implemented as method calls on widget " "objects, you've seen that many Tcl/Tk operations appear as commands that " @@ -676,7 +783,7 @@ msgid "" "parameters, e.g." msgstr "" -#: ../../library/tkinter.rst:409 +#: ../../library/tkinter.rst:465 msgid "" "Others, however, look more like methods called on a widget object (in fact, " "when you create a widget in Tcl/Tk, it creates a Tcl command with the name " @@ -684,7 +791,7 @@ msgid "" "name of a method to call)." msgstr "" -#: ../../library/tkinter.rst:420 +#: ../../library/tkinter.rst:476 msgid "" "In the official Tcl/Tk reference documentation, you'll find most operations " "that look like method calls on the man page for a specific widget (e.g., " @@ -694,7 +801,7 @@ msgid "" "www.tcl.tk/man/tcl8.6/TkCmd/grid.htm>`_)." msgstr "" -#: ../../library/tkinter.rst:428 +#: ../../library/tkinter.rst:484 msgid "" "You'll find many common options and methods in the `options `_ or `ttk::widget `_ man page." msgstr "" -#: ../../library/tkinter.rst:439 +#: ../../library/tkinter.rst:495 msgid "" "Somewhat confusingly, there are also methods on all Tkinter widgets that " "don't actually operate on the widget, but operate at a global scope, " @@ -719,17 +826,17 @@ msgid "" "class:`Widget` class that all Tkinter widgets inherit from)." msgstr "" -#: ../../library/tkinter.rst:448 +#: ../../library/tkinter.rst:504 msgid "Threading model" msgstr "" -#: ../../library/tkinter.rst:450 +#: ../../library/tkinter.rst:506 msgid "" "Python and Tcl/Tk have very different threading models, which :mod:`tkinter` " "tries to bridge. If you use threads, you may need to be aware of this." msgstr "" -#: ../../library/tkinter.rst:453 +#: ../../library/tkinter.rst:509 msgid "" "A Python interpreter may have many threads associated with it. In Tcl, " "multiple threads can be created, but each thread has a separate Tcl " @@ -738,7 +845,7 @@ msgid "" "by the one thread that created it." msgstr "" -#: ../../library/tkinter.rst:458 +#: ../../library/tkinter.rst:514 msgid "" "Each :class:`Tk` object created by :mod:`tkinter` contains a Tcl " "interpreter. It also keeps track of which thread created that interpreter. " @@ -748,7 +855,7 @@ msgid "" "executed, the result is returned to the calling Python thread." msgstr "" -#: ../../library/tkinter.rst:465 +#: ../../library/tkinter.rst:521 msgid "" "Tcl/Tk applications are normally event-driven, meaning that after " "initialization, the interpreter runs an event loop (i.e. :func:`Tk." @@ -761,18 +868,18 @@ msgid "" "event handlers." msgstr "" -#: ../../library/tkinter.rst:474 +#: ../../library/tkinter.rst:530 msgid "" "If the Tcl interpreter is not running the event loop and processing events, " "any :mod:`tkinter` calls made from threads other than the one running the " "Tcl interpreter will fail." msgstr "" -#: ../../library/tkinter.rst:478 +#: ../../library/tkinter.rst:534 msgid "A number of special cases exist:" msgstr "" -#: ../../library/tkinter.rst:480 +#: ../../library/tkinter.rst:536 msgid "" "Tcl/Tk libraries can be built so they are not thread-aware. In this case, :" "mod:`tkinter` calls the library from the originating Python thread, even if " @@ -780,7 +887,7 @@ msgid "" "lock ensures only one call occurs at a time." msgstr "" -#: ../../library/tkinter.rst:485 +#: ../../library/tkinter.rst:541 msgid "" "While :mod:`tkinter` allows you to create more than one instance of a :class:" "`Tk` object (with its own interpreter), all interpreters that are part of " @@ -790,7 +897,7 @@ msgid "" "running a thread-aware Tcl/Tk build." msgstr "" -#: ../../library/tkinter.rst:491 +#: ../../library/tkinter.rst:547 msgid "" "Blocking event handlers are not the only way to prevent the Tcl interpreter " "from reentering the event loop. It is even possible to run multiple nested " @@ -798,47 +905,47 @@ msgid "" "tricky when it comes to events or threads, be aware of these possibilities." msgstr "" -#: ../../library/tkinter.rst:496 +#: ../../library/tkinter.rst:552 msgid "" "There are a few select :mod:`tkinter` functions that presently work only " "when called from the thread that created the Tcl interpreter." msgstr "" -#: ../../library/tkinter.rst:501 +#: ../../library/tkinter.rst:557 msgid "Handy Reference" msgstr "" -#: ../../library/tkinter.rst:507 +#: ../../library/tkinter.rst:563 msgid "Setting Options" msgstr "" -#: ../../library/tkinter.rst:509 +#: ../../library/tkinter.rst:565 msgid "" "Options control things like the color and border width of a widget. Options " "can be set in three ways:" msgstr "" -#: ../../library/tkinter.rst:515 +#: ../../library/tkinter.rst:571 msgid "At object creation time, using keyword arguments" msgstr "" -#: ../../library/tkinter.rst:521 +#: ../../library/tkinter.rst:577 msgid "After object creation, treating the option name like a dictionary index" msgstr "" -#: ../../library/tkinter.rst:526 +#: ../../library/tkinter.rst:582 msgid "" "Use the config() method to update multiple attrs subsequent to object " "creation" msgstr "" -#: ../../library/tkinter.rst:528 +#: ../../library/tkinter.rst:584 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:531 +#: ../../library/tkinter.rst:587 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 " @@ -847,7 +954,7 @@ msgid "" "`options(3)` man page." msgstr "" -#: ../../library/tkinter.rst:537 +#: ../../library/tkinter.rst:593 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 " @@ -855,7 +962,7 @@ msgid "" "widget; buttons have a ``command`` option, labels do not." msgstr "" -#: ../../library/tkinter.rst:542 +#: ../../library/tkinter.rst:598 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 " @@ -864,7 +971,7 @@ msgid "" "option as a string (for example, ``'relief'``) and whose values are 5-tuples." msgstr "" -#: ../../library/tkinter.rst:548 +#: ../../library/tkinter.rst:604 msgid "" "Some options, like ``bg`` are synonyms for common options with long names " "(``bg`` is shorthand for \"background\"). Passing the ``config()`` method " @@ -873,92 +980,92 @@ msgid "" "option (such as ``('bg', 'background')``)." msgstr "" -#: ../../library/tkinter.rst:555 +#: ../../library/tkinter.rst:611 msgid "Index" msgstr "" -#: ../../library/tkinter.rst:555 +#: ../../library/tkinter.rst:611 msgid "Meaning" msgstr "" -#: ../../library/tkinter.rst:555 +#: ../../library/tkinter.rst:611 msgid "Example" msgstr "範例" -#: ../../library/tkinter.rst:557 +#: ../../library/tkinter.rst:613 msgid "0" msgstr "0" -#: ../../library/tkinter.rst:557 +#: ../../library/tkinter.rst:613 msgid "option name" msgstr "" -#: ../../library/tkinter.rst:557 ../../library/tkinter.rst:559 +#: ../../library/tkinter.rst:613 ../../library/tkinter.rst:615 msgid "``'relief'``" msgstr "``'relief'``" -#: ../../library/tkinter.rst:559 +#: ../../library/tkinter.rst:615 msgid "1" msgstr "1" -#: ../../library/tkinter.rst:559 +#: ../../library/tkinter.rst:615 msgid "option name for database lookup" msgstr "" -#: ../../library/tkinter.rst:561 +#: ../../library/tkinter.rst:617 msgid "2" msgstr "2" -#: ../../library/tkinter.rst:561 +#: ../../library/tkinter.rst:617 msgid "option class for database lookup" msgstr "" -#: ../../library/tkinter.rst:561 +#: ../../library/tkinter.rst:617 msgid "``'Relief'``" msgstr "``'Relief'``" -#: ../../library/tkinter.rst:564 +#: ../../library/tkinter.rst:620 msgid "3" msgstr "3" -#: ../../library/tkinter.rst:564 +#: ../../library/tkinter.rst:620 msgid "default value" msgstr "" -#: ../../library/tkinter.rst:564 +#: ../../library/tkinter.rst:620 msgid "``'raised'``" msgstr "``'raised'``" -#: ../../library/tkinter.rst:566 +#: ../../library/tkinter.rst:622 msgid "4" msgstr "4" -#: ../../library/tkinter.rst:566 +#: ../../library/tkinter.rst:622 msgid "current value" msgstr "" -#: ../../library/tkinter.rst:566 +#: ../../library/tkinter.rst:622 msgid "``'groove'``" msgstr "``'groove'``" -#: ../../library/tkinter.rst:569 +#: ../../library/tkinter.rst:625 msgid "Example::" msgstr "" "範例:\n" "\n" "::" -#: ../../library/tkinter.rst:574 +#: ../../library/tkinter.rst:630 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:579 +#: ../../library/tkinter.rst:635 msgid "The Packer" msgstr "" -#: ../../library/tkinter.rst:583 +#: ../../library/tkinter.rst:639 msgid "" "The packer is one of Tk's geometry-management mechanisms. Geometry " "managers are used to specify the relative positioning of widgets within " @@ -969,7 +1076,7 @@ msgid "" "coordinates for you." msgstr "" -#: ../../library/tkinter.rst:590 +#: ../../library/tkinter.rst:646 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 " @@ -979,7 +1086,7 @@ msgid "" "accommodate incremental changes to the configuration, once it is packed." msgstr "" -#: ../../library/tkinter.rst:597 +#: ../../library/tkinter.rst:653 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 " @@ -988,79 +1095,79 @@ msgid "" "the packer's :meth:`pack` method applied to it." msgstr "" -#: ../../library/tkinter.rst:603 +#: ../../library/tkinter.rst:659 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:613 +#: ../../library/tkinter.rst:669 msgid "Packer Options" msgstr "" -#: ../../library/tkinter.rst:615 +#: ../../library/tkinter.rst:671 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:619 ../../library/tkinter.rst:739 +#: ../../library/tkinter.rst:675 ../../library/tkinter.rst:795 msgid "anchor" msgstr "" -#: ../../library/tkinter.rst:619 +#: ../../library/tkinter.rst:675 msgid "" "Anchor type. Denotes where the packer is to place each slave in its parcel." msgstr "" -#: ../../library/tkinter.rst:622 +#: ../../library/tkinter.rst:678 msgid "expand" msgstr "" -#: ../../library/tkinter.rst:622 +#: ../../library/tkinter.rst:678 msgid "Boolean, ``0`` or ``1``." msgstr "" -#: ../../library/tkinter.rst:625 +#: ../../library/tkinter.rst:681 msgid "fill" msgstr "" -#: ../../library/tkinter.rst:625 +#: ../../library/tkinter.rst:681 msgid "Legal values: ``'x'``, ``'y'``, ``'both'``, ``'none'``." msgstr "" -#: ../../library/tkinter.rst:628 +#: ../../library/tkinter.rst:684 msgid "ipadx and ipady" msgstr "" -#: ../../library/tkinter.rst:628 +#: ../../library/tkinter.rst:684 msgid "" "A distance - designating internal padding on each side of the slave widget." msgstr "" -#: ../../library/tkinter.rst:631 +#: ../../library/tkinter.rst:687 msgid "padx and pady" msgstr "" -#: ../../library/tkinter.rst:631 +#: ../../library/tkinter.rst:687 msgid "" "A distance - designating external padding on each side of the slave widget." msgstr "" -#: ../../library/tkinter.rst:635 +#: ../../library/tkinter.rst:691 msgid "side" msgstr "" -#: ../../library/tkinter.rst:634 +#: ../../library/tkinter.rst:690 msgid "Legal values are: ``'left'``, ``'right'``, ``'top'``, ``'bottom'``." msgstr "" -#: ../../library/tkinter.rst:638 +#: ../../library/tkinter.rst:694 msgid "Coupling Widget Variables" msgstr "" -#: ../../library/tkinter.rst:640 +#: ../../library/tkinter.rst:696 msgid "" "The current-value setting of some widgets (like text entry widgets) can be " "connected directly to application variables by using special options. These " @@ -1070,7 +1177,7 @@ msgid "" "value." msgstr "" -#: ../../library/tkinter.rst:646 +#: ../../library/tkinter.rst:702 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 " @@ -1079,7 +1186,7 @@ msgid "" "Variable, defined in :mod:`tkinter`." msgstr "" -#: ../../library/tkinter.rst:652 +#: ../../library/tkinter.rst:708 msgid "" "There are many useful subclasses of Variable already defined: :class:" "`StringVar`, :class:`IntVar`, :class:`DoubleVar`, and :class:`BooleanVar`. " @@ -1089,18 +1196,18 @@ msgid "" "no further intervention on your part." msgstr "" -#: ../../library/tkinter.rst:659 ../../library/tkinter.rst:838 +#: ../../library/tkinter.rst:715 ../../library/tkinter.rst:895 msgid "For example::" msgstr "" "舉例來說:\n" "\n" "::" -#: ../../library/tkinter.rst:692 +#: ../../library/tkinter.rst:748 msgid "The Window Manager" msgstr "" -#: ../../library/tkinter.rst:696 +#: ../../library/tkinter.rst:752 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 " @@ -1110,7 +1217,7 @@ msgid "" "the :class:`Wm` methods directly." msgstr "" -#: ../../library/tkinter.rst:703 +#: ../../library/tkinter.rst:759 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 " @@ -1121,29 +1228,29 @@ msgid "" "to Tk functionality." msgstr "" -#: ../../library/tkinter.rst:710 +#: ../../library/tkinter.rst:766 msgid "Here are some examples of typical usage::" msgstr "" "以下是一些常見用法範例:\n" "\n" "::" -#: ../../library/tkinter.rst:733 +#: ../../library/tkinter.rst:789 msgid "Tk Option Data Types" msgstr "" -#: ../../library/tkinter.rst:738 +#: ../../library/tkinter.rst:794 msgid "" "Legal values are points of the compass: ``\"n\"``, ``\"ne\"``, ``\"e\"``, ``" "\"se\"``, ``\"s\"``, ``\"sw\"``, ``\"w\"``, ``\"nw\"``, and also ``\"center" "\"``." msgstr "" -#: ../../library/tkinter.rst:745 +#: ../../library/tkinter.rst:801 msgid "bitmap" msgstr "" -#: ../../library/tkinter.rst:742 +#: ../../library/tkinter.rst:798 msgid "" "There are eight built-in, named bitmaps: ``'error'``, ``'gray25'``, " "``'gray50'``, ``'hourglass'``, ``'info'``, ``'questhead'``, ``'question'``, " @@ -1151,27 +1258,27 @@ msgid "" "file, preceded with an ``@``, as in ``\"@/usr/contrib/bitmap/gumby.bit\"``." msgstr "" -#: ../../library/tkinter.rst:748 +#: ../../library/tkinter.rst:804 msgid "boolean" msgstr "" -#: ../../library/tkinter.rst:748 +#: ../../library/tkinter.rst:804 msgid "You can pass integers 0 or 1 or the strings ``\"yes\"`` or ``\"no\"``." msgstr "" -#: ../../library/tkinter.rst:755 +#: ../../library/tkinter.rst:811 msgid "callback" msgstr "" -#: ../../library/tkinter.rst:751 +#: ../../library/tkinter.rst:807 msgid "This is any Python function that takes no arguments. For example::" msgstr "" -#: ../../library/tkinter.rst:761 +#: ../../library/tkinter.rst:817 msgid "color" msgstr "" -#: ../../library/tkinter.rst:758 +#: ../../library/tkinter.rst:814 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" @@ -1180,11 +1287,11 @@ msgid "" "Ousterhout's book for details." msgstr "" -#: ../../library/tkinter.rst:767 +#: ../../library/tkinter.rst:823 msgid "cursor" msgstr "" -#: ../../library/tkinter.rst:764 +#: ../../library/tkinter.rst:820 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`), " @@ -1192,11 +1299,11 @@ msgid "" "of your own. See page 179 of Ousterhout's book." msgstr "" -#: ../../library/tkinter.rst:774 +#: ../../library/tkinter.rst:830 msgid "distance" msgstr "" -#: ../../library/tkinter.rst:770 +#: ../../library/tkinter.rst:826 msgid "" "Screen distances can be specified in either pixels or absolute distances. " "Pixels are given as numbers and absolute distances as strings, with the " @@ -1205,119 +1312,120 @@ msgid "" "is expressed as ``\"3.5i\"``." msgstr "" -#: ../../library/tkinter.rst:779 +#: ../../library/tkinter.rst:835 msgid "font" msgstr "" -#: ../../library/tkinter.rst:777 +#: ../../library/tkinter.rst:833 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:784 +#: ../../library/tkinter.rst:840 msgid "geometry" msgstr "" -#: ../../library/tkinter.rst:782 +#: ../../library/tkinter.rst:838 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:788 +#: ../../library/tkinter.rst:844 msgid "justify" msgstr "" -#: ../../library/tkinter.rst:787 +#: ../../library/tkinter.rst:843 msgid "" "Legal values are the strings: ``\"left\"``, ``\"center\"``, ``\"right\"``, " "and ``\"fill\"``." msgstr "" -#: ../../library/tkinter.rst:793 +#: ../../library/tkinter.rst:849 msgid "region" msgstr "" -#: ../../library/tkinter.rst:791 +#: ../../library/tkinter.rst:847 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:797 +#: ../../library/tkinter.rst:853 msgid "relief" msgstr "" -#: ../../library/tkinter.rst:796 +#: ../../library/tkinter.rst:852 msgid "" "Determines what the border style of a widget will be. Legal values are: ``" "\"raised\"``, ``\"sunken\"``, ``\"flat\"``, ``\"groove\"``, and ``\"ridge" "\"``." msgstr "" -#: ../../library/tkinter.rst:801 +#: ../../library/tkinter.rst:857 msgid "scrollcommand" msgstr "" -#: ../../library/tkinter.rst:800 +#: ../../library/tkinter.rst:856 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:804 +#: ../../library/tkinter.rst:860 msgid "wrap" msgstr "" -#: ../../library/tkinter.rst:804 +#: ../../library/tkinter.rst:860 msgid "Must be one of: ``\"none\"``, ``\"char\"``, or ``\"word\"``." msgstr "" -#: ../../library/tkinter.rst:809 +#: ../../library/tkinter.rst:865 msgid "Bindings and Events" msgstr "" -#: ../../library/tkinter.rst:815 +#: ../../library/tkinter.rst:871 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:821 +#: ../../library/tkinter.rst:877 msgid "where:" msgstr "" -#: ../../library/tkinter.rst:825 +#: ../../library/tkinter.rst:882 msgid "sequence" msgstr "" -#: ../../library/tkinter.rst:824 +#: ../../library/tkinter.rst:880 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)." +"is a string that denotes the target kind of event. (See the :manpage:" +"`bind(3tk)` man page, and page 201 of John Ousterhout's book, :title-" +"reference:`Tcl and the Tk Toolkit (2nd edition)`, for details)." msgstr "" -#: ../../library/tkinter.rst:830 +#: ../../library/tkinter.rst:887 msgid "func" msgstr "" -#: ../../library/tkinter.rst:828 +#: ../../library/tkinter.rst:885 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:836 +#: ../../library/tkinter.rst:893 msgid "add" msgstr "" -#: ../../library/tkinter.rst:833 +#: ../../library/tkinter.rst:890 msgid "" "is optional, either ``''`` or ``'+'``. Passing an empty string denotes that " "this binding is to replace any other bindings that this event is associated " @@ -1325,7 +1433,7 @@ msgid "" "of functions bound to this event type." msgstr "" -#: ../../library/tkinter.rst:845 +#: ../../library/tkinter.rst:902 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 " @@ -1334,209 +1442,209 @@ msgid "" "pages." msgstr "" -#: ../../library/tkinter.rst:851 +#: ../../library/tkinter.rst:908 msgid "Tkinter Event Field" msgstr "" -#: ../../library/tkinter.rst:853 +#: ../../library/tkinter.rst:910 msgid "%f" msgstr "%f" -#: ../../library/tkinter.rst:853 +#: ../../library/tkinter.rst:910 msgid "focus" msgstr "" -#: ../../library/tkinter.rst:853 +#: ../../library/tkinter.rst:910 msgid "%A" msgstr "%A" -#: ../../library/tkinter.rst:853 +#: ../../library/tkinter.rst:910 msgid "char" msgstr "char" -#: ../../library/tkinter.rst:855 +#: ../../library/tkinter.rst:912 msgid "%h" msgstr "%h" -#: ../../library/tkinter.rst:855 +#: ../../library/tkinter.rst:912 msgid "height" msgstr "" -#: ../../library/tkinter.rst:855 +#: ../../library/tkinter.rst:912 msgid "%E" msgstr "%E" -#: ../../library/tkinter.rst:855 +#: ../../library/tkinter.rst:912 msgid "send_event" msgstr "send_event" -#: ../../library/tkinter.rst:857 +#: ../../library/tkinter.rst:914 msgid "%k" msgstr "%k" -#: ../../library/tkinter.rst:857 +#: ../../library/tkinter.rst:914 msgid "keycode" msgstr "" -#: ../../library/tkinter.rst:857 +#: ../../library/tkinter.rst:914 msgid "%K" msgstr "%K" -#: ../../library/tkinter.rst:857 +#: ../../library/tkinter.rst:914 msgid "keysym" msgstr "" -#: ../../library/tkinter.rst:859 +#: ../../library/tkinter.rst:916 msgid "%s" msgstr "%s" -#: ../../library/tkinter.rst:859 +#: ../../library/tkinter.rst:916 msgid "state" msgstr "" -#: ../../library/tkinter.rst:859 +#: ../../library/tkinter.rst:916 msgid "%N" msgstr "%N" -#: ../../library/tkinter.rst:859 +#: ../../library/tkinter.rst:916 msgid "keysym_num" msgstr "keysym_num" -#: ../../library/tkinter.rst:861 +#: ../../library/tkinter.rst:918 msgid "%t" msgstr "%t" -#: ../../library/tkinter.rst:861 +#: ../../library/tkinter.rst:918 msgid "time" msgstr "" -#: ../../library/tkinter.rst:861 +#: ../../library/tkinter.rst:918 msgid "%T" msgstr "%T" -#: ../../library/tkinter.rst:861 +#: ../../library/tkinter.rst:918 msgid "type" msgstr "" -#: ../../library/tkinter.rst:863 +#: ../../library/tkinter.rst:920 msgid "%w" msgstr "%w" -#: ../../library/tkinter.rst:863 +#: ../../library/tkinter.rst:920 msgid "width" msgstr "" -#: ../../library/tkinter.rst:863 +#: ../../library/tkinter.rst:920 msgid "%W" msgstr "%W" -#: ../../library/tkinter.rst:863 +#: ../../library/tkinter.rst:920 msgid "widget" msgstr "" -#: ../../library/tkinter.rst:865 +#: ../../library/tkinter.rst:922 msgid "%x" msgstr "%x" -#: ../../library/tkinter.rst:865 +#: ../../library/tkinter.rst:922 msgid "x" msgstr "x" -#: ../../library/tkinter.rst:865 +#: ../../library/tkinter.rst:922 msgid "%X" msgstr "%X" -#: ../../library/tkinter.rst:865 +#: ../../library/tkinter.rst:922 msgid "x_root" msgstr "x_root" -#: ../../library/tkinter.rst:867 +#: ../../library/tkinter.rst:924 msgid "%y" msgstr "%y" -#: ../../library/tkinter.rst:867 +#: ../../library/tkinter.rst:924 msgid "y" msgstr "y" -#: ../../library/tkinter.rst:867 +#: ../../library/tkinter.rst:924 msgid "%Y" msgstr "%Y" -#: ../../library/tkinter.rst:867 +#: ../../library/tkinter.rst:924 msgid "y_root" msgstr "y_root" -#: ../../library/tkinter.rst:872 +#: ../../library/tkinter.rst:929 msgid "The index Parameter" msgstr "" -#: ../../library/tkinter.rst:874 +#: ../../library/tkinter.rst:931 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:881 +#: ../../library/tkinter.rst:938 msgid "Entry widget indexes (index, view index, etc.)" msgstr "" -#: ../../library/tkinter.rst:879 +#: ../../library/tkinter.rst:936 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:885 +#: ../../library/tkinter.rst:942 msgid "Text widget indexes" msgstr "" -#: ../../library/tkinter.rst:884 +#: ../../library/tkinter.rst:941 msgid "" "The index notation for Text widgets is very rich and is best described in " "the Tk man pages." msgstr "" -#: ../../library/tkinter.rst:910 +#: ../../library/tkinter.rst:967 msgid "Menu indexes (menu.invoke(), menu.entryconfig(), etc.)" msgstr "" -#: ../../library/tkinter.rst:888 +#: ../../library/tkinter.rst:945 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:891 +#: ../../library/tkinter.rst:948 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:894 +#: ../../library/tkinter.rst:951 msgid "" "the string ``\"active\"``, which refers to the menu position that is " "currently under the cursor;" msgstr "" -#: ../../library/tkinter.rst:897 +#: ../../library/tkinter.rst:954 msgid "the string ``\"last\"`` which refers to the last menu item;" msgstr "" -#: ../../library/tkinter.rst:899 +#: ../../library/tkinter.rst:956 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:902 +#: ../../library/tkinter.rst:959 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:905 +#: ../../library/tkinter.rst:962 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 " @@ -1545,33 +1653,33 @@ msgid "" "above literals, instead." msgstr "" -#: ../../library/tkinter.rst:913 +#: ../../library/tkinter.rst:970 msgid "Images" msgstr "" -#: ../../library/tkinter.rst:915 +#: ../../library/tkinter.rst:972 msgid "" "Images of different formats can be created through the corresponding " "subclass of :class:`tkinter.Image`:" msgstr "" -#: ../../library/tkinter.rst:918 +#: ../../library/tkinter.rst:975 msgid ":class:`BitmapImage` for images in XBM format." msgstr "" -#: ../../library/tkinter.rst:920 +#: ../../library/tkinter.rst:977 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:923 +#: ../../library/tkinter.rst:980 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:926 +#: ../../library/tkinter.rst:983 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 " @@ -1580,28 +1688,28 @@ msgid "" "empty box wherever the image was used." msgstr "" -#: ../../library/tkinter.rst:934 +#: ../../library/tkinter.rst:991 msgid "" "The `Pillow `_ package adds support for formats " "such as BMP, JPEG, TIFF, and WebP, among others." msgstr "" -#: ../../library/tkinter.rst:940 +#: ../../library/tkinter.rst:997 msgid "File Handlers" msgstr "" -#: ../../library/tkinter.rst:942 +#: ../../library/tkinter.rst:999 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:953 +#: ../../library/tkinter.rst:1010 msgid "This feature is not available on Windows." msgstr "" -#: ../../library/tkinter.rst:955 +#: ../../library/tkinter.rst:1012 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:" @@ -1612,7 +1720,7 @@ msgid "" "maxbytecount)``." msgstr "" -#: ../../library/tkinter.rst:966 +#: ../../library/tkinter.rst:1023 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 " @@ -1621,10 +1729,10 @@ msgid "" "as follows::" msgstr "" -#: ../../library/tkinter.rst:977 +#: ../../library/tkinter.rst:1034 msgid "Unregisters a file handler." msgstr "" -#: ../../library/tkinter.rst:984 +#: ../../library/tkinter.rst:1041 msgid "Constants used in the *mask* arguments." msgstr "" diff --git a/library/typing.po b/library/typing.po index 651a6b4aaa..6591c0c4c1 100644 --- a/library/typing.po +++ b/library/typing.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.10\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2022-03-23 08:26+0000\n" +"POT-Creation-Date: 2022-05-21 17:35+0000\n" "PO-Revision-Date: 2018-05-23 16:14+0000\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -195,7 +195,7 @@ msgid "NewType" msgstr "NewType" #: ../../library/typing.rst:118 -msgid "Use the :class:`NewType` helper class to create distinct types::" +msgid "Use the :class:`NewType` helper to create distinct types::" msgstr "" #: ../../library/typing.rst:125 @@ -216,8 +216,8 @@ msgstr "" msgid "" "Note that these checks are enforced only by the static type checker. At " "runtime, the statement ``Derived = NewType('Derived', Base)`` will make " -"``Derived`` a class that immediately returns whatever parameter you pass it. " -"That means the expression ``Derived(some_value)`` does not create a new " +"``Derived`` a callable that immediately returns whatever parameter you pass " +"it. That means the expression ``Derived(some_value)`` does not create a new " "class or introduce much overhead beyond that of a regular function call." msgstr "" @@ -280,22 +280,22 @@ msgid "" "hinted using ``Callable[[Arg1Type, Arg2Type], ReturnType]``." msgstr "" -#: ../../library/typing.rst:203 ../../library/typing.rst:1015 -#: ../../library/typing.rst:2244 +#: ../../library/typing.rst:203 ../../library/typing.rst:1018 +#: ../../library/typing.rst:2247 msgid "For example::" msgstr "" "舉例來說:\n" "\n" "::" -#: ../../library/typing.rst:214 +#: ../../library/typing.rst:218 msgid "" "It is possible to declare the return type of a callable without specifying " "the call signature by substituting a literal ellipsis for the list of " "arguments in the type hint: ``Callable[..., ReturnType]``." msgstr "" -#: ../../library/typing.rst:218 ../../library/typing.rst:705 +#: ../../library/typing.rst:222 ../../library/typing.rst:709 msgid "" "Callables which take other callables as arguments may indicate that their " "parameter types are dependent on each other using :class:`ParamSpec`. " @@ -306,97 +306,97 @@ msgid "" "ReturnType]`` respectively." msgstr "" -#: ../../library/typing.rst:226 ../../library/typing.rst:717 +#: ../../library/typing.rst:230 ../../library/typing.rst:721 msgid "" "``Callable`` now supports :class:`ParamSpec` and :data:`Concatenate`. See :" "pep:`612` for more information." msgstr "" -#: ../../library/typing.rst:231 +#: ../../library/typing.rst:235 msgid "" -"The documentation for :class:`ParamSpec` and :class:`Concatenate` provide " +"The documentation for :class:`ParamSpec` and :class:`Concatenate` provides " "examples of usage in ``Callable``." msgstr "" -#: ../../library/typing.rst:237 +#: ../../library/typing.rst:241 msgid "Generics" msgstr "" -#: ../../library/typing.rst:239 +#: ../../library/typing.rst:243 msgid "" "Since type information about objects kept in containers cannot be statically " "inferred in a generic way, abstract base classes have been extended to " "support subscription to denote expected types for container elements." msgstr "" -#: ../../library/typing.rst:250 +#: ../../library/typing.rst:254 msgid "" "Generics can be parameterized by using a factory available in typing called :" "class:`TypeVar`." msgstr "" -#: ../../library/typing.rst:266 +#: ../../library/typing.rst:270 msgid "User-defined generic types" msgstr "" -#: ../../library/typing.rst:268 +#: ../../library/typing.rst:272 msgid "A user-defined class can be defined as a generic class." msgstr "" -#: ../../library/typing.rst:294 +#: ../../library/typing.rst:298 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:298 +#: ../../library/typing.rst:302 msgid "" "The :class:`Generic` base class defines :meth:`~object.__class_getitem__` so " "that ``LoggedVar[t]`` is valid as a type::" msgstr "" -#: ../../library/typing.rst:307 +#: ../../library/typing.rst:311 msgid "" "A generic type can have any number of type variables. All varieties of :" "class:`TypeVar` are permissible as parameters for a generic type::" msgstr "" -#: ../../library/typing.rst:319 +#: ../../library/typing.rst:323 msgid "" "Each type variable argument to :class:`Generic` must be distinct. This is " "thus invalid::" msgstr "" -#: ../../library/typing.rst:330 +#: ../../library/typing.rst:334 msgid "You can use multiple inheritance with :class:`Generic`::" msgstr "" -#: ../../library/typing.rst:340 +#: ../../library/typing.rst:344 msgid "" "When inheriting from generic classes, some type variables could be fixed::" msgstr "" -#: ../../library/typing.rst:350 +#: ../../library/typing.rst:354 msgid "In this case ``MyDict`` has a single parameter, ``T``." msgstr "" -#: ../../library/typing.rst:352 +#: ../../library/typing.rst:356 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:360 +#: ../../library/typing.rst:364 msgid "User defined generic type aliases are also supported. Examples::" msgstr "" -#: ../../library/typing.rst:377 +#: ../../library/typing.rst:381 msgid ":class:`Generic` no longer has a custom metaclass." msgstr "" -#: ../../library/typing.rst:380 +#: ../../library/typing.rst:384 msgid "" "User-defined generics for parameter expressions are also supported via " "parameter specification variables in the form ``Generic[P]``. The behavior " @@ -406,28 +406,28 @@ msgid "" "used to substitute a :class:`ParamSpec`::" msgstr "" -#: ../../library/typing.rst:397 +#: ../../library/typing.rst:401 msgid "" "Furthermore, a generic with only one parameter specification variable will " "accept parameter lists in the forms ``X[[Type1, Type2, ...]]`` and also " "``X[Type1, Type2, ...]`` for aesthetic reasons. Internally, the latter is " -"converted to the former and are thus equivalent::" +"converted to the former, so the following are equivalent::" msgstr "" -#: ../../library/typing.rst:409 +#: ../../library/typing.rst:413 msgid "" "Do note that generics with :class:`ParamSpec` may not have correct " "``__parameters__`` after substitution in some cases because they are " "intended primarily for static type checking." msgstr "" -#: ../../library/typing.rst:413 +#: ../../library/typing.rst:417 msgid "" ":class:`Generic` can now be parameterized over parameter expressions. See :" "class:`ParamSpec` and :pep:`612` for more details." msgstr "" -#: ../../library/typing.rst:417 +#: ../../library/typing.rst:421 msgid "" "A user-defined generic class can have ABCs as base classes without a " "metaclass conflict. Generic metaclasses are not supported. The outcome of " @@ -435,24 +435,24 @@ msgid "" "hashable and comparable for equality." msgstr "" -#: ../../library/typing.rst:424 +#: ../../library/typing.rst:428 msgid "The :data:`Any` type" msgstr ":data:`Any` 型別" -#: ../../library/typing.rst:426 +#: ../../library/typing.rst:430 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:430 +#: ../../library/typing.rst:434 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::" msgstr "" -#: ../../library/typing.rst:448 +#: ../../library/typing.rst:452 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 " @@ -461,19 +461,19 @@ msgid "" "runtime!" msgstr "" -#: ../../library/typing.rst:454 +#: ../../library/typing.rst:458 msgid "" "Furthermore, all functions without a return type or parameter types will " "implicitly default to using :data:`Any`::" msgstr "" -#: ../../library/typing.rst:467 +#: ../../library/typing.rst:471 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:470 +#: ../../library/typing.rst:474 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, " @@ -481,7 +481,7 @@ msgid "" "subtype of every other type." msgstr "" -#: ../../library/typing.rst:475 +#: ../../library/typing.rst:479 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 " @@ -489,24 +489,24 @@ msgid "" "example::" msgstr "" -#: ../../library/typing.rst:497 +#: ../../library/typing.rst:501 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:502 +#: ../../library/typing.rst:506 msgid "Nominal vs structural subtyping" msgstr "" -#: ../../library/typing.rst:504 +#: ../../library/typing.rst:508 msgid "" -"Initially :pep:`484` defined Python static type system as using *nominal " +"Initially :pep:`484` defined the 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:508 +#: ../../library/typing.rst:512 msgid "" "This requirement previously also applied to abstract base classes, such as :" "class:`~collections.abc.Iterable`. The problem with this approach is that a " @@ -515,7 +515,7 @@ msgid "" "code. For example, this conforms to :pep:`484`::" msgstr "" -#: ../../library/typing.rst:521 +#: ../../library/typing.rst:525 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 " @@ -524,22 +524,22 @@ msgid "" "subtyping* (or static duck-typing)::" msgstr "" -#: ../../library/typing.rst:537 +#: ../../library/typing.rst:541 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:542 +#: ../../library/typing.rst:546 msgid "Module contents" msgstr "模組內容" -#: ../../library/typing.rst:544 +#: ../../library/typing.rst:548 msgid "The module defines the following classes, functions and decorators." msgstr "" -#: ../../library/typing.rst:548 +#: ../../library/typing.rst:552 msgid "" "This module defines several types that are subclasses of pre-existing " "standard library classes which also extend :class:`Generic` to support type " @@ -547,7 +547,7 @@ msgid "" "corresponding pre-existing classes were enhanced to support ``[]``." msgstr "" -#: ../../library/typing.rst:554 +#: ../../library/typing.rst:558 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 " @@ -555,147 +555,147 @@ msgid "" "Python 3.9 or newer." msgstr "" -#: ../../library/typing.rst:559 +#: ../../library/typing.rst:563 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*." msgstr "" -#: ../../library/typing.rst:565 +#: ../../library/typing.rst:569 msgid "Special typing primitives" msgstr "" -#: ../../library/typing.rst:568 +#: ../../library/typing.rst:572 msgid "Special types" msgstr "" -#: ../../library/typing.rst:570 +#: ../../library/typing.rst:574 msgid "These can be used as types in annotations and do not support ``[]``." msgstr "" -#: ../../library/typing.rst:574 +#: ../../library/typing.rst:578 msgid "Special type indicating an unconstrained type." msgstr "" -#: ../../library/typing.rst:576 +#: ../../library/typing.rst:580 msgid "Every type is compatible with :data:`Any`." msgstr "" -#: ../../library/typing.rst:577 +#: ../../library/typing.rst:581 msgid ":data:`Any` is compatible with every type." msgstr "" -#: ../../library/typing.rst:581 +#: ../../library/typing.rst:585 msgid "Special type indicating that a function never returns. For example::" msgstr "" -#: ../../library/typing.rst:594 +#: ../../library/typing.rst:598 msgid "" "Special annotation for explicitly declaring a :ref:`type alias `. For example::" msgstr "" -#: ../../library/typing.rst:601 +#: ../../library/typing.rst:605 msgid "See :pep:`613` for more details about explicit type aliases." msgstr "" -#: ../../library/typing.rst:606 +#: ../../library/typing.rst:610 msgid "Special forms" msgstr "" -#: ../../library/typing.rst:608 +#: ../../library/typing.rst:612 msgid "" "These can be used as types in annotations using ``[]``, each having a unique " "syntax." msgstr "" -#: ../../library/typing.rst:612 +#: ../../library/typing.rst:616 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:616 +#: ../../library/typing.rst:620 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." msgstr "" -#: ../../library/typing.rst:620 +#: ../../library/typing.rst:624 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`." msgstr "" -#: ../../library/typing.rst:624 +#: ../../library/typing.rst:628 msgid "" ":class:`builtins.tuple ` now supports ``[]``. See :pep:`585` and :ref:" "`types-genericalias`." msgstr "" -#: ../../library/typing.rst:630 +#: ../../library/typing.rst:634 msgid "" "Union type; ``Union[X, Y]`` is equivalent to ``X | Y`` and means either X or " "Y." msgstr "" -#: ../../library/typing.rst:632 +#: ../../library/typing.rst:636 msgid "" "To define a union, use e.g. ``Union[int, str]`` or the shorthand ``int | " "str``. Using that shorthand is recommended. Details:" msgstr "" -#: ../../library/typing.rst:634 +#: ../../library/typing.rst:638 msgid "The arguments must be types and there must be at least one." msgstr "" -#: ../../library/typing.rst:636 +#: ../../library/typing.rst:640 msgid "Unions of unions are flattened, e.g.::" msgstr "" -#: ../../library/typing.rst:640 +#: ../../library/typing.rst:644 msgid "Unions of a single argument vanish, e.g.::" msgstr "" -#: ../../library/typing.rst:644 +#: ../../library/typing.rst:648 msgid "Redundant arguments are skipped, e.g.::" msgstr "" -#: ../../library/typing.rst:648 +#: ../../library/typing.rst:652 msgid "When comparing unions, the argument order is ignored, e.g.::" msgstr "" -#: ../../library/typing.rst:652 +#: ../../library/typing.rst:656 msgid "You cannot subclass or instantiate a ``Union``." msgstr "" -#: ../../library/typing.rst:654 +#: ../../library/typing.rst:658 msgid "You cannot write ``Union[X][Y]``." msgstr "" -#: ../../library/typing.rst:656 +#: ../../library/typing.rst:660 msgid "Don't remove explicit subclasses from unions at runtime." msgstr "" -#: ../../library/typing.rst:659 +#: ../../library/typing.rst:663 msgid "" "Unions can now be written as ``X | Y``. See :ref:`union type " "expressions`." msgstr "" -#: ../../library/typing.rst:665 +#: ../../library/typing.rst:669 msgid "Optional type." msgstr "" -#: ../../library/typing.rst:667 +#: ../../library/typing.rst:671 msgid "``Optional[X]`` is equivalent to ``X | None`` (or ``Union[X, None]``)." msgstr "" -#: ../../library/typing.rst:669 +#: ../../library/typing.rst:673 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 " @@ -703,31 +703,31 @@ msgid "" "optional. For example::" msgstr "" -#: ../../library/typing.rst:677 +#: ../../library/typing.rst:681 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::" msgstr "" -#: ../../library/typing.rst:684 +#: ../../library/typing.rst:688 msgid "" "Optional can now be written as ``X | None``. See :ref:`union type " "expressions`." msgstr "" -#: ../../library/typing.rst:690 +#: ../../library/typing.rst:694 msgid "Callable type; ``Callable[[int], str]`` is a function of (int) -> str." msgstr "" -#: ../../library/typing.rst:692 +#: ../../library/typing.rst:696 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." msgstr "" -#: ../../library/typing.rst:697 +#: ../../library/typing.rst:701 msgid "" "There is no syntax to indicate optional or keyword arguments; such function " "types are rarely used as callback types. ``Callable[..., ReturnType]`` " @@ -737,19 +737,19 @@ msgid "" "Callable`." msgstr "" -#: ../../library/typing.rst:713 +#: ../../library/typing.rst:717 msgid "" ":class:`collections.abc.Callable` now supports ``[]``. See :pep:`585` and :" "ref:`types-genericalias`." msgstr "" -#: ../../library/typing.rst:722 +#: ../../library/typing.rst:726 msgid "" "The documentation for :class:`ParamSpec` and :class:`Concatenate` provide " "examples of usage with ``Callable``." msgstr "" -#: ../../library/typing.rst:727 +#: ../../library/typing.rst:731 msgid "" "Used with :data:`Callable` and :class:`ParamSpec` to type annotate a higher " "order callable which adds, removes, or transforms parameters of another " @@ -759,7 +759,7 @@ msgid "" "``Concatenate`` must be a :class:`ParamSpec`." msgstr "" -#: ../../library/typing.rst:734 +#: ../../library/typing.rst:738 msgid "" "For example, to annotate a decorator ``with_lock`` which provides a :class:" "`threading.Lock` to the decorated function, ``Concatenate`` can be used to " @@ -770,17 +770,17 @@ msgid "" "passed in::" msgstr "" -#: ../../library/typing.rst:774 ../../library/typing.rst:1261 +#: ../../library/typing.rst:777 ../../library/typing.rst:1264 msgid "" ":pep:`612` -- Parameter Specification Variables (the PEP which introduced " "``ParamSpec`` and ``Concatenate``)." msgstr "" -#: ../../library/typing.rst:776 +#: ../../library/typing.rst:779 msgid ":class:`ParamSpec` and :class:`Callable`." msgstr ":class:`ParamSpec` 和 :class:`Callable`\\ 。" -#: ../../library/typing.rst:781 +#: ../../library/typing.rst:784 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 " @@ -788,11 +788,11 @@ msgid "" "``C``. For example::" msgstr "" -#: ../../library/typing.rst:790 +#: ../../library/typing.rst:793 msgid "Note that ``Type[C]`` is covariant::" msgstr "" -#: ../../library/typing.rst:802 +#: ../../library/typing.rst:805 msgid "" "The fact that ``Type[C]`` is covariant implies that all subclasses of ``C`` " "should implement the same constructor signature and class method signatures " @@ -802,39 +802,39 @@ msgid "" "particular case may change in future revisions of :pep:`484`." msgstr "" -#: ../../library/typing.rst:810 +#: ../../library/typing.rst:813 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:816 +#: ../../library/typing.rst:819 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:821 +#: ../../library/typing.rst:824 msgid "" ":class:`builtins.type ` now supports ``[]``. See :pep:`585` and :ref:" "`types-genericalias`." msgstr "" -#: ../../library/typing.rst:827 +#: ../../library/typing.rst:830 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::" msgstr "" -#: ../../library/typing.rst:841 +#: ../../library/typing.rst:844 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." msgstr "" -#: ../../library/typing.rst:847 +#: ../../library/typing.rst:850 msgid "" "``Literal`` now de-duplicates parameters. Equality comparisons of " "``Literal`` objects are no longer order dependent. ``Literal`` objects will " @@ -842,22 +842,22 @@ msgid "" "their parameters are not :term:`hashable`." msgstr "" -#: ../../library/typing.rst:855 +#: ../../library/typing.rst:858 msgid "Special type construct to mark class variables." msgstr "" -#: ../../library/typing.rst:857 +#: ../../library/typing.rst:860 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::" msgstr "" -#: ../../library/typing.rst:865 +#: ../../library/typing.rst:868 msgid ":data:`ClassVar` accepts only types and cannot be further subscribed." msgstr "" -#: ../../library/typing.rst:867 +#: ../../library/typing.rst:870 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 " @@ -865,19 +865,19 @@ msgid "" "example, a type checker might flag the following code as an error::" msgstr "" -#: ../../library/typing.rst:881 +#: ../../library/typing.rst:884 msgid "" "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:893 ../../library/typing.rst:2139 +#: ../../library/typing.rst:896 ../../library/typing.rst:2142 msgid "" "There is no runtime checking of these properties. See :pep:`591` for more " "details." msgstr "" -#: ../../library/typing.rst:900 +#: ../../library/typing.rst:903 msgid "" "A type, introduced in :pep:`593` (``Flexible function and variable " "annotations``), to decorate existing types with context-specific metadata " @@ -889,12 +889,12 @@ msgid "" "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." +"``Annotated`` type allows for both static typechecking of ``T`` (which can " +"safely ignore ``x``) together with runtime access to ``x`` within a specific " +"application." msgstr "" -#: ../../library/typing.rst:914 +#: ../../library/typing.rst:917 msgid "" "Ultimately, the responsibility of how to interpret the annotations (if at " "all) is the responsibility of the tool or library encountering the " @@ -903,21 +903,21 @@ msgid "" "using ``isinstance()``)." msgstr "" -#: ../../library/typing.rst:920 +#: ../../library/typing.rst:923 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." msgstr "" -#: ../../library/typing.rst:924 +#: ../../library/typing.rst:927 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." msgstr "" -#: ../../library/typing.rst:928 +#: ../../library/typing.rst:931 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 " @@ -925,59 +925,59 @@ msgid "" "example, if you are doing value range analysis you might allow this::" msgstr "" -#: ../../library/typing.rst:937 +#: ../../library/typing.rst:940 msgid "" "Passing ``include_extras=True`` to :func:`get_type_hints` lets one access " "the extra annotations at runtime." msgstr "" -#: ../../library/typing.rst:940 +#: ../../library/typing.rst:943 msgid "The details of the syntax:" msgstr "" -#: ../../library/typing.rst:942 +#: ../../library/typing.rst:945 msgid "The first argument to ``Annotated`` must be a valid type" msgstr "" -#: ../../library/typing.rst:944 +#: ../../library/typing.rst:947 msgid "" "Multiple type annotations are supported (``Annotated`` supports variadic " "arguments)::" msgstr "" -#: ../../library/typing.rst:949 +#: ../../library/typing.rst:952 msgid "" "``Annotated`` must be called with at least two arguments " "( ``Annotated[int]`` is not valid)" msgstr "" -#: ../../library/typing.rst:952 +#: ../../library/typing.rst:955 msgid "" "The order of the annotations is preserved and matters for equality checks::" msgstr "" -#: ../../library/typing.rst:959 +#: ../../library/typing.rst:962 msgid "" "Nested ``Annotated`` types are flattened, with metadata ordered starting " "with the innermost annotation::" msgstr "" -#: ../../library/typing.rst:966 +#: ../../library/typing.rst:969 msgid "Duplicated annotations are not removed::" msgstr "" -#: ../../library/typing.rst:972 +#: ../../library/typing.rst:975 msgid "``Annotated`` can be used with nested and generic aliases::" msgstr "" -#: ../../library/typing.rst:985 +#: ../../library/typing.rst:988 msgid "" "Special typing form used to annotate the return type of a user-defined type " "guard function. ``TypeGuard`` only accepts a single type argument. At " "runtime, functions marked this way should return a boolean." msgstr "" -#: ../../library/typing.rst:989 +#: ../../library/typing.rst:992 msgid "" "``TypeGuard`` aims to benefit *type narrowing* -- a technique used by static " "type checkers to determine a more precise type of an expression within a " @@ -986,44 +986,44 @@ msgid "" "conditional expression here is sometimes referred to as a \"type guard\"::" msgstr "" -#: ../../library/typing.rst:1004 +#: ../../library/typing.rst:1007 msgid "" "Sometimes it would be convenient to use a user-defined boolean function as a " "type guard. Such a function should use ``TypeGuard[...]`` as its return " "type to alert static type checkers to this intention." msgstr "" -#: ../../library/typing.rst:1008 +#: ../../library/typing.rst:1011 msgid "" "Using ``-> TypeGuard`` tells the static type checker that for a given " "function:" msgstr "" -#: ../../library/typing.rst:1011 +#: ../../library/typing.rst:1014 msgid "The return value is a boolean." msgstr "" -#: ../../library/typing.rst:1012 +#: ../../library/typing.rst:1015 msgid "" "If the return value is ``True``, the type of its argument is the type inside " "``TypeGuard``." msgstr "" -#: ../../library/typing.rst:1029 +#: ../../library/typing.rst:1032 msgid "" "If ``is_str_list`` is a class or instance method, then the type in " "``TypeGuard`` maps to the type of the second parameter after ``cls`` or " "``self``." msgstr "" -#: ../../library/typing.rst:1033 +#: ../../library/typing.rst:1036 msgid "" "In short, the form ``def foo(arg: TypeA) -> TypeGuard[TypeB]: ...``, means " "that if ``foo(arg)`` returns ``True``, then ``arg`` narrows from ``TypeA`` " "to ``TypeB``." msgstr "" -#: ../../library/typing.rst:1039 +#: ../../library/typing.rst:1042 msgid "" "``TypeB`` need not be a narrower form of ``TypeA`` -- it can even be a wider " "form. The main reason is to allow for things like narrowing ``List[object]`` " @@ -1032,50 +1032,50 @@ msgid "" "guards is left to the user." msgstr "" -#: ../../library/typing.rst:1045 +#: ../../library/typing.rst:1048 msgid "" "``TypeGuard`` also works with type variables. For more information, see :" "pep:`647` (User-Defined Type Guards)." msgstr "" -#: ../../library/typing.rst:1052 +#: ../../library/typing.rst:1055 msgid "Building generic types" msgstr "" -#: ../../library/typing.rst:1054 +#: ../../library/typing.rst:1057 msgid "" "These are not used in annotations. They are building blocks for creating " "generic types." msgstr "" -#: ../../library/typing.rst:1058 +#: ../../library/typing.rst:1061 msgid "Abstract base class for generic types." msgstr "" -#: ../../library/typing.rst:1060 +#: ../../library/typing.rst:1063 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:1069 +#: ../../library/typing.rst:1072 msgid "This class can then be used as follows::" msgstr "" -#: ../../library/typing.rst:1082 +#: ../../library/typing.rst:1085 msgid "Type variable." msgstr "" -#: ../../library/typing.rst:1084 ../../library/typing.rst:1190 -#: ../../library/typing.rst:1367 +#: ../../library/typing.rst:1087 ../../library/typing.rst:1193 +#: ../../library/typing.rst:1370 msgid "Usage::" msgstr "" "用法:\n" "\n" "::" -#: ../../library/typing.rst:1090 +#: ../../library/typing.rst:1093 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 " @@ -1083,13 +1083,13 @@ msgid "" "types. Generic functions work as follows::" msgstr "" -#: ../../library/typing.rst:1110 +#: ../../library/typing.rst:1113 msgid "" "Note that type variables can be *bound*, *constrained*, or neither, but " "cannot be both bound *and* constrained." msgstr "" -#: ../../library/typing.rst:1113 +#: ../../library/typing.rst:1116 msgid "" "Constrained type variables and bound type variables have different semantics " "in several important ways. Using a *constrained* type variable means that " @@ -1097,19 +1097,19 @@ msgid "" "constraints given::" msgstr "" -#: ../../library/typing.rst:1123 +#: ../../library/typing.rst:1126 msgid "" "Using a *bound* type variable, however, means that the ``TypeVar`` will be " "solved using the most specific type possible::" msgstr "" -#: ../../library/typing.rst:1134 +#: ../../library/typing.rst:1137 msgid "" "Type variables can be bound to concrete types, abstract types (ABCs or " "protocols), and even unions of types::" msgstr "" -#: ../../library/typing.rst:1140 +#: ../../library/typing.rst:1143 msgid "" "Bound type variables are particularly useful for annotating :func:" "`classmethods ` that serve as alternative constructors. In the " @@ -1121,26 +1121,26 @@ msgid "" "type even if the method is called on a subclass::" msgstr "" -#: ../../library/typing.rst:1178 +#: ../../library/typing.rst:1181 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:1181 +#: ../../library/typing.rst:1184 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." msgstr "" -#: ../../library/typing.rst:1187 +#: ../../library/typing.rst:1190 msgid "" "Parameter specification variable. A specialized version of :class:`type " "variables `." msgstr "" -#: ../../library/typing.rst:1194 +#: ../../library/typing.rst:1197 msgid "" "Parameter specification variables exist primarily for the benefit of static " "type checkers. They are used to forward the parameter types of one callable " @@ -1150,7 +1150,7 @@ msgid "" "See :class:`Generic` for more information on generic types." msgstr "" -#: ../../library/typing.rst:1201 +#: ../../library/typing.rst:1204 msgid "" "For example, to add basic logging to a function, one can create a decorator " "``add_logging`` to log function calls. The parameter specification variable " @@ -1158,27 +1158,27 @@ msgid "" "new callable returned by it have inter-dependent type parameters::" msgstr "" -#: ../../library/typing.rst:1225 +#: ../../library/typing.rst:1228 msgid "" "Without ``ParamSpec``, the simplest way to annotate this previously was to " "use a :class:`TypeVar` with bound ``Callable[..., Any]``. However this " "causes two problems:" msgstr "" -#: ../../library/typing.rst:1229 +#: ../../library/typing.rst:1232 msgid "" "The type checker can't type check the ``inner`` function because ``*args`` " "and ``**kwargs`` have to be typed :data:`Any`." msgstr "" -#: ../../library/typing.rst:1231 +#: ../../library/typing.rst:1234 msgid "" ":func:`~cast` may be required in the body of the ``add_logging`` decorator " "when returning the ``inner`` function, or the static type checker must be " "told to ignore the ``return inner``." msgstr "" -#: ../../library/typing.rst:1238 +#: ../../library/typing.rst:1241 msgid "" "Since ``ParamSpec`` captures both positional and keyword parameters, ``P." "args`` and ``P.kwargs`` can be used to split a ``ParamSpec`` into its " @@ -1191,7 +1191,7 @@ msgid "" "`ParamSpecKwargs`." msgstr "" -#: ../../library/typing.rst:1248 +#: ../../library/typing.rst:1251 msgid "" "Parameter specification variables created with ``covariant=True`` or " "``contravariant=True`` can be used to declare covariant or contravariant " @@ -1200,17 +1200,17 @@ msgid "" "decided." msgstr "" -#: ../../library/typing.rst:1257 +#: ../../library/typing.rst:1260 msgid "" "Only parameter specification variables defined in global scope can be " "pickled." msgstr "" -#: ../../library/typing.rst:1263 +#: ../../library/typing.rst:1266 msgid ":class:`Callable` and :class:`Concatenate`." msgstr ":class:`Callable` 和 :class:`Concatenate`\\ 。" -#: ../../library/typing.rst:1268 +#: ../../library/typing.rst:1271 msgid "" "Arguments and keyword arguments attributes of a :class:`ParamSpec`. The ``P." "args`` attribute of a ``ParamSpec`` is an instance of ``ParamSpecArgs``, and " @@ -1218,36 +1218,36 @@ msgid "" "runtime introspection and have no special meaning to static type checkers." msgstr "" -#: ../../library/typing.rst:1273 +#: ../../library/typing.rst:1276 msgid "" "Calling :func:`get_origin` on either of these objects will return the " "original ``ParamSpec``::" msgstr "" -#: ../../library/typing.rst:1285 +#: ../../library/typing.rst:1288 msgid "" "``AnyStr`` is a :class:`constrained type variable ` defined as " "``AnyStr = TypeVar('AnyStr', str, bytes)``." msgstr "" -#: ../../library/typing.rst:1288 +#: ../../library/typing.rst:1291 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::" msgstr "" -#: ../../library/typing.rst:1300 +#: ../../library/typing.rst:1303 msgid "" "Base class for protocol classes. Protocol classes are defined like this::" msgstr "" -#: ../../library/typing.rst:1306 +#: ../../library/typing.rst:1309 msgid "" "Such classes are primarily used with static type checkers that recognize " "structural subtyping (static duck-typing), for example::" msgstr "" -#: ../../library/typing.rst:1318 +#: ../../library/typing.rst:1321 msgid "" "See :pep:`544` for details. Protocol classes decorated with :func:" "`runtime_checkable` (described later) act as simple-minded runtime protocols " @@ -1255,15 +1255,15 @@ msgid "" "signatures." msgstr "" -#: ../../library/typing.rst:1323 +#: ../../library/typing.rst:1326 msgid "Protocol classes can be generic, for example::" msgstr "" -#: ../../library/typing.rst:1333 +#: ../../library/typing.rst:1336 msgid "Mark a protocol class as a runtime protocol." msgstr "" -#: ../../library/typing.rst:1335 +#: ../../library/typing.rst:1338 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 " @@ -1272,7 +1272,7 @@ msgid "" "For example::" msgstr "" -#: ../../library/typing.rst:1348 +#: ../../library/typing.rst:1351 msgid "" ":func:`runtime_checkable` will check only the presence of the required " "methods, not their type signatures. For example, :class:`ssl.SSLObject` is a " @@ -1282,91 +1282,92 @@ msgid "" "making it impossible to call (instantiate) :class:`ssl.SSLObject`." msgstr "" -#: ../../library/typing.rst:1359 +#: ../../library/typing.rst:1362 msgid "Other special directives" msgstr "" -#: ../../library/typing.rst:1361 +#: ../../library/typing.rst:1364 msgid "" "These are not used in annotations. They are building blocks for declaring " "types." msgstr "" -#: ../../library/typing.rst:1365 +#: ../../library/typing.rst:1368 msgid "Typed version of :func:`collections.namedtuple`." msgstr "" -#: ../../library/typing.rst:1373 +#: ../../library/typing.rst:1376 msgid "This is equivalent to::" msgstr "" "這等價於:\n" "\n" "::" -#: ../../library/typing.rst:1377 +#: ../../library/typing.rst:1380 msgid "" "To give a field a default value, you can assign to it in the class body::" msgstr "" -#: ../../library/typing.rst:1386 +#: ../../library/typing.rst:1389 msgid "" "Fields with a default value must come after any fields without a default." msgstr "" -#: ../../library/typing.rst:1388 +#: ../../library/typing.rst:1391 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 " "``_fields`` attribute and the default values are in the ``_field_defaults`` " -"attribute both of which are part of the namedtuple API.)" +"attribute, both of which are part of the :func:`~collections.namedtuple` " +"API.)" msgstr "" -#: ../../library/typing.rst:1394 +#: ../../library/typing.rst:1397 msgid "``NamedTuple`` subclasses can also have docstrings and methods::" msgstr "" -#: ../../library/typing.rst:1404 +#: ../../library/typing.rst:1407 msgid "Backward-compatible usage::" msgstr "" -#: ../../library/typing.rst:1408 +#: ../../library/typing.rst:1411 msgid "Added support for :pep:`526` variable annotation syntax." msgstr "" -#: ../../library/typing.rst:1411 +#: ../../library/typing.rst:1414 msgid "Added support for default values, methods, and docstrings." msgstr "" -#: ../../library/typing.rst:1414 +#: ../../library/typing.rst:1417 msgid "" "The ``_field_types`` and ``__annotations__`` attributes are now regular " "dictionaries instead of instances of ``OrderedDict``." msgstr "" -#: ../../library/typing.rst:1418 +#: ../../library/typing.rst:1421 msgid "" "Removed the ``_field_types`` attribute in favor of the more standard " "``__annotations__`` attribute which has the same information." msgstr "" -#: ../../library/typing.rst:1424 +#: ../../library/typing.rst:1427 msgid "" "A helper class to indicate a distinct type to a typechecker, see :ref:" "`distinct`. At runtime it returns an object that returns its argument when " "called. Usage::" msgstr "" -#: ../../library/typing.rst:1434 +#: ../../library/typing.rst:1437 msgid "``NewType`` is now a class rather than a function." msgstr "" -#: ../../library/typing.rst:1439 +#: ../../library/typing.rst:1442 msgid "" "Special construct to add type hints to a dictionary. At runtime it is a " "plain :class:`dict`." msgstr "" -#: ../../library/typing.rst:1442 +#: ../../library/typing.rst:1445 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 " @@ -1374,27 +1375,27 @@ msgid "" "enforced by type checkers. Usage::" msgstr "" -#: ../../library/typing.rst:1458 +#: ../../library/typing.rst:1461 msgid "" "To allow using this feature with older versions of Python that do not " "support :pep:`526`, ``TypedDict`` supports two additional equivalent " "syntactic forms::" msgstr "" -#: ../../library/typing.rst:1465 +#: ../../library/typing.rst:1468 msgid "" "The functional syntax should also be used when any of the keys are not " -"valid :ref:`identifiers`, for example because they are keywords or contain " -"hyphens. Example::" +"valid :ref:`identifiers `, for example because they are " +"keywords or contain hyphens. Example::" msgstr "" -#: ../../library/typing.rst:1477 +#: ../../library/typing.rst:1480 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:1485 +#: ../../library/typing.rst:1488 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 " @@ -1402,37 +1403,37 @@ msgid "" "and makes all items defined in the class body required." msgstr "" -#: ../../library/typing.rst:1490 +#: ../../library/typing.rst:1493 msgid "" "It is possible for a ``TypedDict`` type to inherit from one or more other " "``TypedDict`` types using the class-based syntax. Usage::" msgstr "" -#: ../../library/typing.rst:1497 +#: ../../library/typing.rst:1500 msgid "" "``Point3D`` has three items: ``x``, ``y`` and ``z``. It is equivalent to " "this definition::" msgstr "" -#: ../../library/typing.rst:1505 +#: ../../library/typing.rst:1508 msgid "" -"A ``TypedDict`` cannot inherit from a non-TypedDict class, notably " +"A ``TypedDict`` cannot inherit from a non-\\ ``TypedDict`` class, notably " "including :class:`Generic`. For example::" msgstr "" -#: ../../library/typing.rst:1523 +#: ../../library/typing.rst:1526 msgid "" "A ``TypedDict`` can be introspected via annotations dicts (see :ref:" "`annotations-howto` for more information on annotations best practices), :" "attr:`__total__`, :attr:`__required_keys__`, and :attr:`__optional_keys__`." msgstr "" -#: ../../library/typing.rst:1529 +#: ../../library/typing.rst:1532 msgid "" "``Point2D.__total__`` gives the value of the ``total`` argument. Example::" msgstr "" -#: ../../library/typing.rst:1546 +#: ../../library/typing.rst:1549 msgid "" "``Point2D.__required_keys__`` and ``Point2D.__optional_keys__`` return :" "class:`frozenset` objects containing required and non-required keys, " @@ -1442,152 +1443,152 @@ msgid "" "it from another ``TypedDict`` with a different value for ``total``. Usage::" msgstr "" -#: ../../library/typing.rst:1566 +#: ../../library/typing.rst:1569 msgid "" "See :pep:`589` for more examples and detailed rules of using ``TypedDict``." msgstr "" -#: ../../library/typing.rst:1571 +#: ../../library/typing.rst:1574 msgid "Generic concrete collections" msgstr "" -#: ../../library/typing.rst:1574 +#: ../../library/typing.rst:1577 msgid "Corresponding to built-in types" msgstr "" -#: ../../library/typing.rst:1578 +#: ../../library/typing.rst:1581 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`." msgstr "" -#: ../../library/typing.rst:1582 +#: ../../library/typing.rst:1585 msgid "This type can be used as follows::" msgstr "" -#: ../../library/typing.rst:1587 +#: ../../library/typing.rst:1590 msgid "" ":class:`builtins.dict ` now supports ``[]``. See :pep:`585` and :ref:" "`types-genericalias`." msgstr "" -#: ../../library/typing.rst:1593 +#: ../../library/typing.rst:1596 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:1598 +#: ../../library/typing.rst:1601 msgid "This type may be used as follows::" msgstr "" -#: ../../library/typing.rst:1608 +#: ../../library/typing.rst:1611 msgid "" ":class:`builtins.list ` now supports ``[]``. See :pep:`585` and :ref:" "`types-genericalias`." msgstr "" -#: ../../library/typing.rst:1614 +#: ../../library/typing.rst:1617 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`." msgstr "" -#: ../../library/typing.rst:1618 +#: ../../library/typing.rst:1621 msgid "" ":class:`builtins.set ` now supports ``[]``. See :pep:`585` and :ref:" "`types-genericalias`." msgstr "" -#: ../../library/typing.rst:1624 +#: ../../library/typing.rst:1627 msgid "A generic version of :class:`builtins.frozenset `." msgstr "" -#: ../../library/typing.rst:1626 +#: ../../library/typing.rst:1629 msgid "" ":class:`builtins.frozenset ` now supports ``[]``. See :pep:`585` " "and :ref:`types-genericalias`." msgstr "" -#: ../../library/typing.rst:1630 +#: ../../library/typing.rst:1633 msgid ":data:`Tuple` is a special form." msgstr "" -#: ../../library/typing.rst:1633 +#: ../../library/typing.rst:1636 msgid "Corresponding to types in :mod:`collections`" msgstr "" -#: ../../library/typing.rst:1637 +#: ../../library/typing.rst:1640 msgid "A generic version of :class:`collections.defaultdict`." msgstr "" -#: ../../library/typing.rst:1641 +#: ../../library/typing.rst:1644 msgid "" ":class:`collections.defaultdict` now supports ``[]``. See :pep:`585` and :" "ref:`types-genericalias`." msgstr "" -#: ../../library/typing.rst:1647 +#: ../../library/typing.rst:1650 msgid "A generic version of :class:`collections.OrderedDict`." msgstr "" -#: ../../library/typing.rst:1651 +#: ../../library/typing.rst:1654 msgid "" ":class:`collections.OrderedDict` now supports ``[]``. See :pep:`585` and :" "ref:`types-genericalias`." msgstr "" -#: ../../library/typing.rst:1657 +#: ../../library/typing.rst:1660 msgid "A generic version of :class:`collections.ChainMap`." msgstr "" -#: ../../library/typing.rst:1662 +#: ../../library/typing.rst:1665 msgid "" ":class:`collections.ChainMap` now supports ``[]``. See :pep:`585` and :ref:" "`types-genericalias`." msgstr "" -#: ../../library/typing.rst:1668 +#: ../../library/typing.rst:1671 msgid "A generic version of :class:`collections.Counter`." msgstr "" -#: ../../library/typing.rst:1673 +#: ../../library/typing.rst:1676 msgid "" ":class:`collections.Counter` now supports ``[]``. See :pep:`585` and :ref:" "`types-genericalias`." msgstr "" -#: ../../library/typing.rst:1679 +#: ../../library/typing.rst:1682 msgid "A generic version of :class:`collections.deque`." msgstr "" -#: ../../library/typing.rst:1684 +#: ../../library/typing.rst:1687 msgid "" ":class:`collections.deque` now supports ``[]``. See :pep:`585` and :ref:" "`types-genericalias`." msgstr "" -#: ../../library/typing.rst:1689 +#: ../../library/typing.rst:1692 msgid "Other concrete types" msgstr "" -#: ../../library/typing.rst:1695 +#: ../../library/typing.rst:1698 msgid "" "Generic type ``IO[AnyStr]`` and its subclasses ``TextIO(IO[str])`` and " "``BinaryIO(IO[bytes])`` represent the types of I/O streams such as returned " "by :func:`open`." msgstr "" -#: ../../library/typing.rst:1702 +#: ../../library/typing.rst:1705 msgid "" "The ``typing.io`` namespace is deprecated and will be removed. These types " "should be directly imported from ``typing`` instead." msgstr "" -#: ../../library/typing.rst:1707 +#: ../../library/typing.rst:1710 msgid "" "These type aliases correspond to the return types from :func:`re.compile` " "and :func:`re.match`. These types (and the corresponding functions) are " @@ -1595,413 +1596,413 @@ msgid "" "``Pattern[bytes]``, ``Match[str]``, or ``Match[bytes]``." msgstr "" -#: ../../library/typing.rst:1717 +#: ../../library/typing.rst:1720 msgid "" "The ``typing.re`` namespace is deprecated and will be removed. These types " "should be directly imported from ``typing`` instead." msgstr "" -#: ../../library/typing.rst:1718 +#: ../../library/typing.rst:1721 msgid "" "Classes ``Pattern`` and ``Match`` from :mod:`re` now support ``[]``. See :" "pep:`585` and :ref:`types-genericalias`." msgstr "" -#: ../../library/typing.rst:1724 +#: ../../library/typing.rst:1727 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``." msgstr "" -#: ../../library/typing.rst:1728 +#: ../../library/typing.rst:1731 msgid "" "Use ``Text`` to indicate that a value must contain a unicode string in a " "manner that is compatible with both Python 2 and Python 3::" msgstr "" -#: ../../library/typing.rst:1737 +#: ../../library/typing.rst:1740 msgid "Abstract Base Classes" msgstr "" -#: ../../library/typing.rst:1740 +#: ../../library/typing.rst:1743 msgid "Corresponding to collections in :mod:`collections.abc`" msgstr "" -#: ../../library/typing.rst:1744 +#: ../../library/typing.rst:1747 msgid "A generic version of :class:`collections.abc.Set`." msgstr "" -#: ../../library/typing.rst:1746 +#: ../../library/typing.rst:1749 msgid "" ":class:`collections.abc.Set` now supports ``[]``. See :pep:`585` and :ref:" "`types-genericalias`." msgstr "" -#: ../../library/typing.rst:1752 +#: ../../library/typing.rst:1755 msgid "A generic version of :class:`collections.abc.ByteString`." msgstr "" -#: ../../library/typing.rst:1754 +#: ../../library/typing.rst:1757 msgid "" "This type represents the types :class:`bytes`, :class:`bytearray`, and :" "class:`memoryview` of byte sequences." msgstr "" -#: ../../library/typing.rst:1757 +#: ../../library/typing.rst:1760 msgid "" "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:1760 +#: ../../library/typing.rst:1763 msgid "" ":class:`collections.abc.ByteString` now supports ``[]``. See :pep:`585` and :" "ref:`types-genericalias`." msgstr "" -#: ../../library/typing.rst:1766 +#: ../../library/typing.rst:1769 msgid "A generic version of :class:`collections.abc.Collection`" msgstr "" -#: ../../library/typing.rst:1770 +#: ../../library/typing.rst:1773 msgid "" ":class:`collections.abc.Collection` now supports ``[]``. See :pep:`585` and :" "ref:`types-genericalias`." msgstr "" -#: ../../library/typing.rst:1776 +#: ../../library/typing.rst:1779 msgid "A generic version of :class:`collections.abc.Container`." msgstr "" -#: ../../library/typing.rst:1778 +#: ../../library/typing.rst:1781 msgid "" ":class:`collections.abc.Container` now supports ``[]``. See :pep:`585` and :" "ref:`types-genericalias`." msgstr "" -#: ../../library/typing.rst:1784 +#: ../../library/typing.rst:1787 msgid "A generic version of :class:`collections.abc.ItemsView`." msgstr "" -#: ../../library/typing.rst:1786 +#: ../../library/typing.rst:1789 msgid "" ":class:`collections.abc.ItemsView` now supports ``[]``. See :pep:`585` and :" "ref:`types-genericalias`." msgstr "" -#: ../../library/typing.rst:1792 +#: ../../library/typing.rst:1795 msgid "A generic version of :class:`collections.abc.KeysView`." msgstr "" -#: ../../library/typing.rst:1794 +#: ../../library/typing.rst:1797 msgid "" ":class:`collections.abc.KeysView` now supports ``[]``. See :pep:`585` and :" "ref:`types-genericalias`." msgstr "" -#: ../../library/typing.rst:1800 +#: ../../library/typing.rst:1803 msgid "" "A generic version of :class:`collections.abc.Mapping`. This type can be used " "as follows::" msgstr "" -#: ../../library/typing.rst:1806 +#: ../../library/typing.rst:1809 msgid "" ":class:`collections.abc.Mapping` now supports ``[]``. See :pep:`585` and :" "ref:`types-genericalias`." msgstr "" -#: ../../library/typing.rst:1812 +#: ../../library/typing.rst:1815 msgid "A generic version of :class:`collections.abc.MappingView`." msgstr "" -#: ../../library/typing.rst:1814 +#: ../../library/typing.rst:1817 msgid "" ":class:`collections.abc.MappingView` now supports ``[]``. See :pep:`585` " "and :ref:`types-genericalias`." msgstr "" -#: ../../library/typing.rst:1820 +#: ../../library/typing.rst:1823 msgid "A generic version of :class:`collections.abc.MutableMapping`." msgstr "" -#: ../../library/typing.rst:1822 +#: ../../library/typing.rst:1825 msgid "" ":class:`collections.abc.MutableMapping` now supports ``[]``. See :pep:`585` " "and :ref:`types-genericalias`." msgstr "" -#: ../../library/typing.rst:1828 +#: ../../library/typing.rst:1831 msgid "A generic version of :class:`collections.abc.MutableSequence`." msgstr "" -#: ../../library/typing.rst:1830 +#: ../../library/typing.rst:1833 msgid "" ":class:`collections.abc.MutableSequence` now supports ``[]``. See :pep:`585` " "and :ref:`types-genericalias`." msgstr "" -#: ../../library/typing.rst:1836 +#: ../../library/typing.rst:1839 msgid "A generic version of :class:`collections.abc.MutableSet`." msgstr "" -#: ../../library/typing.rst:1838 +#: ../../library/typing.rst:1841 msgid "" ":class:`collections.abc.MutableSet` now supports ``[]``. See :pep:`585` and :" "ref:`types-genericalias`." msgstr "" -#: ../../library/typing.rst:1844 +#: ../../library/typing.rst:1847 msgid "A generic version of :class:`collections.abc.Sequence`." msgstr "" -#: ../../library/typing.rst:1846 +#: ../../library/typing.rst:1849 msgid "" ":class:`collections.abc.Sequence` now supports ``[]``. See :pep:`585` and :" "ref:`types-genericalias`." msgstr "" -#: ../../library/typing.rst:1852 +#: ../../library/typing.rst:1855 msgid "A generic version of :class:`collections.abc.ValuesView`." msgstr "" -#: ../../library/typing.rst:1854 +#: ../../library/typing.rst:1857 msgid "" ":class:`collections.abc.ValuesView` now supports ``[]``. See :pep:`585` and :" "ref:`types-genericalias`." msgstr "" -#: ../../library/typing.rst:1859 +#: ../../library/typing.rst:1862 msgid "Corresponding to other types in :mod:`collections.abc`" msgstr "" -#: ../../library/typing.rst:1863 +#: ../../library/typing.rst:1866 msgid "A generic version of :class:`collections.abc.Iterable`." msgstr "" -#: ../../library/typing.rst:1865 +#: ../../library/typing.rst:1868 msgid "" ":class:`collections.abc.Iterable` now supports ``[]``. See :pep:`585` and :" "ref:`types-genericalias`." msgstr "" -#: ../../library/typing.rst:1871 +#: ../../library/typing.rst:1874 msgid "A generic version of :class:`collections.abc.Iterator`." msgstr "" -#: ../../library/typing.rst:1873 +#: ../../library/typing.rst:1876 msgid "" ":class:`collections.abc.Iterator` now supports ``[]``. See :pep:`585` and :" "ref:`types-genericalias`." msgstr "" -#: ../../library/typing.rst:1879 +#: ../../library/typing.rst:1882 msgid "" "A generator can be annotated by the generic type ``Generator[YieldType, " "SendType, ReturnType]``. For example::" msgstr "" -#: ../../library/typing.rst:1888 +#: ../../library/typing.rst:1891 msgid "" "Note that unlike many other generics in the typing module, the ``SendType`` " "of :class:`Generator` behaves contravariantly, not covariantly or " "invariantly." msgstr "" -#: ../../library/typing.rst:1892 +#: ../../library/typing.rst:1895 msgid "" "If your generator will only yield values, set the ``SendType`` and " "``ReturnType`` to ``None``::" msgstr "" -#: ../../library/typing.rst:1900 +#: ../../library/typing.rst:1903 msgid "" "Alternatively, annotate your generator as having a return type of either " "``Iterable[YieldType]`` or ``Iterator[YieldType]``::" msgstr "" -#: ../../library/typing.rst:1908 +#: ../../library/typing.rst:1911 msgid "" ":class:`collections.abc.Generator` now supports ``[]``. See :pep:`585` and :" "ref:`types-genericalias`." msgstr "" -#: ../../library/typing.rst:1914 -msgid "An alias to :class:`collections.abc.Hashable`" +#: ../../library/typing.rst:1917 +msgid "An alias to :class:`collections.abc.Hashable`." msgstr "" -#: ../../library/typing.rst:1918 +#: ../../library/typing.rst:1921 msgid "A generic version of :class:`collections.abc.Reversible`." msgstr "" -#: ../../library/typing.rst:1920 +#: ../../library/typing.rst:1923 msgid "" ":class:`collections.abc.Reversible` now supports ``[]``. See :pep:`585` and :" "ref:`types-genericalias`." msgstr "" -#: ../../library/typing.rst:1926 -msgid "An alias to :class:`collections.abc.Sized`" +#: ../../library/typing.rst:1929 +msgid "An alias to :class:`collections.abc.Sized`." msgstr "" -#: ../../library/typing.rst:1929 +#: ../../library/typing.rst:1932 msgid "Asynchronous programming" msgstr "" -#: ../../library/typing.rst:1933 +#: ../../library/typing.rst:1936 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:1945 +#: ../../library/typing.rst:1948 msgid "" ":class:`collections.abc.Coroutine` now supports ``[]``. See :pep:`585` and :" "ref:`types-genericalias`." msgstr "" -#: ../../library/typing.rst:1951 +#: ../../library/typing.rst:1954 msgid "" "An async generator can be annotated by the generic type " "``AsyncGenerator[YieldType, SendType]``. For example::" msgstr "" -#: ../../library/typing.rst:1960 +#: ../../library/typing.rst:1963 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:1964 +#: ../../library/typing.rst:1967 msgid "" "If your generator will only yield values, set the ``SendType`` to ``None``::" msgstr "" -#: ../../library/typing.rst:1972 +#: ../../library/typing.rst:1975 msgid "" "Alternatively, annotate your generator as having a return type of either " "``AsyncIterable[YieldType]`` or ``AsyncIterator[YieldType]``::" msgstr "" -#: ../../library/typing.rst:1982 +#: ../../library/typing.rst:1985 msgid "" ":class:`collections.abc.AsyncGenerator` now supports ``[]``. See :pep:`585` " "and :ref:`types-genericalias`." msgstr "" -#: ../../library/typing.rst:1988 +#: ../../library/typing.rst:1991 msgid "A generic version of :class:`collections.abc.AsyncIterable`." msgstr "" -#: ../../library/typing.rst:1992 +#: ../../library/typing.rst:1995 msgid "" ":class:`collections.abc.AsyncIterable` now supports ``[]``. See :pep:`585` " "and :ref:`types-genericalias`." msgstr "" -#: ../../library/typing.rst:1998 +#: ../../library/typing.rst:2001 msgid "A generic version of :class:`collections.abc.AsyncIterator`." msgstr "" -#: ../../library/typing.rst:2002 +#: ../../library/typing.rst:2005 msgid "" ":class:`collections.abc.AsyncIterator` now supports ``[]``. See :pep:`585` " "and :ref:`types-genericalias`." msgstr "" -#: ../../library/typing.rst:2008 +#: ../../library/typing.rst:2011 msgid "A generic version of :class:`collections.abc.Awaitable`." msgstr "" -#: ../../library/typing.rst:2012 +#: ../../library/typing.rst:2015 msgid "" ":class:`collections.abc.Awaitable` now supports ``[]``. See :pep:`585` and :" "ref:`types-genericalias`." msgstr "" -#: ../../library/typing.rst:2018 +#: ../../library/typing.rst:2021 msgid "Context manager types" msgstr "" -#: ../../library/typing.rst:2022 +#: ../../library/typing.rst:2025 msgid "A generic version of :class:`contextlib.AbstractContextManager`." msgstr "" -#: ../../library/typing.rst:2027 +#: ../../library/typing.rst:2030 msgid "" ":class:`contextlib.AbstractContextManager` now supports ``[]``. See :pep:" "`585` and :ref:`types-genericalias`." msgstr "" -#: ../../library/typing.rst:2033 +#: ../../library/typing.rst:2036 msgid "A generic version of :class:`contextlib.AbstractAsyncContextManager`." msgstr "" -#: ../../library/typing.rst:2038 +#: ../../library/typing.rst:2041 msgid "" ":class:`contextlib.AbstractAsyncContextManager` now supports ``[]``. See :" "pep:`585` and :ref:`types-genericalias`." msgstr "" -#: ../../library/typing.rst:2043 +#: ../../library/typing.rst:2046 msgid "Protocols" msgstr "" -#: ../../library/typing.rst:2045 +#: ../../library/typing.rst:2048 msgid "These protocols are decorated with :func:`runtime_checkable`." msgstr "" -#: ../../library/typing.rst:2049 +#: ../../library/typing.rst:2052 msgid "" "An ABC with one abstract method ``__abs__`` that is covariant in its return " "type." msgstr "" -#: ../../library/typing.rst:2054 +#: ../../library/typing.rst:2057 msgid "An ABC with one abstract method ``__bytes__``." msgstr "" -#: ../../library/typing.rst:2058 +#: ../../library/typing.rst:2061 msgid "An ABC with one abstract method ``__complex__``." msgstr "" -#: ../../library/typing.rst:2062 +#: ../../library/typing.rst:2065 msgid "An ABC with one abstract method ``__float__``." msgstr "" -#: ../../library/typing.rst:2066 +#: ../../library/typing.rst:2069 msgid "An ABC with one abstract method ``__index__``." msgstr "" -#: ../../library/typing.rst:2072 +#: ../../library/typing.rst:2075 msgid "An ABC with one abstract method ``__int__``." msgstr "" -#: ../../library/typing.rst:2076 +#: ../../library/typing.rst:2079 msgid "" "An ABC with one abstract method ``__round__`` that is covariant in its " "return type." msgstr "" -#: ../../library/typing.rst:2080 +#: ../../library/typing.rst:2083 msgid "Functions and decorators" msgstr "函式與裝飾器" -#: ../../library/typing.rst:2084 +#: ../../library/typing.rst:2087 msgid "Cast a value to a type." msgstr "" -#: ../../library/typing.rst:2086 +#: ../../library/typing.rst:2089 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:2093 +#: ../../library/typing.rst:2096 msgid "" "The ``@overload`` decorator allows describing functions and methods that " "support multiple different combinations of argument types. A series of " @@ -2016,69 +2017,69 @@ msgid "" "variable::" msgstr "" -#: ../../library/typing.rst:2117 +#: ../../library/typing.rst:2120 msgid "See :pep:`484` for details and comparison with other typing semantics." msgstr "" -#: ../../library/typing.rst:2121 +#: ../../library/typing.rst:2124 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:2146 +#: ../../library/typing.rst:2149 msgid "Decorator to indicate that annotations are not type hints." msgstr "" -#: ../../library/typing.rst:2148 +#: ../../library/typing.rst:2151 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:2152 +#: ../../library/typing.rst:2155 msgid "This mutates the function(s) in place." msgstr "" -#: ../../library/typing.rst:2156 +#: ../../library/typing.rst:2159 msgid "Decorator to give another decorator the :func:`no_type_check` effect." msgstr "" -#: ../../library/typing.rst:2158 +#: ../../library/typing.rst:2161 msgid "" "This wraps the decorator with something that wraps the decorated function " "in :func:`no_type_check`." msgstr "" -#: ../../library/typing.rst:2163 +#: ../../library/typing.rst:2166 msgid "Decorator to mark a class or function to be unavailable at runtime." msgstr "" -#: ../../library/typing.rst:2165 +#: ../../library/typing.rst:2168 msgid "" "This decorator is itself not available at runtime. It is mainly intended to " "mark classes that are defined in type stub files if an implementation " "returns an instance of a private class::" msgstr "" -#: ../../library/typing.rst:2176 +#: ../../library/typing.rst:2179 msgid "" "Note that returning instances of private classes is not recommended. It is " "usually preferable to make such classes public." msgstr "" -#: ../../library/typing.rst:2180 +#: ../../library/typing.rst:2183 msgid "Introspection helpers" msgstr "" -#: ../../library/typing.rst:2184 +#: ../../library/typing.rst:2187 msgid "" "Return a dictionary containing type hints for a function, method, module or " "class object." msgstr "" -#: ../../library/typing.rst:2187 +#: ../../library/typing.rst:2190 msgid "" "This is often the same as ``obj.__annotations__``. In addition, forward " "references encoded as string literals are handled by evaluating them in " @@ -2088,29 +2089,29 @@ msgid "" "merging all the ``__annotations__`` along ``C.__mro__`` in reverse order." msgstr "" -#: ../../library/typing.rst:2195 +#: ../../library/typing.rst:2198 msgid "" "The function recursively replaces all ``Annotated[T, ...]`` with ``T``, " "unless ``include_extras`` is set to ``True`` (see :class:`Annotated` for " "more information). For example::" msgstr "" -#: ../../library/typing.rst:2210 +#: ../../library/typing.rst:2213 msgid "" ":func:`get_type_hints` does not work with imported :ref:`type aliases ` that include forward references. Enabling postponed evaluation of " "annotations (:pep:`563`) may remove the need for most forward references." msgstr "" -#: ../../library/typing.rst:2215 +#: ../../library/typing.rst:2218 msgid "Added ``include_extras`` parameter as part of :pep:`593`." msgstr "新增 ``include_extras`` 參數(如 :pep:`593` 中所述)。" -#: ../../library/typing.rst:2221 +#: ../../library/typing.rst:2224 msgid "Provide basic introspection for generic types and special typing forms." msgstr "" -#: ../../library/typing.rst:2223 +#: ../../library/typing.rst:2226 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:" @@ -2121,11 +2122,11 @@ msgid "" "and ``()`` correspondingly. Examples::" msgstr "" -#: ../../library/typing.rst:2242 +#: ../../library/typing.rst:2245 msgid "Check if a type is a :class:`TypedDict`." msgstr "" -#: ../../library/typing.rst:2257 +#: ../../library/typing.rst:2260 msgid "" "A class used for internal typing representation of string forward " "references. For example, ``List[\"SomeClass\"]`` is implicitly transformed " @@ -2133,24 +2134,24 @@ msgid "" "instantiated by a user, but may be used by introspection tools." msgstr "" -#: ../../library/typing.rst:2263 +#: ../../library/typing.rst:2266 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:2270 +#: ../../library/typing.rst:2273 msgid "Constant" msgstr "常數" -#: ../../library/typing.rst:2274 +#: ../../library/typing.rst:2277 msgid "" "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:2283 +#: ../../library/typing.rst:2286 msgid "" "The first type annotation must be enclosed in quotes, making it a \"forward " "reference\", to hide the ``expensive_mod`` reference from the interpreter " @@ -2158,10 +2159,10 @@ msgid "" "second annotation does not need to be enclosed in quotes." msgstr "" -#: ../../library/typing.rst:2290 +#: ../../library/typing.rst:2293 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`)." +"If ``from __future__ import annotations`` is used, 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`)." msgstr "" diff --git a/library/unittest.po b/library/unittest.po index a350a4ec70..2d34d0e540 100644 --- a/library/unittest.po +++ b/library/unittest.po @@ -10,8 +10,8 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.10\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2021-11-19 00:09+0000\n" -"PO-Revision-Date: 2018-05-23 16:14+0000\n" +"POT-Creation-Date: 2022-05-21 17:35+0000\n" +"PO-Revision-Date: 2022-05-22 02:20+0800\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" "tw)\n" @@ -20,6 +20,7 @@ msgstr "" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" "Plural-Forms: nplurals=1; plural=0;\n" +"X-Generator: Poedit 3.0.1\n" #: ../../library/unittest.rst:2 msgid ":mod:`unittest` --- Unit testing framework" @@ -53,22 +54,22 @@ msgstr "" msgid "" "To achieve this, :mod:`unittest` supports some important concepts in an " "object-oriented way:" -msgstr ":mod:`unittest` 用來作為實現支援一些重要的物件導向方法的概念。" +msgstr ":mod:`unittest` 用來作為實現支援一些重要的物件導向方法的概念:" #: ../../library/unittest.rst:32 msgid "test fixture" msgstr "test fixture" #: ../../library/unittest.rst:29 -#, fuzzy msgid "" "A :dfn:`test fixture` represents the preparation needed to perform one or " "more tests, and any associated cleanup actions. This may involve, for " "example, creating temporary or proxy databases, directories, or starting a " "server process." msgstr "" -"一個 :dfn:`test fixture` 代表一個或多個測試所需要執行的準備,以及其他相關清理" -"行動,可以包括,例如,建立臨時或是代理資料庫,目錄,或是啟動一個服務的程序。" +"一個 :dfn:`test fixture` 代表執行一個或多個測試所需要的準備,以及其他相關清理" +"操作,例如可以是建立臨時性的或是代理用 (proxy) 資料庫、目錄、或是啟動一個伺服" +"器程序。" #: ../../library/unittest.rst:37 msgid "test case" @@ -94,7 +95,7 @@ msgid "" "is used to aggregate tests that should be executed together." msgstr "" ":dfn:`test suite` 是一個搜集測試條例,測試套件,或是兩者皆有。它需要一起被執" -"行並用來匯總測試。 " +"行並用來匯總測試。" #: ../../library/unittest.rst:48 msgid "test runner" @@ -137,13 +138,12 @@ msgid "`pytest `_" msgstr "`pytest `_" #: ../../library/unittest.rst:60 -#, fuzzy msgid "" "Third-party unittest framework with a lighter-weight syntax for writing " "tests. For example, ``assert func(10) == 42``." msgstr "" "第三方的單元測試框架,但在撰寫測試時使用更輕量的語法。例如: ``assert " -"func(10) == 42``\\ 。 " +"func(10) == 42``\\ 。" #: ../../library/unittest.rst:65 msgid "" @@ -173,7 +173,7 @@ msgstr "" msgid "" "A special-interest-group for discussion of testing, and testing tools, in " "Python." -msgstr "一個專門興趣的群組用來討論 Python 中的測試方式與測試工具。 " +msgstr "一個專門興趣的群組用來討論 Python 中的測試方式與測試工具。" #: ../../library/unittest.rst:71 msgid "" @@ -346,7 +346,7 @@ msgstr "命令列模式選項" #: ../../library/unittest.rst:200 msgid ":program:`unittest` supports these command-line options:" -msgstr " :program:`unittest` 支援以下命令列選項:" +msgstr ":program:`unittest` 支援以下命令列選項:" #: ../../library/unittest.rst:206 msgid "" @@ -424,7 +424,7 @@ msgid "" "The command line can also be used for test discovery, for running all of the " "tests in a project or just a subset." msgstr "" -"對執行所有的專案或是一個子集合測試,命令列模式可以可以被用來做測試探索。 " +"對執行所有的專案或是一個子集合測試,命令列模式可以可以被用來做測試探索。" #: ../../library/unittest.rst:258 msgid "Test Discovery" @@ -3051,7 +3051,7 @@ msgstr "" #: ../../library/unittest.rst:2441 msgid "" "It is responsible for calling all the cleanup functions added by :func:" -"`addCleanupModule`. If you need cleanup functions to be called *prior* to :" +"`addModuleCleanup`. If you need cleanup functions to be called *prior* to :" "func:`tearDownModule` then you can call :func:`doModuleCleanups` yourself." msgstr "" diff --git a/library/urllib.request.po b/library/urllib.request.po index 1c13fe807b..d09736df0c 100644 --- a/library/urllib.request.po +++ b/library/urllib.request.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.10\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2022-04-21 00:16+0000\n" +"POT-Creation-Date: 2022-05-21 17:35+0000\n" "PO-Revision-Date: 2022-04-21 17:59+0800\n" "Last-Translator: Jordan Su \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -684,7 +684,7 @@ msgstr "" msgid "A catch-all class to handle unknown URLs." msgstr "" -#: ../../library/urllib.request.rst:460 ../../library/urllib.request.rst:1155 +#: ../../library/urllib.request.rst:460 ../../library/urllib.request.rst:1156 msgid "Process HTTP error responses." msgstr "" @@ -783,67 +783,68 @@ msgid "" "same name, and later calls will overwrite previous calls in case the *key* " "collides. Currently, this is no loss of HTTP functionality, since all " "headers which have meaning when used more than once have a (header-specific) " -"way of gaining the same functionality using only one header." +"way of gaining the same functionality using only one header. Note that " +"headers added using this method are also added to redirected requests." msgstr "" -#: ../../library/urllib.request.rst:555 +#: ../../library/urllib.request.rst:556 msgid "Add a header that will not be added to a redirected request." msgstr "" -#: ../../library/urllib.request.rst:560 +#: ../../library/urllib.request.rst:561 msgid "" "Return whether the instance has the named header (checks both regular and " "unredirected)." msgstr "" -#: ../../library/urllib.request.rst:566 +#: ../../library/urllib.request.rst:567 msgid "" "Remove named header from the request instance (both from regular and " "unredirected headers)." msgstr "" -#: ../../library/urllib.request.rst:574 +#: ../../library/urllib.request.rst:575 msgid "Return the URL given in the constructor." msgstr "" -#: ../../library/urllib.request.rst:578 +#: ../../library/urllib.request.rst:579 msgid "Returns :attr:`Request.full_url`" msgstr "" -#: ../../library/urllib.request.rst:583 +#: ../../library/urllib.request.rst:584 msgid "" "Prepare the request by connecting to a proxy server. The *host* and *type* " "will replace those of the instance, and the instance's selector will be the " "original URL given in the constructor." msgstr "" -#: ../../library/urllib.request.rst:590 +#: ../../library/urllib.request.rst:591 msgid "" "Return the value of the given header. If the header is not present, return " "the default value." msgstr "" -#: ../../library/urllib.request.rst:596 +#: ../../library/urllib.request.rst:597 msgid "" "Return a list of tuples (header_name, header_value) of the Request headers." msgstr "" -#: ../../library/urllib.request.rst:598 +#: ../../library/urllib.request.rst:599 msgid "" "The request methods add_data, has_data, get_data, get_type, get_host, " "get_selector, get_origin_req_host and is_unverifiable that were deprecated " "since 3.3 have been removed." msgstr "" -#: ../../library/urllib.request.rst:607 +#: ../../library/urllib.request.rst:608 msgid "OpenerDirector Objects" msgstr "OpenerDirector 物件" -#: ../../library/urllib.request.rst:609 +#: ../../library/urllib.request.rst:610 msgid ":class:`OpenerDirector` instances have the following methods:" msgstr "" -#: ../../library/urllib.request.rst:614 +#: ../../library/urllib.request.rst:615 msgid "" "*handler* should be an instance of :class:`BaseHandler`. The following " "methods are searched, and added to the possible chains (note that HTTP " @@ -854,53 +855,53 @@ msgid "" "`http_error_404` would handle HTTP 404 errors." msgstr "" -#: ../../library/urllib.request.rst:622 +#: ../../library/urllib.request.rst:623 msgid "" ":meth:`_open` --- signal that the handler knows how to open " "*protocol* URLs." msgstr "" -#: ../../library/urllib.request.rst:625 +#: ../../library/urllib.request.rst:626 msgid "See |protocol_open|_ for more information." msgstr "更多資訊請見 |protocol_open|_\\ 。" -#: ../../library/urllib.request.rst:627 +#: ../../library/urllib.request.rst:628 msgid "" ":meth:`http_error_\\` --- signal that the handler knows how to " "handle HTTP errors with HTTP error code *type*." msgstr "" -#: ../../library/urllib.request.rst:630 +#: ../../library/urllib.request.rst:631 msgid "See |http_error_nnn|_ for more information." msgstr "更多資訊請見 |http_error_nnn|_\\ 。" -#: ../../library/urllib.request.rst:632 +#: ../../library/urllib.request.rst:633 msgid "" ":meth:`_error` --- signal that the handler knows how to handle " "errors from (non-\\ ``http``) *protocol*." msgstr "" -#: ../../library/urllib.request.rst:635 +#: ../../library/urllib.request.rst:636 msgid "" ":meth:`_request` --- signal that the handler knows how to pre-" "process *protocol* requests." msgstr "" -#: ../../library/urllib.request.rst:638 +#: ../../library/urllib.request.rst:639 msgid "See |protocol_request|_ for more information." msgstr "更多資訊請見 |protocol_request|_\\ 。" -#: ../../library/urllib.request.rst:640 +#: ../../library/urllib.request.rst:641 msgid "" ":meth:`_response` --- signal that the handler knows how to post-" "process *protocol* responses." msgstr "" -#: ../../library/urllib.request.rst:643 +#: ../../library/urllib.request.rst:644 msgid "See |protocol_response|_ for more information." msgstr "更多資訊請見 |protocol_response|_\\ 。" -#: ../../library/urllib.request.rst:652 +#: ../../library/urllib.request.rst:653 msgid "" "Open the given *url* (which can be a request object or a string), optionally " "passing the given *data*. Arguments, return values and exceptions raised are " @@ -912,7 +913,7 @@ msgid "" "HTTP, HTTPS and FTP connections." msgstr "" -#: ../../library/urllib.request.rst:664 +#: ../../library/urllib.request.rst:665 msgid "" "Handle an error of the given protocol. This will call the registered error " "handlers for the given protocol with the given arguments (which are protocol " @@ -921,28 +922,28 @@ msgid "" "\\` methods of the handler classes." msgstr "" -#: ../../library/urllib.request.rst:670 +#: ../../library/urllib.request.rst:671 msgid "" "Return values and exceptions raised are the same as those of :func:`urlopen`." msgstr "" -#: ../../library/urllib.request.rst:672 +#: ../../library/urllib.request.rst:673 msgid "OpenerDirector objects open URLs in three stages:" msgstr "" -#: ../../library/urllib.request.rst:674 +#: ../../library/urllib.request.rst:675 msgid "" "The order in which these methods are called within each stage is determined " "by sorting the handler instances." msgstr "" -#: ../../library/urllib.request.rst:677 +#: ../../library/urllib.request.rst:678 msgid "" "Every handler with a method named like :meth:`_request` has that " "method called to pre-process the request." msgstr "" -#: ../../library/urllib.request.rst:680 +#: ../../library/urllib.request.rst:681 msgid "" "Handlers with a method named like :meth:`_open` are called to " "handle the request. This stage ends when a handler either returns a non-\\ :" @@ -950,7 +951,7 @@ msgid "" "`~urllib.error.URLError`). Exceptions are allowed to propagate." msgstr "" -#: ../../library/urllib.request.rst:685 +#: ../../library/urllib.request.rst:686 msgid "" "In fact, the above algorithm is first tried for methods named :meth:" "`default_open`. If all such methods return :const:`None`, the algorithm is " @@ -959,105 +960,105 @@ msgid "" "meth:`unknown_open`." msgstr "" -#: ../../library/urllib.request.rst:691 +#: ../../library/urllib.request.rst:692 msgid "" "Note that the implementation of these methods may involve calls of the " "parent :class:`OpenerDirector` instance's :meth:`~OpenerDirector.open` and :" "meth:`~OpenerDirector.error` methods." msgstr "" -#: ../../library/urllib.request.rst:695 +#: ../../library/urllib.request.rst:696 msgid "" "Every handler with a method named like :meth:`_response` has that " "method called to post-process the response." msgstr "" -#: ../../library/urllib.request.rst:702 +#: ../../library/urllib.request.rst:703 msgid "BaseHandler Objects" msgstr "BaseHandler 物件" -#: ../../library/urllib.request.rst:704 +#: ../../library/urllib.request.rst:705 msgid "" ":class:`BaseHandler` objects provide a couple of methods that are directly " "useful, and others that are meant to be used by derived classes. These are " "intended for direct use:" msgstr "" -#: ../../library/urllib.request.rst:711 +#: ../../library/urllib.request.rst:712 msgid "Add a director as parent." msgstr "" -#: ../../library/urllib.request.rst:716 +#: ../../library/urllib.request.rst:717 msgid "Remove any parents." msgstr "" -#: ../../library/urllib.request.rst:718 +#: ../../library/urllib.request.rst:719 msgid "" "The following attribute and methods should only be used by classes derived " "from :class:`BaseHandler`." msgstr "" -#: ../../library/urllib.request.rst:723 +#: ../../library/urllib.request.rst:724 msgid "" "The convention has been adopted that subclasses defining :meth:" "`_request` or :meth:`_response` methods are named :class:" "`\\*Processor`; all others are named :class:`\\*Handler`." msgstr "" -#: ../../library/urllib.request.rst:730 +#: ../../library/urllib.request.rst:731 msgid "" "A valid :class:`OpenerDirector`, which can be used to open using a different " "protocol, or handle errors." msgstr "" -#: ../../library/urllib.request.rst:736 +#: ../../library/urllib.request.rst:737 msgid "" "This method is *not* defined in :class:`BaseHandler`, but subclasses should " "define it if they want to catch all URLs." msgstr "" -#: ../../library/urllib.request.rst:739 +#: ../../library/urllib.request.rst:740 msgid "" "This method, if implemented, will be called by the parent :class:" "`OpenerDirector`. It should return a file-like object as described in the " -"return value of the :meth:`open` of :class:`OpenerDirector`, or ``None``. It " -"should raise :exc:`~urllib.error.URLError`, unless a truly exceptional thing " -"happens (for example, :exc:`MemoryError` should not be mapped to :exc:" -"`URLError`)." +"return value of the :meth:`~OpenerDirector.open` method of :class:" +"`OpenerDirector`, or ``None``. It should raise :exc:`~urllib.error." +"URLError`, unless a truly exceptional thing happens (for example, :exc:" +"`MemoryError` should not be mapped to :exc:`URLError`)." msgstr "" -#: ../../library/urllib.request.rst:746 +#: ../../library/urllib.request.rst:747 msgid "This method will be called before any protocol-specific open method." msgstr "" -#: ../../library/urllib.request.rst:753 +#: ../../library/urllib.request.rst:754 msgid "" "This method is *not* defined in :class:`BaseHandler`, but subclasses should " "define it if they want to handle URLs with the given protocol." msgstr "" -#: ../../library/urllib.request.rst:756 +#: ../../library/urllib.request.rst:757 msgid "" "This method, if defined, will be called by the parent :class:" "`OpenerDirector`. Return values should be the same as for :meth:" "`default_open`." msgstr "" -#: ../../library/urllib.request.rst:762 +#: ../../library/urllib.request.rst:763 msgid "" "This method is *not* defined in :class:`BaseHandler`, but subclasses should " "define it if they want to catch all URLs with no specific registered handler " "to open it." msgstr "" -#: ../../library/urllib.request.rst:766 +#: ../../library/urllib.request.rst:767 msgid "" "This method, if implemented, will be called by the :attr:`parent` :class:" "`OpenerDirector`. Return values should be the same as for :meth:" "`default_open`." msgstr "" -#: ../../library/urllib.request.rst:773 +#: ../../library/urllib.request.rst:774 msgid "" "This method is *not* defined in :class:`BaseHandler`, but subclasses should " "override it if they intend to provide a catch-all for otherwise unhandled " @@ -1066,7 +1067,7 @@ msgid "" "other circumstances." msgstr "" -#: ../../library/urllib.request.rst:778 +#: ../../library/urllib.request.rst:779 msgid "" "*req* will be a :class:`Request` object, *fp* will be a file-like object " "with the HTTP error body, *code* will be the three-digit code of the error, " @@ -1074,49 +1075,49 @@ msgid "" "mapping object with the headers of the error." msgstr "" -#: ../../library/urllib.request.rst:783 +#: ../../library/urllib.request.rst:784 msgid "" "Return values and exceptions raised should be the same as those of :func:" "`urlopen`." msgstr "" -#: ../../library/urllib.request.rst:790 +#: ../../library/urllib.request.rst:791 msgid "" "*nnn* should be a three-digit HTTP error code. This method is also not " "defined in :class:`BaseHandler`, but will be called, if it exists, on an " "instance of a subclass, when an HTTP error with code *nnn* occurs." msgstr "" -#: ../../library/urllib.request.rst:794 +#: ../../library/urllib.request.rst:795 msgid "Subclasses should override this method to handle specific HTTP errors." msgstr "" -#: ../../library/urllib.request.rst:796 +#: ../../library/urllib.request.rst:797 msgid "" "Arguments, return values and exceptions raised should be the same as for :" "meth:`http_error_default`." msgstr "" -#: ../../library/urllib.request.rst:804 +#: ../../library/urllib.request.rst:805 msgid "" "This method is *not* defined in :class:`BaseHandler`, but subclasses should " "define it if they want to pre-process requests of the given protocol." msgstr "" -#: ../../library/urllib.request.rst:807 +#: ../../library/urllib.request.rst:808 msgid "" "This method, if defined, will be called by the parent :class:" "`OpenerDirector`. *req* will be a :class:`Request` object. The return value " "should be a :class:`Request` object." msgstr "" -#: ../../library/urllib.request.rst:816 +#: ../../library/urllib.request.rst:817 msgid "" "This method is *not* defined in :class:`BaseHandler`, but subclasses should " "define it if they want to post-process responses of the given protocol." msgstr "" -#: ../../library/urllib.request.rst:819 +#: ../../library/urllib.request.rst:820 msgid "" "This method, if defined, will be called by the parent :class:" "`OpenerDirector`. *req* will be a :class:`Request` object. *response* will " @@ -1125,25 +1126,25 @@ msgid "" "return value of :func:`urlopen`." msgstr "" -#: ../../library/urllib.request.rst:829 +#: ../../library/urllib.request.rst:830 msgid "HTTPRedirectHandler Objects" msgstr "HTTPRedirectHandler 物件" -#: ../../library/urllib.request.rst:833 +#: ../../library/urllib.request.rst:834 msgid "" "Some HTTP redirections require action from this module's client code. If " "this is the case, :exc:`~urllib.error.HTTPError` is raised. See :rfc:`2616` " "for details of the precise meanings of the various redirection codes." msgstr "" -#: ../../library/urllib.request.rst:837 +#: ../../library/urllib.request.rst:838 msgid "" "An :class:`HTTPError` exception raised as a security consideration if the " "HTTPRedirectHandler is presented with a redirected URL which is not an HTTP, " "HTTPS or FTP URL." msgstr "" -#: ../../library/urllib.request.rst:844 +#: ../../library/urllib.request.rst:845 msgid "" "Return a :class:`Request` or ``None`` in response to a redirect. This is " "called by the default implementations of the :meth:`http_error_30\\*` " @@ -1154,7 +1155,7 @@ msgid "" "URL, or return ``None`` if you can't but another handler might." msgstr "" -#: ../../library/urllib.request.rst:854 +#: ../../library/urllib.request.rst:855 msgid "" "The default implementation of this method does not strictly follow :rfc:" "`2616`, which says that 301 and 302 responses to ``POST`` requests must not " @@ -1163,46 +1164,46 @@ msgid "" "POST to a ``GET``, and the default implementation reproduces this behavior." msgstr "" -#: ../../library/urllib.request.rst:863 +#: ../../library/urllib.request.rst:864 msgid "" "Redirect to the ``Location:`` or ``URI:`` URL. This method is called by the " "parent :class:`OpenerDirector` when getting an HTTP 'moved permanently' " "response." msgstr "" -#: ../../library/urllib.request.rst:869 +#: ../../library/urllib.request.rst:870 msgid "" "The same as :meth:`http_error_301`, but called for the 'found' response." msgstr "" -#: ../../library/urllib.request.rst:874 +#: ../../library/urllib.request.rst:875 msgid "" "The same as :meth:`http_error_301`, but called for the 'see other' response." msgstr "" -#: ../../library/urllib.request.rst:879 +#: ../../library/urllib.request.rst:880 msgid "" "The same as :meth:`http_error_301`, but called for the 'temporary redirect' " "response." msgstr "" -#: ../../library/urllib.request.rst:886 +#: ../../library/urllib.request.rst:887 msgid "HTTPCookieProcessor Objects" msgstr "HTTPCookieProcessor 物件" -#: ../../library/urllib.request.rst:888 +#: ../../library/urllib.request.rst:889 msgid ":class:`HTTPCookieProcessor` instances have one attribute:" msgstr "" -#: ../../library/urllib.request.rst:892 +#: ../../library/urllib.request.rst:893 msgid "The :class:`http.cookiejar.CookieJar` in which cookies are stored." msgstr "" -#: ../../library/urllib.request.rst:898 +#: ../../library/urllib.request.rst:899 msgid "ProxyHandler Objects" msgstr "ProxyHandler 物件" -#: ../../library/urllib.request.rst:904 +#: ../../library/urllib.request.rst:905 msgid "" "The :class:`ProxyHandler` will have a method :meth:`_open` for " "every *protocol* which has a proxy in the *proxies* dictionary given in the " @@ -1211,17 +1212,17 @@ msgid "" "actually execute the protocol." msgstr "" -#: ../../library/urllib.request.rst:914 +#: ../../library/urllib.request.rst:915 msgid "HTTPPasswordMgr Objects" msgstr "HTTPPasswordMgr 物件" -#: ../../library/urllib.request.rst:916 +#: ../../library/urllib.request.rst:917 msgid "" "These methods are available on :class:`HTTPPasswordMgr` and :class:" "`HTTPPasswordMgrWithDefaultRealm` objects." msgstr "" -#: ../../library/urllib.request.rst:922 +#: ../../library/urllib.request.rst:923 msgid "" "*uri* can be either a single URI, or a sequence of URIs. *realm*, *user* and " "*passwd* must be strings. This causes ``(user, passwd)`` to be used as " @@ -1229,30 +1230,30 @@ msgid "" "of the given URIs is given." msgstr "" -#: ../../library/urllib.request.rst:930 +#: ../../library/urllib.request.rst:931 msgid "" "Get user/password for given realm and URI, if any. This method will return " "``(None, None)`` if there is no matching user/password." msgstr "" -#: ../../library/urllib.request.rst:933 +#: ../../library/urllib.request.rst:934 msgid "" "For :class:`HTTPPasswordMgrWithDefaultRealm` objects, the realm ``None`` " "will be searched if the given *realm* has no matching user/password." msgstr "" -#: ../../library/urllib.request.rst:940 +#: ../../library/urllib.request.rst:941 msgid "HTTPPasswordMgrWithPriorAuth Objects" msgstr "HTTPPasswordMgrWithPriorAuth 物件" -#: ../../library/urllib.request.rst:942 +#: ../../library/urllib.request.rst:943 msgid "" "This password manager extends :class:`HTTPPasswordMgrWithDefaultRealm` to " "support tracking URIs for which authentication credentials should always be " "sent." msgstr "" -#: ../../library/urllib.request.rst:949 +#: ../../library/urllib.request.rst:950 msgid "" "*realm*, *uri*, *user*, *passwd* are as for :meth:`HTTPPasswordMgr." "add_password`. *is_authenticated* sets the initial value of the " @@ -1260,25 +1261,25 @@ msgid "" "*is_authenticated* is specified as ``True``, *realm* is ignored." msgstr "" -#: ../../library/urllib.request.rst:957 +#: ../../library/urllib.request.rst:958 msgid "Same as for :class:`HTTPPasswordMgrWithDefaultRealm` objects" msgstr "" -#: ../../library/urllib.request.rst:963 +#: ../../library/urllib.request.rst:964 msgid "" "Update the ``is_authenticated`` flag for the given *uri* or list of URIs." msgstr "" -#: ../../library/urllib.request.rst:969 +#: ../../library/urllib.request.rst:970 msgid "" "Returns the current state of the ``is_authenticated`` flag for the given URI." msgstr "" -#: ../../library/urllib.request.rst:976 +#: ../../library/urllib.request.rst:977 msgid "AbstractBasicAuthHandler Objects" msgstr "AbstractBasicAuthHandler 物件" -#: ../../library/urllib.request.rst:981 +#: ../../library/urllib.request.rst:982 msgid "" "Handle an authentication request by getting a user/password pair, and re-" "trying the request. *authreq* should be the name of the header where the " @@ -1287,7 +1288,7 @@ msgid "" "`Request` object, and *headers* should be the error headers." msgstr "" -#: ../../library/urllib.request.rst:987 +#: ../../library/urllib.request.rst:988 msgid "" "*host* is either an authority (e.g. ``\"python.org\"``) or a URL containing " "an authority component (e.g. ``\"http://python.org/\"``). In either case, " @@ -1295,24 +1296,24 @@ msgid "" "and ``\"python.org:80\"`` are fine, ``\"joe:password@python.org\"`` is not)." msgstr "" -#: ../../library/urllib.request.rst:996 +#: ../../library/urllib.request.rst:997 msgid "HTTPBasicAuthHandler Objects" msgstr "HTTPBasicAuthHandler 物件" -#: ../../library/urllib.request.rst:1001 ../../library/urllib.request.rst:1012 -#: ../../library/urllib.request.rst:1037 ../../library/urllib.request.rst:1048 +#: ../../library/urllib.request.rst:1002 ../../library/urllib.request.rst:1013 +#: ../../library/urllib.request.rst:1038 ../../library/urllib.request.rst:1049 msgid "Retry the request with authentication information, if available." msgstr "" -#: ../../library/urllib.request.rst:1007 +#: ../../library/urllib.request.rst:1008 msgid "ProxyBasicAuthHandler Objects" msgstr "ProxyBasicAuthHandler 物件" -#: ../../library/urllib.request.rst:1018 +#: ../../library/urllib.request.rst:1019 msgid "AbstractDigestAuthHandler Objects" msgstr "AbstractDigestAuthHandler 物件" -#: ../../library/urllib.request.rst:1023 +#: ../../library/urllib.request.rst:1024 msgid "" "*authreq* should be the name of the header where the information about the " "realm is included in the request, *host* should be the host to authenticate " @@ -1320,55 +1321,55 @@ msgid "" "should be the error headers." msgstr "" -#: ../../library/urllib.request.rst:1032 +#: ../../library/urllib.request.rst:1033 msgid "HTTPDigestAuthHandler Objects" msgstr "HTTPDigestAuthHandler 物件" -#: ../../library/urllib.request.rst:1043 +#: ../../library/urllib.request.rst:1044 msgid "ProxyDigestAuthHandler Objects" msgstr "ProxyDigestAuthHandler 物件" -#: ../../library/urllib.request.rst:1054 +#: ../../library/urllib.request.rst:1055 msgid "HTTPHandler Objects" msgstr "HTTPHandler 物件" -#: ../../library/urllib.request.rst:1059 +#: ../../library/urllib.request.rst:1060 msgid "" "Send an HTTP request, which can be either GET or POST, depending on ``req." "has_data()``." msgstr "" -#: ../../library/urllib.request.rst:1066 +#: ../../library/urllib.request.rst:1067 msgid "HTTPSHandler Objects" msgstr "HTTPSHandler 物件" -#: ../../library/urllib.request.rst:1071 +#: ../../library/urllib.request.rst:1072 msgid "" "Send an HTTPS request, which can be either GET or POST, depending on ``req." "has_data()``." msgstr "" -#: ../../library/urllib.request.rst:1078 +#: ../../library/urllib.request.rst:1079 msgid "FileHandler Objects" msgstr "FileHandler 物件" -#: ../../library/urllib.request.rst:1083 +#: ../../library/urllib.request.rst:1084 msgid "" "Open the file locally, if there is no host name, or the host name is " "``'localhost'``." msgstr "" -#: ../../library/urllib.request.rst:1086 +#: ../../library/urllib.request.rst:1087 msgid "" "This method is applicable only for local hostnames. When a remote hostname " "is given, an :exc:`~urllib.error.URLError` is raised." msgstr "" -#: ../../library/urllib.request.rst:1094 +#: ../../library/urllib.request.rst:1095 msgid "DataHandler Objects" msgstr "DataHandler 物件" -#: ../../library/urllib.request.rst:1098 +#: ../../library/urllib.request.rst:1099 msgid "" "Read a data URL. This kind of URL contains the content encoded in the URL " "itself. The data URL syntax is specified in :rfc:`2397`. This implementation " @@ -1378,51 +1379,51 @@ msgid "" "implementation will raise an :exc:`ValueError` in that case." msgstr "" -#: ../../library/urllib.request.rst:1109 +#: ../../library/urllib.request.rst:1110 msgid "FTPHandler Objects" msgstr "FTPHandler 物件" -#: ../../library/urllib.request.rst:1114 +#: ../../library/urllib.request.rst:1115 msgid "" "Open the FTP file indicated by *req*. The login is always done with empty " "username and password." msgstr "" -#: ../../library/urllib.request.rst:1121 +#: ../../library/urllib.request.rst:1122 msgid "CacheFTPHandler Objects" msgstr "CacheFTPHandler 物件" -#: ../../library/urllib.request.rst:1123 +#: ../../library/urllib.request.rst:1124 msgid "" ":class:`CacheFTPHandler` objects are :class:`FTPHandler` objects with the " "following additional methods:" msgstr "" -#: ../../library/urllib.request.rst:1129 +#: ../../library/urllib.request.rst:1130 msgid "Set timeout of connections to *t* seconds." msgstr "" -#: ../../library/urllib.request.rst:1134 +#: ../../library/urllib.request.rst:1135 msgid "Set maximum number of cached connections to *m*." msgstr "" -#: ../../library/urllib.request.rst:1140 +#: ../../library/urllib.request.rst:1141 msgid "UnknownHandler Objects" msgstr "UnknownHandler 物件" -#: ../../library/urllib.request.rst:1145 +#: ../../library/urllib.request.rst:1146 msgid "Raise a :exc:`~urllib.error.URLError` exception." msgstr "" -#: ../../library/urllib.request.rst:1151 +#: ../../library/urllib.request.rst:1152 msgid "HTTPErrorProcessor Objects" msgstr "HTTPErrorProcessor 物件" -#: ../../library/urllib.request.rst:1157 +#: ../../library/urllib.request.rst:1158 msgid "For 200 error codes, the response object is returned immediately." msgstr "" -#: ../../library/urllib.request.rst:1159 +#: ../../library/urllib.request.rst:1160 msgid "" "For non-200 error codes, this simply passes the job on to the :meth:" "`http_error_\\` handler methods, via :meth:`OpenerDirector.error`. " @@ -1430,31 +1431,31 @@ msgid "" "error.HTTPError` if no other handler handles the error." msgstr "" -#: ../../library/urllib.request.rst:1167 +#: ../../library/urllib.request.rst:1168 msgid "Process HTTPS error responses." msgstr "" -#: ../../library/urllib.request.rst:1169 +#: ../../library/urllib.request.rst:1170 msgid "The behavior is same as :meth:`http_response`." msgstr "" -#: ../../library/urllib.request.rst:1175 +#: ../../library/urllib.request.rst:1176 msgid "Examples" msgstr "" -#: ../../library/urllib.request.rst:1177 +#: ../../library/urllib.request.rst:1178 msgid "" "In addition to the examples below, more examples are given in :ref:`urllib-" "howto`." msgstr "" -#: ../../library/urllib.request.rst:1180 +#: ../../library/urllib.request.rst:1181 msgid "" "This example gets the python.org main page and displays the first 300 bytes " "of it. ::" msgstr "" -#: ../../library/urllib.request.rst:1193 +#: ../../library/urllib.request.rst:1194 msgid "" "Note that urlopen returns a bytes object. This is because there is no way " "for urlopen to automatically determine the encoding of the byte stream it " @@ -1463,45 +1464,45 @@ msgid "" "appropriate encoding." msgstr "" -#: ../../library/urllib.request.rst:1199 +#: ../../library/urllib.request.rst:1200 msgid "" "The following W3C document, https://www.w3.org/International/O-charset\\ , " "lists the various ways in which an (X)HTML or an XML document could have " "specified its encoding information." msgstr "" -#: ../../library/urllib.request.rst:1203 +#: ../../library/urllib.request.rst:1204 msgid "" "As the python.org website uses *utf-8* encoding as specified in its meta " "tag, we will use the same for decoding the bytes object. ::" msgstr "" -#: ../../library/urllib.request.rst:1212 +#: ../../library/urllib.request.rst:1213 msgid "" "It is also possible to achieve the same result without using the :term:" "`context manager` approach. ::" msgstr "" -#: ../../library/urllib.request.rst:1221 +#: ../../library/urllib.request.rst:1222 msgid "" "In the following example, we are sending a data-stream to the stdin of a CGI " "and reading the data it returns to us. Note that this example will only work " "when the Python installation supports SSL. ::" msgstr "" -#: ../../library/urllib.request.rst:1233 +#: ../../library/urllib.request.rst:1234 msgid "The code for the sample CGI used in the above example is::" msgstr "" -#: ../../library/urllib.request.rst:1240 +#: ../../library/urllib.request.rst:1241 msgid "Here is an example of doing a ``PUT`` request using :class:`Request`::" msgstr "" -#: ../../library/urllib.request.rst:1250 +#: ../../library/urllib.request.rst:1251 msgid "Use of Basic HTTP Authentication::" msgstr "" -#: ../../library/urllib.request.rst:1264 +#: ../../library/urllib.request.rst:1265 msgid "" ":func:`build_opener` provides many handlers by default, including a :class:" "`ProxyHandler`. By default, :class:`ProxyHandler` uses the environment " @@ -1510,71 +1511,71 @@ msgid "" "read to obtain the HTTP proxy's URL." msgstr "" -#: ../../library/urllib.request.rst:1270 +#: ../../library/urllib.request.rst:1271 msgid "" "This example replaces the default :class:`ProxyHandler` with one that uses " "programmatically-supplied proxy URLs, and adds proxy authorization support " "with :class:`ProxyBasicAuthHandler`. ::" msgstr "" -#: ../../library/urllib.request.rst:1282 +#: ../../library/urllib.request.rst:1283 msgid "Adding HTTP headers:" msgstr "" -#: ../../library/urllib.request.rst:1284 +#: ../../library/urllib.request.rst:1285 msgid "Use the *headers* argument to the :class:`Request` constructor, or::" msgstr "" -#: ../../library/urllib.request.rst:1293 +#: ../../library/urllib.request.rst:1294 msgid "" ":class:`OpenerDirector` automatically adds a :mailheader:`User-Agent` header " "to every :class:`Request`. To change this::" msgstr "" -#: ../../library/urllib.request.rst:1301 +#: ../../library/urllib.request.rst:1302 msgid "" "Also, remember that a few standard headers (:mailheader:`Content-Length`, :" "mailheader:`Content-Type` and :mailheader:`Host`) are added when the :class:" "`Request` is passed to :func:`urlopen` (or :meth:`OpenerDirector.open`)." msgstr "" -#: ../../library/urllib.request.rst:1308 +#: ../../library/urllib.request.rst:1309 msgid "" "Here is an example session that uses the ``GET`` method to retrieve a URL " "containing parameters::" msgstr "" -#: ../../library/urllib.request.rst:1319 +#: ../../library/urllib.request.rst:1320 msgid "" "The following example uses the ``POST`` method instead. Note that params " "output from urlencode is encoded to bytes before it is sent to urlopen as " "data::" msgstr "" -#: ../../library/urllib.request.rst:1330 +#: ../../library/urllib.request.rst:1331 msgid "" "The following example uses an explicitly specified HTTP proxy, overriding " "environment settings::" msgstr "" -#: ../../library/urllib.request.rst:1340 +#: ../../library/urllib.request.rst:1341 msgid "" "The following example uses no proxies at all, overriding environment " "settings::" msgstr "" -#: ../../library/urllib.request.rst:1350 +#: ../../library/urllib.request.rst:1351 msgid "Legacy interface" msgstr "" -#: ../../library/urllib.request.rst:1352 +#: ../../library/urllib.request.rst:1353 msgid "" "The following functions and classes are ported from the Python 2 module " "``urllib`` (as opposed to ``urllib2``). They might become deprecated at " "some point in the future." msgstr "" -#: ../../library/urllib.request.rst:1358 +#: ../../library/urllib.request.rst:1359 msgid "" "Copy a network object denoted by a URL to a local file. If the URL points to " "a local file, the object will not be copied unless filename is supplied. " @@ -1584,7 +1585,7 @@ msgid "" "remote object). Exceptions are the same as for :func:`urlopen`." msgstr "" -#: ../../library/urllib.request.rst:1365 +#: ../../library/urllib.request.rst:1366 msgid "" "The second argument, if present, specifies the file location to copy to (if " "absent, the location will be a tempfile with a generated name). The third " @@ -1596,11 +1597,11 @@ msgid "" "file size in response to a retrieval request." msgstr "" -#: ../../library/urllib.request.rst:1374 +#: ../../library/urllib.request.rst:1375 msgid "The following example illustrates the most common usage scenario::" msgstr "" -#: ../../library/urllib.request.rst:1381 +#: ../../library/urllib.request.rst:1382 msgid "" "If the *url* uses the :file:`http:` scheme identifier, the optional *data* " "argument may be given to specify a ``POST`` request (normally the request " @@ -1609,7 +1610,7 @@ msgid "" "parse.urlencode` function." msgstr "" -#: ../../library/urllib.request.rst:1387 +#: ../../library/urllib.request.rst:1388 msgid "" ":func:`urlretrieve` will raise :exc:`ContentTooShortError` when it detects " "that the amount of data available was less than the expected amount (which " @@ -1617,40 +1618,40 @@ msgid "" "example, when the download is interrupted." msgstr "" -#: ../../library/urllib.request.rst:1392 +#: ../../library/urllib.request.rst:1393 msgid "" "The *Content-Length* is treated as a lower bound: if there's more data to " "read, urlretrieve reads more data, but if less data is available, it raises " "the exception." msgstr "" -#: ../../library/urllib.request.rst:1396 +#: ../../library/urllib.request.rst:1397 msgid "" "You can still retrieve the downloaded data in this case, it is stored in " "the :attr:`content` attribute of the exception instance." msgstr "" -#: ../../library/urllib.request.rst:1399 +#: ../../library/urllib.request.rst:1400 msgid "" "If no *Content-Length* header was supplied, urlretrieve can not check the " "size of the data it has downloaded, and just returns it. In this case you " "just have to assume that the download was successful." msgstr "" -#: ../../library/urllib.request.rst:1405 +#: ../../library/urllib.request.rst:1406 msgid "" "Cleans up temporary files that may have been left behind by previous calls " "to :func:`urlretrieve`." msgstr "" -#: ../../library/urllib.request.rst:1412 +#: ../../library/urllib.request.rst:1413 msgid "" "Base class for opening and reading URLs. Unless you need to support opening " "objects using schemes other than :file:`http:`, :file:`ftp:`, or :file:`file:" "`, you probably want to use :class:`FancyURLopener`." msgstr "" -#: ../../library/urllib.request.rst:1416 +#: ../../library/urllib.request.rst:1417 msgid "" "By default, the :class:`URLopener` class sends a :mailheader:`User-Agent` " "header of ``urllib/VVV``, where *VVV* is the :mod:`urllib` version number. " @@ -1660,7 +1661,7 @@ msgid "" "subclass definition." msgstr "" -#: ../../library/urllib.request.rst:1422 +#: ../../library/urllib.request.rst:1423 msgid "" "The optional *proxies* parameter should be a dictionary mapping scheme names " "to proxy URLs, where an empty dictionary turns proxies off completely. Its " @@ -1668,7 +1669,7 @@ msgid "" "be used if present, as discussed in the definition of :func:`urlopen`, above." msgstr "" -#: ../../library/urllib.request.rst:1427 +#: ../../library/urllib.request.rst:1428 msgid "" "Additional keyword parameters, collected in *x509*, may be used for " "authentication of the client when using the :file:`https:` scheme. The " @@ -1676,13 +1677,13 @@ msgid "" "certificate; both are needed to support client authentication." msgstr "" -#: ../../library/urllib.request.rst:1432 +#: ../../library/urllib.request.rst:1433 msgid "" ":class:`URLopener` objects will raise an :exc:`OSError` exception if the " "server returns an error code." msgstr "" -#: ../../library/urllib.request.rst:1437 +#: ../../library/urllib.request.rst:1438 msgid "" "Open *fullurl* using the appropriate protocol. This method sets up cache " "and proxy information, then calls the appropriate open method with its input " @@ -1691,15 +1692,15 @@ msgid "" "`urlopen`." msgstr "" -#: ../../library/urllib.request.rst:1443 +#: ../../library/urllib.request.rst:1444 msgid "This method always quotes *fullurl* using :func:`~urllib.parse.quote`." msgstr "" -#: ../../library/urllib.request.rst:1447 +#: ../../library/urllib.request.rst:1448 msgid "Overridable interface to open unknown URL types." msgstr "" -#: ../../library/urllib.request.rst:1452 +#: ../../library/urllib.request.rst:1453 msgid "" "Retrieves the contents of *url* and places it in *filename*. The return " "value is a tuple consisting of a local filename and either an :class:`email." @@ -1716,7 +1717,7 @@ msgid "" "*reporthook* is ignored for local URLs." msgstr "" -#: ../../library/urllib.request.rst:1465 +#: ../../library/urllib.request.rst:1466 msgid "" "If the *url* uses the :file:`http:` scheme identifier, the optional *data* " "argument may be given to specify a ``POST`` request (normally the request " @@ -1725,7 +1726,7 @@ msgid "" "urlencode` function." msgstr "" -#: ../../library/urllib.request.rst:1474 +#: ../../library/urllib.request.rst:1475 msgid "" "Variable that specifies the user agent of the opener object. To get :mod:" "`urllib` to tell servers that it is a particular user agent, set this in a " @@ -1733,7 +1734,7 @@ msgid "" "constructor." msgstr "" -#: ../../library/urllib.request.rst:1484 +#: ../../library/urllib.request.rst:1485 msgid "" ":class:`FancyURLopener` subclasses :class:`URLopener` providing default " "handling for the following HTTP response codes: 301, 302, 303, 307 and 401. " @@ -1744,14 +1745,14 @@ msgid "" "defaults to 10." msgstr "" -#: ../../library/urllib.request.rst:1491 +#: ../../library/urllib.request.rst:1492 msgid "" "For all other response codes, the method :meth:`http_error_default` is " "called which you can override in subclasses to handle the error " "appropriately." msgstr "" -#: ../../library/urllib.request.rst:1496 +#: ../../library/urllib.request.rst:1497 msgid "" "According to the letter of :rfc:`2616`, 301 and 302 responses to POST " "requests must not be automatically redirected without confirmation by the " @@ -1760,13 +1761,13 @@ msgid "" "behaviour." msgstr "" -#: ../../library/urllib.request.rst:1501 +#: ../../library/urllib.request.rst:1502 msgid "" "The parameters to the constructor are the same as those for :class:" "`URLopener`." msgstr "" -#: ../../library/urllib.request.rst:1505 +#: ../../library/urllib.request.rst:1506 msgid "" "When performing basic authentication, a :class:`FancyURLopener` instance " "calls its :meth:`prompt_user_passwd` method. The default implementation " @@ -1775,59 +1776,59 @@ msgid "" "needed." msgstr "" -#: ../../library/urllib.request.rst:1510 +#: ../../library/urllib.request.rst:1511 msgid "" "The :class:`FancyURLopener` class offers one additional method that should " "be overloaded to provide the appropriate behavior:" msgstr "" -#: ../../library/urllib.request.rst:1515 +#: ../../library/urllib.request.rst:1516 msgid "" "Return information needed to authenticate the user at the given host in the " "specified security realm. The return value should be a tuple, ``(user, " "password)``, which can be used for basic authentication." msgstr "" -#: ../../library/urllib.request.rst:1519 +#: ../../library/urllib.request.rst:1520 msgid "" "The implementation prompts for this information on the terminal; an " "application should override this method to use an appropriate interaction " "model in the local environment." msgstr "" -#: ../../library/urllib.request.rst:1525 +#: ../../library/urllib.request.rst:1526 msgid ":mod:`urllib.request` Restrictions" msgstr "" -#: ../../library/urllib.request.rst:1531 +#: ../../library/urllib.request.rst:1532 msgid "" "Currently, only the following protocols are supported: HTTP (versions 0.9 " "and 1.0), FTP, local files, and data URLs." msgstr "" -#: ../../library/urllib.request.rst:1534 +#: ../../library/urllib.request.rst:1535 msgid "Added support for data URLs." msgstr "" -#: ../../library/urllib.request.rst:1536 +#: ../../library/urllib.request.rst:1537 msgid "" "The caching feature of :func:`urlretrieve` has been disabled until someone " "finds the time to hack proper processing of Expiration time headers." msgstr "" -#: ../../library/urllib.request.rst:1539 +#: ../../library/urllib.request.rst:1540 msgid "" "There should be a function to query whether a particular URL is in the cache." msgstr "" -#: ../../library/urllib.request.rst:1541 +#: ../../library/urllib.request.rst:1542 msgid "" "For backward compatibility, if a URL appears to point to a local file but " "the file can't be opened, the URL is re-interpreted using the FTP protocol. " "This can sometimes cause confusing error messages." msgstr "" -#: ../../library/urllib.request.rst:1545 +#: ../../library/urllib.request.rst:1546 msgid "" "The :func:`urlopen` and :func:`urlretrieve` functions can cause arbitrarily " "long delays while waiting for a network connection to be set up. This means " @@ -1835,7 +1836,7 @@ msgid "" "functions without using threads." msgstr "" -#: ../../library/urllib.request.rst:1554 +#: ../../library/urllib.request.rst:1555 msgid "" "The data returned by :func:`urlopen` or :func:`urlretrieve` is the raw data " "returned by the server. This may be binary data (such as an image), plain " @@ -1845,7 +1846,7 @@ msgid "" "module :mod:`html.parser` to parse it." msgstr "" -#: ../../library/urllib.request.rst:1563 +#: ../../library/urllib.request.rst:1564 msgid "" "The code handling the FTP protocol cannot differentiate between a file and a " "directory. This can lead to unexpected behavior when attempting to read a " @@ -1863,11 +1864,11 @@ msgid "" "meet your needs." msgstr "" -#: ../../library/urllib.request.rst:1580 +#: ../../library/urllib.request.rst:1581 msgid ":mod:`urllib.response` --- Response classes used by urllib" msgstr "" -#: ../../library/urllib.request.rst:1585 +#: ../../library/urllib.request.rst:1586 msgid "" "The :mod:`urllib.response` module defines functions and classes which define " "a minimal file-like interface, including ``read()`` and ``readline()``. " @@ -1876,30 +1877,30 @@ msgid "" "addinfourl` instance:" msgstr "" -#: ../../library/urllib.request.rst:1594 +#: ../../library/urllib.request.rst:1595 msgid "" "URL of the resource retrieved, commonly used to determine if a redirect was " "followed." msgstr "" -#: ../../library/urllib.request.rst:1598 +#: ../../library/urllib.request.rst:1599 msgid "" "Returns the headers of the response in the form of an :class:`~email.message." "EmailMessage` instance." msgstr "" -#: ../../library/urllib.request.rst:1604 +#: ../../library/urllib.request.rst:1605 msgid "Status code returned by server." msgstr "" -#: ../../library/urllib.request.rst:1608 +#: ../../library/urllib.request.rst:1609 msgid "Deprecated in favor of :attr:`~addinfourl.url`." msgstr "" -#: ../../library/urllib.request.rst:1613 +#: ../../library/urllib.request.rst:1614 msgid "Deprecated in favor of :attr:`~addinfourl.headers`." msgstr "" -#: ../../library/urllib.request.rst:1618 ../../library/urllib.request.rst:1623 +#: ../../library/urllib.request.rst:1619 ../../library/urllib.request.rst:1624 msgid "Deprecated in favor of :attr:`~addinfourl.status`." msgstr "" diff --git a/library/uu.po b/library/uu.po index 1a916186b7..859a2f8193 100644 --- a/library/uu.po +++ b/library/uu.po @@ -7,8 +7,8 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.10\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2022-03-23 00:14+0000\n" -"PO-Revision-Date: 2016-01-31 07:32+0000\n" +"POT-Creation-Date: 2022-05-21 17:35+0000\n" +"PO-Revision-Date: 2022-05-22 02:22+0800\n" "Last-Translator: Liang-Bo Wang \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" "tw)\n" @@ -17,6 +17,7 @@ msgstr "" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" "Plural-Forms: nplurals=1; plural=0;\n" +"X-Generator: Poedit 3.0.1\n" #: ../../library/uu.rst:2 msgid ":mod:`uu` --- Encode and decode uuencode files" @@ -27,10 +28,14 @@ msgid "**Source code:** :source:`Lib/uu.py`" msgstr "**原始碼:**\\ :source:`Lib/uu.py`" #: ../../library/uu.rst:12 -msgid "The :mod:`uu` module is deprecated (see :pep:`594` for details)." -msgstr ":mod:`uu` 模組 (module) 即將被棄用(詳見 :pep:`594`\\ )。" +msgid "" +"The :mod:`uu` module is deprecated (see :pep:`PEP 594 <594#uu-and-the-uu-" +"encoding>` for details). :mod:`base64` is a modern alternative." +msgstr "" +":mod:`uu` 模組 (module) 即將被棄用(詳見 :pep:`PEP 594 <594#uu-and-the-uu-" +"encoding>`\\ )。\\ :mod:`base64` 是個現時常用的替代方案。" -#: ../../library/uu.rst:17 +#: ../../library/uu.rst:19 msgid "" "This module encodes and decodes files in uuencode format, allowing arbitrary " "binary data to be transferred over ASCII-only connections. Wherever a file " @@ -42,16 +47,16 @@ msgid "" "and be sure that, when required, the mode is ``'rb'`` or ``'wb'`` on Windows." msgstr "" -#: ../../library/uu.rst:30 +#: ../../library/uu.rst:32 msgid "" "This code was contributed by Lance Ellinghouse, and modified by Jack Jansen." msgstr "" -#: ../../library/uu.rst:32 +#: ../../library/uu.rst:34 msgid "The :mod:`uu` module defines the following functions:" msgstr "" -#: ../../library/uu.rst:37 +#: ../../library/uu.rst:39 msgid "" "Uuencode file *in_file* into file *out_file*. The uuencoded file will have " "the header specifying *name* and *mode* as the defaults for the results of " @@ -60,11 +65,11 @@ msgid "" "``'`'`` instead of spaces." msgstr "" -#: ../../library/uu.rst:43 +#: ../../library/uu.rst:45 msgid "Added the *backtick* parameter." msgstr "新增 *backtick* 參數。" -#: ../../library/uu.rst:49 +#: ../../library/uu.rst:51 msgid "" "This call decodes uuencoded file *in_file* placing the result on file " "*out_file*. If *out_file* is a pathname, *mode* is used to set the " @@ -73,25 +78,25 @@ msgid "" "in the header already exists, a :exc:`uu.Error` is raised." msgstr "" -#: ../../library/uu.rst:55 +#: ../../library/uu.rst:57 msgid "" ":func:`decode` may print a warning to standard error if the input was " "produced by an incorrect uuencoder and Python could recover from that " "error. Setting *quiet* to a true value silences this warning." msgstr "" -#: ../../library/uu.rst:62 +#: ../../library/uu.rst:64 msgid "" "Subclass of :exc:`Exception`, this can be raised by :func:`uu.decode` under " "various situations, such as described above, but also including a badly " "formatted header, or truncated input file." msgstr "" -#: ../../library/uu.rst:69 +#: ../../library/uu.rst:71 msgid "Module :mod:`binascii`" msgstr ":mod:`binascii` 模組" -#: ../../library/uu.rst:70 +#: ../../library/uu.rst:72 msgid "" "Support module containing ASCII-to-binary and binary-to-ASCII conversions." msgstr "" diff --git a/library/xdrlib.po b/library/xdrlib.po index ee320413dd..16b2335daf 100644 --- a/library/xdrlib.po +++ b/library/xdrlib.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.10\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2022-03-23 00:14+0000\n" +"POT-Creation-Date: 2022-05-21 17:35+0000\n" "PO-Revision-Date: 2016-01-31 07:33+0000\n" "Last-Translator: Liang-Bo Wang \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -27,70 +27,73 @@ msgid "**Source code:** :source:`Lib/xdrlib.py`" msgstr "**原始碼:**\\ :source:`Lib/xdrlib.py`" #: ../../library/xdrlib.rst:14 -msgid "The :mod:`xdrlib` module is deprecated (see :pep:`594` for details)." -msgstr ":mod:`xdrlib` 模組 (module) 即將被棄用(詳見 :pep:`594`\\ )。" +msgid "" +"The :mod:`xdrlib` module is deprecated (see :pep:`PEP 594 <594#xdrlib>` for " +"details)." +msgstr "" +":mod:`xdrlib` 模組 (module) 即將被棄用(詳見 :pep:`PEP 594 <594#xdrlib>`\\ )。" -#: ../../library/xdrlib.rst:19 +#: ../../library/xdrlib.rst:20 msgid "" "The :mod:`xdrlib` module supports the External Data Representation Standard " "as described in :rfc:`1014`, written by Sun Microsystems, Inc. June 1987. " "It supports most of the data types described in the RFC." msgstr "" -#: ../../library/xdrlib.rst:23 +#: ../../library/xdrlib.rst:24 msgid "" "The :mod:`xdrlib` module defines two classes, one for packing variables into " "XDR representation, and another for unpacking from XDR representation. " "There are also two exception classes." msgstr "" -#: ../../library/xdrlib.rst:30 +#: ../../library/xdrlib.rst:31 msgid "" ":class:`Packer` is the class for packing data into XDR representation. The :" "class:`Packer` class is instantiated with no arguments." msgstr "" -#: ../../library/xdrlib.rst:36 +#: ../../library/xdrlib.rst:37 msgid "" "``Unpacker`` is the complementary class which unpacks XDR data values from a " "string buffer. The input buffer is given as *data*." msgstr "" -#: ../../library/xdrlib.rst:44 +#: ../../library/xdrlib.rst:45 msgid ":rfc:`1014` - XDR: External Data Representation Standard" msgstr "" -#: ../../library/xdrlib.rst:43 +#: ../../library/xdrlib.rst:44 msgid "" "This RFC defined the encoding of data which was XDR at the time this module " "was originally written. It has apparently been obsoleted by :rfc:`1832`." msgstr "" -#: ../../library/xdrlib.rst:46 +#: ../../library/xdrlib.rst:47 msgid ":rfc:`1832` - XDR: External Data Representation Standard" msgstr "" -#: ../../library/xdrlib.rst:47 +#: ../../library/xdrlib.rst:48 msgid "Newer RFC that provides a revised definition of XDR." msgstr "" -#: ../../library/xdrlib.rst:53 +#: ../../library/xdrlib.rst:54 msgid "Packer Objects" msgstr "" -#: ../../library/xdrlib.rst:55 +#: ../../library/xdrlib.rst:56 msgid ":class:`Packer` instances have the following methods:" msgstr "" -#: ../../library/xdrlib.rst:60 +#: ../../library/xdrlib.rst:61 msgid "Returns the current pack buffer as a string." msgstr "" -#: ../../library/xdrlib.rst:65 +#: ../../library/xdrlib.rst:66 msgid "Resets the pack buffer to the empty string." msgstr "" -#: ../../library/xdrlib.rst:67 +#: ../../library/xdrlib.rst:68 msgid "" "In general, you can pack any of the most common XDR data types by calling " "the appropriate ``pack_type()`` method. Each method takes a single " @@ -99,51 +102,51 @@ msgid "" "`pack_bool`, :meth:`pack_uhyper`, and :meth:`pack_hyper`." msgstr "" -#: ../../library/xdrlib.rst:76 +#: ../../library/xdrlib.rst:77 msgid "Packs the single-precision floating point number *value*." msgstr "" -#: ../../library/xdrlib.rst:81 +#: ../../library/xdrlib.rst:82 msgid "Packs the double-precision floating point number *value*." msgstr "" -#: ../../library/xdrlib.rst:83 +#: ../../library/xdrlib.rst:84 msgid "The following methods support packing strings, bytes, and opaque data:" msgstr "" -#: ../../library/xdrlib.rst:88 +#: ../../library/xdrlib.rst:89 msgid "" "Packs a fixed length string, *s*. *n* is the length of the string but it is " "*not* packed into the data buffer. The string is padded with null bytes if " "necessary to guaranteed 4 byte alignment." msgstr "" -#: ../../library/xdrlib.rst:95 +#: ../../library/xdrlib.rst:96 msgid "" "Packs a fixed length opaque data stream, similarly to :meth:`pack_fstring`." msgstr "" -#: ../../library/xdrlib.rst:100 +#: ../../library/xdrlib.rst:101 msgid "" "Packs a variable length string, *s*. The length of the string is first " "packed as an unsigned integer, then the string data is packed with :meth:" "`pack_fstring`." msgstr "" -#: ../../library/xdrlib.rst:107 +#: ../../library/xdrlib.rst:108 msgid "" "Packs a variable length opaque data string, similarly to :meth:`pack_string`." msgstr "" -#: ../../library/xdrlib.rst:112 +#: ../../library/xdrlib.rst:113 msgid "Packs a variable length byte stream, similarly to :meth:`pack_string`." msgstr "" -#: ../../library/xdrlib.rst:114 +#: ../../library/xdrlib.rst:115 msgid "The following methods support packing arrays and lists:" msgstr "" -#: ../../library/xdrlib.rst:119 +#: ../../library/xdrlib.rst:120 msgid "" "Packs a *list* of homogeneous items. This method is useful for lists with " "an indeterminate size; i.e. the size is not available until the entire list " @@ -153,12 +156,12 @@ msgid "" "list, an unsigned integer ``0`` is packed." msgstr "" -#: ../../library/xdrlib.rst:126 +#: ../../library/xdrlib.rst:127 msgid "" "For example, to pack a list of integers, the code might appear like this::" msgstr "" -#: ../../library/xdrlib.rst:135 +#: ../../library/xdrlib.rst:136 msgid "" "Packs a fixed length list (*array*) of homogeneous items. *n* is the length " "of the list; it is *not* packed into the buffer, but a :exc:`ValueError` " @@ -166,103 +169,103 @@ msgid "" "*pack_item* is the function used to pack each element." msgstr "" -#: ../../library/xdrlib.rst:143 +#: ../../library/xdrlib.rst:144 msgid "" "Packs a variable length *list* of homogeneous items. First, the length of " "the list is packed as an unsigned integer, then each element is packed as " "in :meth:`pack_farray` above." msgstr "" -#: ../../library/xdrlib.rst:151 +#: ../../library/xdrlib.rst:152 msgid "Unpacker Objects" msgstr "" -#: ../../library/xdrlib.rst:153 +#: ../../library/xdrlib.rst:154 msgid "The :class:`Unpacker` class offers the following methods:" msgstr "" -#: ../../library/xdrlib.rst:158 +#: ../../library/xdrlib.rst:159 msgid "Resets the string buffer with the given *data*." msgstr "" -#: ../../library/xdrlib.rst:163 +#: ../../library/xdrlib.rst:164 msgid "Returns the current unpack position in the data buffer." msgstr "" -#: ../../library/xdrlib.rst:168 +#: ../../library/xdrlib.rst:169 msgid "" "Sets the data buffer unpack position to *position*. You should be careful " "about using :meth:`get_position` and :meth:`set_position`." msgstr "" -#: ../../library/xdrlib.rst:174 +#: ../../library/xdrlib.rst:175 msgid "Returns the current unpack data buffer as a string." msgstr "" -#: ../../library/xdrlib.rst:179 +#: ../../library/xdrlib.rst:180 msgid "" "Indicates unpack completion. Raises an :exc:`Error` exception if all of the " "data has not been unpacked." msgstr "" -#: ../../library/xdrlib.rst:182 +#: ../../library/xdrlib.rst:183 msgid "" "In addition, every data type that can be packed with a :class:`Packer`, can " "be unpacked with an :class:`Unpacker`. Unpacking methods are of the form " "``unpack_type()``, and take no arguments. They return the unpacked object." msgstr "" -#: ../../library/xdrlib.rst:189 +#: ../../library/xdrlib.rst:190 msgid "Unpacks a single-precision floating point number." msgstr "" -#: ../../library/xdrlib.rst:194 +#: ../../library/xdrlib.rst:195 msgid "" "Unpacks a double-precision floating point number, similarly to :meth:" "`unpack_float`." msgstr "" -#: ../../library/xdrlib.rst:197 +#: ../../library/xdrlib.rst:198 msgid "" "In addition, the following methods unpack strings, bytes, and opaque data:" msgstr "" -#: ../../library/xdrlib.rst:202 +#: ../../library/xdrlib.rst:203 msgid "" "Unpacks and returns a fixed length string. *n* is the number of characters " "expected. Padding with null bytes to guaranteed 4 byte alignment is assumed." msgstr "" -#: ../../library/xdrlib.rst:208 +#: ../../library/xdrlib.rst:209 msgid "" "Unpacks and returns a fixed length opaque data stream, similarly to :meth:" "`unpack_fstring`." msgstr "" -#: ../../library/xdrlib.rst:214 +#: ../../library/xdrlib.rst:215 msgid "" "Unpacks and returns a variable length string. The length of the string is " "first unpacked as an unsigned integer, then the string data is unpacked " "with :meth:`unpack_fstring`." msgstr "" -#: ../../library/xdrlib.rst:221 +#: ../../library/xdrlib.rst:222 msgid "" "Unpacks and returns a variable length opaque data string, similarly to :meth:" "`unpack_string`." msgstr "" -#: ../../library/xdrlib.rst:227 +#: ../../library/xdrlib.rst:228 msgid "" "Unpacks and returns a variable length byte stream, similarly to :meth:" "`unpack_string`." msgstr "" -#: ../../library/xdrlib.rst:230 +#: ../../library/xdrlib.rst:231 msgid "The following methods support unpacking arrays and lists:" msgstr "" -#: ../../library/xdrlib.rst:235 +#: ../../library/xdrlib.rst:236 msgid "" "Unpacks and returns a list of homogeneous items. The list is unpacked one " "element at a time by first unpacking an unsigned integer flag. If the flag " @@ -271,39 +274,39 @@ msgid "" "called to unpack the items." msgstr "" -#: ../../library/xdrlib.rst:244 +#: ../../library/xdrlib.rst:245 msgid "" "Unpacks and returns (as a list) a fixed length array of homogeneous items. " "*n* is number of list elements to expect in the buffer. As above, " "*unpack_item* is the function used to unpack each element." msgstr "" -#: ../../library/xdrlib.rst:251 +#: ../../library/xdrlib.rst:252 msgid "" "Unpacks and returns a variable length *list* of homogeneous items. First, " "the length of the list is unpacked as an unsigned integer, then each element " "is unpacked as in :meth:`unpack_farray` above." msgstr "" -#: ../../library/xdrlib.rst:259 +#: ../../library/xdrlib.rst:260 msgid "Exceptions" msgstr "例外" -#: ../../library/xdrlib.rst:261 +#: ../../library/xdrlib.rst:262 msgid "Exceptions in this module are coded as class instances:" msgstr "" -#: ../../library/xdrlib.rst:266 +#: ../../library/xdrlib.rst:267 msgid "" "The base exception class. :exc:`Error` has a single public attribute :attr:" "`msg` containing the description of the error." msgstr "" -#: ../../library/xdrlib.rst:272 +#: ../../library/xdrlib.rst:273 msgid "" "Class derived from :exc:`Error`. Contains no additional instance variables." msgstr "" -#: ../../library/xdrlib.rst:274 +#: ../../library/xdrlib.rst:275 msgid "Here is an example of how you would catch one of these exceptions::" msgstr "" diff --git a/library/xml.etree.elementtree.po b/library/xml.etree.elementtree.po index 1cab92eecd..2266b05ee1 100644 --- a/library/xml.etree.elementtree.po +++ b/library/xml.etree.elementtree.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.10\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2021-10-26 16:47+0000\n" +"POT-Creation-Date: 2022-05-21 17:35+0000\n" "PO-Revision-Date: 2018-05-23 16:16+0000\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -279,21 +279,11 @@ msgstr "" msgid "These two approaches both output::" msgstr "" -#: ../../library/xml.etree.elementtree.rst:367 -msgid "Additional resources" -msgstr "" - #: ../../library/xml.etree.elementtree.rst:369 -msgid "" -"See http://effbot.org/zone/element-index.htm for tutorials and links to " -"other docs." -msgstr "" - -#: ../../library/xml.etree.elementtree.rst:376 msgid "XPath support" msgstr "" -#: ../../library/xml.etree.elementtree.rst:378 +#: ../../library/xml.etree.elementtree.rst:371 msgid "" "This module provides limited support for `XPath expressions `_ for locating elements in a tree. The goal is to support a " @@ -301,41 +291,41 @@ msgid "" "scope of the module." msgstr "" -#: ../../library/xml.etree.elementtree.rst:384 -#: ../../library/xml.etree.elementtree.rst:776 +#: ../../library/xml.etree.elementtree.rst:377 +#: ../../library/xml.etree.elementtree.rst:769 msgid "Example" msgstr "範例" -#: ../../library/xml.etree.elementtree.rst:386 +#: ../../library/xml.etree.elementtree.rst:379 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:403 msgid "" "For XML with namespaces, use the usual qualified ``{namespace}tag`` " "notation::" msgstr "" -#: ../../library/xml.etree.elementtree.rst:417 +#: ../../library/xml.etree.elementtree.rst:410 msgid "Supported XPath syntax" msgstr "" -#: ../../library/xml.etree.elementtree.rst:422 +#: ../../library/xml.etree.elementtree.rst:415 msgid "Syntax" msgstr "" -#: ../../library/xml.etree.elementtree.rst:422 +#: ../../library/xml.etree.elementtree.rst:415 msgid "Meaning" msgstr "" -#: ../../library/xml.etree.elementtree.rst:424 +#: ../../library/xml.etree.elementtree.rst:417 msgid "``tag``" msgstr "``tag``" -#: ../../library/xml.etree.elementtree.rst:424 +#: ../../library/xml.etree.elementtree.rst:417 msgid "" "Selects all child elements with the given tag. For example, ``spam`` selects " "all child elements named ``spam``, and ``spam/egg`` selects all " @@ -345,133 +335,133 @@ msgid "" "not in a namespace." msgstr "" -#: ../../library/xml.etree.elementtree.rst:433 +#: ../../library/xml.etree.elementtree.rst:426 msgid "Support for star-wildcards was added." msgstr "" -#: ../../library/xml.etree.elementtree.rst:436 +#: ../../library/xml.etree.elementtree.rst:429 msgid "``*``" msgstr "``*``" -#: ../../library/xml.etree.elementtree.rst:436 +#: ../../library/xml.etree.elementtree.rst:429 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:433 msgid "``.``" msgstr "``.``" -#: ../../library/xml.etree.elementtree.rst:440 +#: ../../library/xml.etree.elementtree.rst:433 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:437 msgid "``//``" msgstr "``//``" -#: ../../library/xml.etree.elementtree.rst:444 +#: ../../library/xml.etree.elementtree.rst:437 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:441 msgid "``..``" msgstr "``..``" -#: ../../library/xml.etree.elementtree.rst:448 +#: ../../library/xml.etree.elementtree.rst:441 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:445 msgid "``[@attrib]``" msgstr "``[@attrib]``" -#: ../../library/xml.etree.elementtree.rst:452 +#: ../../library/xml.etree.elementtree.rst:445 msgid "Selects all elements that have the given attribute." msgstr "" -#: ../../library/xml.etree.elementtree.rst:454 +#: ../../library/xml.etree.elementtree.rst:447 msgid "``[@attrib='value']``" msgstr "``[@attrib='value']``" -#: ../../library/xml.etree.elementtree.rst:454 +#: ../../library/xml.etree.elementtree.rst:447 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:451 msgid "``[@attrib!='value']``" msgstr "``[@attrib!='value']``" -#: ../../library/xml.etree.elementtree.rst:458 +#: ../../library/xml.etree.elementtree.rst:451 msgid "" "Selects all elements for which the given attribute does not have the given " "value. The value cannot contain quotes." msgstr "" -#: ../../library/xml.etree.elementtree.rst:464 +#: ../../library/xml.etree.elementtree.rst:457 msgid "``[tag]``" msgstr "``[tag]``" -#: ../../library/xml.etree.elementtree.rst:464 +#: ../../library/xml.etree.elementtree.rst:457 msgid "" "Selects all elements that have a child named ``tag``. Only immediate " "children are supported." msgstr "" -#: ../../library/xml.etree.elementtree.rst:467 +#: ../../library/xml.etree.elementtree.rst:460 msgid "``[.='text']``" msgstr "``[.='text']``" -#: ../../library/xml.etree.elementtree.rst:467 +#: ../../library/xml.etree.elementtree.rst:460 msgid "" "Selects all elements whose complete text content, including descendants, " "equals the given ``text``." msgstr "" -#: ../../library/xml.etree.elementtree.rst:472 +#: ../../library/xml.etree.elementtree.rst:465 msgid "``[.!='text']``" msgstr "``[.!='text']``" -#: ../../library/xml.etree.elementtree.rst:472 +#: ../../library/xml.etree.elementtree.rst:465 msgid "" "Selects all elements whose complete text content, including descendants, " "does not equal the given ``text``." msgstr "" -#: ../../library/xml.etree.elementtree.rst:478 +#: ../../library/xml.etree.elementtree.rst:471 msgid "``[tag='text']``" msgstr "``[tag='text']``" -#: ../../library/xml.etree.elementtree.rst:478 +#: ../../library/xml.etree.elementtree.rst:471 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:482 +#: ../../library/xml.etree.elementtree.rst:475 msgid "``[tag!='text']``" msgstr "``[tag!='text']``" -#: ../../library/xml.etree.elementtree.rst:482 +#: ../../library/xml.etree.elementtree.rst:475 msgid "" "Selects all elements that have a child named ``tag`` whose complete text " "content, including descendants, does not equal the given ``text``." msgstr "" -#: ../../library/xml.etree.elementtree.rst:488 +#: ../../library/xml.etree.elementtree.rst:481 msgid "``[position]``" msgstr "``[position]``" -#: ../../library/xml.etree.elementtree.rst:488 +#: ../../library/xml.etree.elementtree.rst:481 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 " @@ -479,28 +469,28 @@ msgid "" "position (e.g. ``last()-1``)." msgstr "" -#: ../../library/xml.etree.elementtree.rst:495 +#: ../../library/xml.etree.elementtree.rst:488 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:500 -#: ../../library/xml.etree.elementtree.rst:828 +#: ../../library/xml.etree.elementtree.rst:493 +#: ../../library/xml.etree.elementtree.rst:821 msgid "Reference" msgstr "" -#: ../../library/xml.etree.elementtree.rst:505 -#: ../../library/xml.etree.elementtree.rst:833 +#: ../../library/xml.etree.elementtree.rst:498 +#: ../../library/xml.etree.elementtree.rst:826 msgid "Functions" msgstr "函式" -#: ../../library/xml.etree.elementtree.rst:509 +#: ../../library/xml.etree.elementtree.rst:502 msgid "`C14N 2.0 `_ transformation function." msgstr "" -#: ../../library/xml.etree.elementtree.rst:511 +#: ../../library/xml.etree.elementtree.rst:504 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 " @@ -509,7 +499,7 @@ msgid "" "declarations, the ordering of attributes, and ignorable whitespace." msgstr "" -#: ../../library/xml.etree.elementtree.rst:517 +#: ../../library/xml.etree.elementtree.rst:510 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 " @@ -518,63 +508,63 @@ msgid "" "should therefore be opened in text mode with ``utf-8`` encoding." msgstr "" -#: ../../library/xml.etree.elementtree.rst:524 +#: ../../library/xml.etree.elementtree.rst:517 msgid "Typical uses::" msgstr "" -#: ../../library/xml.etree.elementtree.rst:535 +#: ../../library/xml.etree.elementtree.rst:528 msgid "The configuration *options* are as follows:" msgstr "" -#: ../../library/xml.etree.elementtree.rst:537 +#: ../../library/xml.etree.elementtree.rst:530 msgid "*with_comments*: set to true to include comments (default: false)" msgstr "" -#: ../../library/xml.etree.elementtree.rst:538 +#: ../../library/xml.etree.elementtree.rst:531 msgid "" "*strip_text*: set to true to strip whitespace before and after text content" msgstr "" -#: ../../library/xml.etree.elementtree.rst:539 -#: ../../library/xml.etree.elementtree.rst:541 +#: ../../library/xml.etree.elementtree.rst:532 +#: ../../library/xml.etree.elementtree.rst:534 msgid "(default: false)" msgstr "" -#: ../../library/xml.etree.elementtree.rst:540 +#: ../../library/xml.etree.elementtree.rst:533 msgid "" "*rewrite_prefixes*: set to true to replace namespace prefixes by " "\"n{number}\"" msgstr "" -#: ../../library/xml.etree.elementtree.rst:542 +#: ../../library/xml.etree.elementtree.rst:535 msgid "*qname_aware_tags*: a set of qname aware tag names in which prefixes" msgstr "" -#: ../../library/xml.etree.elementtree.rst:543 -#: ../../library/xml.etree.elementtree.rst:545 +#: ../../library/xml.etree.elementtree.rst:536 +#: ../../library/xml.etree.elementtree.rst:538 msgid "should be replaced in text content (default: empty)" msgstr "" -#: ../../library/xml.etree.elementtree.rst:544 +#: ../../library/xml.etree.elementtree.rst:537 msgid "" "*qname_aware_attrs*: a set of qname aware attribute names in which prefixes" msgstr "" -#: ../../library/xml.etree.elementtree.rst:546 +#: ../../library/xml.etree.elementtree.rst:539 msgid "*exclude_attrs*: a set of attribute names that should not be serialised" msgstr "" -#: ../../library/xml.etree.elementtree.rst:547 +#: ../../library/xml.etree.elementtree.rst:540 msgid "*exclude_tags*: a set of tag names that should not be serialised" msgstr "" -#: ../../library/xml.etree.elementtree.rst:549 +#: ../../library/xml.etree.elementtree.rst:542 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:557 +#: ../../library/xml.etree.elementtree.rst:550 msgid "" "Comment element factory. This factory function creates a special element " "that will be serialized as an XML comment by the standard serializer. The " @@ -583,7 +573,7 @@ msgid "" "representing a comment." msgstr "" -#: ../../library/xml.etree.elementtree.rst:563 +#: ../../library/xml.etree.elementtree.rst:556 msgid "" "Note that :class:`XMLParser` skips over comments in the input instead of " "creating comment objects for them. An :class:`ElementTree` will only contain " @@ -591,29 +581,29 @@ msgid "" "class:`Element` methods." msgstr "" -#: ../../library/xml.etree.elementtree.rst:570 +#: ../../library/xml.etree.elementtree.rst:563 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:573 +#: ../../library/xml.etree.elementtree.rst:566 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:576 +#: ../../library/xml.etree.elementtree.rst:569 msgid "*elem* is an element tree or an individual element." msgstr "" -#: ../../library/xml.etree.elementtree.rst:578 +#: ../../library/xml.etree.elementtree.rst:571 msgid "" "The :func:`dump` function now preserves the attribute order specified by the " "user." msgstr "" -#: ../../library/xml.etree.elementtree.rst:585 +#: ../../library/xml.etree.elementtree.rst:578 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. " @@ -621,7 +611,7 @@ msgid "" "class:`Element` instance." msgstr "" -#: ../../library/xml.etree.elementtree.rst:593 +#: ../../library/xml.etree.elementtree.rst:586 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 " @@ -629,7 +619,7 @@ msgid "" "parser is used. Returns an :class:`Element` instance." msgstr "" -#: ../../library/xml.etree.elementtree.rst:603 +#: ../../library/xml.etree.elementtree.rst:596 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 " @@ -639,13 +629,13 @@ msgid "" "indentation level as *level*." msgstr "" -#: ../../library/xml.etree.elementtree.rst:615 +#: ../../library/xml.etree.elementtree.rst:608 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:621 +#: ../../library/xml.etree.elementtree.rst:614 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` " @@ -660,7 +650,7 @@ msgid "" "elem)`` pairs." msgstr "" -#: ../../library/xml.etree.elementtree.rst:633 +#: ../../library/xml.etree.elementtree.rst:626 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 " @@ -668,7 +658,7 @@ msgid "" "parsing, see :class:`XMLPullParser`." msgstr "" -#: ../../library/xml.etree.elementtree.rst:640 +#: ../../library/xml.etree.elementtree.rst:633 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, " @@ -677,21 +667,21 @@ msgid "" "present." msgstr "" -#: ../../library/xml.etree.elementtree.rst:646 -#: ../../library/xml.etree.elementtree.rst:1474 +#: ../../library/xml.etree.elementtree.rst:639 +#: ../../library/xml.etree.elementtree.rst:1469 msgid "If you need a fully populated element, look for \"end\" events instead." msgstr "" -#: ../../library/xml.etree.elementtree.rst:648 +#: ../../library/xml.etree.elementtree.rst:641 msgid "The *parser* argument." msgstr "*parser* 引數。" -#: ../../library/xml.etree.elementtree.rst:651 -#: ../../library/xml.etree.elementtree.rst:1478 +#: ../../library/xml.etree.elementtree.rst:644 +#: ../../library/xml.etree.elementtree.rst:1473 msgid "The ``comment`` and ``pi`` events were added." msgstr "新增 *context* 與 *check_hostname* 事件。" -#: ../../library/xml.etree.elementtree.rst:657 +#: ../../library/xml.etree.elementtree.rst:650 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 " @@ -699,7 +689,7 @@ msgid "" "class:`ElementTree` instance." msgstr "" -#: ../../library/xml.etree.elementtree.rst:665 +#: ../../library/xml.etree.elementtree.rst:658 msgid "" "PI element factory. This factory function creates a special element that " "will be serialized as an XML processing instruction. *target* is a string " @@ -707,7 +697,7 @@ msgid "" "given. Returns an element instance, representing a processing instruction." msgstr "" -#: ../../library/xml.etree.elementtree.rst:670 +#: ../../library/xml.etree.elementtree.rst:663 msgid "" "Note that :class:`XMLParser` skips over processing instructions in the input " "instead of creating comment objects for them. An :class:`ElementTree` will " @@ -715,7 +705,7 @@ msgid "" "the tree using one of the :class:`Element` methods." msgstr "" -#: ../../library/xml.etree.elementtree.rst:678 +#: ../../library/xml.etree.elementtree.rst:671 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. " @@ -724,13 +714,13 @@ msgid "" "all possible." msgstr "" -#: ../../library/xml.etree.elementtree.rst:689 +#: ../../library/xml.etree.elementtree.rst:682 msgid "" "Subelement factory. This function creates an element instance, and appends " "it to an existing element." msgstr "" -#: ../../library/xml.etree.elementtree.rst:692 +#: ../../library/xml.etree.elementtree.rst:685 msgid "" "The element name, attribute names, and attribute values can be either " "bytestrings or Unicode strings. *parent* is the parent element. *tag* is " @@ -739,7 +729,7 @@ msgid "" "arguments. Returns an element instance." msgstr "" -#: ../../library/xml.etree.elementtree.rst:703 +#: ../../library/xml.etree.elementtree.rst:696 msgid "" "Generates a string representation of an XML element, including all " "subelements. *element* is an :class:`Element` instance. *encoding* [1]_ is " @@ -751,24 +741,24 @@ msgid "" "encoded string containing the XML data." msgstr "" -#: ../../library/xml.etree.elementtree.rst:712 -#: ../../library/xml.etree.elementtree.rst:739 -#: ../../library/xml.etree.elementtree.rst:1186 +#: ../../library/xml.etree.elementtree.rst:705 +#: ../../library/xml.etree.elementtree.rst:732 +#: ../../library/xml.etree.elementtree.rst:1181 msgid "The *short_empty_elements* parameter." msgstr "*short_empty_elements* 參數。" -#: ../../library/xml.etree.elementtree.rst:715 -#: ../../library/xml.etree.elementtree.rst:742 +#: ../../library/xml.etree.elementtree.rst:708 +#: ../../library/xml.etree.elementtree.rst:735 msgid "The *xml_declaration* and *default_namespace* parameters." msgstr "" -#: ../../library/xml.etree.elementtree.rst:718 +#: ../../library/xml.etree.elementtree.rst:711 msgid "" "The :func:`tostring` function now preserves the attribute order specified by " "the user." msgstr "" -#: ../../library/xml.etree.elementtree.rst:727 +#: ../../library/xml.etree.elementtree.rst:720 msgid "" "Generates a string representation of an XML element, including all " "subelements. *element* is an :class:`Element` instance. *encoding* [1]_ is " @@ -782,13 +772,13 @@ msgid "" "tostring(element)``." msgstr "" -#: ../../library/xml.etree.elementtree.rst:745 +#: ../../library/xml.etree.elementtree.rst:738 msgid "" "The :func:`tostringlist` function now preserves the attribute order " "specified by the user." msgstr "" -#: ../../library/xml.etree.elementtree.rst:752 +#: ../../library/xml.etree.elementtree.rst:745 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 " @@ -796,7 +786,7 @@ msgid "" "class:`XMLParser` parser is used. Returns an :class:`Element` instance." msgstr "" -#: ../../library/xml.etree.elementtree.rst:760 +#: ../../library/xml.etree.elementtree.rst:753 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 " @@ -805,11 +795,11 @@ msgid "" "`Element` instance and a dictionary." msgstr "" -#: ../../library/xml.etree.elementtree.rst:770 +#: ../../library/xml.etree.elementtree.rst:763 msgid "XInclude support" msgstr "" -#: ../../library/xml.etree.elementtree.rst:772 +#: ../../library/xml.etree.elementtree.rst:765 msgid "" "This module provides limited support for `XInclude directives `_, via the :mod:`xml.etree.ElementInclude` helper " @@ -817,7 +807,7 @@ msgid "" "element trees, based on information in the tree." msgstr "" -#: ../../library/xml.etree.elementtree.rst:778 +#: ../../library/xml.etree.elementtree.rst:771 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/" @@ -825,43 +815,43 @@ msgid "" "and use the **href** attribute to specify the document to include." msgstr "" -#: ../../library/xml.etree.elementtree.rst:787 +#: ../../library/xml.etree.elementtree.rst:780 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:789 +#: ../../library/xml.etree.elementtree.rst:782 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:800 +#: ../../library/xml.etree.elementtree.rst:793 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:808 +#: ../../library/xml.etree.elementtree.rst:801 msgid "" "If the **parse** attribute is omitted, it defaults to \"xml\". The href " "attribute is required." msgstr "" -#: ../../library/xml.etree.elementtree.rst:810 +#: ../../library/xml.etree.elementtree.rst:803 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:819 +#: ../../library/xml.etree.elementtree.rst:812 msgid "The result might look something like:" msgstr "" -#: ../../library/xml.etree.elementtree.rst:837 +#: ../../library/xml.etree.elementtree.rst:831 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\". " @@ -872,7 +862,7 @@ msgid "" "exception." msgstr "" -#: ../../library/xml.etree.elementtree.rst:848 +#: ../../library/xml.etree.elementtree.rst:843 msgid "" "This function expands XInclude directives. *elem* is the root element. " "*loader* is an optional resource loader. If omitted, it defaults to :func:" @@ -883,28 +873,28 @@ msgid "" "malicious content explosion. Pass a negative value to disable the limitation." msgstr "" -#: ../../library/xml.etree.elementtree.rst:856 +#: ../../library/xml.etree.elementtree.rst:851 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:861 +#: ../../library/xml.etree.elementtree.rst:856 msgid "The *base_url* and *max_depth* parameters." msgstr "" -#: ../../library/xml.etree.elementtree.rst:868 +#: ../../library/xml.etree.elementtree.rst:863 msgid "Element Objects" msgstr "" -#: ../../library/xml.etree.elementtree.rst:872 +#: ../../library/xml.etree.elementtree.rst:867 msgid "" "Element class. This class defines the Element interface, and provides a " "reference implementation of this interface." msgstr "" -#: ../../library/xml.etree.elementtree.rst:875 +#: ../../library/xml.etree.elementtree.rst:870 msgid "" "The element name, attribute names, and attribute values can be either " "bytestrings or Unicode strings. *tag* is the element name. *attrib* is an " @@ -912,13 +902,13 @@ msgid "" "additional attributes, given as keyword arguments." msgstr "" -#: ../../library/xml.etree.elementtree.rst:883 +#: ../../library/xml.etree.elementtree.rst:878 msgid "" "A string identifying what kind of data this element represents (the element " "type, in other words)." msgstr "" -#: ../../library/xml.etree.elementtree.rst:890 +#: ../../library/xml.etree.elementtree.rst:885 msgid "" "These attributes can be used to hold additional data associated with the " "element. Their values are usually strings but may be any application-" @@ -929,7 +919,7 @@ msgid "" "the XML data" msgstr "" -#: ../../library/xml.etree.elementtree.rst:902 +#: ../../library/xml.etree.elementtree.rst:897 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 " @@ -937,17 +927,17 @@ msgid "" "``None`` and *tail* ``\"3\"``." msgstr "" -#: ../../library/xml.etree.elementtree.rst:907 +#: ../../library/xml.etree.elementtree.rst:902 msgid "" "To collect the inner text of an element, see :meth:`itertext`, for example ``" "\"\".join(element.itertext())``." msgstr "" -#: ../../library/xml.etree.elementtree.rst:910 +#: ../../library/xml.etree.elementtree.rst:905 msgid "Applications may store arbitrary objects in these attributes." msgstr "" -#: ../../library/xml.etree.elementtree.rst:915 +#: ../../library/xml.etree.elementtree.rst:910 msgid "" "A dictionary containing the element's attributes. Note that while the " "*attrib* value is always a real mutable Python dictionary, an ElementTree " @@ -956,59 +946,59 @@ msgid "" "implementations, use the dictionary methods below whenever possible." msgstr "" -#: ../../library/xml.etree.elementtree.rst:921 +#: ../../library/xml.etree.elementtree.rst:916 msgid "The following dictionary-like methods work on the element attributes." msgstr "" -#: ../../library/xml.etree.elementtree.rst:926 +#: ../../library/xml.etree.elementtree.rst:921 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:932 +#: ../../library/xml.etree.elementtree.rst:927 msgid "Gets the element attribute named *key*." msgstr "" -#: ../../library/xml.etree.elementtree.rst:934 +#: ../../library/xml.etree.elementtree.rst:929 msgid "" "Returns the attribute value, or *default* if the attribute was not found." msgstr "" -#: ../../library/xml.etree.elementtree.rst:939 +#: ../../library/xml.etree.elementtree.rst:934 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:945 +#: ../../library/xml.etree.elementtree.rst:940 msgid "" "Returns the elements attribute names as a list. The names are returned in " "an arbitrary order." msgstr "" -#: ../../library/xml.etree.elementtree.rst:951 +#: ../../library/xml.etree.elementtree.rst:946 msgid "Set the attribute *key* on the element to *value*." msgstr "" -#: ../../library/xml.etree.elementtree.rst:953 +#: ../../library/xml.etree.elementtree.rst:948 msgid "The following methods work on the element's children (subelements)." msgstr "" -#: ../../library/xml.etree.elementtree.rst:958 +#: ../../library/xml.etree.elementtree.rst:953 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:965 +#: ../../library/xml.etree.elementtree.rst:960 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:973 +#: ../../library/xml.etree.elementtree.rst:968 msgid "" "Finds the first subelement matching *match*. *match* may be a tag name or " "a :ref:`path `. Returns an element instance or " @@ -1017,7 +1007,7 @@ msgid "" "expression into the given namespace." msgstr "" -#: ../../library/xml.etree.elementtree.rst:982 +#: ../../library/xml.etree.elementtree.rst:977 msgid "" "Finds all matching subelements, by tag name or :ref:`path `. Returns a list containing all matching elements in document " @@ -1026,7 +1016,7 @@ msgid "" "expression into the given namespace." msgstr "" -#: ../../library/xml.etree.elementtree.rst:991 +#: ../../library/xml.etree.elementtree.rst:986 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 " @@ -1037,13 +1027,13 @@ msgid "" "into the given namespace." msgstr "" -#: ../../library/xml.etree.elementtree.rst:1002 +#: ../../library/xml.etree.elementtree.rst:997 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:1008 +#: ../../library/xml.etree.elementtree.rst:1003 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 " @@ -1052,7 +1042,7 @@ msgid "" "structure is modified during iteration, the result is undefined." msgstr "" -#: ../../library/xml.etree.elementtree.rst:1019 +#: ../../library/xml.etree.elementtree.rst:1014 msgid "" "Finds all matching subelements, by tag name or :ref:`path `. Returns an iterable yielding all matching elements in document " @@ -1060,40 +1050,40 @@ msgid "" "name." msgstr "" -#: ../../library/xml.etree.elementtree.rst:1030 +#: ../../library/xml.etree.elementtree.rst:1025 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:1038 +#: ../../library/xml.etree.elementtree.rst:1033 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:1044 +#: ../../library/xml.etree.elementtree.rst:1039 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:1048 +#: ../../library/xml.etree.elementtree.rst:1043 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:1053 +#: ../../library/xml.etree.elementtree.rst:1048 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:1065 +#: ../../library/xml.etree.elementtree.rst:1060 msgid "" "Prior to Python 3.8, the serialisation order of the XML attributes of " "elements was artificially made predictable by sorting the attributes by " @@ -1102,7 +1092,7 @@ msgid "" "attributes were originally parsed or created by user code." msgstr "" -#: ../../library/xml.etree.elementtree.rst:1071 +#: ../../library/xml.etree.elementtree.rst:1066 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 " @@ -1337,11 +1327,11 @@ msgid "" "using the *write* function." msgstr "" -#: ../../library/xml.etree.elementtree.rst:1349 +#: ../../library/xml.etree.elementtree.rst:1344 msgid "XMLParser Objects" msgstr "XMLParser 物件" -#: ../../library/xml.etree.elementtree.rst:1354 +#: ../../library/xml.etree.elementtree.rst:1349 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 " @@ -1352,24 +1342,24 @@ msgid "" "XML file." msgstr "" -#: ../../library/xml.etree.elementtree.rst:1362 +#: ../../library/xml.etree.elementtree.rst:1357 msgid "" "Parameters are now :ref:`keyword-only `. The *html* " "argument no longer supported." msgstr "" -#: ../../library/xml.etree.elementtree.rst:1369 +#: ../../library/xml.etree.elementtree.rst:1364 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:1376 +#: ../../library/xml.etree.elementtree.rst:1371 msgid "Feeds data to the parser. *data* is encoded data." msgstr "" -#: ../../library/xml.etree.elementtree.rst:1378 +#: ../../library/xml.etree.elementtree.rst:1373 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 " @@ -1380,11 +1370,11 @@ msgid "" "of an XML file::" msgstr "" -#: ../../library/xml.etree.elementtree.rst:1422 +#: ../../library/xml.etree.elementtree.rst:1417 msgid "XMLPullParser Objects" msgstr "XMLPullParser 物件" -#: ../../library/xml.etree.elementtree.rst:1426 +#: ../../library/xml.etree.elementtree.rst:1421 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 " @@ -1396,11 +1386,11 @@ msgid "" "is omitted, only ``\"end\"`` events are reported." msgstr "" -#: ../../library/xml.etree.elementtree.rst:1437 +#: ../../library/xml.etree.elementtree.rst:1432 msgid "Feed the given bytes data to the parser." msgstr "" -#: ../../library/xml.etree.elementtree.rst:1441 +#: ../../library/xml.etree.elementtree.rst:1436 msgid "" "Signal the parser that the data stream is terminated. Unlike :meth:" "`XMLParser.close`, this method always returns :const:`None`. Any events not " @@ -1408,7 +1398,7 @@ msgid "" "`read_events`." msgstr "" -#: ../../library/xml.etree.elementtree.rst:1448 +#: ../../library/xml.etree.elementtree.rst:1443 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 " @@ -1417,25 +1407,25 @@ msgid "" "follows." msgstr "" -#: ../../library/xml.etree.elementtree.rst:1454 +#: ../../library/xml.etree.elementtree.rst:1449 msgid "``start``, ``end``: the current Element." msgstr "" -#: ../../library/xml.etree.elementtree.rst:1455 +#: ../../library/xml.etree.elementtree.rst:1450 msgid "``comment``, ``pi``: the current comment / processing instruction" msgstr "" -#: ../../library/xml.etree.elementtree.rst:1456 +#: ../../library/xml.etree.elementtree.rst:1451 msgid "" "``start-ns``: a tuple ``(prefix, uri)`` naming the declared namespace " "mapping." msgstr "" -#: ../../library/xml.etree.elementtree.rst:1458 +#: ../../library/xml.etree.elementtree.rst:1453 msgid "``end-ns``: :const:`None` (this may change in a future version)" msgstr "" -#: ../../library/xml.etree.elementtree.rst:1460 +#: ../../library/xml.etree.elementtree.rst:1455 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 " @@ -1444,7 +1434,7 @@ msgid "" "results." msgstr "" -#: ../../library/xml.etree.elementtree.rst:1468 +#: ../../library/xml.etree.elementtree.rst:1463 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 " @@ -1453,11 +1443,11 @@ msgid "" "be present." msgstr "" -#: ../../library/xml.etree.elementtree.rst:1483 +#: ../../library/xml.etree.elementtree.rst:1478 msgid "Exceptions" msgstr "例外" -#: ../../library/xml.etree.elementtree.rst:1487 +#: ../../library/xml.etree.elementtree.rst:1482 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 " @@ -1465,22 +1455,22 @@ msgid "" "following attributes available:" msgstr "" -#: ../../library/xml.etree.elementtree.rst:1494 +#: ../../library/xml.etree.elementtree.rst:1489 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:1499 +#: ../../library/xml.etree.elementtree.rst:1494 msgid "" "A tuple of *line*, *column* numbers, specifying where the error occurred." msgstr "" -#: ../../library/xml.etree.elementtree.rst:1502 +#: ../../library/xml.etree.elementtree.rst:1497 msgid "Footnotes" msgstr "註解" -#: ../../library/xml.etree.elementtree.rst:1503 +#: ../../library/xml.etree.elementtree.rst:1498 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.sax.handler.po b/library/xml.sax.handler.po index 6716d9bc6f..8e04b5f6c7 100644 --- a/library/xml.sax.handler.po +++ b/library/xml.sax.handler.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.10\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2021-10-26 16:47+0000\n" +"POT-Creation-Date: 2022-05-21 17:35+0000\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-" @@ -228,7 +228,7 @@ msgid "value: ``\"http://xml.org/sax/properties/xml-string\"``" msgstr "" #: ../../library/xml.sax.handler.rst:150 -msgid "data type: String" +msgid "data type: Bytes" msgstr "" #: ../../library/xml.sax.handler.rst:152 diff --git a/library/xmlrpc.client.po b/library/xmlrpc.client.po index 52581ce3af..6e0a86ff07 100644 --- a/library/xmlrpc.client.po +++ b/library/xmlrpc.client.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.10\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2021-10-26 16:47+0000\n" +"POT-Creation-Date: 2022-05-21 17:35+0000\n" "PO-Revision-Date: 2018-05-23 16:16+0000\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -80,7 +80,7 @@ msgid "" "date/time values." msgstr "" -#: ../../library/xmlrpc.client.rst:65 ../../library/xmlrpc.client.rst:552 +#: ../../library/xmlrpc.client.rst:65 ../../library/xmlrpc.client.rst:546 msgid "The *use_builtin_types* flag was added." msgstr "" @@ -278,7 +278,7 @@ msgstr "" msgid "Describes the XML-RPC protocol extension for introspection." msgstr "" -#: ../../library/xmlrpc.client.rst:170 +#: ../../library/xmlrpc.client.rst:169 msgid "`XML-RPC Specification `_" msgstr "" @@ -287,21 +287,10 @@ msgid "The official specification." msgstr "" #: ../../library/xmlrpc.client.rst:175 -msgid "`Unofficial XML-RPC Errata `_" -msgstr "" - -#: ../../library/xmlrpc.client.rst:173 -msgid "" -"Fredrik Lundh's \"unofficial errata, intended to clarify certain details in " -"the XML-RPC specification, as well as hint at 'best practices' to use when " -"designing your own XML-RPC implementations.\"" -msgstr "" - -#: ../../library/xmlrpc.client.rst:181 msgid "ServerProxy Objects" msgstr "ServerProxy 物件" -#: ../../library/xmlrpc.client.rst:183 +#: ../../library/xmlrpc.client.rst:177 msgid "" "A :class:`ServerProxy` instance has a method corresponding to each remote " "procedure call accepted by the XML-RPC server. Calling the method performs " @@ -311,19 +300,19 @@ msgid "" "or a :class:`Fault` or :class:`ProtocolError` object indicating an error." msgstr "" -#: ../../library/xmlrpc.client.rst:190 +#: ../../library/xmlrpc.client.rst:184 msgid "" "Servers that support the XML introspection API support some common methods " "grouped under the reserved :attr:`~ServerProxy.system` attribute:" msgstr "" -#: ../../library/xmlrpc.client.rst:196 +#: ../../library/xmlrpc.client.rst:190 msgid "" "This method returns a list of strings, one for each (non-system) method " "supported by the XML-RPC server." msgstr "" -#: ../../library/xmlrpc.client.rst:202 +#: ../../library/xmlrpc.client.rst:196 msgid "" "This method takes one parameter, the name of a method implemented by the XML-" "RPC server. It returns an array of possible signatures for this method. A " @@ -331,13 +320,13 @@ msgid "" "of the method, the rest are parameters." msgstr "" -#: ../../library/xmlrpc.client.rst:207 +#: ../../library/xmlrpc.client.rst:201 msgid "" "Because multiple signatures (ie. overloading) is permitted, this method " "returns a list of signatures rather than a singleton." msgstr "" -#: ../../library/xmlrpc.client.rst:210 +#: ../../library/xmlrpc.client.rst:204 msgid "" "Signatures themselves are restricted to the top level parameters expected by " "a method. For instance if a method expects one array of structs as a " @@ -346,14 +335,14 @@ msgid "" "\"string, int, int, int\"." msgstr "" -#: ../../library/xmlrpc.client.rst:215 +#: ../../library/xmlrpc.client.rst:209 msgid "" "If no signature is defined for the method, a non-array value is returned. In " "Python this means that the type of the returned value will be something " "other than list." msgstr "" -#: ../../library/xmlrpc.client.rst:222 +#: ../../library/xmlrpc.client.rst:216 msgid "" "This method takes one parameter, the name of a method implemented by the XML-" "RPC server. It returns a documentation string describing the use of that " @@ -361,26 +350,26 @@ msgid "" "documentation string may contain HTML markup." msgstr "" -#: ../../library/xmlrpc.client.rst:229 +#: ../../library/xmlrpc.client.rst:223 msgid "" "Instances of :class:`ServerProxy` support the :term:`context manager` " "protocol for closing the underlying transport." msgstr "" -#: ../../library/xmlrpc.client.rst:233 ../../library/xmlrpc.client.rst:279 +#: ../../library/xmlrpc.client.rst:227 ../../library/xmlrpc.client.rst:273 msgid "A working example follows. The server code::" msgstr "" -#: ../../library/xmlrpc.client.rst:245 ../../library/xmlrpc.client.rst:294 -#: ../../library/xmlrpc.client.rst:404 ../../library/xmlrpc.client.rst:510 +#: ../../library/xmlrpc.client.rst:239 ../../library/xmlrpc.client.rst:288 +#: ../../library/xmlrpc.client.rst:398 ../../library/xmlrpc.client.rst:504 msgid "The client code for the preceding server::" msgstr "" -#: ../../library/xmlrpc.client.rst:256 +#: ../../library/xmlrpc.client.rst:250 msgid "DateTime Objects" msgstr "日期時間物件" -#: ../../library/xmlrpc.client.rst:260 +#: ../../library/xmlrpc.client.rst:254 msgid "" "This class may be initialized with seconds since the epoch, a time tuple, an " "ISO 8601 time/date string, or a :class:`datetime.datetime` instance. It has " @@ -388,150 +377,150 @@ msgid "" "unmarshalling code:" msgstr "" -#: ../../library/xmlrpc.client.rst:268 +#: ../../library/xmlrpc.client.rst:262 msgid "Accept a string as the instance's new time value." msgstr "" -#: ../../library/xmlrpc.client.rst:273 +#: ../../library/xmlrpc.client.rst:267 msgid "" "Write the XML-RPC encoding of this :class:`DateTime` item to the *out* " "stream object." msgstr "" -#: ../../library/xmlrpc.client.rst:276 +#: ../../library/xmlrpc.client.rst:270 msgid "" "It also supports certain of Python's built-in operators through rich " "comparison and :meth:`__repr__` methods." msgstr "" -#: ../../library/xmlrpc.client.rst:309 +#: ../../library/xmlrpc.client.rst:303 msgid "Binary Objects" msgstr "" -#: ../../library/xmlrpc.client.rst:313 +#: ../../library/xmlrpc.client.rst:307 msgid "" "This class may be initialized from bytes data (which may include NULs). The " "primary access to the content of a :class:`Binary` object is provided by an " "attribute:" msgstr "" -#: ../../library/xmlrpc.client.rst:320 +#: ../../library/xmlrpc.client.rst:314 msgid "" "The binary data encapsulated by the :class:`Binary` instance. The data is " "provided as a :class:`bytes` object." msgstr "" -#: ../../library/xmlrpc.client.rst:323 +#: ../../library/xmlrpc.client.rst:317 msgid "" ":class:`Binary` objects have the following methods, supported mainly for " "internal use by the marshalling/unmarshalling code:" msgstr "" -#: ../../library/xmlrpc.client.rst:329 +#: ../../library/xmlrpc.client.rst:323 msgid "" "Accept a base64 :class:`bytes` object and decode it as the instance's new " "data." msgstr "" -#: ../../library/xmlrpc.client.rst:334 +#: ../../library/xmlrpc.client.rst:328 msgid "" "Write the XML-RPC base 64 encoding of this binary item to the *out* stream " "object." msgstr "" -#: ../../library/xmlrpc.client.rst:336 +#: ../../library/xmlrpc.client.rst:330 msgid "" "The encoded data will have newlines every 76 characters as per :rfc:`RFC " "2045 section 6.8 <2045#section-6.8>`, which was the de facto standard base64 " "specification when the XML-RPC spec was written." msgstr "" -#: ../../library/xmlrpc.client.rst:341 +#: ../../library/xmlrpc.client.rst:335 msgid "" "It also supports certain of Python's built-in operators through :meth:" "`__eq__` and :meth:`__ne__` methods." msgstr "" -#: ../../library/xmlrpc.client.rst:344 +#: ../../library/xmlrpc.client.rst:338 msgid "" "Example usage of the binary objects. We're going to transfer an image over " "XMLRPC::" msgstr "" -#: ../../library/xmlrpc.client.rst:360 +#: ../../library/xmlrpc.client.rst:354 msgid "The client gets the image and saves it to a file::" msgstr "" -#: ../../library/xmlrpc.client.rst:371 +#: ../../library/xmlrpc.client.rst:365 msgid "Fault Objects" msgstr "" -#: ../../library/xmlrpc.client.rst:375 +#: ../../library/xmlrpc.client.rst:369 msgid "" "A :class:`Fault` object encapsulates the content of an XML-RPC fault tag. " "Fault objects have the following attributes:" msgstr "" -#: ../../library/xmlrpc.client.rst:381 +#: ../../library/xmlrpc.client.rst:375 msgid "An int indicating the fault type." msgstr "" -#: ../../library/xmlrpc.client.rst:386 +#: ../../library/xmlrpc.client.rst:380 msgid "A string containing a diagnostic message associated with the fault." msgstr "" -#: ../../library/xmlrpc.client.rst:388 +#: ../../library/xmlrpc.client.rst:382 msgid "" "In the following example we're going to intentionally cause a :exc:`Fault` " "by returning a complex type object. The server code::" msgstr "" -#: ../../library/xmlrpc.client.rst:421 +#: ../../library/xmlrpc.client.rst:415 msgid "ProtocolError Objects" msgstr "ProtocolError 物件" -#: ../../library/xmlrpc.client.rst:425 +#: ../../library/xmlrpc.client.rst:419 msgid "" "A :class:`ProtocolError` object describes a protocol error in the underlying " "transport layer (such as a 404 'not found' error if the server named by the " "URI does not exist). It has the following attributes:" msgstr "" -#: ../../library/xmlrpc.client.rst:432 +#: ../../library/xmlrpc.client.rst:426 msgid "The URI or URL that triggered the error." msgstr "" -#: ../../library/xmlrpc.client.rst:437 +#: ../../library/xmlrpc.client.rst:431 msgid "The error code." msgstr "" -#: ../../library/xmlrpc.client.rst:442 +#: ../../library/xmlrpc.client.rst:436 msgid "The error message or diagnostic string." msgstr "" -#: ../../library/xmlrpc.client.rst:447 +#: ../../library/xmlrpc.client.rst:441 msgid "" "A dict containing the headers of the HTTP/HTTPS request that triggered the " "error." msgstr "" -#: ../../library/xmlrpc.client.rst:450 +#: ../../library/xmlrpc.client.rst:444 msgid "" "In the following example we're going to intentionally cause a :exc:" "`ProtocolError` by providing an invalid URI::" msgstr "" -#: ../../library/xmlrpc.client.rst:468 +#: ../../library/xmlrpc.client.rst:462 msgid "MultiCall Objects" msgstr "MultiCall 物件" -#: ../../library/xmlrpc.client.rst:470 +#: ../../library/xmlrpc.client.rst:464 msgid "" "The :class:`MultiCall` object provides a way to encapsulate multiple calls " "to a remote server into a single request [#]_." msgstr "" -#: ../../library/xmlrpc.client.rst:476 +#: ../../library/xmlrpc.client.rst:470 msgid "" "Create an object used to boxcar method calls. *server* is the eventual " "target of the call. Calls can be made to the result object, but they will " @@ -542,15 +531,15 @@ msgid "" "the individual results." msgstr "" -#: ../../library/xmlrpc.client.rst:484 +#: ../../library/xmlrpc.client.rst:478 msgid "A usage example of this class follows. The server code::" msgstr "" -#: ../../library/xmlrpc.client.rst:526 +#: ../../library/xmlrpc.client.rst:520 msgid "Convenience Functions" msgstr "" -#: ../../library/xmlrpc.client.rst:530 +#: ../../library/xmlrpc.client.rst:524 msgid "" "Convert *params* into an XML-RPC request. or into a response if " "*methodresponse* is true. *params* can be either a tuple of arguments or an " @@ -562,7 +551,7 @@ msgid "" "*allow_none*." msgstr "" -#: ../../library/xmlrpc.client.rst:541 +#: ../../library/xmlrpc.client.rst:535 msgid "" "Convert an XML-RPC request or response into Python objects, a ``(params, " "methodname)``. *params* is a tuple of argument; *methodname* is a string, " @@ -573,35 +562,35 @@ msgid "" "to be presented as :class:`bytes` objects; this flag is false by default." msgstr "" -#: ../../library/xmlrpc.client.rst:549 +#: ../../library/xmlrpc.client.rst:543 msgid "" "The obsolete *use_datetime* flag is similar to *use_builtin_types* but it " "applies only to date/time values." msgstr "" -#: ../../library/xmlrpc.client.rst:559 +#: ../../library/xmlrpc.client.rst:553 msgid "Example of Client Usage" msgstr "" -#: ../../library/xmlrpc.client.rst:576 +#: ../../library/xmlrpc.client.rst:570 msgid "" "To access an XML-RPC server through a HTTP proxy, you need to define a " "custom transport. The following example shows how::" msgstr "" -#: ../../library/xmlrpc.client.rst:601 +#: ../../library/xmlrpc.client.rst:595 msgid "Example of Client and Server Usage" msgstr "" -#: ../../library/xmlrpc.client.rst:603 +#: ../../library/xmlrpc.client.rst:597 msgid "See :ref:`simplexmlrpcserver-example`." msgstr "" -#: ../../library/xmlrpc.client.rst:607 +#: ../../library/xmlrpc.client.rst:601 msgid "Footnotes" msgstr "註解" -#: ../../library/xmlrpc.client.rst:608 +#: ../../library/xmlrpc.client.rst:602 msgid "" "This approach has been first presented in `a discussion on xmlrpc.com " "\n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -342,8 +342,8 @@ msgstr "" #: ../../library/zipfile.rst:291 msgid "" -":meth:`open` can now be used to write files into the archive with the " -"``mode='w'`` option." +":meth:`ZipFile.open` can now be used to write files into the archive with " +"the ``mode='w'`` option." msgstr "" #: ../../library/zipfile.rst:295 diff --git a/reference/expressions.po b/reference/expressions.po index 443f9bb2a4..07655223ff 100644 --- a/reference/expressions.po +++ b/reference/expressions.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.10\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2022-04-01 00:15+0000\n" +"POT-Creation-Date: 2022-05-21 17:35+0000\n" "PO-Revision-Date: 2018-05-23 16:17+0000\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -2003,8 +2003,8 @@ msgid "Subscription, slicing, call, attribute reference" msgstr "" #: ../../reference/expressions.rst:1894 -msgid ":keyword:`await` ``x``" -msgstr ":keyword:`await` ``x``" +msgid ":keyword:`await x `" +msgstr ":keyword:`await x `" #: ../../reference/expressions.rst:1896 msgid "``**``" @@ -2083,8 +2083,8 @@ msgid "Comparisons, including membership tests and identity tests" msgstr "" #: ../../reference/expressions.rst:1918 -msgid ":keyword:`not` ``x``" -msgstr ":keyword:`not` ``x``" +msgid ":keyword:`not x `" +msgstr ":keyword:`not x `" #: ../../reference/expressions.rst:1918 msgid "Boolean NOT" diff --git a/reference/lexical_analysis.po b/reference/lexical_analysis.po index 2d2371fbe9..e181a1a49b 100644 --- a/reference/lexical_analysis.po +++ b/reference/lexical_analysis.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.10\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2022-04-04 00:13+0000\n" +"POT-Creation-Date: 2022-05-21 17:35+0000\n" "PO-Revision-Date: 2018-05-23 16:17+0000\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -541,12 +541,15 @@ msgid "" "In plain English: Both types of literals can be enclosed in matching single " "quotes (``'``) or double quotes (``\"``). They can also be enclosed in " "matching groups of three single or double quotes (these are generally " -"referred to as *triple-quoted strings*). The backslash (``\\``) character " -"is used to escape characters that otherwise have a special meaning, such as " -"newline, backslash itself, or the quote character." +"referred to as *triple-quoted strings*). The backslash (``\\``) character is " +"used to give special meaning to otherwise ordinary characters like ``n``, " +"which means 'newline' when escaped (``\\n``). It can also be used to escape " +"characters that otherwise have a special meaning, such as newline, backslash " +"itself, or the quote character. See :ref:`escape sequences ` below for examples." msgstr "" -#: ../../reference/lexical_analysis.rst:491 +#: ../../reference/lexical_analysis.rst:493 msgid "" "Bytes literals are always prefixed with ``'b'`` or ``'B'``; they produce an " "instance of the :class:`bytes` type instead of the :class:`str` type. They " @@ -554,7 +557,7 @@ msgid "" "greater must be expressed with escapes." msgstr "" -#: ../../reference/lexical_analysis.rst:500 +#: ../../reference/lexical_analysis.rst:502 msgid "" "Both string and bytes literals may optionally be prefixed with a letter " "``'r'`` or ``'R'``; such strings are called :dfn:`raw strings` and treat " @@ -564,20 +567,20 @@ msgid "" "3.x's the ``'ur'`` syntax is not supported." msgstr "" -#: ../../reference/lexical_analysis.rst:507 +#: ../../reference/lexical_analysis.rst:509 msgid "" "The ``'rb'`` prefix of raw bytes literals has been added as a synonym of " "``'br'``." msgstr "" -#: ../../reference/lexical_analysis.rst:511 +#: ../../reference/lexical_analysis.rst:513 msgid "" "Support for the unicode legacy literal (``u'value'``) was reintroduced to " "simplify the maintenance of dual Python 2.x and 3.x codebases. See :pep:" "`414` for more information." msgstr "" -#: ../../reference/lexical_analysis.rst:520 +#: ../../reference/lexical_analysis.rst:522 msgid "" "A string literal with ``'f'`` or ``'F'`` in its prefix is a :dfn:`formatted " "string literal`; see :ref:`f-strings`. The ``'f'`` may be combined with " @@ -585,7 +588,7 @@ msgid "" "are possible, but formatted bytes literals are not." msgstr "" -#: ../../reference/lexical_analysis.rst:525 +#: ../../reference/lexical_analysis.rst:527 msgid "" "In triple-quoted literals, unescaped newlines and quotes are allowed (and " "are retained), except that three unescaped quotes in a row terminate the " @@ -593,214 +596,214 @@ msgid "" "either ``'`` or ``\"``.)" msgstr "" -#: ../../reference/lexical_analysis.rst:544 +#: ../../reference/lexical_analysis.rst:548 msgid "" "Unless an ``'r'`` or ``'R'`` prefix is present, escape sequences in string " "and bytes literals are interpreted according to rules similar to those used " "by Standard C. The recognized escape sequences are:" msgstr "" -#: ../../reference/lexical_analysis.rst:549 -#: ../../reference/lexical_analysis.rst:582 +#: ../../reference/lexical_analysis.rst:553 +#: ../../reference/lexical_analysis.rst:586 msgid "Escape Sequence" msgstr "" -#: ../../reference/lexical_analysis.rst:549 -#: ../../reference/lexical_analysis.rst:582 +#: ../../reference/lexical_analysis.rst:553 +#: ../../reference/lexical_analysis.rst:586 msgid "Meaning" msgstr "" -#: ../../reference/lexical_analysis.rst:549 -#: ../../reference/lexical_analysis.rst:582 +#: ../../reference/lexical_analysis.rst:553 +#: ../../reference/lexical_analysis.rst:586 msgid "Notes" msgstr "註解" -#: ../../reference/lexical_analysis.rst:551 +#: ../../reference/lexical_analysis.rst:555 msgid "``\\newline``" msgstr "``\\newline``" -#: ../../reference/lexical_analysis.rst:551 +#: ../../reference/lexical_analysis.rst:555 msgid "Backslash and newline ignored" msgstr "" -#: ../../reference/lexical_analysis.rst:553 +#: ../../reference/lexical_analysis.rst:557 msgid "``\\\\``" msgstr "``\\\\``" -#: ../../reference/lexical_analysis.rst:553 +#: ../../reference/lexical_analysis.rst:557 msgid "Backslash (``\\``)" msgstr "" -#: ../../reference/lexical_analysis.rst:555 +#: ../../reference/lexical_analysis.rst:559 msgid "``\\'``" msgstr "``\\'``" -#: ../../reference/lexical_analysis.rst:555 +#: ../../reference/lexical_analysis.rst:559 msgid "Single quote (``'``)" msgstr "" -#: ../../reference/lexical_analysis.rst:557 +#: ../../reference/lexical_analysis.rst:561 msgid "``\\\"``" msgstr "``\\\"``" -#: ../../reference/lexical_analysis.rst:557 +#: ../../reference/lexical_analysis.rst:561 msgid "Double quote (``\"``)" msgstr "" -#: ../../reference/lexical_analysis.rst:559 +#: ../../reference/lexical_analysis.rst:563 msgid "``\\a``" msgstr "``\\a``" -#: ../../reference/lexical_analysis.rst:559 +#: ../../reference/lexical_analysis.rst:563 msgid "ASCII Bell (BEL)" msgstr "" -#: ../../reference/lexical_analysis.rst:561 +#: ../../reference/lexical_analysis.rst:565 msgid "``\\b``" msgstr "``\\b``" -#: ../../reference/lexical_analysis.rst:561 +#: ../../reference/lexical_analysis.rst:565 msgid "ASCII Backspace (BS)" msgstr "" -#: ../../reference/lexical_analysis.rst:563 +#: ../../reference/lexical_analysis.rst:567 msgid "``\\f``" msgstr "``\\f``" -#: ../../reference/lexical_analysis.rst:563 +#: ../../reference/lexical_analysis.rst:567 msgid "ASCII Formfeed (FF)" msgstr "" -#: ../../reference/lexical_analysis.rst:565 +#: ../../reference/lexical_analysis.rst:569 msgid "``\\n``" msgstr "``\\n``" -#: ../../reference/lexical_analysis.rst:565 +#: ../../reference/lexical_analysis.rst:569 msgid "ASCII Linefeed (LF)" msgstr "" -#: ../../reference/lexical_analysis.rst:567 +#: ../../reference/lexical_analysis.rst:571 msgid "``\\r``" msgstr "``\\r``" -#: ../../reference/lexical_analysis.rst:567 +#: ../../reference/lexical_analysis.rst:571 msgid "ASCII Carriage Return (CR)" msgstr "" -#: ../../reference/lexical_analysis.rst:569 +#: ../../reference/lexical_analysis.rst:573 msgid "``\\t``" msgstr "``\\t``" -#: ../../reference/lexical_analysis.rst:569 +#: ../../reference/lexical_analysis.rst:573 msgid "ASCII Horizontal Tab (TAB)" msgstr "" -#: ../../reference/lexical_analysis.rst:571 +#: ../../reference/lexical_analysis.rst:575 msgid "``\\v``" msgstr "``\\v``" -#: ../../reference/lexical_analysis.rst:571 +#: ../../reference/lexical_analysis.rst:575 msgid "ASCII Vertical Tab (VT)" msgstr "" -#: ../../reference/lexical_analysis.rst:573 +#: ../../reference/lexical_analysis.rst:577 msgid "``\\ooo``" msgstr "``\\ooo``" -#: ../../reference/lexical_analysis.rst:573 +#: ../../reference/lexical_analysis.rst:577 msgid "Character with octal value *ooo*" msgstr "" -#: ../../reference/lexical_analysis.rst:573 +#: ../../reference/lexical_analysis.rst:577 msgid "(1,3)" msgstr "(1,3)" -#: ../../reference/lexical_analysis.rst:576 +#: ../../reference/lexical_analysis.rst:580 msgid "``\\xhh``" msgstr "``\\xhh``" -#: ../../reference/lexical_analysis.rst:576 +#: ../../reference/lexical_analysis.rst:580 msgid "Character with hex value *hh*" msgstr "" -#: ../../reference/lexical_analysis.rst:576 +#: ../../reference/lexical_analysis.rst:580 msgid "(2,3)" msgstr "(2,3)" -#: ../../reference/lexical_analysis.rst:579 +#: ../../reference/lexical_analysis.rst:583 msgid "Escape sequences only recognized in string literals are:" msgstr "" -#: ../../reference/lexical_analysis.rst:584 +#: ../../reference/lexical_analysis.rst:588 msgid "``\\N{name}``" msgstr "``\\N{name}``" -#: ../../reference/lexical_analysis.rst:584 +#: ../../reference/lexical_analysis.rst:588 msgid "Character named *name* in the Unicode database" msgstr "" -#: ../../reference/lexical_analysis.rst:584 +#: ../../reference/lexical_analysis.rst:588 msgid "\\(4)" msgstr "\\(4)" -#: ../../reference/lexical_analysis.rst:587 +#: ../../reference/lexical_analysis.rst:591 msgid "``\\uxxxx``" msgstr "``\\uxxxx``" -#: ../../reference/lexical_analysis.rst:587 +#: ../../reference/lexical_analysis.rst:591 msgid "Character with 16-bit hex value *xxxx*" msgstr "" -#: ../../reference/lexical_analysis.rst:587 +#: ../../reference/lexical_analysis.rst:591 msgid "\\(5)" msgstr "\\(5)" -#: ../../reference/lexical_analysis.rst:590 +#: ../../reference/lexical_analysis.rst:594 msgid "``\\Uxxxxxxxx``" msgstr "``\\Uxxxxxxxx``" -#: ../../reference/lexical_analysis.rst:590 +#: ../../reference/lexical_analysis.rst:594 msgid "Character with 32-bit hex value *xxxxxxxx*" msgstr "" -#: ../../reference/lexical_analysis.rst:590 +#: ../../reference/lexical_analysis.rst:594 msgid "\\(6)" msgstr "\\(6)" -#: ../../reference/lexical_analysis.rst:594 +#: ../../reference/lexical_analysis.rst:598 msgid "Notes:" msgstr "註解:" -#: ../../reference/lexical_analysis.rst:597 +#: ../../reference/lexical_analysis.rst:601 msgid "As in Standard C, up to three octal digits are accepted." msgstr "" -#: ../../reference/lexical_analysis.rst:600 +#: ../../reference/lexical_analysis.rst:604 msgid "Unlike in Standard C, exactly two hex digits are required." msgstr "" -#: ../../reference/lexical_analysis.rst:603 +#: ../../reference/lexical_analysis.rst:607 msgid "" "In a bytes literal, hexadecimal and octal escapes denote the byte with the " "given value. In a string literal, these escapes denote a Unicode character " "with the given value." msgstr "" -#: ../../reference/lexical_analysis.rst:608 +#: ../../reference/lexical_analysis.rst:612 msgid "Support for name aliases [#]_ has been added." msgstr "" -#: ../../reference/lexical_analysis.rst:612 +#: ../../reference/lexical_analysis.rst:616 msgid "Exactly four hex digits are required." msgstr "" -#: ../../reference/lexical_analysis.rst:615 +#: ../../reference/lexical_analysis.rst:619 msgid "" "Any Unicode character can be encoded this way. Exactly eight hex digits are " "required." msgstr "" -#: ../../reference/lexical_analysis.rst:621 +#: ../../reference/lexical_analysis.rst:625 msgid "" "Unlike Standard C, all unrecognized escape sequences are left in the string " "unchanged, i.e., *the backslash is left in the result*. (This behavior is " @@ -810,14 +813,14 @@ msgid "" "category of unrecognized escapes for bytes literals." msgstr "" -#: ../../reference/lexical_analysis.rst:628 +#: ../../reference/lexical_analysis.rst:632 msgid "" "Unrecognized escape sequences produce a :exc:`DeprecationWarning`. In a " "future Python version they will be a :exc:`SyntaxWarning` and eventually a :" "exc:`SyntaxError`." msgstr "" -#: ../../reference/lexical_analysis.rst:633 +#: ../../reference/lexical_analysis.rst:637 msgid "" "Even in a raw literal, quotes can be escaped with a backslash, but the " "backslash remains in the result; for example, ``r\"\\\"\"`` is a valid " @@ -830,11 +833,11 @@ msgid "" "continuation." msgstr "" -#: ../../reference/lexical_analysis.rst:646 +#: ../../reference/lexical_analysis.rst:650 msgid "String literal concatenation" msgstr "" -#: ../../reference/lexical_analysis.rst:648 +#: ../../reference/lexical_analysis.rst:652 msgid "" "Multiple adjacent string or bytes literals (delimited by whitespace), " "possibly using different quoting conventions, are allowed, and their meaning " @@ -844,7 +847,7 @@ msgid "" "lines, or even to add comments to parts of strings, for example::" msgstr "" -#: ../../reference/lexical_analysis.rst:659 +#: ../../reference/lexical_analysis.rst:663 msgid "" "Note that this feature is defined at the syntactical level, but implemented " "at compile time. The '+' operator must be used to concatenate string " @@ -854,11 +857,11 @@ msgid "" "with plain string literals." msgstr "" -#: ../../reference/lexical_analysis.rst:680 +#: ../../reference/lexical_analysis.rst:684 msgid "Formatted string literals" msgstr "" -#: ../../reference/lexical_analysis.rst:684 +#: ../../reference/lexical_analysis.rst:688 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 " @@ -867,14 +870,14 @@ msgid "" "are really expressions evaluated at run time." msgstr "" -#: ../../reference/lexical_analysis.rst:690 +#: ../../reference/lexical_analysis.rst:694 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:704 +#: ../../reference/lexical_analysis.rst:708 msgid "" "The parts of the string outside curly braces are treated literally, except " "that any doubled curly braces ``'{{'`` or ``'}}'`` are replaced with the " @@ -887,7 +890,7 @@ msgid "" "replacement field ends with a closing curly bracket ``'}'``." msgstr "" -#: ../../reference/lexical_analysis.rst:714 +#: ../../reference/lexical_analysis.rst:718 msgid "" "Expressions in formatted string literals are treated like regular Python " "expressions surrounded by parentheses, with a few exceptions. An empty " @@ -898,14 +901,14 @@ msgid "" "where the formatted string literal appears, in order from left to right." msgstr "" -#: ../../reference/lexical_analysis.rst:723 +#: ../../reference/lexical_analysis.rst:727 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:728 +#: ../../reference/lexical_analysis.rst:732 msgid "" "When the equal sign ``'='`` is provided, the output will have the expression " "text, the ``'='`` and the evaluated value. Spaces after the opening brace " @@ -916,18 +919,18 @@ msgid "" "r'`` is declared." msgstr "" -#: ../../reference/lexical_analysis.rst:736 +#: ../../reference/lexical_analysis.rst:740 msgid "The equal sign ``'='``." msgstr "" -#: ../../reference/lexical_analysis.rst:739 +#: ../../reference/lexical_analysis.rst:743 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:743 +#: ../../reference/lexical_analysis.rst:747 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 " @@ -936,7 +939,7 @@ msgid "" "whole string." msgstr "" -#: ../../reference/lexical_analysis.rst:749 +#: ../../reference/lexical_analysis.rst:753 msgid "" "Top-level format specifiers may include nested replacement fields. These " "nested fields may include their own conversion fields and :ref:`format " @@ -945,111 +948,111 @@ msgid "" "as that used by the :meth:`str.format` method." msgstr "" -#: ../../reference/lexical_analysis.rst:755 +#: ../../reference/lexical_analysis.rst:759 msgid "" "Formatted string literals may be concatenated, but replacement fields cannot " "be split across literals." msgstr "" -#: ../../reference/lexical_analysis.rst:758 +#: ../../reference/lexical_analysis.rst:762 msgid "Some examples of formatted string literals::" msgstr "" -#: ../../reference/lexical_analysis.rst:790 +#: ../../reference/lexical_analysis.rst:794 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:797 +#: ../../reference/lexical_analysis.rst:801 msgid "" "Backslashes are not allowed in format expressions and will raise an error::" msgstr "" -#: ../../reference/lexical_analysis.rst:802 +#: ../../reference/lexical_analysis.rst:806 msgid "" "To include a value in which a backslash escape is required, create a " "temporary variable." msgstr "" -#: ../../reference/lexical_analysis.rst:809 +#: ../../reference/lexical_analysis.rst:813 msgid "" "Formatted string literals cannot be used as docstrings, even if they do not " "include expressions." msgstr "" -#: ../../reference/lexical_analysis.rst:820 +#: ../../reference/lexical_analysis.rst:824 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:827 +#: ../../reference/lexical_analysis.rst:831 msgid "Numeric literals" msgstr "" -#: ../../reference/lexical_analysis.rst:833 +#: ../../reference/lexical_analysis.rst:837 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:837 +#: ../../reference/lexical_analysis.rst:841 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:851 +#: ../../reference/lexical_analysis.rst:855 msgid "Integer literals" msgstr "" -#: ../../reference/lexical_analysis.rst:853 +#: ../../reference/lexical_analysis.rst:857 msgid "Integer literals are described by the following lexical definitions:" msgstr "" -#: ../../reference/lexical_analysis.rst:867 +#: ../../reference/lexical_analysis.rst:871 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:870 +#: ../../reference/lexical_analysis.rst:874 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:874 +#: ../../reference/lexical_analysis.rst:878 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:878 +#: ../../reference/lexical_analysis.rst:882 msgid "Some examples of integer literals::" msgstr "" -#: ../../reference/lexical_analysis.rst:884 -#: ../../reference/lexical_analysis.rst:916 +#: ../../reference/lexical_analysis.rst:888 +#: ../../reference/lexical_analysis.rst:920 msgid "Underscores are now allowed for grouping purposes in literals." msgstr "" -#: ../../reference/lexical_analysis.rst:895 +#: ../../reference/lexical_analysis.rst:899 msgid "Floating point literals" msgstr "" -#: ../../reference/lexical_analysis.rst:897 +#: ../../reference/lexical_analysis.rst:901 msgid "" "Floating point literals are described by the following lexical definitions:" msgstr "" -#: ../../reference/lexical_analysis.rst:907 +#: ../../reference/lexical_analysis.rst:911 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 " @@ -1058,19 +1061,19 @@ msgid "" "grouping." msgstr "" -#: ../../reference/lexical_analysis.rst:912 +#: ../../reference/lexical_analysis.rst:916 msgid "Some examples of floating point literals::" msgstr "" -#: ../../reference/lexical_analysis.rst:925 +#: ../../reference/lexical_analysis.rst:929 msgid "Imaginary literals" msgstr "" -#: ../../reference/lexical_analysis.rst:927 +#: ../../reference/lexical_analysis.rst:931 msgid "Imaginary literals are described by the following lexical definitions:" msgstr "" -#: ../../reference/lexical_analysis.rst:932 +#: ../../reference/lexical_analysis.rst:936 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 " @@ -1079,23 +1082,23 @@ msgid "" "Some examples of imaginary literals::" msgstr "" -#: ../../reference/lexical_analysis.rst:944 +#: ../../reference/lexical_analysis.rst:948 msgid "Operators" msgstr "" -#: ../../reference/lexical_analysis.rst:948 +#: ../../reference/lexical_analysis.rst:952 msgid "The following tokens are operators:" msgstr "" -#: ../../reference/lexical_analysis.rst:961 +#: ../../reference/lexical_analysis.rst:965 msgid "Delimiters" msgstr "" -#: ../../reference/lexical_analysis.rst:965 +#: ../../reference/lexical_analysis.rst:969 msgid "The following tokens serve as delimiters in the grammar:" msgstr "" -#: ../../reference/lexical_analysis.rst:974 +#: ../../reference/lexical_analysis.rst:978 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 " @@ -1103,22 +1106,22 @@ msgid "" "as delimiters, but also perform an operation." msgstr "" -#: ../../reference/lexical_analysis.rst:979 +#: ../../reference/lexical_analysis.rst:983 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:986 +#: ../../reference/lexical_analysis.rst:990 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:995 +#: ../../reference/lexical_analysis.rst:999 msgid "Footnotes" msgstr "註解" -#: ../../reference/lexical_analysis.rst:996 +#: ../../reference/lexical_analysis.rst:1000 msgid "https://www.unicode.org/Public/11.0.0/ucd/NameAliases.txt" msgstr "https://www.unicode.org/Public/11.0.0/ucd/NameAliases.txt" diff --git a/tutorial/inputoutput.po b/tutorial/inputoutput.po index 4720224d5c..fdf622a676 100644 --- a/tutorial/inputoutput.po +++ b/tutorial/inputoutput.po @@ -9,8 +9,8 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.10\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2021-09-13 00:11+0000\n" -"PO-Revision-Date: 2021-06-27 20:51+0800\n" +"POT-Creation-Date: 2022-05-21 17:35+0000\n" +"PO-Revision-Date: 2022-05-22 02:40+0800\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" "tw)\n" @@ -19,7 +19,7 @@ msgstr "" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" "Plural-Forms: nplurals=1; plural=0;\n" -"X-Generator: Poedit 2.4.3\n" +"X-Generator: Poedit 3.0.1\n" #: ../../tutorial/inputoutput.rst:5 msgid "Input and Output" @@ -355,12 +355,13 @@ msgstr "讀寫檔案" #: ../../tutorial/inputoutput.rst:281 msgid "" ":func:`open` returns a :term:`file object`, and is most commonly used with " -"two arguments: ``open(filename, mode)``." +"two positional arguments and one keyword argument: ``open(filename, mode, " +"encoding=None)``" msgstr "" -":func:`open` 回傳一個 :term:`file object`\\ ,而它最常使用的兩個引數是:\\ " -"``open(filename, mode)``。" +":func:`open` 回傳一個 :term:`file object`\\ ,而它最常使用的兩個位置引數和一" +"個關鍵字引數是:\\ ``open(filename, mode, encoding=None)``" -#: ../../tutorial/inputoutput.rst:293 +#: ../../tutorial/inputoutput.rst:294 msgid "" "The first argument is a string containing the filename. The second argument " "is another string containing a few characters describing the way in which " @@ -378,21 +379,25 @@ msgstr "" "``'r+'`` 可以開啟檔案並進行讀取和寫入。\\ *mode* 引數是選擇性的,若省略時會預" "設為 ``'r'``。" -#: ../../tutorial/inputoutput.rst:302 +#: ../../tutorial/inputoutput.rst:303 msgid "" "Normally, files are opened in :dfn:`text mode`, that means, you read and " "write strings from and to the file, which are encoded in a specific " -"encoding. If encoding is not specified, the default is platform dependent " -"(see :func:`open`). ``'b'`` appended to the mode opens the file in :dfn:" -"`binary mode`: now the data is read and written in the form of bytes " -"objects. This mode should be used for all files that don't contain text." +"*encoding*. If *encoding* is not specified, the default is platform " +"dependent (see :func:`open`). Because UTF-8 is the modern de-facto standard, " +"``encoding=\"utf-8\"`` is recommended unless you know that you need to use a " +"different encoding. Appending a ``'b'`` to the mode opens the file in :dfn:" +"`binary mode`. Binary mode data is read and written as :class:`bytes` " +"objects. You can not specify *encoding* when opening file in binary mode." msgstr "" "通常,檔案以 :dfn:`text mode` 開啟,意即,從檔案中讀取或寫入字串時,都以特定" -"編碼方式進行編碼。如未指定編碼方式,則預設值會取決於系統平台(見 :func:`open`" -"\\ )。在 mode 加上 ``'b'`` 會以 :dfn:`binary mode` 開啟檔案:此時,資料以位" -"元組串物件 (bytes object) 的形式被讀寫。此模式應該使用於所有不含文字的檔案。" +"編碼方式 *encoding* 進行編碼。如未指定 *encoding*\\ ,則預設值會取決於系統平" +"台(見 :func:`open`\\ )。因為 UTF-8 是現時的標準,除非你很清楚該用什麼編碼," +"否則推薦使用 ``encoding=\"utf-8\"``\\ 。在 mode 後面加上 ``'b'`` 會以 :dfn:" +"`binary mode`\\ (二進制模式)開啟檔案,二進制模式資料以 :class:`bytes` 物件" +"的形式被讀寫。以二進制模式開啟檔案時不可以指定 *encoding*\\ 。" -#: ../../tutorial/inputoutput.rst:309 +#: ../../tutorial/inputoutput.rst:313 msgid "" "In text mode, the default when reading is to convert platform-specific line " "endings (``\\n`` on Unix, ``\\r\\n`` on Windows) to just ``\\n``. When " @@ -408,7 +413,7 @@ msgstr "" "字檔案來說沒有問題,但會毀壞像是 :file:`JPEG` 或 :file:`EXE` 檔案中的二進制資" "料。在讀寫此類檔案時,注意一定要使用二進制模式。" -#: ../../tutorial/inputoutput.rst:317 +#: ../../tutorial/inputoutput.rst:321 msgid "" "It is good practice to use the :keyword:`with` keyword when dealing with " "file objects. The advantage is that the file is properly closed after its " @@ -422,7 +427,7 @@ msgstr "" "\n" "::" -#: ../../tutorial/inputoutput.rst:330 +#: ../../tutorial/inputoutput.rst:334 msgid "" "If you're not using the :keyword:`with` keyword, then you should call ``f." "close()`` to close the file and immediately free up any system resources " @@ -431,7 +436,7 @@ msgstr "" "如果你沒有使用 :keyword:`with` 關鍵字,則應呼叫 ``f.close()`` 關閉檔案,可以" "立即釋放被它所使用的系統資源。" -#: ../../tutorial/inputoutput.rst:335 +#: ../../tutorial/inputoutput.rst:339 msgid "" "Calling ``f.write()`` without using the :keyword:`!with` keyword or calling " "``f.close()`` **might** result in the arguments of ``f.write()`` not being " @@ -441,7 +446,7 @@ msgstr "" "即使程式成功退出,也\\ **可能**\\ 導致 ``f.write()`` 的引數沒有被完全寫入硬" "碟。" -#: ../../tutorial/inputoutput.rst:343 +#: ../../tutorial/inputoutput.rst:347 msgid "" "After a file object is closed, either by a :keyword:`with` statement or by " "calling ``f.close()``, attempts to use the file object will automatically " @@ -452,17 +457,17 @@ msgstr "" "\n" "::" -#: ../../tutorial/inputoutput.rst:357 +#: ../../tutorial/inputoutput.rst:361 msgid "Methods of File Objects" msgstr "檔案物件的 method" -#: ../../tutorial/inputoutput.rst:359 +#: ../../tutorial/inputoutput.rst:363 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:366 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 +487,7 @@ msgstr "" "\n" "::" -#: ../../tutorial/inputoutput.rst:376 +#: ../../tutorial/inputoutput.rst:380 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 +503,7 @@ msgstr "" "\n" "::" -#: ../../tutorial/inputoutput.rst:390 +#: ../../tutorial/inputoutput.rst:394 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 +513,7 @@ msgstr "" "\n" "::" -#: ../../tutorial/inputoutput.rst:399 +#: ../../tutorial/inputoutput.rst:403 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 +521,7 @@ msgstr "" "如果你想把一個檔案的所有行讀進一個 list 裡,可以用 ``list(f)`` 或 ``f." "readlines()``。" -#: ../../tutorial/inputoutput.rst:402 +#: ../../tutorial/inputoutput.rst:406 msgid "" "``f.write(string)`` writes the contents of *string* to the file, returning " "the number of characters written. ::" @@ -525,7 +530,7 @@ msgstr "" "\n" "::" -#: ../../tutorial/inputoutput.rst:408 +#: ../../tutorial/inputoutput.rst:412 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 +540,7 @@ msgstr "" "\n" "::" -#: ../../tutorial/inputoutput.rst:416 +#: ../../tutorial/inputoutput.rst:420 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 +549,7 @@ msgstr "" "``f.tell()`` 回傳一個整數,它給出檔案物件在檔案中的當前位置,在二進制模式下表" "示為檔案開始至今的位元組數,在文字模式下表示為一個意義不明的數字。" -#: ../../tutorial/inputoutput.rst:420 +#: ../../tutorial/inputoutput.rst:424 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 +566,7 @@ msgstr "" "\n" "::" -#: ../../tutorial/inputoutput.rst:439 +#: ../../tutorial/inputoutput.rst:443 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 +579,7 @@ msgstr "" "的值,或是 0,才是有效的 *offset* 值。其他任何 *offset* 值都會產生未定義的行" "為。" -#: ../../tutorial/inputoutput.rst:445 +#: ../../tutorial/inputoutput.rst:449 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 +588,11 @@ msgstr "" "檔案物件還有一些附加的 method,像是較不常使用的 :meth:`~file.isatty` 和 :" "meth:`~file.truncate`\\ ;檔案物件的完整指南詳見程式庫參考手冊。" -#: ../../tutorial/inputoutput.rst:453 +#: ../../tutorial/inputoutput.rst:457 msgid "Saving structured data with :mod:`json`" msgstr "使用 :mod:`json` 儲存結構化資料" -#: ../../tutorial/inputoutput.rst:457 +#: ../../tutorial/inputoutput.rst:461 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 +606,7 @@ msgstr "" "樣的字串,並回傳數值 123。當你想儲存像是巢狀 list 和 dictionary(字典)等複雜" "的資料類型時,手動剖析 (parsing) 和序列化 (serializing) 就變得複雜。" -#: ../../tutorial/inputoutput.rst:464 +#: ../../tutorial/inputoutput.rst:468 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 +625,7 @@ msgstr "" "料則稱為 :dfn:`deserializing`\\ (反序列化)。在序列化和反序列化之間,表示物" "件的字串可以被儲存在檔案或資料中,或通過網路連接發送到遠端的機器。" -#: ../../tutorial/inputoutput.rst:475 +#: ../../tutorial/inputoutput.rst:479 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 +634,7 @@ msgstr "" "JSON 格式經常地使用於現代應用程式的資料交換。許多程序設計師早已對它耳熟能詳," "使它成為提升互操作性 (interoperability) 的好選擇。" -#: ../../tutorial/inputoutput.rst:479 +#: ../../tutorial/inputoutput.rst:483 msgid "" "If you have an object ``x``, you can view its JSON string representation " "with a simple line of code::" @@ -638,7 +643,7 @@ msgstr "" "\n" "::" -#: ../../tutorial/inputoutput.rst:487 +#: ../../tutorial/inputoutput.rst:491 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,17 +655,23 @@ msgstr "" "\n" "::" -#: ../../tutorial/inputoutput.rst:493 +#: ../../tutorial/inputoutput.rst:497 msgid "" -"To decode the object again, if ``f`` is a :term:`text file` object which has " -"been opened for reading::" +"To decode the object again, if ``f`` is a :term:`binary file` or :term:`text " +"file` object which has been opened for reading::" msgstr "" -"若 ``f`` 是一個已開啟、可讀取的 :term:`text file` 物件,要再次解碼物件的" -"話:\n" +"若 ``f`` 是一個已開啟、可讀取的 :term:`binary file` 或 :term:`text file` 物" +"件,要再次解碼物件的話:\n" "\n" "::" -#: ../../tutorial/inputoutput.rst:498 +#: ../../tutorial/inputoutput.rst:503 +msgid "" +"JSON files must be encoded in UTF-8. Use ``encoding=\"utf-8\"`` when opening " +"JSON file as a :term:`text file` for both of reading and writing." +msgstr "" + +#: ../../tutorial/inputoutput.rst:506 msgid "" "This simple serialization technique can handle lists and dictionaries, but " "serializing arbitrary class instances in JSON requires a bit of extra " @@ -671,11 +682,11 @@ msgstr "" "class(類別)實例,則需要一些額外的工作。\\ :mod:`json` 模組的參考資料包含對" "此的說明。" -#: ../../tutorial/inputoutput.rst:504 +#: ../../tutorial/inputoutput.rst:512 msgid ":mod:`pickle` - the pickle module" msgstr ":mod:`pickle` - pickle 模組" -#: ../../tutorial/inputoutput.rst:506 +#: ../../tutorial/inputoutput.rst:514 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/modules.po b/tutorial/modules.po index 9483cf5aa1..3c56c5fe69 100644 --- a/tutorial/modules.po +++ b/tutorial/modules.po @@ -11,8 +11,8 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.10\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2022-04-18 00:15+0000\n" -"PO-Revision-Date: 2022-04-21 17:56+0800\n" +"POT-Creation-Date: 2022-05-21 17:35+0000\n" +"PO-Revision-Date: 2022-05-22 02:31+0800\n" "Last-Translator: Phil Lin \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" "tw)\n" @@ -278,21 +278,23 @@ msgstr "模組的搜尋路徑" #: ../../tutorial/modules.rst:185 msgid "" "When a module named :mod:`spam` is imported, the interpreter first searches " -"for a built-in module with that name. If not found, it then searches for a " -"file named :file:`spam.py` in a list of directories given by the variable :" -"data:`sys.path`. :data:`sys.path` is initialized from these locations:" +"for a built-in module with that name. These module names are listed in :data:" +"`sys.builtin_module_names`. If not found, it then searches for a file named :" +"file:`spam.py` in a list of directories given by the variable :data:`sys." +"path`. :data:`sys.path` is initialized from these locations:" msgstr "" "Import 一個名為 :mod:`spam` 的模組時,直譯器首先會搜尋具有該名稱的內建模組。" -"如果找不到,接下來會在變數 :data:`sys.path` 所給定的資料夾清單之中,搜尋一個" -"名為 :file:`spam.py` 的檔案。\\ :data:`sys.path` 從這些位置開始進行初始化:" +"模組名稱列在 :data:`sys.builtin_module_names` 當中。如果找不到,接下來會在變" +"數 :data:`sys.path` 所給定的資料夾清單之中,搜尋一個名為 :file:`spam.py` 的檔" +"案。\\ :data:`sys.path` 從這些位置開始進行初始化:" -#: ../../tutorial/modules.rst:190 +#: ../../tutorial/modules.rst:191 msgid "" "The directory containing the input script (or the current directory when no " "file is specified)." msgstr "輸入腳本所位在的資料夾(如未指定檔案時,則是當前資料夾)。" -#: ../../tutorial/modules.rst:192 +#: ../../tutorial/modules.rst:193 msgid "" ":envvar:`PYTHONPATH` (a list of directory names, with the same syntax as the " "shell variable :envvar:`PATH`)." @@ -300,7 +302,7 @@ msgstr "" ":envvar:`PYTHONPATH`\\ (一連串和 shell 變數 :envvar:`PATH` 的語法相同的資料" "夾名稱)。" -#: ../../tutorial/modules.rst:194 +#: ../../tutorial/modules.rst:195 msgid "" "The installation-dependent default (by convention including a ``site-" "packages`` directory, handled by the :mod:`site` module)." @@ -308,7 +310,7 @@ msgstr "" "與安裝相關的預設值(按慣例會包含一個 ``site-packages`` 資料夾,它是由 :mod:" "`site` 模組所處理)。" -#: ../../tutorial/modules.rst:198 +#: ../../tutorial/modules.rst:199 msgid "" "On file systems which support symlinks, the directory containing the input " "script is calculated after the symlink is followed. In other words the " @@ -318,7 +320,7 @@ msgstr "" "後才被計算的。換言之,包含符號連結的資料夾\\ **並沒有**\\ 增加到模組的搜尋路" "徑中。" -#: ../../tutorial/modules.rst:202 +#: ../../tutorial/modules.rst:203 msgid "" "After initialization, Python programs can modify :data:`sys.path`. The " "directory containing the script being run is placed at the beginning of the " @@ -332,11 +334,11 @@ msgstr "" "而不是函式庫資料夾中相同名稱的模組。除非是有意要做這樣的替換,否則這是一個錯" "誤。 請參見\\ :ref:`tut-standardmodules`\\ 以瞭解更多資訊。" -#: ../../tutorial/modules.rst:213 +#: ../../tutorial/modules.rst:214 msgid "\"Compiled\" Python files" msgstr "「編譯」Python 檔案" -#: ../../tutorial/modules.rst:215 +#: ../../tutorial/modules.rst:216 msgid "" "To speed up loading modules, Python caches the compiled version of each " "module in the ``__pycache__`` directory under the name :file:`module." @@ -352,7 +354,7 @@ msgstr "" "spam.py 的編譯版本將被暫存為 ``__pycache__/spam.cpython-33.pyc``\\ 。此命名準" "則可以讓來自不同版本的編譯模組和 Python 的不同版本同時共存。" -#: ../../tutorial/modules.rst:223 +#: ../../tutorial/modules.rst:224 msgid "" "Python checks the modification date of the source against the compiled " "version to see if it's out of date and needs to be recompiled. This is a " @@ -364,7 +366,7 @@ msgstr "" "完全自動的過程。另外,編譯後的模組獨立於平台,因此不同架構的作業系統之間可以" "共用同一函式庫。" -#: ../../tutorial/modules.rst:228 +#: ../../tutorial/modules.rst:229 msgid "" "Python does not check the cache in two circumstances. First, it always " "recompiles and does not store the result for the module that's loaded " @@ -377,11 +379,11 @@ msgstr "" "列載入的模組的結果。第二,如果沒有源模組,則不會檢查快取。要支援非源模組(僅" "編譯)的發布,編譯後的模組必須位於原始資料夾中,並且不能有源模組。" -#: ../../tutorial/modules.rst:235 +#: ../../tutorial/modules.rst:236 msgid "Some tips for experts:" msgstr "一些給專家的秘訣:" -#: ../../tutorial/modules.rst:237 +#: ../../tutorial/modules.rst:238 msgid "" "You can use the :option:`-O` or :option:`-OO` switches on the Python command " "to reduce the size of a compiled module. The ``-O`` switch removes assert " @@ -397,7 +399,7 @@ msgstr "" "只有在您知道自己在做什麼時,才應使用此參數。「已優化」模組有 ``opt-`` 標記," "且通常較小。未來的版本可能會改變優化的效果。" -#: ../../tutorial/modules.rst:245 +#: ../../tutorial/modules.rst:246 msgid "" "A program doesn't run any faster when it is read from a ``.pyc`` file than " "when it is read from a ``.py`` file; the only thing that's faster about ``." @@ -406,23 +408,23 @@ msgstr "" "讀取 ``.pyc`` 檔案時,程式的執行速度並不會比讀取 ``.py`` 檔案快。唯一比較快的" "地方是載入的速度。" -#: ../../tutorial/modules.rst:249 +#: ../../tutorial/modules.rst:250 msgid "" "The module :mod:`compileall` can create .pyc files for all modules in a " "directory." msgstr "模組 :mod:`compileall` 可以為資料夾中的所有模組創建 .pyc 檔。" -#: ../../tutorial/modules.rst:252 +#: ../../tutorial/modules.rst:253 msgid "" "There is more detail on this process, including a flow chart of the " "decisions, in :pep:`3147`." msgstr "更多的細節,包括決策流程圖,請參考\\ :pep:`3147`\\ 。" -#: ../../tutorial/modules.rst:259 +#: ../../tutorial/modules.rst:260 msgid "Standard Modules" msgstr "標準模組" -#: ../../tutorial/modules.rst:263 +#: ../../tutorial/modules.rst:264 msgid "" "Python comes with a library of standard modules, described in a separate " "document, the Python Library Reference (\"Library Reference\" hereafter). " @@ -446,13 +448,13 @@ msgstr "" "\n" "::" -#: ../../tutorial/modules.rst:286 +#: ../../tutorial/modules.rst:287 msgid "" "These two variables are only defined if the interpreter is in interactive " "mode." msgstr "只有直譯器在互動模式時,才需要定義這兩個變數。" -#: ../../tutorial/modules.rst:288 +#: ../../tutorial/modules.rst:289 msgid "" "The variable ``sys.path`` is a list of strings that determines the " "interpreter's search path for modules. It is initialized to a default path " @@ -466,11 +468,11 @@ msgstr "" "\n" "::" -#: ../../tutorial/modules.rst:301 +#: ../../tutorial/modules.rst:302 msgid "The :func:`dir` Function" msgstr ":func:`dir` 函式" -#: ../../tutorial/modules.rst:303 +#: ../../tutorial/modules.rst:304 msgid "" "The built-in function :func:`dir` is used to find out which names a module " "defines. It returns a sorted list of strings::" @@ -480,7 +482,7 @@ msgstr "" "\n" "::" -#: ../../tutorial/modules.rst:332 +#: ../../tutorial/modules.rst:333 msgid "" "Without arguments, :func:`dir` lists the names you have defined currently::" msgstr "" @@ -488,12 +490,12 @@ msgstr "" "\n" "::" -#: ../../tutorial/modules.rst:340 +#: ../../tutorial/modules.rst:341 msgid "" "Note that it lists all types of names: variables, modules, functions, etc." msgstr "請注意,它列出所有類型的名稱:變數、模組、函式等。" -#: ../../tutorial/modules.rst:344 +#: ../../tutorial/modules.rst:345 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:" @@ -504,11 +506,11 @@ msgstr "" "\n" "::" -#: ../../tutorial/modules.rst:383 +#: ../../tutorial/modules.rst:384 msgid "Packages" msgstr "套件 (Package)" -#: ../../tutorial/modules.rst:385 +#: ../../tutorial/modules.rst:386 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 " @@ -523,7 +525,7 @@ msgstr "" "的作者不需擔心與其他模組的全域變數名稱重複,點分隔模組名稱的使用,也讓多模組" "套件(像 NumPy 或 Pillow)的作者們不須擔心其他套件的模組名稱。" -#: ../../tutorial/modules.rst:393 +#: ../../tutorial/modules.rst:394 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 " @@ -545,13 +547,13 @@ msgstr "" "一系列無止盡的模組來執行這些作業。以下是你的套件可能的架構(以階層式檔案系統" "的方式表示):" -#: ../../tutorial/modules.rst:430 +#: ../../tutorial/modules.rst:431 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:433 +#: ../../tutorial/modules.rst:434 msgid "" "The :file:`__init__.py` files are required to make Python treat directories " "containing the file as packages. This prevents directories with a common " @@ -565,7 +567,7 @@ msgstr "" "尋路徑中的有效模組。在最簡單的情況,\\ :file:`__init__.py` 可以只是一個空白檔" "案;但它也可以執行套件的初始化程式碼,或設置 ``__all__`` 變數,之後會詳述。" -#: ../../tutorial/modules.rst:440 +#: ../../tutorial/modules.rst:441 msgid "" "Users of the package can import individual modules from the package, for " "example::" @@ -574,7 +576,7 @@ msgstr "" "\n" "::" -#: ../../tutorial/modules.rst:445 +#: ../../tutorial/modules.rst:446 msgid "" "This loads the submodule :mod:`sound.effects.echo`. It must be referenced " "with its full name. ::" @@ -583,14 +585,14 @@ msgstr "" "\n" "::" -#: ../../tutorial/modules.rst:450 +#: ../../tutorial/modules.rst:451 msgid "An alternative way of importing the submodule is::" msgstr "" "另一種 import 子模組的方法是:\n" "\n" "::" -#: ../../tutorial/modules.rst:454 +#: ../../tutorial/modules.rst:455 msgid "" "This also loads the submodule :mod:`echo`, and makes it available without " "its package prefix, so it can be used as follows::" @@ -600,7 +602,7 @@ msgstr "" "\n" "::" -#: ../../tutorial/modules.rst:459 +#: ../../tutorial/modules.rst:460 msgid "" "Yet another variation is to import the desired function or variable " "directly::" @@ -609,7 +611,7 @@ msgstr "" "\n" "::" -#: ../../tutorial/modules.rst:463 +#: ../../tutorial/modules.rst:464 msgid "" "Again, this loads the submodule :mod:`echo`, but this makes its function :" "func:`echofilter` directly available::" @@ -619,7 +621,7 @@ msgstr "" "\n" "::" -#: ../../tutorial/modules.rst:468 +#: ../../tutorial/modules.rst:469 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 " @@ -633,7 +635,7 @@ msgstr "" "陳述式首先測試套件中有沒有定義該 item;如果沒有,則會假設它是模組,並嘗試載" "入。如果還是找不到 item,則會引發 :exc:`ImportError` 例外。" -#: ../../tutorial/modules.rst:475 +#: ../../tutorial/modules.rst:476 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 " @@ -644,11 +646,11 @@ msgstr "" "一項都必須是套件;最後一項可以是模組或套件,但不能是前一項中定義的 class、函" "式或變數。" -#: ../../tutorial/modules.rst:484 +#: ../../tutorial/modules.rst:485 msgid "Importing \\* From a Package" msgstr "從套件中 import \\*" -#: ../../tutorial/modules.rst:488 +#: ../../tutorial/modules.rst:489 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 " @@ -661,7 +663,7 @@ msgstr "" "會花費較長的時間,且 import 子模組的過程可能會有不必要的副作用,這些副作用只" "有在明確地 import 子模組時才會發生。" -#: ../../tutorial/modules.rst:494 +#: ../../tutorial/modules.rst:495 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: " @@ -682,7 +684,7 @@ msgstr "" "\n" "::" -#: ../../tutorial/modules.rst:506 +#: ../../tutorial/modules.rst:507 msgid "" "This would mean that ``from sound.effects import *`` would import the three " "named submodules of the :mod:`sound.effects` package." @@ -690,7 +692,7 @@ msgstr "" "意思是,\\ ``from sound.effects import *`` 將會 import :mod:`sound.effects` " "套件中,這三個被提名的子模組。" -#: ../../tutorial/modules.rst:509 +#: ../../tutorial/modules.rst:510 msgid "" "If ``__all__`` is not defined, the statement ``from sound.effects import *`` " "does *not* import all submodules from the package :mod:`sound.effects` into " @@ -711,7 +713,7 @@ msgstr "" "\n" "::" -#: ../../tutorial/modules.rst:522 +#: ../../tutorial/modules.rst:523 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` " @@ -722,7 +724,7 @@ msgstr "" "`surround` 模組被 import 進當前的命名空間,因為它們是在 :mod:`sound.effects` " "套件裡定義的。(當 ``__all__`` 有被定義時,這規則也有效。)" -#: ../../tutorial/modules.rst:527 +#: ../../tutorial/modules.rst:528 msgid "" "Although certain modules are designed to export only names that follow " "certain patterns when you use ``import *``, it is still considered bad " @@ -731,7 +733,7 @@ msgstr "" "雖然,有些特定模組的設計,讓你使用 ``import *`` 時,該模組只會輸出遵循特定樣" "式的名稱,但在正式環境 (production) 的程式碼中這仍然被視為是不良習慣。" -#: ../../tutorial/modules.rst:531 +#: ../../tutorial/modules.rst:532 msgid "" "Remember, there is nothing wrong with using ``from package import " "specific_submodule``! In fact, this is the recommended notation unless the " @@ -741,11 +743,11 @@ msgstr "" "記住,使用 ``from package import specific_submodule`` 不會有任何問題!實際" "上,這是推薦用法,除非 import 的模組需要用到的子模組和其他套件的子模組同名。" -#: ../../tutorial/modules.rst:540 +#: ../../tutorial/modules.rst:541 msgid "Intra-package References" msgstr "套件內引用" -#: ../../tutorial/modules.rst:542 +#: ../../tutorial/modules.rst:543 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 " @@ -758,7 +760,7 @@ msgstr "" "filters.vocoder` 模組中使用 :mod:`sound.effects` 中的 :mod:`echo` 模組時,可" "以用 ``from sound.effects import echo``\\ 。" -#: ../../tutorial/modules.rst:548 +#: ../../tutorial/modules.rst:549 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 " @@ -771,7 +773,7 @@ msgstr "" "\n" "::" -#: ../../tutorial/modules.rst:557 +#: ../../tutorial/modules.rst:558 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 " @@ -782,11 +784,11 @@ msgstr "" "\"__main__\"``\\ ,所以如果一個模組預期被用作 Python 應用程式的主模組,那它必" "須永遠使用絕對 import。" -#: ../../tutorial/modules.rst:563 +#: ../../tutorial/modules.rst:564 msgid "Packages in Multiple Directories" msgstr "多目錄中的套件" -#: ../../tutorial/modules.rst:565 +#: ../../tutorial/modules.rst:566 msgid "" "Packages support one more special attribute, :attr:`__path__`. This is " "initialized to be a list containing the name of the directory holding the " @@ -799,17 +801,17 @@ msgstr "" "執行之前。這個變數可以被修改,但這樣做會影響將來對套件內的模組和子套件的搜" "尋。" -#: ../../tutorial/modules.rst:571 +#: ../../tutorial/modules.rst:572 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:576 +#: ../../tutorial/modules.rst:577 msgid "Footnotes" msgstr "註解" -#: ../../tutorial/modules.rst:577 +#: ../../tutorial/modules.rst:578 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/stdlib.po b/tutorial/stdlib.po index 5f31b9bbb2..35285615a3 100644 --- a/tutorial/stdlib.po +++ b/tutorial/stdlib.po @@ -14,7 +14,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.10\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2022-04-04 00:13+0000\n" +"POT-Creation-Date: 2022-05-21 17:35+0000\n" "PO-Revision-Date: 2022-01-31 18:14+0800\n" "Last-Translator: Phil Lin \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -346,7 +346,7 @@ msgstr "" #: ../../tutorial/stdlib.rst:329 msgid "" "The :mod:`xmlrpc.client` and :mod:`xmlrpc.server` modules make implementing " -"remote procedure calls into an almost trivial task. Despite the modules " +"remote procedure calls into an almost trivial task. Despite the modules' " "names, no direct knowledge or handling of XML is needed." msgstr "" "使用 :mod:`xmlrpc.client` 和 :mod:`xmlrpc.server` 模組使實作遠端程序呼叫變得" diff --git a/using/mac.po b/using/mac.po index 50a8802fb7..13bc9f7c00 100644 --- a/using/mac.po +++ b/using/mac.po @@ -10,7 +10,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.10\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2021-09-24 00:11+0000\n" +"POT-Creation-Date: 2022-05-21 17:35+0000\n" "PO-Revision-Date: 2022-02-12 19:12+0800\n" "Last-Translator: Matt Wang \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -323,10 +323,10 @@ msgstr "於 Mac 上發行 Python 應用程式" msgid "" "The standard tool for deploying standalone Python applications on the Mac " "is :program:`py2app`. More information on installing and using py2app can be " -"found at http://undefined.org/python/#py2app." +"found at https://pypi.org/project/py2app/." msgstr "" "在 Mac 上部署獨立 Python 應用程式的標準工具是 :program:`py2app`\\ 。有關安裝" -"和使用 py2app 的更多資訊,請參考 http://undefined.org/python/#py2app\\ 。" +"和使用 py2app 的更多資訊,請參考 https://pypi.org/project/py2app/\\ 。" #: ../../using/mac.rst:167 msgid "Other Resources" diff --git a/using/windows.po b/using/windows.po index 4fde2d2a22..6b6fd50e7c 100644 --- a/using/windows.po +++ b/using/windows.po @@ -9,7 +9,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.10\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2022-04-05 00:13+0000\n" +"POT-Creation-Date: 2022-05-21 17:35+0000\n" "PO-Revision-Date: 2018-05-23 16:19+0000\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -89,7 +89,6 @@ msgid "The full installer" msgstr "" #: ../../using/windows.rst:55 -#, fuzzy msgid "Installation steps" msgstr "安裝步驟" @@ -703,10 +702,10 @@ msgid "" "a subdirectory. By default, the subdirectory is named the same as the " "package, and without the ``-ExcludeVersion`` option this name will include " "the specific version installed. Inside the subdirectory is a ``tools`` " -"directory that contains the Python installation::" +"directory that contains the Python installation:" msgstr "" -#: ../../using/windows.rst:387 +#: ../../using/windows.rst:389 msgid "" "In general, nuget packages are not upgradeable, and newer versions should be " "installed side-by-side and referenced using the full path. Alternatively, " @@ -714,7 +713,7 @@ msgid "" "will do this automatically if they do not preserve files between builds." msgstr "" -#: ../../using/windows.rst:392 +#: ../../using/windows.rst:394 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+" @@ -722,7 +721,7 @@ msgid "" "automatically use the headers and import libraries in your build." msgstr "" -#: ../../using/windows.rst:397 +#: ../../using/windows.rst:399 msgid "" "The package information pages on nuget.org are `www.nuget.org/packages/" "python `_ for the 64-bit version and " @@ -730,18 +729,18 @@ msgid "" "pythonx86>`_ for the 32-bit version." msgstr "" -#: ../../using/windows.rst:406 +#: ../../using/windows.rst:408 msgid "The embeddable package" msgstr "" -#: ../../using/windows.rst:410 +#: ../../using/windows.rst:412 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:416 msgid "" "When extracted, the embedded distribution is (almost) fully isolated from " "the user's system, including environment variables, system registry " @@ -752,17 +751,17 @@ msgid "" "documentation are not included." msgstr "" -#: ../../using/windows.rst:423 +#: ../../using/windows.rst:425 msgid "" "The embedded distribution does not include the `Microsoft C Runtime `_ and it is the " -"responsibility of the application installer to provide this. The runtime may " -"have already been installed on a user's system previously or automatically " -"via Windows Update, and can be detected by finding ``ucrtbase.dll`` in the " -"system directory." +"docs.microsoft.com/en-US/cpp/windows/latest-supported-vc-redist#visual-" +"studio-2015-2017-2019-and-2022>`_ and it is the responsibility of the " +"application installer to provide this. The runtime may have already been " +"installed on a user's system previously or automatically via Windows Update, " +"and can be detected by finding ``ucrtbase.dll`` in the system directory." msgstr "" -#: ../../using/windows.rst:430 +#: ../../using/windows.rst:432 msgid "" "Third-party packages should be installed by the application installer " "alongside the embedded distribution. Using pip to manage dependencies as for " @@ -773,16 +772,16 @@ msgid "" "compatibility with newer versions before providing updates to users." msgstr "" -#: ../../using/windows.rst:438 +#: ../../using/windows.rst:440 msgid "" "The two recommended use cases for this distribution are described below." msgstr "" -#: ../../using/windows.rst:441 +#: ../../using/windows.rst:443 msgid "Python Application" msgstr "" -#: ../../using/windows.rst:443 +#: ../../using/windows.rst:445 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 " @@ -791,7 +790,7 @@ msgid "" "there are two options." msgstr "" -#: ../../using/windows.rst:449 +#: ../../using/windows.rst:451 msgid "" "Using a specialized executable as a launcher requires some coding, but " "provides the most transparent experience for users. With a customized " @@ -802,7 +801,7 @@ msgid "" "line." msgstr "" -#: ../../using/windows.rst:456 +#: ../../using/windows.rst:458 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 " @@ -811,7 +810,7 @@ msgid "" "from other running Python processes or file associations." msgstr "" -#: ../../using/windows.rst:462 +#: ../../using/windows.rst:464 msgid "" "With the latter approach, packages should be installed as directories " "alongside the Python executable to ensure they are available on the path. " @@ -820,11 +819,11 @@ msgid "" "application." msgstr "" -#: ../../using/windows.rst:468 +#: ../../using/windows.rst:470 msgid "Embedding Python" msgstr "嵌入 Python" -#: ../../using/windows.rst:470 +#: ../../using/windows.rst:472 msgid "" "Applications written in native code often require some form of scripting " "language, and the embedded Python distribution can be used for this purpose. " @@ -835,7 +834,7 @@ msgid "" "interpreter." msgstr "" -#: ../../using/windows.rst:477 +#: ../../using/windows.rst:479 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 " @@ -843,66 +842,66 @@ msgid "" "the embedded distribution and a regular installation." msgstr "" -#: ../../using/windows.rst:484 +#: ../../using/windows.rst:486 msgid "Alternative bundles" msgstr "" -#: ../../using/windows.rst:486 +#: ../../using/windows.rst:488 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:493 msgid "`ActivePython `_" msgstr "`ActivePython `_" -#: ../../using/windows.rst:491 +#: ../../using/windows.rst:493 msgid "Installer with multi-platform compatibility, documentation, PyWin32" msgstr "" -#: ../../using/windows.rst:495 +#: ../../using/windows.rst:497 msgid "`Anaconda `_" msgstr "`Anaconda `_" -#: ../../using/windows.rst:494 +#: ../../using/windows.rst:496 msgid "" "Popular scientific modules (such as numpy, scipy and pandas) and the " "``conda`` package manager." msgstr "" -#: ../../using/windows.rst:499 +#: ../../using/windows.rst:501 msgid "`Canopy `_" msgstr "`Canopy `_" -#: ../../using/windows.rst:498 +#: ../../using/windows.rst:500 msgid "" "A \"comprehensive Python analysis environment\" with editors and other " "development tools." msgstr "" -#: ../../using/windows.rst:503 +#: ../../using/windows.rst:505 msgid "`WinPython `_" msgstr "`WinPython `_" -#: ../../using/windows.rst:502 +#: ../../using/windows.rst:504 msgid "" "Windows-specific distribution with prebuilt scientific packages and tools " "for building packages." msgstr "" -#: ../../using/windows.rst:505 +#: ../../using/windows.rst:507 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:513 msgid "Configuring Python" msgstr "設定 Python" -#: ../../using/windows.rst:513 +#: ../../using/windows.rst:515 msgid "" "To run Python conveniently from a command prompt, you might consider " "changing some default environment variables in Windows. While the installer " @@ -911,29 +910,29 @@ msgid "" "use multiple versions of Python, consider using the :ref:`launcher`." msgstr "" -#: ../../using/windows.rst:523 +#: ../../using/windows.rst:525 msgid "Excursus: Setting environment variables" msgstr "" -#: ../../using/windows.rst:525 +#: ../../using/windows.rst:527 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:530 msgid "" "To temporarily set environment variables, open Command Prompt and use the :" "command:`set` command:" msgstr "" -#: ../../using/windows.rst:537 +#: ../../using/windows.rst:539 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:542 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. " @@ -942,7 +941,7 @@ msgid "" "launched." msgstr "" -#: ../../using/windows.rst:546 +#: ../../using/windows.rst:548 msgid "" "To permanently modify the default environment variables, click Start and " "search for 'edit environment variables', or open System properties, :" @@ -952,76 +951,67 @@ msgid "" "your machine (i.e. Administrator rights)." msgstr "" -#: ../../using/windows.rst:555 +#: ../../using/windows.rst:557 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:560 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 " -"only includes code that is compatible with all of your installed Python " -"versions." +"The :envvar:`PYTHONPATH` variable is used by all versions of Python, so you " +"should not permanently configure it unless the listed paths only include " +"code that is compatible with all of your installed Python versions." msgstr "" -#: ../../using/windows.rst:566 -msgid "https://www.microsoft.com/en-us/wdsi/help/folder-variables" -msgstr "https://www.microsoft.com/en-us/wdsi/help/folder-variables" - -#: ../../using/windows.rst:566 -msgid "Environment variables in Windows NT" -msgstr "環境變數於 Windows NT" +#: ../../using/windows.rst:568 +msgid "" +"https://docs.microsoft.com/en-us/windows/win32/procthread/environment-" +"variables" +msgstr "" +"https://docs.microsoft.com/en-us/windows/win32/procthread/environment-" +"variables" -#: ../../using/windows.rst:569 -msgid "https://technet.microsoft.com/en-us/library/cc754250.aspx" -msgstr "https://technet.microsoft.com/en-us/library/cc754250.aspx" +#: ../../using/windows.rst:568 +msgid "Overview of environment variables on Windows" +msgstr "Windows 上的環境變數概要" -#: ../../using/windows.rst:569 -msgid "The SET command, for temporarily modifying environment variables" +#: ../../using/windows.rst:571 +msgid "" +"https://docs.microsoft.com/en-us/windows-server/administration/windows-" +"commands/set_1" msgstr "" +"https://docs.microsoft.com/en-us/windows-server/administration/windows-" +"commands/set_1" -#: ../../using/windows.rst:572 -msgid "https://technet.microsoft.com/en-us/library/cc755104.aspx" -msgstr "https://technet.microsoft.com/en-us/library/cc755104.aspx" - -#: ../../using/windows.rst:572 -msgid "The SETX command, for permanently modifying environment variables" +#: ../../using/windows.rst:571 +msgid "The ``set`` command, for temporarily modifying environment variables" msgstr "" -#: ../../using/windows.rst:575 +#: ../../using/windows.rst:573 msgid "" -"https://support.microsoft.com/en-us/help/310519/how-to-manage-environment-" -"variables-in-windows-xp" +"https://docs.microsoft.com/en-us/windows-server/administration/windows-" +"commands/setx" msgstr "" -"https://support.microsoft.com/en-us/help/310519/how-to-manage-environment-" -"variables-in-windows-xp" +"https://docs.microsoft.com/en-us/windows-server/administration/windows-" +"commands/setx" -#: ../../using/windows.rst:575 -msgid "How To Manage Environment Variables in Windows XP" -msgstr "如何管理環境變數於 Windows XP" - -#: ../../using/windows.rst:577 -msgid "https://www.chem.gla.ac.uk/~louis/software/faq/q1.html" -msgstr "https://www.chem.gla.ac.uk/~louis/software/faq/q1.html" - -#: ../../using/windows.rst:578 -msgid "Setting Environment variables, Louis J. Farrugia" -msgstr "設定環境變數-Louis J. Farrugia" +#: ../../using/windows.rst:574 +msgid "The ``setx`` command, for permanently modifying environment variables" +msgstr "" -#: ../../using/windows.rst:583 +#: ../../using/windows.rst:580 msgid "Finding the Python executable" msgstr "" -#: ../../using/windows.rst:587 +#: ../../using/windows.rst:584 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:588 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 :" @@ -1032,7 +1022,7 @@ msgid "" "documentation." msgstr "" -#: ../../using/windows.rst:598 +#: ../../using/windows.rst:595 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 " @@ -1043,24 +1033,24 @@ msgid "" "entries already existed)::" msgstr "" -#: ../../using/windows.rst:611 +#: ../../using/windows.rst:608 msgid "UTF-8 mode" msgstr "" -#: ../../using/windows.rst:615 +#: ../../using/windows.rst:612 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:616 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:619 msgid "" "You can use the :ref:`Python UTF-8 Mode ` to change the default " "text encoding to UTF-8. You can enable the :ref:`Python UTF-8 Mode ` is enabled, you can still use " "the system encoding (the ANSI Code Page) via the \"mbcs\" codec." msgstr "" -#: ../../using/windows.rst:631 +#: ../../using/windows.rst:628 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 " @@ -1084,27 +1074,27 @@ msgid "" "utf8`` command line option." msgstr "" -#: ../../using/windows.rst:638 +#: ../../using/windows.rst:635 msgid "" "Even when UTF-8 mode is disabled, Python uses UTF-8 by default on Windows " "for:" msgstr "" -#: ../../using/windows.rst:641 +#: ../../using/windows.rst:638 msgid "Console I/O including standard I/O (see :pep:`528` for details)." msgstr "" -#: ../../using/windows.rst:642 +#: ../../using/windows.rst:639 msgid "" "The :term:`filesystem encoding ` " "(see :pep:`529` for details)." msgstr "" -#: ../../using/windows.rst:649 +#: ../../using/windows.rst:646 msgid "Python Launcher for Windows" msgstr "" -#: ../../using/windows.rst:653 +#: ../../using/windows.rst:650 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-" @@ -1112,7 +1102,7 @@ msgid "" "locate and execute that version." msgstr "" -#: ../../using/windows.rst:658 +#: ../../using/windows.rst:655 msgid "" "Unlike the :envvar:`PATH` variable, the launcher will correctly select the " "most appropriate version of Python. It will prefer per-user installations " @@ -1120,69 +1110,74 @@ msgid "" "most recently installed version." msgstr "" -#: ../../using/windows.rst:663 +#: ../../using/windows.rst:660 msgid "The launcher was originally specified in :pep:`397`." msgstr "" -#: ../../using/windows.rst:666 +#: ../../using/windows.rst:663 msgid "Getting started" msgstr "開始" -#: ../../using/windows.rst:669 +#: ../../using/windows.rst:666 msgid "From the command-line" msgstr "" -#: ../../using/windows.rst:673 +#: ../../using/windows.rst:670 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 " "of Python, so it does not matter which version is installed. To check that " -"the launcher is available, execute the following command in Command Prompt:" +"the launcher is available, execute the following command in Command Prompt::" msgstr "" -#: ../../using/windows.rst:682 +#: ../../using/windows.rst:677 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:686 +#: ../../using/windows.rst:681 msgid "" -"If you have multiple versions of Python installed (e.g., 2.7 and |version|) " +"If you have multiple versions of Python installed (e.g., 3.7 and |version|) " "you will have noticed that Python |version| was started - to launch Python " -"2.7, try the command:" +"3.7, try the command::" msgstr "" -#: ../../using/windows.rst:694 +#: ../../using/windows.rst:687 msgid "" -"If you want the latest version of Python 2.x you have installed, try the " -"command:" +"If you want the latest version of Python 2 you have installed, try the " +"command::" msgstr "" -#: ../../using/windows.rst:701 -msgid "You should find the latest version of Python 2.x starts." +#: ../../using/windows.rst:692 +msgid "You should find the latest version of Python 3.x starts." msgstr "" -#: ../../using/windows.rst:703 -msgid "If you see the following error, you do not have the launcher installed:" +#: ../../using/windows.rst:694 +msgid "" +"If you see the following error, you do not have the launcher installed::" msgstr "" -#: ../../using/windows.rst:710 +#: ../../using/windows.rst:699 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:717 -msgid "You should see the currently installed versions of Python." +#: ../../using/windows.rst:702 +msgid "The command::" +msgstr "" + +#: ../../using/windows.rst:706 +msgid "displays the currently installed version(s) of Python." msgstr "" -#: ../../using/windows.rst:720 +#: ../../using/windows.rst:709 msgid "Virtual environments" msgstr "虛擬環境(Virtual environment)" -#: ../../using/windows.rst:724 +#: ../../using/windows.rst:713 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 " @@ -1192,36 +1187,36 @@ msgid "" "specify the global Python version." msgstr "" -#: ../../using/windows.rst:732 +#: ../../using/windows.rst:721 msgid "From a script" msgstr "" -#: ../../using/windows.rst:734 +#: ../../using/windows.rst:723 msgid "" "Let's create a test Python script - create a file called ``hello.py`` with " "the following contents" msgstr "" -#: ../../using/windows.rst:743 -msgid "From the directory in which hello.py lives, execute the command:" +#: ../../using/windows.rst:732 +msgid "From the directory in which hello.py lives, execute the command::" msgstr "" -#: ../../using/windows.rst:749 +#: ../../using/windows.rst:736 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:743 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 " -"version qualifier. Assuming you have Python 2.6 installed, try changing the " -"first line to ``#! python2.6`` and you should find the 2.6 version " +"version qualifier. Assuming you have Python 3.7 installed, try changing the " +"first line to ``#! python3.7`` and you should find the |version| version " "information printed." msgstr "" -#: ../../using/windows.rst:762 +#: ../../using/windows.rst:749 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 " @@ -1229,11 +1224,11 @@ msgid "" "typically refers to Python 2." msgstr "" -#: ../../using/windows.rst:768 +#: ../../using/windows.rst:755 msgid "From file associations" msgstr "從檔案關聯" -#: ../../using/windows.rst:770 +#: ../../using/windows.rst:757 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 " @@ -1242,17 +1237,17 @@ msgid "" "have the script specify the version which should be used." msgstr "" -#: ../../using/windows.rst:776 +#: ../../using/windows.rst:763 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:767 msgid "Shebang Lines" msgstr "" -#: ../../using/windows.rst:782 +#: ../../using/windows.rst:769 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 " @@ -1262,34 +1257,34 @@ msgid "" "demonstrate their use." msgstr "" -#: ../../using/windows.rst:789 +#: ../../using/windows.rst:776 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:780 msgid "``/usr/bin/env python``" msgstr "``/usr/bin/env python``" -#: ../../using/windows.rst:794 +#: ../../using/windows.rst:781 msgid "``/usr/bin/python``" msgstr "``/usr/bin/python``" -#: ../../using/windows.rst:795 +#: ../../using/windows.rst:782 msgid "``/usr/local/bin/python``" msgstr "``/usr/local/bin/python``" -#: ../../using/windows.rst:796 +#: ../../using/windows.rst:783 msgid "``python``" msgstr "``python``" -#: ../../using/windows.rst:798 +#: ../../using/windows.rst:785 msgid "For example, if the first line of your script starts with" msgstr "" -#: ../../using/windows.rst:804 +#: ../../using/windows.rst:791 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 " @@ -1298,23 +1293,23 @@ msgid "" "of the shebang lines starting with ``/usr``." msgstr "" -#: ../../using/windows.rst:810 +#: ../../using/windows.rst:797 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 " "the 32-bit version can be requested by adding \"-32\" after the minor " -"version. I.e. ``/usr/bin/python2.7-32`` will request usage of the 32-bit " -"python 2.7." +"version. I.e. ``/usr/bin/python3.7-32`` will request usage of the 32-bit " +"python 3.7." msgstr "" -#: ../../using/windows.rst:818 +#: ../../using/windows.rst:805 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:809 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 " @@ -1323,29 +1318,29 @@ msgid "" "search." msgstr "" -#: ../../using/windows.rst:828 +#: ../../using/windows.rst:815 msgid "Arguments in shebang lines" msgstr "" -#: ../../using/windows.rst:830 +#: ../../using/windows.rst:817 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:824 msgid "Then Python will be started with the ``-v`` option" msgstr "" -#: ../../using/windows.rst:840 +#: ../../using/windows.rst:827 msgid "Customization" msgstr "" -#: ../../using/windows.rst:843 +#: ../../using/windows.rst:830 msgid "Customization via INI files" msgstr "" -#: ../../using/windows.rst:845 +#: ../../using/windows.rst:832 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 " @@ -1355,7 +1350,7 @@ msgid "" "launcher (i.e. py.exe) and for the 'windows' version (i.e. pyw.exe)." msgstr "" -#: ../../using/windows.rst:852 +#: ../../using/windows.rst:839 msgid "" "Customization specified in the \"application directory\" will have " "precedence over the one next to the executable, so a user, who may not have " @@ -1363,11 +1358,11 @@ msgid "" "that global .ini file." msgstr "" -#: ../../using/windows.rst:857 +#: ../../using/windows.rst:844 msgid "Customizing default Python versions" msgstr "" -#: ../../using/windows.rst:859 +#: ../../using/windows.rst:846 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 " @@ -1377,13 +1372,13 @@ msgid "" "\"-32\" or \"-64\"." msgstr "" -#: ../../using/windows.rst:865 +#: ../../using/windows.rst:852 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:855 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 " @@ -1393,7 +1388,7 @@ msgid "" "launcher included with Python 3.7 or newer.)" msgstr "" -#: ../../using/windows.rst:875 +#: ../../using/windows.rst:862 msgid "" "If no minor version qualifiers are found, the environment variable " "``PY_PYTHON{major}`` (where ``{major}`` is the current major version " @@ -1404,7 +1399,7 @@ msgid "" "version in that family." msgstr "" -#: ../../using/windows.rst:883 +#: ../../using/windows.rst:870 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 " @@ -1418,44 +1413,44 @@ msgid "" "suffix can be used on a version specifier to change this behaviour." msgstr "" -#: ../../using/windows.rst:894 +#: ../../using/windows.rst:881 msgid "Examples:" msgstr "範例:" -#: ../../using/windows.rst:896 +#: ../../using/windows.rst:883 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:887 msgid "" -"The commands ``python3.1`` and ``python2.7`` will not consult any options at " -"all as the versions are fully specified." +"The command ``python3.7`` will not consult any options at all as the " +"versions are fully specified." msgstr "" -#: ../../using/windows.rst:903 +#: ../../using/windows.rst:890 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:893 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 " +"If ``PY_PYTHON=3.7-32``, the command ``python`` will use the 32-bit " +"implementation of 3.7 whereas the command ``python3`` will use the latest " "installed Python (PY_PYTHON was not considered at all as a major version was " "specified.)" msgstr "" -#: ../../using/windows.rst:911 +#: ../../using/windows.rst:898 msgid "" -"If ``PY_PYTHON=3`` and ``PY_PYTHON3=3.1``, the commands ``python`` and " -"``python3`` will both use specifically 3.1" +"If ``PY_PYTHON=3`` and ``PY_PYTHON3=3.7``, the commands ``python`` and " +"``python3`` will both use specifically 3.7" msgstr "" -#: ../../using/windows.rst:914 +#: ../../using/windows.rst:901 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 " @@ -1465,25 +1460,25 @@ msgid "" "will override things specified in the INI file." msgstr "" -#: ../../using/windows.rst:921 +#: ../../using/windows.rst:908 msgid "For example:" msgstr "" -#: ../../using/windows.rst:923 -msgid "Setting ``PY_PYTHON=3.1`` is equivalent to the INI file containing:" +#: ../../using/windows.rst:910 +msgid "Setting ``PY_PYTHON=3.7`` is equivalent to the INI file containing:" msgstr "" -#: ../../using/windows.rst:930 +#: ../../using/windows.rst:917 msgid "" -"Setting ``PY_PYTHON=3`` and ``PY_PYTHON3=3.1`` is equivalent to the INI file " +"Setting ``PY_PYTHON=3`` and ``PY_PYTHON3=3.7`` is equivalent to the INI file " "containing:" msgstr "" -#: ../../using/windows.rst:940 +#: ../../using/windows.rst:927 msgid "Diagnostics" msgstr "" -#: ../../using/windows.rst:942 +#: ../../using/windows.rst:929 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). " @@ -1493,11 +1488,11 @@ msgid "" "target Python." msgstr "" -#: ../../using/windows.rst:954 +#: ../../using/windows.rst:941 msgid "Finding modules" msgstr "" -#: ../../using/windows.rst:956 +#: ../../using/windows.rst:943 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:\\" @@ -1506,7 +1501,7 @@ msgid "" "\\\\site-packages\\\\`." msgstr "" -#: ../../using/windows.rst:962 +#: ../../using/windows.rst:949 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``) " @@ -1515,7 +1510,7 @@ msgid "" "allows paths to be restricted for any program loading the runtime if desired." msgstr "" -#: ../../using/windows.rst:968 +#: ../../using/windows.rst:955 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 " @@ -1525,25 +1520,25 @@ msgid "" "arbitrary code cannot be specified." msgstr "" -#: ../../using/windows.rst:975 +#: ../../using/windows.rst:962 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:965 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:968 msgid "" "An empty entry is added at the start, which corresponds to the current " "directory." msgstr "" -#: ../../using/windows.rst:984 +#: ../../using/windows.rst:971 msgid "" "If the environment variable :envvar:`PYTHONPATH` exists, as described in :" "ref:`using-on-envvars`, its entries are added next. Note that on Windows, " @@ -1551,7 +1546,7 @@ msgid "" "from the colon used in drive identifiers (``C:\\`` etc.)." msgstr "" -#: ../../using/windows.rst:989 +#: ../../using/windows.rst:976 msgid "" "Additional \"application paths\" can be added in the registry as subkeys of :" "samp:`\\\\SOFTWARE\\\\Python\\\\PythonCore\\\\{version}\\\\PythonPath` under " @@ -1561,7 +1556,7 @@ msgid "" "installers only use HKLM, so HKCU is typically empty.)" msgstr "" -#: ../../using/windows.rst:996 +#: ../../using/windows.rst:983 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 " @@ -1572,31 +1567,31 @@ msgid "" "PythonPath stored in the registry." msgstr "" -#: ../../using/windows.rst:1004 +#: ../../using/windows.rst:991 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:995 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:998 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:1002 msgid "The end result of all this is:" msgstr "最終這所有的結果為:" -#: ../../using/windows.rst:1017 +#: ../../using/windows.rst:1004 msgid "" "When running :file:`python.exe`, or any other .exe in the main Python " "directory (either an installed version, or directly from the PCbuild " @@ -1604,7 +1599,7 @@ msgid "" "ignored. Other \"application paths\" in the registry are always read." msgstr "" -#: ../../using/windows.rst:1022 +#: ../../using/windows.rst:1009 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 " @@ -1612,20 +1607,20 @@ msgid "" "always read." msgstr "" -#: ../../using/windows.rst:1026 +#: ../../using/windows.rst:1013 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:1017 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:1020 msgid "" "Include a ``._pth`` file alongside your executable containing the " "directories to include. This will ignore paths listed in the registry and " @@ -1633,20 +1628,20 @@ msgid "" "listed." msgstr "" -#: ../../using/windows.rst:1038 +#: ../../using/windows.rst:1025 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:1029 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:1032 msgid "" "If you cannot use the previous suggestions (for example, you are a " "distribution that allows people to run :file:`python.exe` directly), ensure " @@ -1655,7 +1650,7 @@ msgid "" "correctly named ZIP file will be detected instead.)" msgstr "" -#: ../../using/windows.rst:1051 +#: ../../using/windows.rst:1038 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 " @@ -1665,19 +1660,19 @@ msgid "" "packages." msgstr "" -#: ../../using/windows.rst:1060 +#: ../../using/windows.rst:1047 msgid "" "Adds ``._pth`` file support and removes ``applocal`` option from ``pyvenv." "cfg``." msgstr "" -#: ../../using/windows.rst:1062 +#: ../../using/windows.rst:1049 msgid "" "Adds ``pythonXX.zip`` as a potential landmark when directly adjacent to the " "executable." msgstr "" -#: ../../using/windows.rst:1068 +#: ../../using/windows.rst:1055 msgid "" "Modules specified in the registry under ``Modules`` (not ``PythonPath``) may " "be imported by :class:`importlib.machinery.WindowsRegistryFinder`. This " @@ -1685,88 +1680,89 @@ msgid "" "explicitly added to :attr:`sys.meta_path` in the future." msgstr "" -#: ../../using/windows.rst:1074 +#: ../../using/windows.rst:1061 msgid "Additional modules" msgstr "" -#: ../../using/windows.rst:1076 +#: ../../using/windows.rst:1063 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:1067 msgid "" "The Windows-specific standard modules are documented in :ref:`mswin-specific-" "services`." msgstr "" -#: ../../using/windows.rst:1084 +#: ../../using/windows.rst:1071 msgid "PyWin32" msgstr "PyWin32" -#: ../../using/windows.rst:1086 +#: ../../using/windows.rst:1073 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:1077 msgid "" -"`Component Object Model `_ (COM)" +"`Component Object Model `_ (COM)" msgstr "" -#: ../../using/windows.rst:1093 +#: ../../using/windows.rst:1080 msgid "Win32 API calls" msgstr "" -#: ../../using/windows.rst:1094 +#: ../../using/windows.rst:1081 msgid "Registry" msgstr "登錄檔(Registry)" -#: ../../using/windows.rst:1095 +#: ../../using/windows.rst:1082 msgid "Event log" msgstr "事件日誌(Event log)" -#: ../../using/windows.rst:1096 +#: ../../using/windows.rst:1083 msgid "" -"`Microsoft Foundation Classes `_ (MFC) user interfaces" +"`Microsoft Foundation Classes `_ (MFC) user interfaces" msgstr "" -#: ../../using/windows.rst:1099 +#: ../../using/windows.rst:1087 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:1094 msgid "" "`Win32 How Do I...? `_" msgstr "" "`Win32 How Do I...? `_" -#: ../../using/windows.rst:1106 +#: ../../using/windows.rst:1094 msgid "by Tim Golden" msgstr "由 Tim Golden 所著" -#: ../../using/windows.rst:1108 -msgid "`Python and COM `_" +#: ../../using/windows.rst:1096 +#, fuzzy +msgid "`Python and COM `_" msgstr "`Python and COM `_" -#: ../../using/windows.rst:1109 +#: ../../using/windows.rst:1097 msgid "by David and Paul Boddie" msgstr "由 David 與 Paul Boddie 所著" -#: ../../using/windows.rst:1113 +#: ../../using/windows.rst:1101 msgid "cx_Freeze" msgstr "cx_Freeze" -#: ../../using/windows.rst:1115 +#: ../../using/windows.rst:1103 msgid "" "`cx_Freeze `_ is a :mod:" "`distutils` extension (see :ref:`extending-distutils`) which wraps Python " @@ -1775,28 +1771,11 @@ msgid "" "users to install Python." msgstr "" -#: ../../using/windows.rst:1123 -msgid "WConio" -msgstr "WConio" - -#: ../../using/windows.rst:1125 -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 -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:1111 msgid "Compiling Python on Windows" msgstr "編譯 Python 在 Windows" -#: ../../using/windows.rst:1137 +#: ../../using/windows.rst:1113 msgid "" "If you want to compile CPython yourself, first thing you should do is get " "the `source `_. You can download " @@ -1804,70 +1783,49 @@ msgid "" "devguide.python.org/setup/#getting-the-source-code>`_." msgstr "" -#: ../../using/windows.rst:1142 +#: ../../using/windows.rst:1118 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 " +"Visual Studio, which is the compiler used to build the official Python " "releases. These files are in the :file:`PCbuild` directory." msgstr "" -#: ../../using/windows.rst:1146 +#: ../../using/windows.rst:1122 msgid "" "Check :file:`PCbuild/readme.txt` for general information on the build " "process." msgstr "" -#: ../../using/windows.rst:1149 +#: ../../using/windows.rst:1124 msgid "For extension modules, consult :ref:`building-on-windows`." msgstr "" -#: ../../using/windows.rst:1155 -msgid "" -"`Python + Windows + distutils + SWIG + gcc MinGW `_" -msgstr "" - -#: ../../using/windows.rst:1154 -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:1128 msgid "Other Platforms" msgstr "其他平台" -#: ../../using/windows.rst:1162 +#: ../../using/windows.rst:1130 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 -msgid "`Windows CE `_ is still supported." +#: ../../using/windows.rst:1134 +msgid "" +"`Windows CE `_ is `no longer supported " +"`__ since Python 3 (if it " +"ever was)." msgstr "" -#: ../../using/windows.rst:1167 +#: ../../using/windows.rst:1137 msgid "" -"The `Cygwin `_ installer offers to install the Python " -"interpreter as well (cf. `Cygwin package source `_, `Maintainer " -"releases `_)" +"The `Cygwin `_ installer offers to install the `Python " +"interpreter `__ as well" msgstr "" -#: ../../using/windows.rst:1173 +#: ../../using/windows.rst:1141 msgid "" "See `Python for Windows `_ for " "detailed information about platforms with pre-compiled installers." msgstr "" - -#~ msgid "Installing Python" -#~ msgstr "安裝 Python" - -#~ msgid "Embedded Distribution" -#~ msgstr "嵌入式發行版本" - -#~ msgid "Other resources" -#~ msgstr "其他資源" diff --git a/whatsnew/2.5.po b/whatsnew/2.5.po index f03078d3bb..bec4dca2f1 100644 --- a/whatsnew/2.5.po +++ b/whatsnew/2.5.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.10\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2020-06-20 18:08+0800\n" +"POT-Creation-Date: 2022-05-21 17:35+0000\n" "PO-Revision-Date: 2018-05-23 16:20+0000\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -2076,8 +2076,8 @@ msgstr "" #: ../../whatsnew/2.5.rst:1768 msgid "" "The rest of this section will provide a brief overview of using ElementTree. " -"Full documentation for ElementTree is available at http://effbot.org/zone/" -"element-index.htm." +"Full documentation for ElementTree is available at https://web.archive.org/" +"web/20201124024954/http://effbot.org/zone/element-index.htm." msgstr "" #: ../../whatsnew/2.5.rst:1772 @@ -2252,8 +2252,10 @@ msgid "" msgstr "" #: ../../whatsnew/2.5.rst:1868 -msgid "http://effbot.org/zone/element-index.htm" -msgstr "http://effbot.org/zone/element-index.htm" +msgid "" +"https://web.archive.org/web/20201124024954/http://effbot.org/zone/element-" +"index.htm" +msgstr "" #: ../../whatsnew/2.5.rst:1869 msgid "Official documentation for ElementTree." @@ -2734,3 +2736,6 @@ msgid "" "Paul Prescod, James Pryor, Mike Rovner, Scott Weikart, Barry Warsaw, Thomas " "Wouters." msgstr "" + +#~ msgid "http://effbot.org/zone/element-index.htm" +#~ msgstr "http://effbot.org/zone/element-index.htm" diff --git a/whatsnew/2.7.po b/whatsnew/2.7.po index ee22198d35..4a004882c8 100644 --- a/whatsnew/2.7.po +++ b/whatsnew/2.7.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.10\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2021-09-29 00:11+0000\n" +"POT-Creation-Date: 2022-05-21 17:35+0000\n" "PO-Revision-Date: 2018-05-23 16:20+0000\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -2427,9 +2427,10 @@ msgstr "" #: ../../whatsnew/2.7.rst:2090 msgid "" "Fredrik Lundh develops ElementTree and produced the 1.3 version; you can " -"read his article describing 1.3 at http://effbot.org/zone/elementtree-13-" -"intro.htm. Florent Xicluna updated the version included with Python, after " -"discussions on python-dev and in :issue:`6472`.)" +"read his article describing 1.3 at https://web.archive.org/" +"web/20200703234532/http://effbot.org/zone/elementtree-13-intro.htm. Florent " +"Xicluna updated the version included with Python, after discussions on " +"python-dev and in :issue:`6472`.)" msgstr "" #: ../../whatsnew/2.7.rst:2100 diff --git a/whatsnew/3.10.po b/whatsnew/3.10.po index bc6980a5cf..6d5d7f5444 100644 --- a/whatsnew/3.10.po +++ b/whatsnew/3.10.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.10\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2022-02-13 08:54+0000\n" +"POT-Creation-Date: 2022-05-21 17:35+0000\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -137,7 +137,7 @@ msgstr "" msgid ":pep:`597`, Add optional EncodingWarning" msgstr "" -#: ../../whatsnew/3.10.rst:93 ../../whatsnew/3.10.rst:2042 +#: ../../whatsnew/3.10.rst:93 ../../whatsnew/3.10.rst:2048 msgid "New Features" msgstr "" @@ -1197,7 +1197,7 @@ msgid "doctest" msgstr "doctest" #: ../../whatsnew/3.10.rst:1076 ../../whatsnew/3.10.rst:1197 -#: ../../whatsnew/3.10.rst:1218 ../../whatsnew/3.10.rst:1317 +#: ../../whatsnew/3.10.rst:1224 ../../whatsnew/3.10.rst:1323 msgid "" "When a module does not define ``__loader__``, fall back to ``__spec__." "loader``. (Contributed by Brett Cannon in :issue:`42133`.)" @@ -1407,27 +1407,37 @@ msgid "" msgstr "" #: ../../whatsnew/3.10.rst:1216 +msgid "itertools" +msgstr "" + +#: ../../whatsnew/3.10.rst:1218 +msgid "" +"Add :func:`itertools.pairwise()`. (Contributed by Raymond Hettinger in :" +"issue:`38200`.)" +msgstr "" + +#: ../../whatsnew/3.10.rst:1222 msgid "linecache" msgstr "linecache" -#: ../../whatsnew/3.10.rst:1222 +#: ../../whatsnew/3.10.rst:1228 msgid "os" msgstr "os" -#: ../../whatsnew/3.10.rst:1224 +#: ../../whatsnew/3.10.rst:1230 msgid "" "Add :func:`os.cpu_count()` support for VxWorks RTOS. (Contributed by Peixing " "Xin in :issue:`41440`.)" msgstr "" -#: ../../whatsnew/3.10.rst:1227 +#: ../../whatsnew/3.10.rst:1233 msgid "" "Add a new function :func:`os.eventfd` and related helpers to wrap the " "``eventfd2`` syscall on Linux. (Contributed by Christian Heimes in :issue:" "`41001`.)" msgstr "" -#: ../../whatsnew/3.10.rst:1231 +#: ../../whatsnew/3.10.rst:1237 msgid "" "Add :func:`os.splice()` that allows to move data between two file " "descriptors without copying between kernel address space and user address " @@ -1435,41 +1445,41 @@ msgid "" "by Pablo Galindo in :issue:`41625`.)" msgstr "" -#: ../../whatsnew/3.10.rst:1236 +#: ../../whatsnew/3.10.rst:1242 msgid "" "Add :data:`~os.O_EVTONLY`, :data:`~os.O_FSYNC`, :data:`~os.O_SYMLINK` and :" "data:`~os.O_NOFOLLOW_ANY` for macOS. (Contributed by Dong-hee Na in :issue:" "`43106`.)" msgstr "" -#: ../../whatsnew/3.10.rst:1241 +#: ../../whatsnew/3.10.rst:1247 msgid "os.path" msgstr "os.path" -#: ../../whatsnew/3.10.rst:1243 +#: ../../whatsnew/3.10.rst:1249 msgid "" ":func:`os.path.realpath` now accepts a *strict* keyword-only argument. When " "set to ``True``, :exc:`OSError` is raised if a path doesn't exist or a " "symlink loop is encountered. (Contributed by Barney Gale in :issue:`43757`.)" msgstr "" -#: ../../whatsnew/3.10.rst:1249 +#: ../../whatsnew/3.10.rst:1255 msgid "pathlib" msgstr "pathlib" -#: ../../whatsnew/3.10.rst:1251 +#: ../../whatsnew/3.10.rst:1257 msgid "" "Add slice support to :attr:`PurePath.parents `. " "(Contributed by Joshua Cannon in :issue:`35498`)" msgstr "" -#: ../../whatsnew/3.10.rst:1254 +#: ../../whatsnew/3.10.rst:1260 msgid "" "Add negative indexing support to :attr:`PurePath.parents `. (Contributed by Yaroslav Pankovych in :issue:`21041`)" msgstr "" -#: ../../whatsnew/3.10.rst:1258 +#: ../../whatsnew/3.10.rst:1264 msgid "" "Add :meth:`Path.hardlink_to ` method that " "supersedes :meth:`~pathlib.Path.link_to`. The new method has the same " @@ -1477,7 +1487,7 @@ msgid "" "Gale in :issue:`39950`.)" msgstr "" -#: ../../whatsnew/3.10.rst:1263 +#: ../../whatsnew/3.10.rst:1269 msgid "" ":meth:`pathlib.Path.stat` and :meth:`~pathlib.Path.chmod` now accept a " "*follow_symlinks* keyword-only argument for consistency with corresponding " @@ -1485,11 +1495,11 @@ msgid "" "`39906`.)" msgstr "" -#: ../../whatsnew/3.10.rst:1269 +#: ../../whatsnew/3.10.rst:1275 msgid "platform" msgstr "platform" -#: ../../whatsnew/3.10.rst:1271 +#: ../../whatsnew/3.10.rst:1277 msgid "" "Add :func:`platform.freedesktop_os_release()` to retrieve operation system " "identification from `freedesktop.org os-release ` section for " "more information." msgstr "" -#: ../../whatsnew/3.10.rst:1616 +#: ../../whatsnew/3.10.rst:1622 msgid "" "Non-integer arguments to :func:`random.randrange` are deprecated. The :exc:" "`ValueError` is deprecated in favor of a :exc:`TypeError`. (Contributed by " "Serhiy Storchaka and Raymond Hettinger in :issue:`37319`.)" msgstr "" -#: ../../whatsnew/3.10.rst:1620 +#: ../../whatsnew/3.10.rst:1626 msgid "" "The various ``load_module()`` methods of :mod:`importlib` have been " "documented as deprecated since Python 3.6, but will now also trigger a :exc:" @@ -2015,21 +2025,21 @@ msgid "" "(Contributed by Brett Cannon in :issue:`26131`.)" msgstr "" -#: ../../whatsnew/3.10.rst:1626 +#: ../../whatsnew/3.10.rst:1632 msgid "" ":meth:`zimport.zipimporter.load_module` has been deprecated in preference " "for :meth:`~zipimport.zipimporter.exec_module`. (Contributed by Brett Cannon " "in :issue:`26131`.)" msgstr "" -#: ../../whatsnew/3.10.rst:1630 +#: ../../whatsnew/3.10.rst:1636 msgid "" "The use of :meth:`~importlib.abc.Loader.load_module` by the import system " "now triggers an :exc:`ImportWarning` as :meth:`~importlib.abc.Loader." "exec_module` is preferred. (Contributed by Brett Cannon in :issue:`26131`.)" msgstr "" -#: ../../whatsnew/3.10.rst:1635 +#: ../../whatsnew/3.10.rst:1641 msgid "" "The use of :meth:`importlib.abc.MetaPathFinder.find_module` and :meth:" "`importlib.abc.PathEntryFinder.find_module` by the import system now trigger " @@ -2039,7 +2049,7 @@ msgid "" "porting. (Contributed by Brett Cannon in :issue:`42134`.)" msgstr "" -#: ../../whatsnew/3.10.rst:1644 +#: ../../whatsnew/3.10.rst:1650 msgid "" "The use of :meth:`importlib.abc.PathEntryFinder.find_loader` by the import " "system now triggers an :exc:`ImportWarning` as :meth:`importlib.abc." @@ -2048,7 +2058,7 @@ msgid "" "`43672`.)" msgstr "" -#: ../../whatsnew/3.10.rst:1650 +#: ../../whatsnew/3.10.rst:1656 msgid "" "The various implementations of :meth:`importlib.abc.MetaPathFinder." "find_module` ( :meth:`importlib.machinery.BuiltinImporter.find_module`, :" @@ -2063,7 +2073,7 @@ msgid "" "Python 3.4). (Contributed by Brett Cannon in :issue:`42135`.)" msgstr "" -#: ../../whatsnew/3.10.rst:1665 +#: ../../whatsnew/3.10.rst:1671 msgid "" ":class:`importlib.abc.Finder` is deprecated (including its sole method, :" "meth:`~importlib.abc.Finder.find_module`). Both :class:`importlib.abc." @@ -2072,7 +2082,7 @@ msgid "" "appropriate instead. (Contributed by Brett Cannon in :issue:`42135`.)" msgstr "" -#: ../../whatsnew/3.10.rst:1672 +#: ../../whatsnew/3.10.rst:1678 msgid "" "The deprecations of :mod:`imp`, :func:`importlib.find_loader`, :func:" "`importlib.util.set_package_wrapper`, :func:`importlib.util." @@ -2083,7 +2093,7 @@ msgid "" "Brett Cannon in :issue:`43720`.)" msgstr "" -#: ../../whatsnew/3.10.rst:1682 +#: ../../whatsnew/3.10.rst:1688 msgid "" "The import system now uses the ``__spec__`` attribute on modules before " "falling back on :meth:`~importlib.abc.Loader.module_repr` for a module's " @@ -2091,7 +2101,7 @@ msgid "" "for Python 3.12. (Contributed by Brett Cannon in :issue:`42137`.)" msgstr "" -#: ../../whatsnew/3.10.rst:1688 +#: ../../whatsnew/3.10.rst:1694 msgid "" ":meth:`importlib.abc.Loader.module_repr`, :meth:`importlib.machinery." "FrozenLoader.module_repr`, and :meth:`importlib.machinery.BuiltinLoader." @@ -2099,7 +2109,7 @@ msgid "" "(Contributed by Brett Cannon in :issue:`42136`.)" msgstr "" -#: ../../whatsnew/3.10.rst:1694 +#: ../../whatsnew/3.10.rst:1700 msgid "" "``sqlite3.OptimizedUnicode`` has been undocumented and obsolete since Python " "3.3, when it was made an alias to :class:`str`. It is now deprecated, " @@ -2107,7 +2117,7 @@ msgid "" "issue:`42264`.)" msgstr "" -#: ../../whatsnew/3.10.rst:1699 +#: ../../whatsnew/3.10.rst:1705 msgid "" ":func:`asyncio.get_event_loop` now emits a deprecation warning if there is " "no running event loop. In the future it will be an alias of :func:`~asyncio." @@ -2121,7 +2131,7 @@ msgid "" "(Contributed by Serhiy Storchaka in :issue:`39529`.)" msgstr "" -#: ../../whatsnew/3.10.rst:1712 +#: ../../whatsnew/3.10.rst:1718 msgid "" "The undocumented built-in function ``sqlite3.enable_shared_cache`` is now " "deprecated, scheduled for removal in Python 3.12. Its use is strongly " @@ -2131,68 +2141,68 @@ msgid "" "query parameter. (Contributed by Erlend E. Aasland in :issue:`24464`.)" msgstr "" -#: ../../whatsnew/3.10.rst:1720 +#: ../../whatsnew/3.10.rst:1726 msgid "The following ``threading`` methods are now deprecated:" msgstr "" -#: ../../whatsnew/3.10.rst:1722 +#: ../../whatsnew/3.10.rst:1728 msgid "``threading.currentThread`` => :func:`threading.current_thread`" msgstr "``threading.currentThread`` => :func:`threading.current_thread`" -#: ../../whatsnew/3.10.rst:1724 +#: ../../whatsnew/3.10.rst:1730 msgid "``threading.activeCount`` => :func:`threading.active_count`" msgstr "``threading.activeCount`` => :func:`threading.active_count`" -#: ../../whatsnew/3.10.rst:1726 +#: ../../whatsnew/3.10.rst:1732 msgid "" "``threading.Condition.notifyAll`` => :meth:`threading.Condition.notify_all`" msgstr "" "``threading.Condition.notifyAll`` => :meth:`threading.Condition.notify_all`" -#: ../../whatsnew/3.10.rst:1729 +#: ../../whatsnew/3.10.rst:1735 msgid "``threading.Event.isSet`` => :meth:`threading.Event.is_set`" msgstr "``threading.Event.isSet`` => :meth:`threading.Event.is_set`" -#: ../../whatsnew/3.10.rst:1731 +#: ../../whatsnew/3.10.rst:1737 msgid "``threading.Thread.setName`` => :attr:`threading.Thread.name`" msgstr "``threading.Thread.setName`` => :attr:`threading.Thread.name`" -#: ../../whatsnew/3.10.rst:1733 +#: ../../whatsnew/3.10.rst:1739 msgid "``threading.thread.getName`` => :attr:`threading.Thread.name`" msgstr "``threading.thread.getName`` => :attr:`threading.Thread.name`" -#: ../../whatsnew/3.10.rst:1735 +#: ../../whatsnew/3.10.rst:1741 msgid "``threading.Thread.isDaemon`` => :attr:`threading.Thread.daemon`" msgstr "``threading.Thread.isDaemon`` => :attr:`threading.Thread.daemon`" -#: ../../whatsnew/3.10.rst:1737 +#: ../../whatsnew/3.10.rst:1743 msgid "``threading.Thread.setDaemon`` => :attr:`threading.Thread.daemon`" msgstr "``threading.Thread.setDaemon`` => :attr:`threading.Thread.daemon`" -#: ../../whatsnew/3.10.rst:1739 +#: ../../whatsnew/3.10.rst:1745 msgid "(Contributed by Jelle Zijlstra in :issue:`21574`.)" msgstr "" -#: ../../whatsnew/3.10.rst:1741 +#: ../../whatsnew/3.10.rst:1747 msgid "" ":meth:`pathlib.Path.link_to` is deprecated and slated for removal in Python " "3.12. Use :meth:`pathlib.Path.hardlink_to` instead. (Contributed by Barney " "Gale in :issue:`39950`.)" msgstr "" -#: ../../whatsnew/3.10.rst:1745 +#: ../../whatsnew/3.10.rst:1751 msgid "" "``cgi.log()`` is deprecated and slated for removal in Python 3.12. " "(Contributed by Inada Naoki in :issue:`41139`.)" msgstr "" -#: ../../whatsnew/3.10.rst:1748 +#: ../../whatsnew/3.10.rst:1754 msgid "" "The following :mod:`ssl` features have been deprecated since Python 3.6, " "Python 3.7, or OpenSSL 1.1.0 and will be removed in 3.11:" msgstr "" -#: ../../whatsnew/3.10.rst:1751 +#: ../../whatsnew/3.10.rst:1757 msgid "" ":data:`~ssl.OP_NO_SSLv2`, :data:`~ssl.OP_NO_SSLv3`, :data:`~ssl." "OP_NO_TLSv1`, :data:`~ssl.OP_NO_TLSv1_1`, :data:`~ssl.OP_NO_TLSv1_2`, and :" @@ -2200,7 +2210,7 @@ msgid "" "minimum_version` and :attr:`sslSSLContext.maximum_version`." msgstr "" -#: ../../whatsnew/3.10.rst:1757 +#: ../../whatsnew/3.10.rst:1763 msgid "" ":data:`~ssl.PROTOCOL_SSLv2`, :data:`~ssl.PROTOCOL_SSLv3`, :data:`~ssl." "PROTOCOL_SSLv23`, :data:`~ssl.PROTOCOL_TLSv1`, :data:`~ssl." @@ -2209,26 +2219,26 @@ msgid "" "and :data:`~ssl.PROTOCOL_TLS_SERVER`" msgstr "" -#: ../../whatsnew/3.10.rst:1763 +#: ../../whatsnew/3.10.rst:1769 msgid "" ":func:`~ssl.wrap_socket` is replaced by :meth:`ssl.SSLContext.wrap_socket`" msgstr "" -#: ../../whatsnew/3.10.rst:1765 +#: ../../whatsnew/3.10.rst:1771 msgid ":func:`~ssl.match_hostname`" msgstr ":func:`~ssl.match_hostname`" -#: ../../whatsnew/3.10.rst:1767 +#: ../../whatsnew/3.10.rst:1773 msgid ":func:`~ssl.RAND_pseudo_bytes`, :func:`~ssl.RAND_egd`" msgstr ":func:`~ssl.RAND_pseudo_bytes`, :func:`~ssl.RAND_egd`" -#: ../../whatsnew/3.10.rst:1769 +#: ../../whatsnew/3.10.rst:1775 msgid "" "NPN features like :meth:`ssl.SSLSocket.selected_npn_protocol` and :meth:`ssl." "SSLContext.set_npn_protocols` are replaced by ALPN." msgstr "" -#: ../../whatsnew/3.10.rst:1772 +#: ../../whatsnew/3.10.rst:1778 msgid "" "The threading debug (:envvar:`PYTHONTHREADDEBUG` environment variable) is " "deprecated in Python 3.10 and will be removed in Python 3.12. This feature " @@ -2236,7 +2246,7 @@ msgid "" "Victor Stinner in :issue:`44584`.)" msgstr "" -#: ../../whatsnew/3.10.rst:1777 +#: ../../whatsnew/3.10.rst:1783 msgid "" "Importing from the ``typing.io`` and ``typing.re`` submodules will now emit :" "exc:`DeprecationWarning`. These submodules will be removed in a future " @@ -2245,11 +2255,11 @@ msgid "" "Rittau in :issue:`38291`)" msgstr "" -#: ../../whatsnew/3.10.rst:1786 ../../whatsnew/3.10.rst:2211 +#: ../../whatsnew/3.10.rst:1792 ../../whatsnew/3.10.rst:2217 msgid "Removed" msgstr "" -#: ../../whatsnew/3.10.rst:1788 +#: ../../whatsnew/3.10.rst:1794 msgid "" "Removed special methods ``__int__``, ``__float__``, ``__floordiv__``, " "``__mod__``, ``__divmod__``, ``__rfloordiv__``, ``__rmod__`` and " @@ -2257,7 +2267,7 @@ msgid "" "`TypeError`. (Contributed by Serhiy Storchaka in :issue:`41974`.)" msgstr "" -#: ../../whatsnew/3.10.rst:1794 +#: ../../whatsnew/3.10.rst:1800 msgid "" "The ``ParserBase.error()`` method from the private and undocumented " "``_markupbase`` module has been removed. :class:`html.parser.HTMLParser` is " @@ -2266,7 +2276,7 @@ msgid "" "`31844`.)" msgstr "" -#: ../../whatsnew/3.10.rst:1800 +#: ../../whatsnew/3.10.rst:1806 msgid "" "Removed the ``unicodedata.ucnhash_CAPI`` attribute which was an internal " "PyCapsule object. The related private ``_PyUnicode_Name_CAPI`` structure was " @@ -2274,7 +2284,7 @@ msgid "" "`42157`.)" msgstr "" -#: ../../whatsnew/3.10.rst:1805 +#: ../../whatsnew/3.10.rst:1811 msgid "" "Removed the ``parser`` module, which was deprecated in 3.9 due to the switch " "to the new PEG parser, as well as all the C source and header files that " @@ -2282,7 +2292,7 @@ msgid "" "``graminit.h`` and ``grammar.h``." msgstr "" -#: ../../whatsnew/3.10.rst:1810 +#: ../../whatsnew/3.10.rst:1816 msgid "" "Removed the Public C API functions ``PyParser_SimpleParseStringFlags``, " "``PyParser_SimpleParseStringFlagsFilename``, " @@ -2290,7 +2300,7 @@ msgid "" "deprecated in 3.9 due to the switch to the new PEG parser." msgstr "" -#: ../../whatsnew/3.10.rst:1815 +#: ../../whatsnew/3.10.rst:1821 msgid "" "Removed the ``formatter`` module, which was deprecated in Python 3.4. It is " "somewhat obsolete, little used, and not tested. It was originally scheduled " @@ -2300,71 +2310,71 @@ msgid "" "`42299`.)" msgstr "" -#: ../../whatsnew/3.10.rst:1822 +#: ../../whatsnew/3.10.rst:1828 msgid "" "Removed the :c:func:`PyModule_GetWarningsModule` function that was useless " "now due to the _warnings module was converted to a builtin module in 2.6. " "(Contributed by Hai Shi in :issue:`42599`.)" msgstr "" -#: ../../whatsnew/3.10.rst:1826 +#: ../../whatsnew/3.10.rst:1832 msgid "" "Remove deprecated aliases to :ref:`collections-abstract-base-classes` from " "the :mod:`collections` module. (Contributed by Victor Stinner in :issue:" "`37324`.)" msgstr "" -#: ../../whatsnew/3.10.rst:1830 +#: ../../whatsnew/3.10.rst:1836 msgid "" "The ``loop`` parameter has been removed from most of :mod:`asyncio`\\ 's :" "doc:`high-level API <../library/asyncio-api-index>` following deprecation in " "Python 3.8. The motivation behind this change is multifold:" msgstr "" -#: ../../whatsnew/3.10.rst:1834 +#: ../../whatsnew/3.10.rst:1840 msgid "This simplifies the high-level API." msgstr "" -#: ../../whatsnew/3.10.rst:1835 +#: ../../whatsnew/3.10.rst:1841 msgid "" "The functions in the high-level API have been implicitly getting the current " "thread's running event loop since Python 3.7. There isn't a need to pass " "the event loop to the API in most normal use cases." msgstr "" -#: ../../whatsnew/3.10.rst:1838 +#: ../../whatsnew/3.10.rst:1844 msgid "" "Event loop passing is error-prone especially when dealing with loops running " "in different threads." msgstr "" -#: ../../whatsnew/3.10.rst:1841 +#: ../../whatsnew/3.10.rst:1847 msgid "" "Note that the low-level API will still accept ``loop``. See :ref:`changes-" "python-api` for examples of how to replace existing code." msgstr "" -#: ../../whatsnew/3.10.rst:1844 ../../whatsnew/3.10.rst:1916 +#: ../../whatsnew/3.10.rst:1850 ../../whatsnew/3.10.rst:1922 msgid "" "(Contributed by Yurii Karabas, Andrew Svetlov, Yury Selivanov and Kyle " "Stanley in :issue:`42392`.)" msgstr "" -#: ../../whatsnew/3.10.rst:1849 ../../whatsnew/3.10.rst:2136 +#: ../../whatsnew/3.10.rst:1855 ../../whatsnew/3.10.rst:2142 msgid "Porting to Python 3.10" msgstr "" -#: ../../whatsnew/3.10.rst:1851 +#: ../../whatsnew/3.10.rst:1857 msgid "" "This section lists previously described changes and other bugfixes that may " "require changes to your code." msgstr "" -#: ../../whatsnew/3.10.rst:1856 +#: ../../whatsnew/3.10.rst:1862 msgid "Changes in the Python syntax" msgstr "" -#: ../../whatsnew/3.10.rst:1858 +#: ../../whatsnew/3.10.rst:1864 msgid "" "Deprecation warning is now emitted when compiling previously valid syntax if " "the numeric literal is immediately followed by a keyword (like in ``0in " @@ -2374,11 +2384,11 @@ msgid "" "following keyword. (Contributed by Serhiy Storchaka in :issue:`43833`)." msgstr "" -#: ../../whatsnew/3.10.rst:1869 +#: ../../whatsnew/3.10.rst:1875 msgid "Changes in the Python API" msgstr "" -#: ../../whatsnew/3.10.rst:1871 +#: ../../whatsnew/3.10.rst:1877 msgid "" "The *etype* parameters of the :func:`~traceback.format_exception`, :func:" "`~traceback.format_exception_only`, and :func:`~traceback.print_exception` " @@ -2386,7 +2396,7 @@ msgid "" "(Contributed by Zackery Spytz and Matthias Bussonnier in :issue:`26389`.)" msgstr "" -#: ../../whatsnew/3.10.rst:1877 +#: ../../whatsnew/3.10.rst:1883 msgid "" ":mod:`atexit`: At Python exit, if a callback registered with :func:`atexit." "register` fails, its exception is now logged. Previously, only some " @@ -2394,7 +2404,7 @@ msgid "" "(Contributed by Victor Stinner in :issue:`42639`.)" msgstr "" -#: ../../whatsnew/3.10.rst:1883 +#: ../../whatsnew/3.10.rst:1889 msgid "" ":class:`collections.abc.Callable` generic now flattens type parameters, " "similar to what :data:`typing.Callable` currently does. This means that " @@ -2407,7 +2417,7 @@ msgid "" "`42195`.)" msgstr "" -#: ../../whatsnew/3.10.rst:1893 +#: ../../whatsnew/3.10.rst:1899 msgid "" ":meth:`socket.htons` and :meth:`socket.ntohs` now raise :exc:`OverflowError` " "instead of :exc:`DeprecationWarning` if the given parameter will not fit in " @@ -2415,29 +2425,29 @@ msgid "" "`42393`.)" msgstr "" -#: ../../whatsnew/3.10.rst:1898 +#: ../../whatsnew/3.10.rst:1904 msgid "" "The ``loop`` parameter has been removed from most of :mod:`asyncio`\\ 's :" "doc:`high-level API <../library/asyncio-api-index>` following deprecation in " "Python 3.8." msgstr "" -#: ../../whatsnew/3.10.rst:1902 +#: ../../whatsnew/3.10.rst:1908 msgid "A coroutine that currently looks like this::" msgstr "" -#: ../../whatsnew/3.10.rst:1907 +#: ../../whatsnew/3.10.rst:1913 msgid "Should be replaced with this::" msgstr "" -#: ../../whatsnew/3.10.rst:1912 +#: ../../whatsnew/3.10.rst:1918 msgid "" "If ``foo()`` was specifically designed *not* to run in the current thread's " "running event loop (e.g. running in another thread's event loop), consider " "using :func:`asyncio.run_coroutine_threadsafe` instead." msgstr "" -#: ../../whatsnew/3.10.rst:1919 +#: ../../whatsnew/3.10.rst:1925 msgid "" "The :data:`types.FunctionType` constructor now inherits the current builtins " "if the *globals* dictionary has no ``\"__builtins__\"`` key, rather than " @@ -2448,11 +2458,11 @@ msgid "" "`42990`.)" msgstr "" -#: ../../whatsnew/3.10.rst:1928 +#: ../../whatsnew/3.10.rst:1934 msgid "Changes in the C API" msgstr "" -#: ../../whatsnew/3.10.rst:1930 +#: ../../whatsnew/3.10.rst:1936 msgid "" "The C API functions ``PyParser_SimpleParseStringFlags``, " "``PyParser_SimpleParseStringFlagsFilename``, " @@ -2461,31 +2471,31 @@ msgid "" "PEG parser." msgstr "" -#: ../../whatsnew/3.10.rst:1936 +#: ../../whatsnew/3.10.rst:1942 msgid "" "Source should be now be compiled directly to a code object using, for " "example, :c:func:`Py_CompileString`. The resulting code object can then be " "evaluated using, for example, :c:func:`PyEval_EvalCode`." msgstr "" -#: ../../whatsnew/3.10.rst:1940 +#: ../../whatsnew/3.10.rst:1946 msgid "Specifically:" msgstr "" -#: ../../whatsnew/3.10.rst:1942 +#: ../../whatsnew/3.10.rst:1948 msgid "" "A call to ``PyParser_SimpleParseStringFlags`` followed by ``PyNode_Compile`` " "can be replaced by calling :c:func:`Py_CompileString`." msgstr "" -#: ../../whatsnew/3.10.rst:1945 +#: ../../whatsnew/3.10.rst:1951 msgid "" "There is no direct replacement for ``PyParser_SimpleParseFileFlags``. To " "compile code from a ``FILE *`` argument, you will need to read the file in C " "and pass the resulting buffer to :c:func:`Py_CompileString`." msgstr "" -#: ../../whatsnew/3.10.rst:1949 +#: ../../whatsnew/3.10.rst:1955 msgid "" "To compile a file given a ``char *`` filename, explicitly open the file, " "read it and compile the result. One way to do this is using the :py:mod:`io` " @@ -2494,7 +2504,7 @@ msgid "" "(Declarations and error handling are omitted.) ::" msgstr "" -#: ../../whatsnew/3.10.rst:1962 +#: ../../whatsnew/3.10.rst:1968 msgid "" "For ``FrameObject`` objects, the ``f_lasti`` member now represents a " "wordcode offset instead of a simple offset into the bytecode string. This " @@ -2504,53 +2514,53 @@ msgid "" "considered stable: please use :c:func:`PyFrame_GetLineNumber` instead." msgstr "" -#: ../../whatsnew/3.10.rst:1970 +#: ../../whatsnew/3.10.rst:1976 msgid "CPython bytecode changes" msgstr "" -#: ../../whatsnew/3.10.rst:1972 +#: ../../whatsnew/3.10.rst:1978 msgid "" "The ``MAKE_FUNCTION`` instruction now accepts either a dict or a tuple of " "strings as the function's annotations. (Contributed by Yurii Karabas and " "Inada Naoki in :issue:`42202`)" msgstr "" -#: ../../whatsnew/3.10.rst:1977 +#: ../../whatsnew/3.10.rst:1983 msgid "Build Changes" msgstr "" -#: ../../whatsnew/3.10.rst:1979 +#: ../../whatsnew/3.10.rst:1985 msgid "" ":pep:`644`: Python now requires OpenSSL 1.1.1 or newer. OpenSSL 1.0.2 is no " "longer supported. (Contributed by Christian Heimes in :issue:`43669`.)" msgstr "" -#: ../../whatsnew/3.10.rst:1983 +#: ../../whatsnew/3.10.rst:1989 msgid "" "The C99 functions :c:func:`snprintf` and :c:func:`vsnprintf` are now " "required to build Python. (Contributed by Victor Stinner in :issue:`36020`.)" msgstr "" -#: ../../whatsnew/3.10.rst:1987 +#: ../../whatsnew/3.10.rst:1993 msgid "" ":mod:`sqlite3` requires SQLite 3.7.15 or higher. (Contributed by Sergey " "Fedoseev and Erlend E. Aasland in :issue:`40744` and :issue:`40810`.)" msgstr "" -#: ../../whatsnew/3.10.rst:1990 +#: ../../whatsnew/3.10.rst:1996 msgid "" "The :mod:`atexit` module must now always be built as a built-in module. " "(Contributed by Victor Stinner in :issue:`42639`.)" msgstr "" -#: ../../whatsnew/3.10.rst:1993 +#: ../../whatsnew/3.10.rst:1999 msgid "" "Add :option:`--disable-test-modules` option to the ``configure`` script: " "don't build nor install test modules. (Contributed by Xavier de Gaye, Thomas " "Petazzoni and Peixing Xin in :issue:`27640`.)" msgstr "" -#: ../../whatsnew/3.10.rst:1997 +#: ../../whatsnew/3.10.rst:2003 msgid "" "Add :option:`--with-wheel-pkg-dir=PATH option <--with-wheel-pkg-dir>` to the " "``./configure`` script. If specified, the :mod:`ensurepip` module looks for " @@ -2559,7 +2569,7 @@ msgid "" "packages." msgstr "" -#: ../../whatsnew/3.10.rst:2003 +#: ../../whatsnew/3.10.rst:2009 msgid "" "Some Linux distribution packaging policies recommend against bundling " "dependencies. For example, Fedora installs wheel packages in the ``/usr/" @@ -2567,22 +2577,22 @@ msgid "" "_bundled`` package." msgstr "" -#: ../../whatsnew/3.10.rst:2008 +#: ../../whatsnew/3.10.rst:2014 msgid "(Contributed by Victor Stinner in :issue:`42856`.)" msgstr "" -#: ../../whatsnew/3.10.rst:2010 +#: ../../whatsnew/3.10.rst:2016 msgid "" "Add a new :option:`configure --without-static-libpython option <--without-" "static-libpython>` to not build the ``libpythonMAJOR.MINOR.a`` static " "library and not install the ``python.o`` object file." msgstr "" -#: ../../whatsnew/3.10.rst:2014 +#: ../../whatsnew/3.10.rst:2020 msgid "(Contributed by Victor Stinner in :issue:`43103`.)" msgstr "" -#: ../../whatsnew/3.10.rst:2016 +#: ../../whatsnew/3.10.rst:2022 msgid "" "The ``configure`` script now uses the ``pkg-config`` utility, if available, " "to detect the location of Tcl/Tk headers and libraries. As before, those " @@ -2591,7 +2601,7 @@ msgid "" "(Contributed by Manolis Stamatogiannakis in :issue:`42603`.)" msgstr "" -#: ../../whatsnew/3.10.rst:2022 +#: ../../whatsnew/3.10.rst:2028 msgid "" "Add :option:`--with-openssl-rpath` option to ``configure`` script. The " "option simplifies building Python with a custom OpenSSL installation, e.g. " @@ -2599,15 +2609,15 @@ msgid "" "(Contributed by Christian Heimes in :issue:`43466`.)" msgstr "" -#: ../../whatsnew/3.10.rst:2029 +#: ../../whatsnew/3.10.rst:2035 msgid "C API Changes" msgstr "" -#: ../../whatsnew/3.10.rst:2032 +#: ../../whatsnew/3.10.rst:2038 msgid "PEP 652: Maintaining the Stable ABI" msgstr "" -#: ../../whatsnew/3.10.rst:2034 +#: ../../whatsnew/3.10.rst:2040 msgid "" "The Stable ABI (Application Binary Interface) for extension modules or " "embedding Python is now explicitly defined. :ref:`stable` describes C API " @@ -2615,25 +2625,25 @@ msgid "" "ABI." msgstr "" -#: ../../whatsnew/3.10.rst:2039 +#: ../../whatsnew/3.10.rst:2045 msgid "(Contributed by Petr Viktorin in :pep:`652` and :issue:`43795`.)" msgstr "" -#: ../../whatsnew/3.10.rst:2044 +#: ../../whatsnew/3.10.rst:2050 msgid "" "The result of :c:func:`PyNumber_Index` now always has exact type :class:" "`int`. Previously, the result could have been an instance of a subclass of " "``int``. (Contributed by Serhiy Storchaka in :issue:`40792`.)" msgstr "" -#: ../../whatsnew/3.10.rst:2048 +#: ../../whatsnew/3.10.rst:2054 msgid "" "Add a new :c:member:`~PyConfig.orig_argv` member to the :c:type:`PyConfig` " "structure: the list of the original command line arguments passed to the " "Python executable. (Contributed by Victor Stinner in :issue:`23427`.)" msgstr "" -#: ../../whatsnew/3.10.rst:2053 +#: ../../whatsnew/3.10.rst:2059 msgid "" "The :c:func:`PyDateTime_DATE_GET_TZINFO` and :c:func:" "`PyDateTime_TIME_GET_TZINFO` macros have been added for accessing the " @@ -2641,72 +2651,72 @@ msgid "" "time` objects. (Contributed by Zackery Spytz in :issue:`30155`.)" msgstr "" -#: ../../whatsnew/3.10.rst:2059 +#: ../../whatsnew/3.10.rst:2065 msgid "" "Add a :c:func:`PyCodec_Unregister` function to unregister a codec search " "function. (Contributed by Hai Shi in :issue:`41842`.)" msgstr "" -#: ../../whatsnew/3.10.rst:2063 +#: ../../whatsnew/3.10.rst:2069 msgid "" "The :c:func:`PyIter_Send` function was added to allow sending value into " "iterator without raising ``StopIteration`` exception. (Contributed by " "Vladimir Matveev in :issue:`41756`.)" msgstr "" -#: ../../whatsnew/3.10.rst:2067 +#: ../../whatsnew/3.10.rst:2073 msgid "" "Add :c:func:`PyUnicode_AsUTF8AndSize` to the limited C API. (Contributed by " "Alex Gaynor in :issue:`41784`.)" msgstr "" -#: ../../whatsnew/3.10.rst:2070 +#: ../../whatsnew/3.10.rst:2076 msgid "" "Add :c:func:`PyModule_AddObjectRef` function: similar to :c:func:" "`PyModule_AddObject` but don't steal a reference to the value on success. " "(Contributed by Victor Stinner in :issue:`1635741`.)" msgstr "" -#: ../../whatsnew/3.10.rst:2075 +#: ../../whatsnew/3.10.rst:2081 msgid "" "Add :c:func:`Py_NewRef` and :c:func:`Py_XNewRef` functions to increment the " "reference count of an object and return the object. (Contributed by Victor " "Stinner in :issue:`42262`.)" msgstr "" -#: ../../whatsnew/3.10.rst:2079 +#: ../../whatsnew/3.10.rst:2085 msgid "" "The :c:func:`PyType_FromSpecWithBases` and :c:func:" "`PyType_FromModuleAndSpec` functions now accept a single class as the " "*bases* argument. (Contributed by Serhiy Storchaka in :issue:`42423`.)" msgstr "" -#: ../../whatsnew/3.10.rst:2083 +#: ../../whatsnew/3.10.rst:2089 msgid "" "The :c:func:`PyType_FromModuleAndSpec` function now accepts NULL ``tp_doc`` " "slot. (Contributed by Hai Shi in :issue:`41832`.)" msgstr "" -#: ../../whatsnew/3.10.rst:2087 +#: ../../whatsnew/3.10.rst:2093 msgid "" "The :c:func:`PyType_GetSlot` function can accept :ref:`static types `. (Contributed by Hai Shi and Petr Viktorin in :issue:`41073`.)" msgstr "" -#: ../../whatsnew/3.10.rst:2091 +#: ../../whatsnew/3.10.rst:2097 msgid "" "Add a new :c:func:`PySet_CheckExact` function to the C-API to check if an " "object is an instance of :class:`set` but not an instance of a subtype. " "(Contributed by Pablo Galindo in :issue:`43277`.)" msgstr "" -#: ../../whatsnew/3.10.rst:2095 +#: ../../whatsnew/3.10.rst:2101 msgid "" "Add :c:func:`PyErr_SetInterruptEx` which allows passing a signal number to " "simulate. (Contributed by Antoine Pitrou in :issue:`43356`.)" msgstr "" -#: ../../whatsnew/3.10.rst:2099 +#: ../../whatsnew/3.10.rst:2105 msgid "" "The limited C API is now supported if :ref:`Python is built in debug mode " "` (if the ``Py_DEBUG`` macro is defined). In the limited C API, " @@ -2719,14 +2729,14 @@ msgid "" "`36465`)." msgstr "" -#: ../../whatsnew/3.10.rst:2109 +#: ../../whatsnew/3.10.rst:2115 msgid "" "The limited C API is still not supported in the :option:`--with-trace-refs` " "special build (``Py_TRACE_REFS`` macro). (Contributed by Victor Stinner in :" "issue:`43688`.)" msgstr "" -#: ../../whatsnew/3.10.rst:2113 +#: ../../whatsnew/3.10.rst:2119 msgid "" "Add the :c:func:`Py_Is(x, y) ` function to test if the *x* object is " "the *y* object, the same as ``x is y`` in Python. Add also the :c:func:" @@ -2736,7 +2746,7 @@ msgid "" "`43753`.)" msgstr "" -#: ../../whatsnew/3.10.rst:2120 +#: ../../whatsnew/3.10.rst:2126 msgid "" "Add new functions to control the garbage collector from C code: :c:func:" "`PyGC_Enable()`, :c:func:`PyGC_Disable()`, :c:func:`PyGC_IsEnabled()`. These " @@ -2744,20 +2754,20 @@ msgid "" "collector from C code without having to import the :mod:`gc` module." msgstr "" -#: ../../whatsnew/3.10.rst:2127 +#: ../../whatsnew/3.10.rst:2133 msgid "" "Add a new :c:data:`Py_TPFLAGS_DISALLOW_INSTANTIATION` type flag to disallow " "creating type instances. (Contributed by Victor Stinner in :issue:`43916`.)" msgstr "" -#: ../../whatsnew/3.10.rst:2131 +#: ../../whatsnew/3.10.rst:2137 msgid "" "Add a new :c:data:`Py_TPFLAGS_IMMUTABLETYPE` type flag for creating " "immutable type objects: type attributes cannot be set nor deleted. " "(Contributed by Victor Stinner and Erlend E. Aasland in :issue:`43908`.)" msgstr "" -#: ../../whatsnew/3.10.rst:2138 +#: ../../whatsnew/3.10.rst:2144 msgid "" "The ``PY_SSIZE_T_CLEAN`` macro must now be defined to use :c:func:" "`PyArg_ParseTuple` and :c:func:`Py_BuildValue` formats which use ``#``: " @@ -2766,7 +2776,7 @@ msgid "" "`353`. (Contributed by Victor Stinner in :issue:`40943`.)" msgstr "" -#: ../../whatsnew/3.10.rst:2145 +#: ../../whatsnew/3.10.rst:2151 msgid "" "Since :c:func:`Py_REFCNT()` is changed to the inline static function, " "``Py_REFCNT(obj) = new_refcnt`` must be replaced with ``Py_SET_REFCNT(obj, " @@ -2774,18 +2784,18 @@ msgid "" "For backward compatibility, this macro can be used::" msgstr "" -#: ../../whatsnew/3.10.rst:2154 +#: ../../whatsnew/3.10.rst:2160 msgid "(Contributed by Victor Stinner in :issue:`39573`.)" msgstr "" -#: ../../whatsnew/3.10.rst:2156 +#: ../../whatsnew/3.10.rst:2162 msgid "" "Calling :c:func:`PyDict_GetItem` without :term:`GIL` held had been allowed " "for historical reason. It is no longer allowed. (Contributed by Victor " "Stinner in :issue:`40839`.)" msgstr "" -#: ../../whatsnew/3.10.rst:2160 +#: ../../whatsnew/3.10.rst:2166 msgid "" "``PyUnicode_FromUnicode(NULL, size)`` and " "``PyUnicode_FromStringAndSize(NULL, size)`` raise ``DeprecationWarning`` " @@ -2793,14 +2803,14 @@ msgid "" "data. (Contributed by Inada Naoki in :issue:`36346`.)" msgstr "" -#: ../../whatsnew/3.10.rst:2165 +#: ../../whatsnew/3.10.rst:2171 msgid "" "The private ``_PyUnicode_Name_CAPI`` structure of the PyCapsule API " "``unicodedata.ucnhash_CAPI`` has been moved to the internal C API. " "(Contributed by Victor Stinner in :issue:`42157`.)" msgstr "" -#: ../../whatsnew/3.10.rst:2169 +#: ../../whatsnew/3.10.rst:2175 msgid "" ":c:func:`Py_GetPath`, :c:func:`Py_GetPrefix`, :c:func:`Py_GetExecPrefix`, :c:" "func:`Py_GetProgramFullPath`, :c:func:`Py_GetPythonHome` and :c:func:" @@ -2811,7 +2821,7 @@ msgid "" "issue:`42260`.)" msgstr "" -#: ../../whatsnew/3.10.rst:2177 +#: ../../whatsnew/3.10.rst:2183 msgid "" ":c:func:`PyList_SET_ITEM`, :c:func:`PyTuple_SET_ITEM` and :c:func:" "`PyCell_SET` macros can no longer be used as l-value or r-value. For " @@ -2821,7 +2831,7 @@ msgid "" "and Victor Stinner in :issue:`30459`.)" msgstr "" -#: ../../whatsnew/3.10.rst:2184 +#: ../../whatsnew/3.10.rst:2190 msgid "" "The non-limited API files ``odictobject.h``, ``parser_interface.h``, " "``picklebufobject.h``, ``pyarena.h``, ``pyctype.h``, ``pydebug.h``, ``pyfpe." @@ -2832,7 +2842,7 @@ msgid "" "Nicholas Sim in :issue:`35134`)" msgstr "" -#: ../../whatsnew/3.10.rst:2192 +#: ../../whatsnew/3.10.rst:2198 msgid "" "Use the :c:data:`Py_TPFLAGS_IMMUTABLETYPE` type flag to create immutable " "type objects. Do not rely on :c:data:`Py_TPFLAGS_HEAPTYPE` to decide if a " @@ -2841,85 +2851,85 @@ msgid "" "issue:`43908`.)" msgstr "" -#: ../../whatsnew/3.10.rst:2198 +#: ../../whatsnew/3.10.rst:2204 msgid "" "The undocumented function ``Py_FrozenMain`` has been removed from the " "limited API. The function is mainly useful for custom builds of Python. " "(Contributed by Petr Viktorin in :issue:`26241`)" msgstr "" -#: ../../whatsnew/3.10.rst:2205 +#: ../../whatsnew/3.10.rst:2211 msgid "" "The ``PyUnicode_InternImmortal()`` function is now deprecated and will be " "removed in Python 3.12: use :c:func:`PyUnicode_InternInPlace` instead. " "(Contributed by Victor Stinner in :issue:`41692`.)" msgstr "" -#: ../../whatsnew/3.10.rst:2213 +#: ../../whatsnew/3.10.rst:2219 msgid "" "Removed ``Py_UNICODE_str*`` functions manipulating ``Py_UNICODE*`` strings. " "(Contributed by Inada Naoki in :issue:`41123`.)" msgstr "" -#: ../../whatsnew/3.10.rst:2216 +#: ../../whatsnew/3.10.rst:2222 msgid "" "``Py_UNICODE_strlen``: use :c:func:`PyUnicode_GetLength` or :c:macro:" "`PyUnicode_GET_LENGTH`" msgstr "" -#: ../../whatsnew/3.10.rst:2218 +#: ../../whatsnew/3.10.rst:2224 msgid "" "``Py_UNICODE_strcat``: use :c:func:`PyUnicode_CopyCharacters` or :c:func:" "`PyUnicode_FromFormat`" msgstr "" -#: ../../whatsnew/3.10.rst:2220 +#: ../../whatsnew/3.10.rst:2226 msgid "" "``Py_UNICODE_strcpy``, ``Py_UNICODE_strncpy``: use :c:func:" "`PyUnicode_CopyCharacters` or :c:func:`PyUnicode_Substring`" msgstr "" -#: ../../whatsnew/3.10.rst:2222 +#: ../../whatsnew/3.10.rst:2228 msgid "``Py_UNICODE_strcmp``: use :c:func:`PyUnicode_Compare`" msgstr "" -#: ../../whatsnew/3.10.rst:2223 +#: ../../whatsnew/3.10.rst:2229 msgid "``Py_UNICODE_strncmp``: use :c:func:`PyUnicode_Tailmatch`" msgstr "" -#: ../../whatsnew/3.10.rst:2224 +#: ../../whatsnew/3.10.rst:2230 msgid "" "``Py_UNICODE_strchr``, ``Py_UNICODE_strrchr``: use :c:func:" "`PyUnicode_FindChar`" msgstr "" -#: ../../whatsnew/3.10.rst:2227 +#: ../../whatsnew/3.10.rst:2233 msgid "" "Removed ``PyUnicode_GetMax()``. Please migrate to new (:pep:`393`) APIs. " "(Contributed by Inada Naoki in :issue:`41103`.)" msgstr "" -#: ../../whatsnew/3.10.rst:2230 +#: ../../whatsnew/3.10.rst:2236 msgid "" "Removed ``PyLong_FromUnicode()``. Please migrate to :c:func:" "`PyLong_FromUnicodeObject`. (Contributed by Inada Naoki in :issue:`41103`.)" msgstr "" -#: ../../whatsnew/3.10.rst:2233 +#: ../../whatsnew/3.10.rst:2239 msgid "" "Removed ``PyUnicode_AsUnicodeCopy()``. Please use :c:func:" "`PyUnicode_AsUCS4Copy` or :c:func:`PyUnicode_AsWideCharString` (Contributed " "by Inada Naoki in :issue:`41103`.)" msgstr "" -#: ../../whatsnew/3.10.rst:2237 +#: ../../whatsnew/3.10.rst:2243 msgid "" "Removed ``_Py_CheckRecursionLimit`` variable: it has been replaced by " "``ceval.recursion_limit`` of the :c:type:`PyInterpreterState` structure. " "(Contributed by Victor Stinner in :issue:`41834`.)" msgstr "" -#: ../../whatsnew/3.10.rst:2241 +#: ../../whatsnew/3.10.rst:2247 msgid "" "Removed undocumented macros ``Py_ALLOW_RECURSION`` and " "``Py_END_ALLOW_RECURSION`` and the ``recursion_critical`` field of the :c:" @@ -2927,14 +2937,14 @@ msgid "" "issue:`41936`.)" msgstr "" -#: ../../whatsnew/3.10.rst:2246 +#: ../../whatsnew/3.10.rst:2252 msgid "" "Removed the undocumented ``PyOS_InitInterrupts()`` function. Initializing " "Python already implicitly installs signal handlers: see :c:member:`PyConfig." "install_signal_handlers`. (Contributed by Victor Stinner in :issue:`41713`.)" msgstr "" -#: ../../whatsnew/3.10.rst:2251 +#: ../../whatsnew/3.10.rst:2257 msgid "" "Remove the ``PyAST_Validate()`` function. It is no longer possible to build " "a AST object (``mod_ty`` type) with the public C API. The function was " @@ -2942,48 +2952,48 @@ msgid "" "Stinner in :issue:`43244`.)" msgstr "" -#: ../../whatsnew/3.10.rst:2256 +#: ../../whatsnew/3.10.rst:2262 msgid "Remove the ``symtable.h`` header file and the undocumented functions:" msgstr "" -#: ../../whatsnew/3.10.rst:2258 +#: ../../whatsnew/3.10.rst:2264 msgid "``PyST_GetScope()``" msgstr "``PyST_GetScope()``" -#: ../../whatsnew/3.10.rst:2259 +#: ../../whatsnew/3.10.rst:2265 msgid "``PySymtable_Build()``" msgstr "``PySymtable_Build()``" -#: ../../whatsnew/3.10.rst:2260 +#: ../../whatsnew/3.10.rst:2266 msgid "``PySymtable_BuildObject()``" msgstr "``PySymtable_BuildObject()``" -#: ../../whatsnew/3.10.rst:2261 +#: ../../whatsnew/3.10.rst:2267 msgid "``PySymtable_Free()``" msgstr "``PySymtable_Free()``" -#: ../../whatsnew/3.10.rst:2262 +#: ../../whatsnew/3.10.rst:2268 msgid "``Py_SymtableString()``" msgstr "``Py_SymtableString()``" -#: ../../whatsnew/3.10.rst:2263 +#: ../../whatsnew/3.10.rst:2269 msgid "``Py_SymtableStringObject()``" msgstr "``Py_SymtableStringObject()``" -#: ../../whatsnew/3.10.rst:2265 +#: ../../whatsnew/3.10.rst:2271 msgid "" "The ``Py_SymtableString()`` function was part the stable ABI by mistake but " "it could not be used, because the ``symtable.h`` header file was excluded " "from the limited C API." msgstr "" -#: ../../whatsnew/3.10.rst:2269 +#: ../../whatsnew/3.10.rst:2275 msgid "" "Use Python :mod:`symtable` module instead. (Contributed by Victor Stinner " "in :issue:`43244`.)" msgstr "" -#: ../../whatsnew/3.10.rst:2272 +#: ../../whatsnew/3.10.rst:2278 msgid "" "Remove :c:func:`PyOS_ReadlineFunctionPointer` from the limited C API headers " "and from ``python3.dll``, the library that provides the stable ABI on " @@ -2991,7 +3001,7 @@ msgid "" "cannot be guaranteed. (Contributed by Petr Viktorin in :issue:`43868`.)" msgstr "" -#: ../../whatsnew/3.10.rst:2278 +#: ../../whatsnew/3.10.rst:2284 msgid "" "Remove ``ast.h``, ``asdl.h``, and ``Python-ast.h`` header files. These " "functions were undocumented and excluded from the limited C API. Most names " @@ -3002,86 +3012,86 @@ msgid "" "(Contributed by Victor Stinner in :issue:`43244`.)" msgstr "" -#: ../../whatsnew/3.10.rst:2286 +#: ../../whatsnew/3.10.rst:2292 msgid "" "Remove the compiler and parser functions using ``struct _mod`` type, because " "the public AST C API was removed:" msgstr "" -#: ../../whatsnew/3.10.rst:2289 +#: ../../whatsnew/3.10.rst:2295 msgid "``PyAST_Compile()``" msgstr "``PyAST_Compile()``" -#: ../../whatsnew/3.10.rst:2290 +#: ../../whatsnew/3.10.rst:2296 msgid "``PyAST_CompileEx()``" msgstr "``PyAST_CompileEx()``" -#: ../../whatsnew/3.10.rst:2291 +#: ../../whatsnew/3.10.rst:2297 msgid "``PyAST_CompileObject()``" msgstr "``PyAST_CompileObject()``" -#: ../../whatsnew/3.10.rst:2292 +#: ../../whatsnew/3.10.rst:2298 msgid "``PyFuture_FromAST()``" msgstr "``PyFuture_FromAST()``" -#: ../../whatsnew/3.10.rst:2293 +#: ../../whatsnew/3.10.rst:2299 msgid "``PyFuture_FromASTObject()``" msgstr "``PyFuture_FromASTObject()``" -#: ../../whatsnew/3.10.rst:2294 +#: ../../whatsnew/3.10.rst:2300 msgid "``PyParser_ASTFromFile()``" msgstr "``PyParser_ASTFromFile()``" -#: ../../whatsnew/3.10.rst:2295 +#: ../../whatsnew/3.10.rst:2301 msgid "``PyParser_ASTFromFileObject()``" msgstr "``PyParser_ASTFromFileObject()``" -#: ../../whatsnew/3.10.rst:2296 +#: ../../whatsnew/3.10.rst:2302 msgid "``PyParser_ASTFromFilename()``" msgstr "``PyParser_ASTFromFilename()``" -#: ../../whatsnew/3.10.rst:2297 +#: ../../whatsnew/3.10.rst:2303 msgid "``PyParser_ASTFromString()``" msgstr "``PyParser_ASTFromString()``" -#: ../../whatsnew/3.10.rst:2298 +#: ../../whatsnew/3.10.rst:2304 msgid "``PyParser_ASTFromStringObject()``" msgstr "``PyParser_ASTFromStringObject()``" -#: ../../whatsnew/3.10.rst:2300 +#: ../../whatsnew/3.10.rst:2306 msgid "" "These functions were undocumented and excluded from the limited C API. " "(Contributed by Victor Stinner in :issue:`43244`.)" msgstr "" -#: ../../whatsnew/3.10.rst:2303 +#: ../../whatsnew/3.10.rst:2309 msgid "Remove the ``pyarena.h`` header file with functions:" msgstr "" -#: ../../whatsnew/3.10.rst:2305 +#: ../../whatsnew/3.10.rst:2311 msgid "``PyArena_New()``" msgstr "``PyArena_New()``" -#: ../../whatsnew/3.10.rst:2306 +#: ../../whatsnew/3.10.rst:2312 msgid "``PyArena_Free()``" msgstr "``PyArena_Free()``" -#: ../../whatsnew/3.10.rst:2307 +#: ../../whatsnew/3.10.rst:2313 msgid "``PyArena_Malloc()``" msgstr "``PyArena_Malloc()``" -#: ../../whatsnew/3.10.rst:2308 +#: ../../whatsnew/3.10.rst:2314 msgid "``PyArena_AddPyObject()``" msgstr "``PyArena_AddPyObject()``" -#: ../../whatsnew/3.10.rst:2310 +#: ../../whatsnew/3.10.rst:2316 msgid "" "These functions were undocumented, excluded from the limited C API, and were " "only used internally by the compiler. (Contributed by Victor Stinner in :" "issue:`43244`.)" msgstr "" -#: ../../whatsnew/3.10.rst:2314 +#: ../../whatsnew/3.10.rst:2320 msgid "" "The ``PyThreadState.use_tracing`` member has been removed to optimize " "Python. (Contributed by Mark Shannon in :issue:`43760`.)" diff --git a/whatsnew/3.2.po b/whatsnew/3.2.po index f1a4e0e0d0..a2d3f239f5 100644 --- a/whatsnew/3.2.po +++ b/whatsnew/3.2.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.10\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2021-10-26 16:47+0000\n" +"POT-Creation-Date: 2022-05-21 17:35+0000\n" "PO-Revision-Date: 2018-05-23 16:20+0000\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -824,44 +824,45 @@ msgstr "" #: ../../whatsnew/3.2.rst:746 msgid "" -"For details of the update, see `Introducing ElementTree `_ on Fredrik Lundh's website." +"For details of the update, see `Introducing ElementTree `_ on " +"Fredrik Lundh's website." msgstr "" -#: ../../whatsnew/3.2.rst:749 +#: ../../whatsnew/3.2.rst:750 msgid "(Contributed by Florent Xicluna and Fredrik Lundh, :issue:`6472`.)" msgstr "" -#: ../../whatsnew/3.2.rst:752 +#: ../../whatsnew/3.2.rst:753 msgid "functools" msgstr "functools" -#: ../../whatsnew/3.2.rst:754 +#: ../../whatsnew/3.2.rst:755 msgid "" "The :mod:`functools` module includes a new decorator for caching function " "calls. :func:`functools.lru_cache` can save repeated queries to an external " "resource whenever the results are expected to be the same." msgstr "" -#: ../../whatsnew/3.2.rst:758 +#: ../../whatsnew/3.2.rst:759 msgid "" "For example, adding a caching decorator to a database query function can " "save database accesses for popular searches:" msgstr "" -#: ../../whatsnew/3.2.rst:771 +#: ../../whatsnew/3.2.rst:772 msgid "" "To help with choosing an effective cache size, the wrapped function is " "instrumented for tracking cache statistics:" msgstr "" -#: ../../whatsnew/3.2.rst:777 +#: ../../whatsnew/3.2.rst:778 msgid "" "If the phonelist table gets updated, the outdated contents of the cache can " "be cleared with:" msgstr "" -#: ../../whatsnew/3.2.rst:782 +#: ../../whatsnew/3.2.rst:783 msgid "" "(Contributed by Raymond Hettinger and incorporating design ideas from Jim " "Baker, Miki Tebeka, and Nick Coghlan; see `recipe 498245 `_\\, :issue:`10586`, and :issue:`10593`.)" msgstr "" -#: ../../whatsnew/3.2.rst:788 +#: ../../whatsnew/3.2.rst:789 msgid "" "The :func:`functools.wraps` decorator now adds a :attr:`__wrapped__` " "attribute pointing to the original callable function. This allows wrapped " @@ -878,84 +879,84 @@ msgid "" "attr:`__doc__` which might not be defined for the wrapped callable." msgstr "" -#: ../../whatsnew/3.2.rst:794 +#: ../../whatsnew/3.2.rst:795 msgid "" "In the above example, the cache can be removed by recovering the original " "function:" msgstr "" -#: ../../whatsnew/3.2.rst:799 +#: ../../whatsnew/3.2.rst:800 msgid "" "(By Nick Coghlan and Terrence Cole; :issue:`9567`, :issue:`3445`, and :issue:" "`8814`.)" msgstr "" -#: ../../whatsnew/3.2.rst:802 +#: ../../whatsnew/3.2.rst:803 msgid "" "To help write classes with rich comparison methods, a new decorator :func:" "`functools.total_ordering` will use existing equality and inequality methods " "to fill in the remaining methods." msgstr "" -#: ../../whatsnew/3.2.rst:806 +#: ../../whatsnew/3.2.rst:807 msgid "" "For example, supplying *__eq__* and *__lt__* will enable :func:`~functools." "total_ordering` to fill-in *__le__*, *__gt__* and *__ge__*::" msgstr "" -#: ../../whatsnew/3.2.rst:819 +#: ../../whatsnew/3.2.rst:820 msgid "" "With the *total_ordering* decorator, the remaining comparison methods are " "filled in automatically." msgstr "" -#: ../../whatsnew/3.2.rst:822 ../../whatsnew/3.2.rst:834 -#: ../../whatsnew/3.2.rst:878 ../../whatsnew/3.2.rst:899 -#: ../../whatsnew/3.2.rst:913 ../../whatsnew/3.2.rst:1783 -#: ../../whatsnew/3.2.rst:1828 +#: ../../whatsnew/3.2.rst:823 ../../whatsnew/3.2.rst:835 +#: ../../whatsnew/3.2.rst:879 ../../whatsnew/3.2.rst:900 +#: ../../whatsnew/3.2.rst:914 ../../whatsnew/3.2.rst:1784 +#: ../../whatsnew/3.2.rst:1829 msgid "(Contributed by Raymond Hettinger.)" msgstr "" -#: ../../whatsnew/3.2.rst:824 +#: ../../whatsnew/3.2.rst:825 msgid "" "To aid in porting programs from Python 2, the :func:`functools.cmp_to_key` " "function converts an old-style comparison function to modern :term:`key " "function`:" msgstr "" -#: ../../whatsnew/3.2.rst:831 +#: ../../whatsnew/3.2.rst:832 msgid "" "For sorting examples and a brief sorting tutorial, see the `Sorting HowTo " "`_ tutorial." msgstr "" -#: ../../whatsnew/3.2.rst:837 +#: ../../whatsnew/3.2.rst:838 msgid "itertools" msgstr "itertools" -#: ../../whatsnew/3.2.rst:839 +#: ../../whatsnew/3.2.rst:840 msgid "" "The :mod:`itertools` module has a new :func:`~itertools.accumulate` function " "modeled on APL's *scan* operator and Numpy's *accumulate* function:" msgstr "" -#: ../../whatsnew/3.2.rst:850 +#: ../../whatsnew/3.2.rst:851 msgid "" "For an example using :func:`~itertools.accumulate`, see the :ref:`examples " "for the random module `." msgstr "" -#: ../../whatsnew/3.2.rst:853 +#: ../../whatsnew/3.2.rst:854 msgid "" "(Contributed by Raymond Hettinger and incorporating design suggestions from " "Mark Dickinson.)" msgstr "" -#: ../../whatsnew/3.2.rst:857 +#: ../../whatsnew/3.2.rst:858 msgid "collections" msgstr "collections" -#: ../../whatsnew/3.2.rst:859 +#: ../../whatsnew/3.2.rst:860 msgid "" "The :class:`collections.Counter` class now has two forms of in-place " "subtraction, the existing *-=* operator for `saturating subtraction `_ which is defined for only two threads." msgstr "" -#: ../../whatsnew/3.2.rst:928 +#: ../../whatsnew/3.2.rst:929 msgid "" "Implemented as a two-phase cyclic barrier, :class:`~threading.Barrier` " "objects are suitable for use in loops. The separate *filling* and " @@ -1022,11 +1023,11 @@ msgid "" "resets after each cycle." msgstr "" -#: ../../whatsnew/3.2.rst:933 +#: ../../whatsnew/3.2.rst:934 msgid "Example of using barriers::" msgstr "" -#: ../../whatsnew/3.2.rst:947 +#: ../../whatsnew/3.2.rst:948 msgid "" "In this example, the barrier enforces a rule that votes cannot be counted at " "any polling site until all polls are closed. Notice how a solution with a " @@ -1035,7 +1036,7 @@ msgid "" "barrier point is crossed." msgstr "" -#: ../../whatsnew/3.2.rst:953 +#: ../../whatsnew/3.2.rst:954 msgid "" "If any of the predecessor tasks can hang or be delayed, a barrier can be " "created with an optional *timeout* parameter. Then if the timeout period " @@ -1044,14 +1045,14 @@ msgid "" "exception is raised::" msgstr "" -#: ../../whatsnew/3.2.rst:969 +#: ../../whatsnew/3.2.rst:970 msgid "" "In this example, the barrier enforces a more robust rule. If some election " "sites do not finish before midnight, the barrier times-out and the ballots " "are sealed and deposited in a queue for later handling." msgstr "" -#: ../../whatsnew/3.2.rst:973 +#: ../../whatsnew/3.2.rst:974 msgid "" "See `Barrier Synchronization Patterns `_ for more examples " @@ -1061,17 +1062,17 @@ msgid "" "*section 3.6*." msgstr "" -#: ../../whatsnew/3.2.rst:979 +#: ../../whatsnew/3.2.rst:980 msgid "" "(Contributed by Kristján Valur Jónsson with an API review by Jeffrey Yasskin " "in :issue:`8777`.)" msgstr "" -#: ../../whatsnew/3.2.rst:983 +#: ../../whatsnew/3.2.rst:984 msgid "datetime and time" msgstr "datetime 和 time" -#: ../../whatsnew/3.2.rst:985 +#: ../../whatsnew/3.2.rst:986 msgid "" "The :mod:`datetime` module has a new type :class:`~datetime.timezone` that " "implements the :class:`~datetime.tzinfo` interface by returning a fixed UTC " @@ -1079,20 +1080,20 @@ msgid "" "datetime objects::" msgstr "" -#: ../../whatsnew/3.2.rst:998 +#: ../../whatsnew/3.2.rst:999 msgid "" "Also, :class:`~datetime.timedelta` objects can now be multiplied by :class:" "`float` and divided by :class:`float` and :class:`int` objects. And :class:" "`~datetime.timedelta` objects can now divide one another." msgstr "" -#: ../../whatsnew/3.2.rst:1002 +#: ../../whatsnew/3.2.rst:1003 msgid "" "The :meth:`datetime.date.strftime` method is no longer restricted to years " "after 1900. The new supported year range is from 1000 to 9999 inclusive." msgstr "" -#: ../../whatsnew/3.2.rst:1005 +#: ../../whatsnew/3.2.rst:1006 msgid "" "Whenever a two-digit year is used in a time tuple, the interpretation has " "been governed by :attr:`time.accept2dyear`. The default is ``True`` which " @@ -1100,7 +1101,7 @@ msgid "" "POSIX rules governing the ``%y`` strptime format." msgstr "" -#: ../../whatsnew/3.2.rst:1010 +#: ../../whatsnew/3.2.rst:1011 msgid "" "Starting with Py3.2, use of the century guessing heuristic will emit a :exc:" "`DeprecationWarning`. Instead, it is recommended that :attr:`time." @@ -1108,7 +1109,7 @@ msgid "" "without guesswork::" msgstr "" -#: ../../whatsnew/3.2.rst:1029 +#: ../../whatsnew/3.2.rst:1030 msgid "" "Several functions now have significantly expanded date ranges. When :attr:" "`time.accept2dyear` is false, the :func:`time.asctime` function will accept " @@ -1117,45 +1118,45 @@ msgid "" "corresponding operating system functions." msgstr "" -#: ../../whatsnew/3.2.rst:1035 +#: ../../whatsnew/3.2.rst:1036 msgid "" "(Contributed by Alexander Belopolsky and Victor Stinner in :issue:" "`1289118`, :issue:`5094`, :issue:`6641`, :issue:`2706`, :issue:`1777412`, :" "issue:`8013`, and :issue:`10827`.)" msgstr "" -#: ../../whatsnew/3.2.rst:1042 +#: ../../whatsnew/3.2.rst:1043 msgid "math" msgstr "math" -#: ../../whatsnew/3.2.rst:1044 +#: ../../whatsnew/3.2.rst:1045 msgid "" "The :mod:`math` module has been updated with six new functions inspired by " "the C99 standard." msgstr "" -#: ../../whatsnew/3.2.rst:1047 +#: ../../whatsnew/3.2.rst:1048 msgid "" "The :func:`~math.isfinite` function provides a reliable and fast way to " "detect special values. It returns ``True`` for regular numbers and " "``False`` for *Nan* or *Infinity*:" msgstr "" -#: ../../whatsnew/3.2.rst:1055 +#: ../../whatsnew/3.2.rst:1056 msgid "" "The :func:`~math.expm1` function computes ``e**x-1`` for small values of *x* " "without incurring the loss of precision that usually accompanies the " "subtraction of nearly equal quantities:" msgstr "" -#: ../../whatsnew/3.2.rst:1063 +#: ../../whatsnew/3.2.rst:1064 msgid "" "The :func:`~math.erf` function computes a probability integral or `Gaussian " "error function `_. The " "complementary error function, :func:`~math.erfc`, is ``1 - erf(x)``:" msgstr "" -#: ../../whatsnew/3.2.rst:1078 +#: ../../whatsnew/3.2.rst:1079 msgid "" "The :func:`~math.gamma` function is a continuous extension of the factorial " "function. See https://en.wikipedia.org/wiki/Gamma_function for details. " @@ -1164,36 +1165,36 @@ msgid "" "computing the natural logarithm of the gamma function:" msgstr "" -#: ../../whatsnew/3.2.rst:1090 +#: ../../whatsnew/3.2.rst:1091 msgid "(Contributed by Mark Dickinson.)" msgstr "" -#: ../../whatsnew/3.2.rst:1093 +#: ../../whatsnew/3.2.rst:1094 msgid "abc" msgstr "abc" -#: ../../whatsnew/3.2.rst:1095 +#: ../../whatsnew/3.2.rst:1096 msgid "" "The :mod:`abc` module now supports :func:`~abc.abstractclassmethod` and :" "func:`~abc.abstractstaticmethod`." msgstr "" -#: ../../whatsnew/3.2.rst:1098 +#: ../../whatsnew/3.2.rst:1099 msgid "" "These tools make it possible to define an :term:`abstract base class` that " "requires a particular :func:`classmethod` or :func:`staticmethod` to be " "implemented::" msgstr "" -#: ../../whatsnew/3.2.rst:1110 +#: ../../whatsnew/3.2.rst:1111 msgid "(Patch submitted by Daniel Urban; :issue:`5867`.)" msgstr "" -#: ../../whatsnew/3.2.rst:1113 +#: ../../whatsnew/3.2.rst:1114 msgid "io" msgstr "io" -#: ../../whatsnew/3.2.rst:1115 +#: ../../whatsnew/3.2.rst:1116 msgid "" "The :class:`io.BytesIO` has a new method, :meth:`~io.BytesIO.getbuffer`, " "which provides functionality similar to :func:`memoryview`. It creates an " @@ -1201,15 +1202,15 @@ msgid "" "and support for slice notation are well-suited to in-place editing::" msgstr "" -#: ../../whatsnew/3.2.rst:1141 +#: ../../whatsnew/3.2.rst:1142 msgid "(Contributed by Antoine Pitrou in :issue:`5506`.)" msgstr "" -#: ../../whatsnew/3.2.rst:1144 +#: ../../whatsnew/3.2.rst:1145 msgid "reprlib" msgstr "reprlib" -#: ../../whatsnew/3.2.rst:1146 +#: ../../whatsnew/3.2.rst:1147 msgid "" "When writing a :meth:`__repr__` method for a custom container, it is easy to " "forget to handle the case where a member refers back to the container " @@ -1218,28 +1219,28 @@ msgid "" "representation string." msgstr "" -#: ../../whatsnew/3.2.rst:1152 +#: ../../whatsnew/3.2.rst:1153 msgid "" "To help write such :meth:`__repr__` methods, the :mod:`reprlib` module has a " "new decorator, :func:`~reprlib.recursive_repr`, for detecting recursive " "calls to :meth:`__repr__` and substituting a placeholder string instead::" msgstr "" -#: ../../whatsnew/3.2.rst:1167 +#: ../../whatsnew/3.2.rst:1168 msgid "(Contributed by Raymond Hettinger in :issue:`9826` and :issue:`9840`.)" msgstr "" -#: ../../whatsnew/3.2.rst:1170 +#: ../../whatsnew/3.2.rst:1171 msgid "logging" msgstr "logging" -#: ../../whatsnew/3.2.rst:1172 +#: ../../whatsnew/3.2.rst:1173 msgid "" "In addition to dictionary-based configuration described above, the :mod:" "`logging` package has many other improvements." msgstr "" -#: ../../whatsnew/3.2.rst:1175 +#: ../../whatsnew/3.2.rst:1176 msgid "" "The logging documentation has been augmented by a :ref:`basic tutorial " "`\\, an :ref:`advanced tutorial ` for zipfiles, uncompressed tarfiles, " @@ -1664,7 +1665,7 @@ msgid "" "tarfiles or custom formats)." msgstr "" -#: ../../whatsnew/3.2.rst:1556 +#: ../../whatsnew/3.2.rst:1557 msgid "" "The principal functions are :func:`~shutil.make_archive` and :func:`~shutil." "unpack_archive`. By default, both operate on the current directory (which " @@ -1673,23 +1674,23 @@ msgid "" "non-destructive (the original files are left unchanged)." msgstr "" -#: ../../whatsnew/3.2.rst:1590 +#: ../../whatsnew/3.2.rst:1591 msgid "sqlite3" msgstr "sqlite3" -#: ../../whatsnew/3.2.rst:1592 +#: ../../whatsnew/3.2.rst:1593 msgid "" "The :mod:`sqlite3` module was updated to pysqlite version 2.6.0. It has two " "new capabilities." msgstr "" -#: ../../whatsnew/3.2.rst:1594 +#: ../../whatsnew/3.2.rst:1595 msgid "" "The :attr:`sqlite3.Connection.in_transit` attribute is true if there is an " "active transaction for uncommitted changes." msgstr "" -#: ../../whatsnew/3.2.rst:1597 +#: ../../whatsnew/3.2.rst:1598 msgid "" "The :meth:`sqlite3.Connection.enable_load_extension` and :meth:`sqlite3." "Connection.load_extension` methods allows you to load SQLite extensions from " @@ -1697,30 +1698,30 @@ msgid "" "distributed with SQLite." msgstr "" -#: ../../whatsnew/3.2.rst:1602 +#: ../../whatsnew/3.2.rst:1603 msgid "(Contributed by R. David Murray and Shashwat Anand; :issue:`8845`.)" msgstr "" -#: ../../whatsnew/3.2.rst:1605 +#: ../../whatsnew/3.2.rst:1606 msgid "html" msgstr "html" -#: ../../whatsnew/3.2.rst:1607 +#: ../../whatsnew/3.2.rst:1608 msgid "" "A new :mod:`html` module was introduced with only a single function, :func:" "`~html.escape`, which is used for escaping reserved characters from HTML " "markup:" msgstr "" -#: ../../whatsnew/3.2.rst:1616 +#: ../../whatsnew/3.2.rst:1617 msgid "socket" msgstr "socket" -#: ../../whatsnew/3.2.rst:1618 +#: ../../whatsnew/3.2.rst:1619 msgid "The :mod:`socket` module has two new improvements." msgstr "" -#: ../../whatsnew/3.2.rst:1620 +#: ../../whatsnew/3.2.rst:1621 msgid "" "Socket objects now have a :meth:`~socket.socket.detach()` method which puts " "the socket into closed state without actually closing the underlying file " @@ -1728,24 +1729,24 @@ msgid "" "Antoine Pitrou; :issue:`8524`.)" msgstr "" -#: ../../whatsnew/3.2.rst:1625 +#: ../../whatsnew/3.2.rst:1626 msgid "" ":func:`socket.create_connection` now supports the context management " "protocol to unconditionally consume :exc:`socket.error` exceptions and to " "close the socket when done. (Contributed by Giampaolo Rodolà; :issue:`9794`.)" msgstr "" -#: ../../whatsnew/3.2.rst:1631 +#: ../../whatsnew/3.2.rst:1632 msgid "ssl" msgstr "ssl" -#: ../../whatsnew/3.2.rst:1633 +#: ../../whatsnew/3.2.rst:1634 msgid "" "The :mod:`ssl` module added a number of features to satisfy common " "requirements for secure (encrypted, authenticated) internet connections:" msgstr "" -#: ../../whatsnew/3.2.rst:1636 +#: ../../whatsnew/3.2.rst:1637 msgid "" "A new class, :class:`~ssl.SSLContext`, serves as a container for persistent " "SSL data, such as protocol settings, certificates, private keys, and various " @@ -1753,14 +1754,14 @@ msgid "" "creating an SSL socket from an SSL context." msgstr "" -#: ../../whatsnew/3.2.rst:1641 +#: ../../whatsnew/3.2.rst:1642 msgid "" "A new function, :func:`ssl.match_hostname`, supports server identity " "verification for higher-level protocols by implementing the rules of HTTPS " "(from :rfc:`2818`) which are also suitable for other protocols." msgstr "" -#: ../../whatsnew/3.2.rst:1645 +#: ../../whatsnew/3.2.rst:1646 msgid "" "The :func:`ssl.wrap_socket` constructor function now takes a *ciphers* " "argument. The *ciphers* string lists the allowed encryption algorithms " @@ -1768,7 +1769,7 @@ msgid "" "openssl.org/docs/manmaster/man1/ciphers.html#CIPHER-LIST-FORMAT>`__." msgstr "" -#: ../../whatsnew/3.2.rst:1650 +#: ../../whatsnew/3.2.rst:1651 msgid "" "When linked against recent versions of OpenSSL, the :mod:`ssl` module now " "supports the Server Name Indication extension to the TLS protocol, allowing " @@ -1777,20 +1778,20 @@ msgid "" "the *server_hostname* argument to :meth:`ssl.SSLContext.wrap_socket`." msgstr "" -#: ../../whatsnew/3.2.rst:1656 +#: ../../whatsnew/3.2.rst:1657 msgid "" "Various options have been added to the :mod:`ssl` module, such as :data:" "`~ssl.OP_NO_SSLv2` which disables the insecure and obsolete SSLv2 protocol." msgstr "" -#: ../../whatsnew/3.2.rst:1660 +#: ../../whatsnew/3.2.rst:1661 msgid "" "The extension now loads all the OpenSSL ciphers and digest algorithms. If " "some SSL certificates cannot be verified, they are reported as an \"unknown " "algorithm\" error." msgstr "" -#: ../../whatsnew/3.2.rst:1664 +#: ../../whatsnew/3.2.rst:1665 msgid "" "The version of OpenSSL being used is now accessible using the module " "attributes :data:`ssl.OPENSSL_VERSION` (a string), :data:`ssl." @@ -1798,17 +1799,17 @@ msgid "" "(an integer)." msgstr "" -#: ../../whatsnew/3.2.rst:1669 +#: ../../whatsnew/3.2.rst:1670 msgid "" "(Contributed by Antoine Pitrou in :issue:`8850`, :issue:`1589`, :issue:" "`8322`, :issue:`5639`, :issue:`4870`, :issue:`8484`, and :issue:`8321`.)" msgstr "" -#: ../../whatsnew/3.2.rst:1673 +#: ../../whatsnew/3.2.rst:1674 msgid "nntp" msgstr "nntp" -#: ../../whatsnew/3.2.rst:1675 +#: ../../whatsnew/3.2.rst:1676 msgid "" "The :mod:`nntplib` module has a revamped implementation with better bytes " "and text semantics as well as more practical APIs. These improvements break " @@ -1816,24 +1817,24 @@ msgid "" "dysfunctional in itself." msgstr "" -#: ../../whatsnew/3.2.rst:1680 +#: ../../whatsnew/3.2.rst:1681 msgid "" "Support for secure connections through both implicit (using :class:`nntplib." "NNTP_SSL`) and explicit (using :meth:`nntplib.NNTP.starttls`) TLS has also " "been added." msgstr "" -#: ../../whatsnew/3.2.rst:1684 +#: ../../whatsnew/3.2.rst:1685 msgid "" "(Contributed by Antoine Pitrou in :issue:`9360` and Andrew Vant in :issue:" "`1926`.)" msgstr "" -#: ../../whatsnew/3.2.rst:1687 +#: ../../whatsnew/3.2.rst:1688 msgid "certificates" msgstr "certificates" -#: ../../whatsnew/3.2.rst:1689 +#: ../../whatsnew/3.2.rst:1690 msgid "" ":class:`http.client.HTTPSConnection`, :class:`urllib.request.HTTPSHandler` " "and :func:`urllib.request.urlopen` now take optional arguments to allow for " @@ -1841,49 +1842,49 @@ msgid "" "recommended in public uses of HTTPS." msgstr "" -#: ../../whatsnew/3.2.rst:1694 +#: ../../whatsnew/3.2.rst:1695 msgid "(Added by Antoine Pitrou, :issue:`9003`.)" msgstr "" -#: ../../whatsnew/3.2.rst:1697 +#: ../../whatsnew/3.2.rst:1698 msgid "imaplib" msgstr "imaplib" -#: ../../whatsnew/3.2.rst:1699 +#: ../../whatsnew/3.2.rst:1700 msgid "" "Support for explicit TLS on standard IMAP4 connections has been added " "through the new :mod:`imaplib.IMAP4.starttls` method." msgstr "" -#: ../../whatsnew/3.2.rst:1702 +#: ../../whatsnew/3.2.rst:1703 msgid "(Contributed by Lorenzo M. Catucci and Antoine Pitrou, :issue:`4471`.)" msgstr "" -#: ../../whatsnew/3.2.rst:1705 +#: ../../whatsnew/3.2.rst:1706 msgid "http.client" msgstr "http.client" -#: ../../whatsnew/3.2.rst:1707 +#: ../../whatsnew/3.2.rst:1708 msgid "" "There were a number of small API improvements in the :mod:`http.client` " "module. The old-style HTTP 0.9 simple responses are no longer supported and " "the *strict* parameter is deprecated in all classes." msgstr "" -#: ../../whatsnew/3.2.rst:1711 +#: ../../whatsnew/3.2.rst:1712 msgid "" "The :class:`~http.client.HTTPConnection` and :class:`~http.client." "HTTPSConnection` classes now have a *source_address* parameter for a (host, " "port) tuple indicating where the HTTP connection is made from." msgstr "" -#: ../../whatsnew/3.2.rst:1716 +#: ../../whatsnew/3.2.rst:1717 msgid "" "Support for certificate checking and HTTPS virtual hosts were added to :" "class:`~http.client.HTTPSConnection`." msgstr "" -#: ../../whatsnew/3.2.rst:1719 +#: ../../whatsnew/3.2.rst:1720 msgid "" "The :meth:`~http.client.HTTPConnection.request` method on connection objects " "allowed an optional *body* argument so that a :term:`file object` could be " @@ -1893,14 +1894,14 @@ msgid "" "flexible than before." msgstr "" -#: ../../whatsnew/3.2.rst:1726 +#: ../../whatsnew/3.2.rst:1727 msgid "" "To establish an HTTPS connection through a proxy server, there is a new :" "meth:`~http.client.HTTPConnection.set_tunnel` method that sets the host and " "port for HTTP Connect tunneling." msgstr "" -#: ../../whatsnew/3.2.rst:1730 +#: ../../whatsnew/3.2.rst:1731 msgid "" "To match the behavior of :mod:`http.server`, the HTTP client library now " "also encodes headers with ISO-8859-1 (Latin-1) encoding. It was already " @@ -1909,11 +1910,11 @@ msgid "" "`10980`.)" msgstr "" -#: ../../whatsnew/3.2.rst:1736 +#: ../../whatsnew/3.2.rst:1737 msgid "unittest" msgstr "unittest" -#: ../../whatsnew/3.2.rst:1738 +#: ../../whatsnew/3.2.rst:1739 msgid "" "The unittest module has a number of improvements supporting test discovery " "for packages, easier experimentation at the interactive prompt, new testcase " @@ -1921,7 +1922,7 @@ msgid "" "names." msgstr "" -#: ../../whatsnew/3.2.rst:1743 +#: ../../whatsnew/3.2.rst:1744 msgid "" "The command-line call ``python -m unittest`` can now accept file paths " "instead of module names for running specific tests (:issue:`10620`). The " @@ -1931,29 +1932,29 @@ msgid "" "and a directory to start discovery with ``-s``:" msgstr "" -#: ../../whatsnew/3.2.rst:1754 ../../whatsnew/3.2.rst:1763 -#: ../../whatsnew/3.2.rst:1919 +#: ../../whatsnew/3.2.rst:1755 ../../whatsnew/3.2.rst:1764 +#: ../../whatsnew/3.2.rst:1920 msgid "(Contributed by Michael Foord.)" msgstr "" -#: ../../whatsnew/3.2.rst:1756 +#: ../../whatsnew/3.2.rst:1757 msgid "" "Experimentation at the interactive prompt is now easier because the :class:" "`unittest.case.TestCase` class can now be instantiated without arguments:" msgstr "" -#: ../../whatsnew/3.2.rst:1765 +#: ../../whatsnew/3.2.rst:1766 msgid "" "The :mod:`unittest` module has two new methods, :meth:`~unittest.TestCase." "assertWarns` and :meth:`~unittest.TestCase.assertWarnsRegex` to verify that " "a given warning type is triggered by the code under test::" msgstr "" -#: ../../whatsnew/3.2.rst:1773 +#: ../../whatsnew/3.2.rst:1774 msgid "(Contributed by Antoine Pitrou, :issue:`9754`.)" msgstr "" -#: ../../whatsnew/3.2.rst:1775 +#: ../../whatsnew/3.2.rst:1776 msgid "" "Another new method, :meth:`~unittest.TestCase.assertCountEqual` is used to " "compare two iterables to determine if their element counts are equal " @@ -1961,7 +1962,7 @@ msgid "" "regardless of order)::" msgstr "" -#: ../../whatsnew/3.2.rst:1785 +#: ../../whatsnew/3.2.rst:1786 msgid "" "A principal feature of the unittest module is an effort to produce " "meaningful diagnostics when a test fails. When possible, the failure is " @@ -1971,13 +1972,13 @@ msgid "" "that sets maximum length of diffs displayed." msgstr "" -#: ../../whatsnew/3.2.rst:1792 +#: ../../whatsnew/3.2.rst:1793 msgid "" "In addition, the method names in the module have undergone a number of clean-" "ups." msgstr "" -#: ../../whatsnew/3.2.rst:1794 +#: ../../whatsnew/3.2.rst:1795 msgid "" "For example, :meth:`~unittest.TestCase.assertRegex` is the new name for :" "meth:`~unittest.TestCase.assertRegexpMatches` which was misnamed because the " @@ -1988,76 +1989,76 @@ msgid "" "has unambiguous camel-casing." msgstr "" -#: ../../whatsnew/3.2.rst:1802 +#: ../../whatsnew/3.2.rst:1803 msgid "(Contributed by Raymond Hettinger and implemented by Ezio Melotti.)" msgstr "" -#: ../../whatsnew/3.2.rst:1804 +#: ../../whatsnew/3.2.rst:1805 msgid "" "To improve consistency, some long-standing method aliases are being " "deprecated in favor of the preferred names:" msgstr "" -#: ../../whatsnew/3.2.rst:1808 +#: ../../whatsnew/3.2.rst:1809 msgid "Old Name" msgstr "" -#: ../../whatsnew/3.2.rst:1808 +#: ../../whatsnew/3.2.rst:1809 msgid "Preferred Name" msgstr "" -#: ../../whatsnew/3.2.rst:1810 +#: ../../whatsnew/3.2.rst:1811 msgid ":meth:`assert_`" msgstr ":meth:`assert_`" -#: ../../whatsnew/3.2.rst:1810 +#: ../../whatsnew/3.2.rst:1811 msgid ":meth:`.assertTrue`" msgstr ":meth:`.assertTrue`" -#: ../../whatsnew/3.2.rst:1811 +#: ../../whatsnew/3.2.rst:1812 msgid ":meth:`assertEquals`" msgstr ":meth:`assertEquals`" -#: ../../whatsnew/3.2.rst:1811 +#: ../../whatsnew/3.2.rst:1812 msgid ":meth:`.assertEqual`" msgstr ":meth:`.assertEqual`" -#: ../../whatsnew/3.2.rst:1812 +#: ../../whatsnew/3.2.rst:1813 msgid ":meth:`assertNotEquals`" msgstr ":meth:`assertNotEquals`" -#: ../../whatsnew/3.2.rst:1812 +#: ../../whatsnew/3.2.rst:1813 msgid ":meth:`.assertNotEqual`" msgstr ":meth:`.assertNotEqual`" -#: ../../whatsnew/3.2.rst:1813 +#: ../../whatsnew/3.2.rst:1814 msgid ":meth:`assertAlmostEquals`" msgstr ":meth:`assertAlmostEquals`" -#: ../../whatsnew/3.2.rst:1813 +#: ../../whatsnew/3.2.rst:1814 msgid ":meth:`.assertAlmostEqual`" msgstr ":meth:`.assertAlmostEqual`" -#: ../../whatsnew/3.2.rst:1814 +#: ../../whatsnew/3.2.rst:1815 msgid ":meth:`assertNotAlmostEquals`" msgstr ":meth:`assertNotAlmostEquals`" -#: ../../whatsnew/3.2.rst:1814 +#: ../../whatsnew/3.2.rst:1815 msgid ":meth:`.assertNotAlmostEqual`" msgstr ":meth:`.assertNotAlmostEqual`" -#: ../../whatsnew/3.2.rst:1817 +#: ../../whatsnew/3.2.rst:1818 msgid "" "Likewise, the ``TestCase.fail*`` methods deprecated in Python 3.1 are " "expected to be removed in Python 3.3. Also see the :ref:`deprecated-" "aliases` section in the :mod:`unittest` documentation." msgstr "" -#: ../../whatsnew/3.2.rst:1821 +#: ../../whatsnew/3.2.rst:1822 msgid "(Contributed by Ezio Melotti; :issue:`9424`.)" msgstr "" -#: ../../whatsnew/3.2.rst:1823 +#: ../../whatsnew/3.2.rst:1824 msgid "" "The :meth:`~unittest.TestCase.assertDictContainsSubset` method was " "deprecated because it was misimplemented with the arguments in the wrong " @@ -2065,11 +2066,11 @@ msgid "" "``TestCase().assertDictContainsSubset({'a':1, 'b':2}, {'a':1})`` would fail." msgstr "" -#: ../../whatsnew/3.2.rst:1831 +#: ../../whatsnew/3.2.rst:1832 msgid "random" msgstr "random" -#: ../../whatsnew/3.2.rst:1833 +#: ../../whatsnew/3.2.rst:1834 msgid "" "The integer methods in the :mod:`random` module now do a better job of " "producing uniform distributions. Previously, they computed selections with " @@ -2081,15 +2082,15 @@ msgid "" "func:`~random.sample`." msgstr "" -#: ../../whatsnew/3.2.rst:1842 +#: ../../whatsnew/3.2.rst:1843 msgid "(Contributed by Raymond Hettinger; :issue:`9025`.)" msgstr "" -#: ../../whatsnew/3.2.rst:1845 +#: ../../whatsnew/3.2.rst:1846 msgid "poplib" msgstr "poplib" -#: ../../whatsnew/3.2.rst:1847 +#: ../../whatsnew/3.2.rst:1848 msgid "" ":class:`~poplib.POP3_SSL` class now accepts a *context* parameter, which is " "a :class:`ssl.SSLContext` object allowing bundling SSL configuration " @@ -2097,15 +2098,15 @@ msgid "" "lived) structure." msgstr "" -#: ../../whatsnew/3.2.rst:1852 +#: ../../whatsnew/3.2.rst:1853 msgid "(Contributed by Giampaolo Rodolà; :issue:`8807`.)" msgstr "" -#: ../../whatsnew/3.2.rst:1855 +#: ../../whatsnew/3.2.rst:1856 msgid "asyncore" msgstr "asyncore" -#: ../../whatsnew/3.2.rst:1857 +#: ../../whatsnew/3.2.rst:1858 msgid "" ":class:`asyncore.dispatcher` now provides a :meth:`~asyncore.dispatcher." "handle_accepted()` method returning a `(sock, addr)` pair which is called " @@ -2115,41 +2116,41 @@ msgid "" "dispatcher.accept()` directly." msgstr "" -#: ../../whatsnew/3.2.rst:1864 +#: ../../whatsnew/3.2.rst:1865 msgid "(Contributed by Giampaolo Rodolà; :issue:`6706`.)" msgstr "" -#: ../../whatsnew/3.2.rst:1867 +#: ../../whatsnew/3.2.rst:1868 msgid "tempfile" msgstr "tempfile" -#: ../../whatsnew/3.2.rst:1869 +#: ../../whatsnew/3.2.rst:1870 msgid "" "The :mod:`tempfile` module has a new context manager, :class:`~tempfile." "TemporaryDirectory` which provides easy deterministic cleanup of temporary " "directories::" msgstr "" -#: ../../whatsnew/3.2.rst:1876 +#: ../../whatsnew/3.2.rst:1877 msgid "(Contributed by Neil Schemenauer and Nick Coghlan; :issue:`5178`.)" msgstr "" -#: ../../whatsnew/3.2.rst:1879 +#: ../../whatsnew/3.2.rst:1880 msgid "inspect" msgstr "inspect" -#: ../../whatsnew/3.2.rst:1881 +#: ../../whatsnew/3.2.rst:1882 msgid "" "The :mod:`inspect` module has a new function :func:`~inspect." "getgeneratorstate` to easily identify the current state of a generator-" "iterator::" msgstr "" -#: ../../whatsnew/3.2.rst:1899 +#: ../../whatsnew/3.2.rst:1900 msgid "(Contributed by Rodolpho Eckhardt and Nick Coghlan, :issue:`10220`.)" msgstr "" -#: ../../whatsnew/3.2.rst:1901 +#: ../../whatsnew/3.2.rst:1902 msgid "" "To support lookups without the possibility of activating a dynamic " "attribute, the :mod:`inspect` module has a new function, :func:`~inspect." @@ -2157,26 +2158,26 @@ msgid "" "guaranteed not to change state while it is searching::" msgstr "" -#: ../../whatsnew/3.2.rst:1922 +#: ../../whatsnew/3.2.rst:1923 msgid "pydoc" msgstr "pydoc" -#: ../../whatsnew/3.2.rst:1924 +#: ../../whatsnew/3.2.rst:1925 msgid "" "The :mod:`pydoc` module now provides a much-improved web server interface, " "as well as a new command-line option ``-b`` to automatically open a browser " "window to display that server:" msgstr "" -#: ../../whatsnew/3.2.rst:1932 +#: ../../whatsnew/3.2.rst:1933 msgid "(Contributed by Ron Adam; :issue:`2001`.)" msgstr "" -#: ../../whatsnew/3.2.rst:1935 +#: ../../whatsnew/3.2.rst:1936 msgid "dis" msgstr "dis" -#: ../../whatsnew/3.2.rst:1937 +#: ../../whatsnew/3.2.rst:1938 msgid "" "The :mod:`dis` module gained two new functions for inspecting code, :func:" "`~dis.code_info` and :func:`~dis.show_code`. Both provide detailed code " @@ -2184,197 +2185,197 @@ msgid "" "code object. The former returns a string and the latter prints it::" msgstr "" -#: ../../whatsnew/3.2.rst:1964 +#: ../../whatsnew/3.2.rst:1965 msgid "" "In addition, the :func:`~dis.dis` function now accepts string arguments so " "that the common idiom ``dis(compile(s, '', 'eval'))`` can be shortened to " "``dis(s)``::" msgstr "" -#: ../../whatsnew/3.2.rst:1986 +#: ../../whatsnew/3.2.rst:1987 msgid "" "Taken together, these improvements make it easier to explore how CPython is " "implemented and to see for yourself what the language syntax does under-the-" "hood." msgstr "" -#: ../../whatsnew/3.2.rst:1990 +#: ../../whatsnew/3.2.rst:1991 msgid "(Contributed by Nick Coghlan in :issue:`9147`.)" msgstr "" -#: ../../whatsnew/3.2.rst:1993 +#: ../../whatsnew/3.2.rst:1994 msgid "dbm" msgstr "dbm" -#: ../../whatsnew/3.2.rst:1995 +#: ../../whatsnew/3.2.rst:1996 msgid "" "All database modules now support the :meth:`get` and :meth:`setdefault` " "methods." msgstr "" -#: ../../whatsnew/3.2.rst:1997 +#: ../../whatsnew/3.2.rst:1998 msgid "(Suggested by Ray Allen in :issue:`9523`.)" msgstr "" -#: ../../whatsnew/3.2.rst:2000 +#: ../../whatsnew/3.2.rst:2001 msgid "ctypes" msgstr "ctypes" -#: ../../whatsnew/3.2.rst:2002 +#: ../../whatsnew/3.2.rst:2003 msgid "" "A new type, :class:`ctypes.c_ssize_t` represents the C :c:type:`ssize_t` " "datatype." msgstr "" -#: ../../whatsnew/3.2.rst:2005 +#: ../../whatsnew/3.2.rst:2006 msgid "site" msgstr "site" -#: ../../whatsnew/3.2.rst:2007 +#: ../../whatsnew/3.2.rst:2008 msgid "" "The :mod:`site` module has three new functions useful for reporting on the " "details of a given Python installation." msgstr "" -#: ../../whatsnew/3.2.rst:2010 +#: ../../whatsnew/3.2.rst:2011 msgid "" ":func:`~site.getsitepackages` lists all global site-packages directories." msgstr "" -#: ../../whatsnew/3.2.rst:2012 +#: ../../whatsnew/3.2.rst:2013 msgid "" ":func:`~site.getuserbase` reports on the user's base directory where data " "can be stored." msgstr "" -#: ../../whatsnew/3.2.rst:2015 +#: ../../whatsnew/3.2.rst:2016 msgid "" ":func:`~site.getusersitepackages` reveals the user-specific site-packages " "directory path." msgstr "" -#: ../../whatsnew/3.2.rst:2030 +#: ../../whatsnew/3.2.rst:2031 msgid "" "Conveniently, some of site's functionality is accessible directly from the " "command-line:" msgstr "" -#: ../../whatsnew/3.2.rst:2040 +#: ../../whatsnew/3.2.rst:2041 msgid "(Contributed by Tarek Ziadé in :issue:`6693`.)" msgstr "" -#: ../../whatsnew/3.2.rst:2043 +#: ../../whatsnew/3.2.rst:2044 msgid "sysconfig" msgstr "sysconfig" -#: ../../whatsnew/3.2.rst:2045 +#: ../../whatsnew/3.2.rst:2046 msgid "" "The new :mod:`sysconfig` module makes it straightforward to discover " "installation paths and configuration variables that vary across platforms " "and installations." msgstr "" -#: ../../whatsnew/3.2.rst:2049 +#: ../../whatsnew/3.2.rst:2050 msgid "" "The module offers access simple access functions for platform and version " "information:" msgstr "" -#: ../../whatsnew/3.2.rst:2052 +#: ../../whatsnew/3.2.rst:2053 msgid "" ":func:`~sysconfig.get_platform` returning values like *linux-i586* or " "*macosx-10.6-ppc*." msgstr "" -#: ../../whatsnew/3.2.rst:2054 +#: ../../whatsnew/3.2.rst:2055 msgid "" ":func:`~sysconfig.get_python_version` returns a Python version string such " "as \"3.2\"." msgstr "" -#: ../../whatsnew/3.2.rst:2057 +#: ../../whatsnew/3.2.rst:2058 msgid "" "It also provides access to the paths and variables corresponding to one of " "seven named schemes used by :mod:`distutils`. Those include *posix_prefix*, " "*posix_home*, *posix_user*, *nt*, *nt_user*, *os2*, *os2_home*:" msgstr "" -#: ../../whatsnew/3.2.rst:2061 +#: ../../whatsnew/3.2.rst:2062 msgid "" ":func:`~sysconfig.get_paths` makes a dictionary containing installation " "paths for the current installation scheme." msgstr "" -#: ../../whatsnew/3.2.rst:2063 +#: ../../whatsnew/3.2.rst:2064 msgid "" ":func:`~sysconfig.get_config_vars` returns a dictionary of platform specific " "variables." msgstr "" -#: ../../whatsnew/3.2.rst:2066 +#: ../../whatsnew/3.2.rst:2067 msgid "There is also a convenient command-line interface:" msgstr "" -#: ../../whatsnew/3.2.rst:2105 +#: ../../whatsnew/3.2.rst:2106 msgid "(Moved out of Distutils by Tarek Ziadé.)" msgstr "" -#: ../../whatsnew/3.2.rst:2108 +#: ../../whatsnew/3.2.rst:2109 msgid "pdb" msgstr "pdb" -#: ../../whatsnew/3.2.rst:2110 +#: ../../whatsnew/3.2.rst:2111 msgid "" "The :mod:`pdb` debugger module gained a number of usability improvements:" msgstr "" -#: ../../whatsnew/3.2.rst:2112 +#: ../../whatsnew/3.2.rst:2113 msgid "" ":file:`pdb.py` now has a ``-c`` option that executes commands as given in a :" "file:`.pdbrc` script file." msgstr "" -#: ../../whatsnew/3.2.rst:2114 +#: ../../whatsnew/3.2.rst:2115 msgid "" "A :file:`.pdbrc` script file can contain ``continue`` and ``next`` commands " "that continue debugging." msgstr "" -#: ../../whatsnew/3.2.rst:2116 +#: ../../whatsnew/3.2.rst:2117 msgid "The :class:`Pdb` class constructor now accepts a *nosigint* argument." msgstr "" -#: ../../whatsnew/3.2.rst:2117 +#: ../../whatsnew/3.2.rst:2118 msgid "" "New commands: ``l(list)``, ``ll(long list)`` and ``source`` for listing " "source code." msgstr "" -#: ../../whatsnew/3.2.rst:2119 +#: ../../whatsnew/3.2.rst:2120 msgid "" "New commands: ``display`` and ``undisplay`` for showing or hiding the value " "of an expression if it has changed." msgstr "" -#: ../../whatsnew/3.2.rst:2121 +#: ../../whatsnew/3.2.rst:2122 msgid "" "New command: ``interact`` for starting an interactive interpreter containing " "the global and local names found in the current scope." msgstr "" -#: ../../whatsnew/3.2.rst:2123 +#: ../../whatsnew/3.2.rst:2124 msgid "Breakpoints can be cleared by breakpoint number." msgstr "" -#: ../../whatsnew/3.2.rst:2125 +#: ../../whatsnew/3.2.rst:2126 msgid "(Contributed by Georg Brandl, Antonio Cuni and Ilya Sandler.)" msgstr "" -#: ../../whatsnew/3.2.rst:2128 +#: ../../whatsnew/3.2.rst:2129 msgid "configparser" msgstr "configparser" -#: ../../whatsnew/3.2.rst:2130 +#: ../../whatsnew/3.2.rst:2131 msgid "" "The :mod:`configparser` module was modified to improve usability and " "predictability of the default parser and its supported INI syntax. The old :" @@ -2384,63 +2385,63 @@ msgid "" "option duplicates are not allowed in a single configuration source." msgstr "" -#: ../../whatsnew/3.2.rst:2137 +#: ../../whatsnew/3.2.rst:2138 msgid "Config parsers gained a new API based on the mapping protocol::" msgstr "" -#: ../../whatsnew/3.2.rst:2165 +#: ../../whatsnew/3.2.rst:2166 msgid "" "The new API is implemented on top of the classical API, so custom parser " "subclasses should be able to use it without modifications." msgstr "" -#: ../../whatsnew/3.2.rst:2168 +#: ../../whatsnew/3.2.rst:2169 msgid "" "The INI file structure accepted by config parsers can now be customized. " "Users can specify alternative option/value delimiters and comment prefixes, " "change the name of the *DEFAULT* section or switch the interpolation syntax." msgstr "" -#: ../../whatsnew/3.2.rst:2172 +#: ../../whatsnew/3.2.rst:2173 msgid "" "There is support for pluggable interpolation including an additional " "interpolation handler :class:`~configparser.ExtendedInterpolation`::" msgstr "" -#: ../../whatsnew/3.2.rst:2205 +#: ../../whatsnew/3.2.rst:2206 msgid "" "A number of smaller features were also introduced, like support for " "specifying encoding in read operations, specifying fallback values for get-" "functions, or reading directly from dictionaries and strings." msgstr "" -#: ../../whatsnew/3.2.rst:2209 +#: ../../whatsnew/3.2.rst:2210 msgid "(All changes contributed by Łukasz Langa.)" msgstr "" -#: ../../whatsnew/3.2.rst:2214 +#: ../../whatsnew/3.2.rst:2215 msgid "urllib.parse" msgstr "urllib.parse" -#: ../../whatsnew/3.2.rst:2216 +#: ../../whatsnew/3.2.rst:2217 msgid "" "A number of usability improvements were made for the :mod:`urllib.parse` " "module." msgstr "" -#: ../../whatsnew/3.2.rst:2218 +#: ../../whatsnew/3.2.rst:2219 msgid "" "The :func:`~urllib.parse.urlparse` function now supports `IPv6 `_ addresses as described in :rfc:`2732`:" msgstr "" -#: ../../whatsnew/3.2.rst:2230 +#: ../../whatsnew/3.2.rst:2231 msgid "" "The :func:`~urllib.parse.urldefrag` function now returns a :term:`named " "tuple`::" msgstr "" -#: ../../whatsnew/3.2.rst:2240 +#: ../../whatsnew/3.2.rst:2241 msgid "" "And, the :func:`~urllib.parse.urlencode` function is now much more flexible, " "accepting either a string or bytes type for the *query* argument. If it is " @@ -2448,7 +2449,7 @@ msgid "" "func:`~urllib.parse.quote_plus` for encoding::" msgstr "" -#: ../../whatsnew/3.2.rst:2251 +#: ../../whatsnew/3.2.rst:2252 msgid "" "As detailed in :ref:`parsing-ascii-encoded-bytes`, all the :mod:`urllib." "parse` functions now accept ASCII-encoded byte strings as input, so long as " @@ -2457,17 +2458,17 @@ msgid "" "strings:" msgstr "" -#: ../../whatsnew/3.2.rst:2260 +#: ../../whatsnew/3.2.rst:2261 msgid "" "(Work by Nick Coghlan, Dan Mahn, and Senthil Kumaran in :issue:`2987`, :" "issue:`5468`, and :issue:`9873`.)" msgstr "" -#: ../../whatsnew/3.2.rst:2264 +#: ../../whatsnew/3.2.rst:2265 msgid "mailbox" msgstr "mailbox" -#: ../../whatsnew/3.2.rst:2266 +#: ../../whatsnew/3.2.rst:2267 msgid "" "Thanks to a concerted effort by R. David Murray, the :mod:`mailbox` module " "has been fixed for Python 3.2. The challenge was that mailbox had been " @@ -2476,27 +2477,27 @@ msgid "" "different encodings." msgstr "" -#: ../../whatsnew/3.2.rst:2271 +#: ../../whatsnew/3.2.rst:2272 msgid "" "The solution harnessed the :mod:`email` package's binary support for parsing " "arbitrary email messages. In addition, the solution required a number of " "API changes." msgstr "" -#: ../../whatsnew/3.2.rst:2275 +#: ../../whatsnew/3.2.rst:2276 msgid "" "As expected, the :meth:`~mailbox.Mailbox.add` method for :class:`mailbox." "Mailbox` objects now accepts binary input." msgstr "" -#: ../../whatsnew/3.2.rst:2278 +#: ../../whatsnew/3.2.rst:2279 msgid "" ":class:`~io.StringIO` and text file input are deprecated. Also, string " "input will fail early if non-ASCII characters are used. Previously it would " "fail when the email was processed in a later step." msgstr "" -#: ../../whatsnew/3.2.rst:2282 +#: ../../whatsnew/3.2.rst:2283 msgid "" "There is also support for binary output. The :meth:`~mailbox.Mailbox." "get_file` method now returns a file in the binary mode (where it used to " @@ -2505,7 +2506,7 @@ msgid "" "message corresponding to a given *key*." msgstr "" -#: ../../whatsnew/3.2.rst:2288 +#: ../../whatsnew/3.2.rst:2289 msgid "" "It is still possible to get non-binary output using the old API's :meth:" "`~mailbox.Mailbox.get_string` method, but that approach is not very useful. " @@ -2513,17 +2514,17 @@ msgid "" "object or to load them from binary input." msgstr "" -#: ../../whatsnew/3.2.rst:2293 +#: ../../whatsnew/3.2.rst:2294 msgid "" "(Contributed by R. David Murray, with efforts from Steffen Daode Nurpmeso " "and an initial patch by Victor Stinner in :issue:`9124`.)" msgstr "" -#: ../../whatsnew/3.2.rst:2297 +#: ../../whatsnew/3.2.rst:2298 msgid "turtledemo" msgstr "turtledemo" -#: ../../whatsnew/3.2.rst:2299 +#: ../../whatsnew/3.2.rst:2300 msgid "" "The demonstration code for the :mod:`turtle` module was moved from the " "*Demo* directory to main library. It includes over a dozen sample scripts " @@ -2531,16 +2532,16 @@ msgid "" "from the command-line:" msgstr "" -#: ../../whatsnew/3.2.rst:2308 +#: ../../whatsnew/3.2.rst:2309 msgid "" "(Moved from the Demo directory by Alexander Belopolsky in :issue:`10199`.)" msgstr "" -#: ../../whatsnew/3.2.rst:2311 +#: ../../whatsnew/3.2.rst:2312 msgid "Multi-threading" msgstr "" -#: ../../whatsnew/3.2.rst:2313 +#: ../../whatsnew/3.2.rst:2314 msgid "" "The mechanism for serializing execution of concurrently running Python " "threads (generally known as the :term:`GIL` or Global Interpreter Lock) has " @@ -2552,7 +2553,7 @@ msgid "" "setswitchinterval()`. It currently defaults to 5 milliseconds." msgstr "" -#: ../../whatsnew/3.2.rst:2322 +#: ../../whatsnew/3.2.rst:2323 msgid "" "Additional details about the implementation can be read from a `python-dev " "mailing-list message `_ used in :" "meth:`list.sort` and :func:`sorted` now runs faster and uses less memory " @@ -2636,35 +2637,35 @@ msgid "" "saves time lost to delegating comparisons." msgstr "" -#: ../../whatsnew/3.2.rst:2377 +#: ../../whatsnew/3.2.rst:2378 msgid "(Patch by Daniel Stutzbach in :issue:`9915`.)" msgstr "" -#: ../../whatsnew/3.2.rst:2379 +#: ../../whatsnew/3.2.rst:2380 msgid "" "JSON decoding performance is improved and memory consumption is reduced " "whenever the same string is repeated for multiple keys. Also, JSON encoding " "now uses the C speedups when the ``sort_keys`` argument is true." msgstr "" -#: ../../whatsnew/3.2.rst:2383 +#: ../../whatsnew/3.2.rst:2384 msgid "" "(Contributed by Antoine Pitrou in :issue:`7451` and by Raymond Hettinger and " "Antoine Pitrou in :issue:`10314`.)" msgstr "" -#: ../../whatsnew/3.2.rst:2386 +#: ../../whatsnew/3.2.rst:2387 msgid "" "Recursive locks (created with the :func:`threading.RLock` API) now benefit " "from a C implementation which makes them as fast as regular locks, and " "between 10x and 15x faster than their previous pure Python implementation." msgstr "" -#: ../../whatsnew/3.2.rst:2390 +#: ../../whatsnew/3.2.rst:2391 msgid "(Contributed by Antoine Pitrou; :issue:`3001`.)" msgstr "" -#: ../../whatsnew/3.2.rst:2392 +#: ../../whatsnew/3.2.rst:2393 msgid "" "The fast-search algorithm in stringlib is now used by the :meth:`split`, :" "meth:`rsplit`, :meth:`splitlines` and :meth:`replace` methods on :class:" @@ -2673,21 +2674,21 @@ msgid "" "meth:`rpartition`." msgstr "" -#: ../../whatsnew/3.2.rst:2398 +#: ../../whatsnew/3.2.rst:2399 msgid "(Patch by Florent Xicluna in :issue:`7622` and :issue:`7462`.)" msgstr "" -#: ../../whatsnew/3.2.rst:2401 +#: ../../whatsnew/3.2.rst:2402 msgid "" "Integer to string conversions now work two \"digits\" at a time, reducing " "the number of division and modulo operations." msgstr "" -#: ../../whatsnew/3.2.rst:2404 +#: ../../whatsnew/3.2.rst:2405 msgid "(:issue:`6713` by Gawain Bolton, Mark Dickinson, and Victor Stinner.)" msgstr "" -#: ../../whatsnew/3.2.rst:2406 +#: ../../whatsnew/3.2.rst:2407 msgid "" "There were several other minor optimizations. Set differencing now runs " "faster when one operand is much larger than the other (patch by Andress " @@ -2699,11 +2700,11 @@ msgid "" "line arguments a bit faster (:issue:`7113` by Łukasz Langa)." msgstr "" -#: ../../whatsnew/3.2.rst:2417 +#: ../../whatsnew/3.2.rst:2418 msgid "Unicode" msgstr "" -#: ../../whatsnew/3.2.rst:2419 +#: ../../whatsnew/3.2.rst:2420 msgid "" "Python has been updated to `Unicode 6.0.0 `_. The update to the standard adds over 2,000 new characters " @@ -2711,7 +2712,7 @@ msgid "" "important for mobile phones." msgstr "" -#: ../../whatsnew/3.2.rst:2424 +#: ../../whatsnew/3.2.rst:2425 msgid "" "In addition, the updated standard has altered the character properties for " "two Kannada characters (U+0CF1, U+0CF2) and one New Tai Lue numeric " @@ -2721,15 +2722,15 @@ msgid "" "#Database_Changes>`_." msgstr "" -#: ../../whatsnew/3.2.rst:2432 +#: ../../whatsnew/3.2.rst:2433 msgid "Codecs" msgstr "" -#: ../../whatsnew/3.2.rst:2434 +#: ../../whatsnew/3.2.rst:2435 msgid "Support was added for *cp720* Arabic DOS encoding (:issue:`1616979`)." msgstr "" -#: ../../whatsnew/3.2.rst:2436 +#: ../../whatsnew/3.2.rst:2437 msgid "" "MBCS encoding no longer ignores the error handler argument. In the default " "strict mode, it raises an :exc:`UnicodeDecodeError` when it encounters an " @@ -2737,40 +2738,40 @@ msgid "" "unencodable character." msgstr "" -#: ../../whatsnew/3.2.rst:2441 +#: ../../whatsnew/3.2.rst:2442 msgid "" "The MBCS codec supports ``'strict'`` and ``'ignore'`` error handlers for " "decoding, and ``'strict'`` and ``'replace'`` for encoding." msgstr "" -#: ../../whatsnew/3.2.rst:2444 +#: ../../whatsnew/3.2.rst:2445 msgid "" "To emulate Python3.1 MBCS encoding, select the ``'ignore'`` handler for " "decoding and the ``'replace'`` handler for encoding." msgstr "" -#: ../../whatsnew/3.2.rst:2447 +#: ../../whatsnew/3.2.rst:2448 msgid "" "On Mac OS X, Python decodes command line arguments with ``'utf-8'`` rather " "than the locale encoding." msgstr "" -#: ../../whatsnew/3.2.rst:2450 +#: ../../whatsnew/3.2.rst:2451 msgid "" "By default, :mod:`tarfile` uses ``'utf-8'`` encoding on Windows (instead of " "``'mbcs'``) and the ``'surrogateescape'`` error handler on all operating " "systems." msgstr "" -#: ../../whatsnew/3.2.rst:2456 +#: ../../whatsnew/3.2.rst:2457 msgid "Documentation" msgstr "文件" -#: ../../whatsnew/3.2.rst:2458 +#: ../../whatsnew/3.2.rst:2459 msgid "The documentation continues to be improved." msgstr "" -#: ../../whatsnew/3.2.rst:2460 +#: ../../whatsnew/3.2.rst:2461 msgid "" "A table of quick links has been added to the top of lengthy sections such " "as :ref:`built-in-funcs`. In the case of :mod:`itertools`, the links are " @@ -2778,7 +2779,7 @@ msgid "" "and memory jog without having to read all of the docs." msgstr "" -#: ../../whatsnew/3.2.rst:2465 +#: ../../whatsnew/3.2.rst:2466 msgid "" "In some cases, the pure Python source code can be a helpful adjunct to the " "documentation, so now many modules now feature quick links to the latest " @@ -2786,80 +2787,80 @@ msgid "" "documentation has a quick link at the top labeled:" msgstr "" -#: ../../whatsnew/3.2.rst:2470 +#: ../../whatsnew/3.2.rst:2471 msgid "**Source code** :source:`Lib/functools.py`." msgstr "" -#: ../../whatsnew/3.2.rst:2472 +#: ../../whatsnew/3.2.rst:2473 msgid "" "(Contributed by Raymond Hettinger; see `rationale `_.)" msgstr "" -#: ../../whatsnew/3.2.rst:2475 +#: ../../whatsnew/3.2.rst:2476 msgid "" "The docs now contain more examples and recipes. In particular, :mod:`re` " "module has an extensive section, :ref:`re-examples`. Likewise, the :mod:" "`itertools` module continues to be updated with new :ref:`itertools-recipes`." msgstr "" -#: ../../whatsnew/3.2.rst:2480 +#: ../../whatsnew/3.2.rst:2481 msgid "" "The :mod:`datetime` module now has an auxiliary implementation in pure " "Python. No functionality was changed. This just provides an easier-to-read " "alternate implementation." msgstr "" -#: ../../whatsnew/3.2.rst:2484 +#: ../../whatsnew/3.2.rst:2485 msgid "(Contributed by Alexander Belopolsky in :issue:`9528`.)" msgstr "" -#: ../../whatsnew/3.2.rst:2486 +#: ../../whatsnew/3.2.rst:2487 msgid "" "The unmaintained :file:`Demo` directory has been removed. Some demos were " "integrated into the documentation, some were moved to the :file:`Tools/demo` " "directory, and others were removed altogether." msgstr "" -#: ../../whatsnew/3.2.rst:2490 +#: ../../whatsnew/3.2.rst:2491 msgid "(Contributed by Georg Brandl in :issue:`7962`.)" msgstr "" -#: ../../whatsnew/3.2.rst:2494 +#: ../../whatsnew/3.2.rst:2495 msgid "IDLE" msgstr "IDLE" -#: ../../whatsnew/3.2.rst:2496 +#: ../../whatsnew/3.2.rst:2497 msgid "" "The format menu now has an option to clean source files by stripping " "trailing whitespace." msgstr "" -#: ../../whatsnew/3.2.rst:2499 +#: ../../whatsnew/3.2.rst:2500 msgid "(Contributed by Raymond Hettinger; :issue:`5150`.)" msgstr "" -#: ../../whatsnew/3.2.rst:2501 +#: ../../whatsnew/3.2.rst:2502 msgid "IDLE on Mac OS X now works with both Carbon AquaTk and Cocoa AquaTk." msgstr "" -#: ../../whatsnew/3.2.rst:2503 +#: ../../whatsnew/3.2.rst:2504 msgid "" "(Contributed by Kevin Walzer, Ned Deily, and Ronald Oussoren; :issue:`6075`.)" msgstr "" -#: ../../whatsnew/3.2.rst:2506 +#: ../../whatsnew/3.2.rst:2507 msgid "Code Repository" msgstr "" -#: ../../whatsnew/3.2.rst:2508 +#: ../../whatsnew/3.2.rst:2509 msgid "" "In addition to the existing Subversion code repository at http://svn.python." "org there is now a `Mercurial `_ repository " "at https://hg.python.org/\\ ." msgstr "" -#: ../../whatsnew/3.2.rst:2512 +#: ../../whatsnew/3.2.rst:2513 msgid "" "After the 3.2 release, there are plans to switch to Mercurial as the primary " "repository. This distributed version control system should make it easier " @@ -2867,28 +2868,28 @@ msgid "" "pep:`385` for details." msgstr "" -#: ../../whatsnew/3.2.rst:2517 +#: ../../whatsnew/3.2.rst:2518 msgid "" "To learn to use the new version control system, see the `Quick Start " "`_ or the `Guide to Mercurial " "Workflows `_." msgstr "" -#: ../../whatsnew/3.2.rst:2523 +#: ../../whatsnew/3.2.rst:2524 msgid "Build and C API Changes" msgstr "" -#: ../../whatsnew/3.2.rst:2525 +#: ../../whatsnew/3.2.rst:2526 msgid "Changes to Python's build process and to the C API include:" msgstr "" -#: ../../whatsnew/3.2.rst:2527 +#: ../../whatsnew/3.2.rst:2528 msgid "" "The *idle*, *pydoc* and *2to3* scripts are now installed with a version-" "specific suffix on ``make altinstall`` (:issue:`10679`)." msgstr "" -#: ../../whatsnew/3.2.rst:2530 +#: ../../whatsnew/3.2.rst:2531 msgid "" "The C functions that access the Unicode Database now accept and return " "characters from the full Unicode range, even on narrow unicode builds " @@ -2898,33 +2899,33 @@ msgid "" "characters as printable." msgstr "" -#: ../../whatsnew/3.2.rst:2537 +#: ../../whatsnew/3.2.rst:2538 msgid "" "(Reported by Bupjoe Lee and fixed by Amaury Forgeot D'Arc; :issue:`5127`.)" msgstr "" -#: ../../whatsnew/3.2.rst:2539 +#: ../../whatsnew/3.2.rst:2540 msgid "" "Computed gotos are now enabled by default on supported compilers (which are " "detected by the configure script). They can still be disabled selectively " "by specifying ``--without-computed-gotos``." msgstr "" -#: ../../whatsnew/3.2.rst:2543 +#: ../../whatsnew/3.2.rst:2544 msgid "(Contributed by Antoine Pitrou; :issue:`9203`.)" msgstr "" -#: ../../whatsnew/3.2.rst:2545 +#: ../../whatsnew/3.2.rst:2546 msgid "" "The option ``--with-wctype-functions`` was removed. The built-in unicode " "database is now used for all functions." msgstr "" -#: ../../whatsnew/3.2.rst:2548 +#: ../../whatsnew/3.2.rst:2549 msgid "(Contributed by Amaury Forgeot D'Arc; :issue:`9210`.)" msgstr "" -#: ../../whatsnew/3.2.rst:2550 +#: ../../whatsnew/3.2.rst:2551 msgid "" "Hash values are now values of a new type, :c:type:`Py_hash_t`, which is " "defined to be the same size as a pointer. Previously they were of type " @@ -2934,34 +2935,34 @@ msgid "" "grow to that size but their performance degraded catastrophically)." msgstr "" -#: ../../whatsnew/3.2.rst:2557 +#: ../../whatsnew/3.2.rst:2558 msgid "" "(Suggested by Raymond Hettinger and implemented by Benjamin Peterson; :issue:" "`9778`.)" msgstr "" -#: ../../whatsnew/3.2.rst:2560 +#: ../../whatsnew/3.2.rst:2561 msgid "" "A new macro :c:macro:`Py_VA_COPY` copies the state of the variable argument " "list. It is equivalent to C99 *va_copy* but available on all Python " "platforms (:issue:`2443`)." msgstr "" -#: ../../whatsnew/3.2.rst:2564 +#: ../../whatsnew/3.2.rst:2565 msgid "" "A new C API function :c:func:`PySys_SetArgvEx` allows an embedded " "interpreter to set :attr:`sys.argv` without also modifying :attr:`sys.path` " "(:issue:`5753`)." msgstr "" -#: ../../whatsnew/3.2.rst:2568 +#: ../../whatsnew/3.2.rst:2569 msgid "" ":c:macro:`PyEval_CallObject` is now only available in macro form. The " "function declaration, which was kept for backwards compatibility reasons, is " "now removed -- the macro was introduced in 1997 (:issue:`8276`)." msgstr "" -#: ../../whatsnew/3.2.rst:2572 +#: ../../whatsnew/3.2.rst:2573 msgid "" "There is a new function :c:func:`PyLong_AsLongLongAndOverflow` which is " "analogous to :c:func:`PyLong_AsLongAndOverflow`. They both serve to convert " @@ -2969,13 +2970,13 @@ msgid "" "of cases where the conversion won't fit (:issue:`7767`)." msgstr "" -#: ../../whatsnew/3.2.rst:2577 +#: ../../whatsnew/3.2.rst:2578 msgid "" "The :c:func:`PyUnicode_CompareWithASCIIString` function now returns *not " "equal* if the Python string is *NUL* terminated." msgstr "" -#: ../../whatsnew/3.2.rst:2580 +#: ../../whatsnew/3.2.rst:2581 msgid "" "There is a new function :c:func:`PyErr_NewExceptionWithDoc` that is like :c:" "func:`PyErr_NewException` but allows a docstring to be specified. This lets " @@ -2983,7 +2984,7 @@ msgid "" "Python counterparts (:issue:`7033`)." msgstr "" -#: ../../whatsnew/3.2.rst:2585 +#: ../../whatsnew/3.2.rst:2586 msgid "" "When compiled with the ``--with-valgrind`` option, the pymalloc allocator " "will be automatically disabled when running under Valgrind. This gives " @@ -2991,19 +2992,19 @@ msgid "" "advantage of pymalloc at other times (:issue:`2422`)." msgstr "" -#: ../../whatsnew/3.2.rst:2590 +#: ../../whatsnew/3.2.rst:2591 msgid "" "Removed the ``O?`` format from the *PyArg_Parse* functions. The format is " "no longer used and it had never been documented (:issue:`8837`)." msgstr "" -#: ../../whatsnew/3.2.rst:2593 +#: ../../whatsnew/3.2.rst:2594 msgid "" "There were a number of other small changes to the C-API. See the :source:" "`Misc/NEWS` file for a complete list." msgstr "" -#: ../../whatsnew/3.2.rst:2596 +#: ../../whatsnew/3.2.rst:2597 msgid "" "Also, there were a number of updates to the Mac OS X build, see :source:`Mac/" "BuildScript/README.txt` for details. For users running a 32/64-bit build, " @@ -3013,17 +3014,17 @@ msgid "" "\\. See https://www.python.org/download/mac/tcltk/ for additional details." msgstr "" -#: ../../whatsnew/3.2.rst:2604 +#: ../../whatsnew/3.2.rst:2605 msgid "Porting to Python 3.2" msgstr "" -#: ../../whatsnew/3.2.rst:2606 +#: ../../whatsnew/3.2.rst:2607 msgid "" "This section lists previously described changes and other bugfixes that may " "require changes to your code:" msgstr "" -#: ../../whatsnew/3.2.rst:2609 +#: ../../whatsnew/3.2.rst:2610 msgid "" "The :mod:`configparser` module has a number of clean-ups. The major change " "is to replace the old :class:`ConfigParser` class with long-standing " @@ -3031,7 +3032,7 @@ msgid "" "number of smaller incompatibilities:" msgstr "" -#: ../../whatsnew/3.2.rst:2614 +#: ../../whatsnew/3.2.rst:2615 msgid "" "The interpolation syntax is now validated on :meth:`~configparser." "ConfigParser.get` and :meth:`~configparser.ConfigParser.set` operations. In " @@ -3039,14 +3040,14 @@ msgid "" "valid: ``%(name)s`` and ``%%``, the latter being an escaped percent sign." msgstr "" -#: ../../whatsnew/3.2.rst:2620 +#: ../../whatsnew/3.2.rst:2621 msgid "" "The :meth:`~configparser.ConfigParser.set` and :meth:`~configparser." "ConfigParser.add_section` methods now verify that values are actual " "strings. Formerly, unsupported types could be introduced unintentionally." msgstr "" -#: ../../whatsnew/3.2.rst:2625 +#: ../../whatsnew/3.2.rst:2626 msgid "" "Duplicate sections or options from a single source now raise either :exc:" "`~configparser.DuplicateSectionError` or :exc:`~configparser." @@ -3054,57 +3055,57 @@ msgid "" "previous entry." msgstr "" -#: ../../whatsnew/3.2.rst:2630 +#: ../../whatsnew/3.2.rst:2631 msgid "" "Inline comments are now disabled by default so now the **;** character can " "be safely used in values." msgstr "" -#: ../../whatsnew/3.2.rst:2633 +#: ../../whatsnew/3.2.rst:2634 msgid "" "Comments now can be indented. Consequently, for **;** or **#** to appear at " "the start of a line in multiline values, it has to be interpolated. This " "keeps comment prefix characters in values from being mistaken as comments." msgstr "" -#: ../../whatsnew/3.2.rst:2637 +#: ../../whatsnew/3.2.rst:2638 msgid "" "``\"\"`` is now a valid value and is no longer automatically converted to an " "empty string. For empty strings, use ``\"option =\"`` in a line." msgstr "" -#: ../../whatsnew/3.2.rst:2640 +#: ../../whatsnew/3.2.rst:2641 msgid "" "The :mod:`nntplib` module was reworked extensively, meaning that its APIs " "are often incompatible with the 3.1 APIs." msgstr "" -#: ../../whatsnew/3.2.rst:2643 +#: ../../whatsnew/3.2.rst:2644 msgid "" ":class:`bytearray` objects can no longer be used as filenames; instead, they " "should be converted to :class:`bytes`." msgstr "" -#: ../../whatsnew/3.2.rst:2646 +#: ../../whatsnew/3.2.rst:2647 msgid "" "The :meth:`array.tostring` and :meth:`array.fromstring` have been renamed " "to :meth:`array.tobytes` and :meth:`array.frombytes` for clarity. The old " "names have been deprecated. (See :issue:`8990`.)" msgstr "" -#: ../../whatsnew/3.2.rst:2650 +#: ../../whatsnew/3.2.rst:2651 msgid "``PyArg_Parse*()`` functions:" msgstr "" -#: ../../whatsnew/3.2.rst:2652 +#: ../../whatsnew/3.2.rst:2653 msgid "\"t#\" format has been removed: use \"s#\" or \"s*\" instead" msgstr "" -#: ../../whatsnew/3.2.rst:2653 +#: ../../whatsnew/3.2.rst:2654 msgid "\"w\" and \"w#\" formats has been removed: use \"w*\" instead" msgstr "" -#: ../../whatsnew/3.2.rst:2655 +#: ../../whatsnew/3.2.rst:2656 msgid "" "The :c:type:`PyCObject` type, deprecated in 3.1, has been removed. To wrap " "opaque C pointers in Python objects, the :c:type:`PyCapsule` API should be " @@ -3112,13 +3113,13 @@ msgid "" "safety information and a less complicated signature for calling a destructor." msgstr "" -#: ../../whatsnew/3.2.rst:2660 +#: ../../whatsnew/3.2.rst:2661 msgid "" "The :func:`sys.setfilesystemencoding` function was removed because it had a " "flawed design." msgstr "" -#: ../../whatsnew/3.2.rst:2663 +#: ../../whatsnew/3.2.rst:2664 msgid "" "The :func:`random.seed` function and method now salt string seeds with an " "sha512 hash function. To access the previous version of *seed* in order to " @@ -3126,7 +3127,7 @@ msgid "" "seed(s, version=1)``." msgstr "" -#: ../../whatsnew/3.2.rst:2668 +#: ../../whatsnew/3.2.rst:2669 msgid "" "The previously deprecated :func:`string.maketrans` function has been removed " "in favor of the static methods :meth:`bytes.maketrans` and :meth:`bytearray." @@ -3136,11 +3137,11 @@ msgid "" "methods with intermediate translation tables of the appropriate type." msgstr "" -#: ../../whatsnew/3.2.rst:2676 +#: ../../whatsnew/3.2.rst:2677 msgid "(Contributed by Georg Brandl; :issue:`5675`.)" msgstr "" -#: ../../whatsnew/3.2.rst:2678 +#: ../../whatsnew/3.2.rst:2679 msgid "" "The previously deprecated :func:`contextlib.nested` function has been " "removed in favor of a plain :keyword:`with` statement which can accept " @@ -3149,13 +3150,13 @@ msgid "" "when one of them raises an exception::" msgstr "" -#: ../../whatsnew/3.2.rst:2689 +#: ../../whatsnew/3.2.rst:2690 msgid "" "(Contributed by Georg Brandl and Mattias Brändström; `appspot issue 53094 " "`_.)" msgstr "" -#: ../../whatsnew/3.2.rst:2692 +#: ../../whatsnew/3.2.rst:2693 msgid "" ":func:`struct.pack` now only allows bytes for the ``s`` string pack code. " "Formerly, it would accept text arguments and implicitly encode them to bytes " @@ -3164,32 +3165,32 @@ msgid "" "writing to fixed length segment of a structure." msgstr "" -#: ../../whatsnew/3.2.rst:2698 +#: ../../whatsnew/3.2.rst:2699 msgid "" "Code such as ``struct.pack('<6sHHBBB', 'GIF87a', x, y)`` should be rewritten " "with to use bytes instead of text, ``struct.pack('<6sHHBBB', b'GIF87a', x, " "y)``." msgstr "" -#: ../../whatsnew/3.2.rst:2701 +#: ../../whatsnew/3.2.rst:2702 msgid "" "(Discovered by David Beazley and fixed by Victor Stinner; :issue:`10783`.)" msgstr "" -#: ../../whatsnew/3.2.rst:2703 +#: ../../whatsnew/3.2.rst:2704 msgid "" "The :class:`xml.etree.ElementTree` class now raises an :exc:`xml.etree." "ElementTree.ParseError` when a parse fails. Previously it raised an :exc:" "`xml.parsers.expat.ExpatError`." msgstr "" -#: ../../whatsnew/3.2.rst:2707 +#: ../../whatsnew/3.2.rst:2708 msgid "" "The new, longer :func:`str` value on floats may break doctests which rely on " "the old output format." msgstr "" -#: ../../whatsnew/3.2.rst:2710 +#: ../../whatsnew/3.2.rst:2711 msgid "" "In :class:`subprocess.Popen`, the default value for *close_fds* is now " "``True`` under Unix; under Windows, it is ``True`` if the three standard " @@ -3198,28 +3199,28 @@ msgid "" "race conditions when open file descriptors would leak into the child process." msgstr "" -#: ../../whatsnew/3.2.rst:2717 +#: ../../whatsnew/3.2.rst:2718 msgid "" "Support for legacy HTTP 0.9 has been removed from :mod:`urllib.request` and :" "mod:`http.client`. Such support is still present on the server side (in :" "mod:`http.server`)." msgstr "" -#: ../../whatsnew/3.2.rst:2721 +#: ../../whatsnew/3.2.rst:2722 msgid "(Contributed by Antoine Pitrou, :issue:`10711`.)" msgstr "" -#: ../../whatsnew/3.2.rst:2723 +#: ../../whatsnew/3.2.rst:2724 msgid "" "SSL sockets in timeout mode now raise :exc:`socket.timeout` when a timeout " "occurs, rather than a generic :exc:`~ssl.SSLError`." msgstr "" -#: ../../whatsnew/3.2.rst:2726 +#: ../../whatsnew/3.2.rst:2727 msgid "(Contributed by Antoine Pitrou, :issue:`10272`.)" msgstr "" -#: ../../whatsnew/3.2.rst:2728 +#: ../../whatsnew/3.2.rst:2729 msgid "" "The misleading functions :c:func:`PyEval_AcquireLock()` and :c:func:" "`PyEval_ReleaseLock()` have been officially deprecated. The thread-state " @@ -3227,18 +3228,18 @@ msgid "" "`PyEval_RestoreThread()`) should be used instead." msgstr "" -#: ../../whatsnew/3.2.rst:2733 +#: ../../whatsnew/3.2.rst:2734 msgid "" "Due to security risks, :func:`asyncore.handle_accept` has been deprecated, " "and a new function, :func:`asyncore.handle_accepted`, was added to replace " "it." msgstr "" -#: ../../whatsnew/3.2.rst:2736 +#: ../../whatsnew/3.2.rst:2737 msgid "(Contributed by Giampaolo Rodola in :issue:`6706`.)" msgstr "" -#: ../../whatsnew/3.2.rst:2738 +#: ../../whatsnew/3.2.rst:2739 msgid "" "Due to the new :term:`GIL` implementation, :c:func:`PyEval_InitThreads()` " "cannot be called before :c:func:`Py_Initialize()` anymore." diff --git a/whatsnew/3.8.po b/whatsnew/3.8.po index 86a89a665c..c5e64cc37a 100644 --- a/whatsnew/3.8.po +++ b/whatsnew/3.8.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.10\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2021-10-26 16:47+0000\n" +"POT-Creation-Date: 2022-05-21 17:35+0000\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -1834,7 +1834,7 @@ msgstr "" #: ../../whatsnew/3.8.rst:1493 msgid "" -"Removed one ``Py_ssize_t`` member from ``PyGC_Head``. All GC tracked " +"Removed one :c:type:`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 ""